I am building a make file with Cmake version 3.27 on a MacBook with Sonoma and an Apple Silicon M2 Chip.
Also, I use a Conda environment with Cmake, make, clang, mpich and hdf5 installed.
When running Cmake (Conda environment activated) with “cmake <path_to_project> -DCMAKE_PREFIX_PATH=$CONDA_PREFIX” the compilers are recognized correctly.
However, it fails finding the mpi:
– Could NOT find MPI_C (missing: MPI_C_WORKS)
– Found MPI_CXX: /Users//anaconda3/envs/alpaca/lib/libmpicxx.dylib (found version “4.0”)
CMake Error at /Users//anaconda3/envs/alpaca/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MPI (missing: MPI_C_FOUND) (found version “4.0”)
Call Stack (most recent call first):
What I do not understand is, that Cmake finds MPI_CXX, but not MPI_C as both libmpicxx.dylib and libmpi.dylib are existent in the lib-directory.
I am glad for any help!