First time here? Checkout the FAQ!
0 votes
by (1.6k points)
In general, openCARP compiles well natively on machines equipped with an Apple M1 processor.

Some dependencies are a little bit tricky, though. See below for instruction that worked for me.

1 Answer

0 votes
by (1.6k points)
edited by

In general, follow the build instructions:

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 numpypandas 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.

Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance