In general, follow the build instructions: https://opencarp.org/download/installation#building-from-source
Some peculiarities:
Homebrew works on M1 machines, however the packages are not installed in /usr/local but /opt/homebrew. It is not recommended to change that (and my attempts to do so were not successful).
- The resulting non-standard paths require some environment variables to be set:
- export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
- export HDF5_DIR=/opt/homebrew
- export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/llvm/bin:$PATH"
- export BLAS=/opt/homebrew/Cellar/lapack/3.9.0_1/lib/libblas.dylib
- export LAPACK=/opt/homebrew/Cellar/lapack/3.9.0_1/lib/liblapack.dylib
- Make sure to install libjpeg, c-blosc, llvm and python@3.8 from homebrew. Some of the carputils dependencies (e.g. tables) do not yet work properly with Python 3.9 as of now. However, homebrew also requires Python 3.9. Thus, you'll need both versions installed. To use 3.8 by default, run
- brew install python@3.8
- brew unlink python@3.9
- brew link python@3.8
- Make sure the directory /usr/local/bin exists
The hardest part was to get all python dependencies installed. The following worked for me:
Then, remove the version specifications from carputils/requirements.py3.txt for numpy, pandas and scipy. After that, pip3 install --user -r requirements.txt should run fine.
When compiling meshtool, you also need to provide the non-standard path for libomp:
- In openCARP/_build/external/meshtool/src/meshtool/switches.def, add -L/opt/homebrew/opt/llvm/lib to the end of line 26. In openCARP/_build/external/meshtool/src/meshtool/my_switches.def, make sure to use clang as compiler
Meshalyzer compiled without problems using the CMake workflow.