Hi Benjamin,

This seems to be a deeper problem on OSX, see


Interestingly, it works for me on Mojave.

The quick-fix would be to build NEST with MPI but without OpenMP using the Clang compiler.

With llvm and libomp from brew installed, the following also works for me

cmake -E env LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" \
      -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \
      -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \
      -Dwith-mpi=ON ../src

This builds NEST using the Clang compiler from llvm with OpenMP and MPI support. The only problem is that some Python tests crash, complaining about two different OpenMP libraries imported (libomp and libiomp5, where the latter comes from Anaconda's MKL library). One can (with a certain risk of problems) set


which will make macOS ignore the duplicate libraries. Tests then pass, but behavior may be unpredictable.

Alternatively, one can create a Conda environment without MKL as describe on StackOverflow (https://stackoverflow.com/questions/38345519/how-to-install-scipy-without-mkl). I haven't tested this yet.

I also tried compiling with the Apple Clang, configuring as

   -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" -DOpenMP_CXX_LIB_NAMES="omp" \
   -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" -DOpenMP_C_LIB_NAMES="omp" \
   -DOpenMP_omp_LIBRARY=/usr/local/lib/libomp.dylib \
   -Dwith-mpi=ON ../src

based on https://iscinumpy.gitlab.io/post/omp-on-high-sierra/, but this failed when linking, since the library information probably is not used properly by our CMake script.

Hans Ekkehard


Prof. Dr. Hans Ekkehard Plesser
Head, Data Science Section

Faculty of Science and Technology
Norwegian University of Life Sciences
PO Box 5003, 1432 Aas, Norway

Phone +47 6723 1560
Email hans.ekkehard.plesser@nmbu.no
Home  http://arken.nmbu.no/~plesser