# MPI recognition with Conda on Apple silicon

**URL:** https://discourse.cmake.org/t/mpi-recognition-with-conda-on-apple-silicon/9252
**Category:** Usage
**Created:** [October 23, 2023, 12:15pm UTC](https://discourse.cmake.org/t/mpi-recognition-with-conda-on-apple-silicon/9252 "2023-10-23T12:15:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Benedikt.biller](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@Benedikt.biller](https://discourse.cmake.org/u/Benedikt.biller)
#### Post date: [October 23, 2023, 12:15pm UTC](https://discourse.cmake.org/t/mpi-recognition-with-conda-on-apple-silicon/9252/1 "2023-10-23T12:15:35Z")

</div>

Hi,  
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):  
/Users//anaconda3/envs/alpaca/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (\_FPHSA\_FAILURE\_MESSAGE)  
/Users//anaconda3/envs/alpaca/share/cmake-3.27/Modules/FindMPI.cmake:1837 (find\_package\_handle\_standard\_args)  
CMakeLists.txt:11 (FIND\_PACKAGE)

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!

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [October 23, 2023, 1:02pm UTC](https://discourse.cmake.org/t/mpi-recognition-with-conda-on-apple-silicon/9252/2 "2023-10-23T13:02:02Z")

</div>

In general across operating systems I’ve found the conda libraries may not be ABI compatible with non-conda compilers. Looking at CMakeConfigureLog.yaml and/or `cmake -Bbuild --debug-find-pkg=MPI` might give hints.

---

<div class="post-metadata">

### Author: ![Benedikt.biller](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@Benedikt.biller](https://discourse.cmake.org/u/Benedikt.biller)
#### Post date: [October 23, 2023, 3:04pm UTC](https://discourse.cmake.org/t/mpi-recognition-with-conda-on-apple-silicon/9252/3 "2023-10-23T15:04:53Z")

</div>

Thank you for this suggestion. Looking at the output revealed, that all packages are found. I think the decisive line might be `missing: MPI_C_WORKS`.  
Does Cmake test what it found in the background? What can make this test fail?

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [October 23, 2023, 5:39pm UTC](https://discourse.cmake.org/t/mpi-recognition-with-conda-on-apple-silicon/9252/4 "2023-10-23T17:39:01Z")

</div>

Look at ${CMAKE\_BINARY\_DIR}/CMakeFiles/CMakeConfigureLog.yaml to see why mpi\_c\_works fails
