Skip to content

Commit

Permalink
Add MacBook Air M2 installation instructions to site_installs/Apple_M…
Browse files Browse the repository at this point in the history
…acBook.md
  • Loading branch information
vasdommes committed Nov 22, 2023
1 parent d0a6b6f commit bcdc25a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
This guide is for building SDPB. To just run SDPB, it may be easier
to use [Docker](docs/Docker.md) or [Singularity](docs/Singularity.md).
In addition, there are [site specific
notes](docs/site_installs/Readme.md) for different HPC machines.
notes](docs/site_installs/Readme.md) for different HPC machines and also
for [Apple MacBooks](docs/site_installs/Apple_MacBook.md).

* [Requirements](#requirements)
* [Installation](#installation)
Expand Down
48 changes: 48 additions & 0 deletions docs/site_installs/Apple_MacBook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Apple MacBook Air M2

Chip: Apple M2
macOS: Ventura 13.6

# Build SDPB from sources

## Homebrew packages

If you don't have Homebrew package manager, install it following official instructions from https://brew.sh/. Add brew
to path following instructions shown after installing.

Then you can install packages required for SDPB:

brew install gmp mpfr boost rapidjson libarchive openblas cmake open-mpi

You can see installation directory and another information for a package (e.g. `boost`)
by calling `brew info <package>` (e.g. `brew info boost`).

## Python 2

If Python 2 is missing, install it using macOS installer from https://www.python.org/downloads/release/python-2718/

You may try to skip this step, but note that waf fails with `bunzip2: Data integrity error when decompressing` when
using default Python 3, at least on some laptops.

## Elemental

git clone https://gitlab.com/bootstrapcollaboration/elemental.git
cd elemental
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc
make && make install
cd ../..

## sdpb

git clone https://github.com/davidsd/sdpb.git
cd sdpb
CXXFLAGS="${CXXFLAGS} -arch arm64" LDFLAGS="${LDFLAGS} -arch arm64" ./waf configure --elemental-dir=$HOME/install --boost-dir=/opt/homebrew/opt/boost/ --gmpxx-dir=/opt/homebrew/Cellar/gmp/6.3.0/ --mpfr-dir=/opt/homebrew/Cellar/mpfr/4.2.1/ --rapidjson-dir=/opt/homebrew/Cellar/rapidjson/1.1.0 --libarchive-dir=/opt/homebrew/Cellar/libarchive/3.7.2/ --prefix=$HOME/install/sdpb-master
./waf # build binaries
./build/sdpb --help # run SDPB binary
./test/run_all_tests.sh # run tests to check correctness
./waf install # install sdpb to --prefix=$HOME/install/sdpb-master

If waf fails to find some package, e.g. `boost`, check the installation directory by calling, e.g. `brew info boost` and
update `--boost-dir` argument above.
4 changes: 3 additions & 1 deletion docs/site_installs/Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
The *.org and *.md files in this directory contain notes on building and
running SDPB on various HPC machines. Most of the systems use
running SDPB on various HPC machines, as well as [Apple MacBooks](Apple_MacBook).

Most of the HPC systems use
modules, so there is typically a module invocation like

module load gcc/8.3.0 openmpi/3.1.4 openblas/0.3.6
Expand Down

0 comments on commit bcdc25a

Please sign in to comment.