FindMPI: broken for MPICH on mac OS installed via Homebrew
Steps to reproduce:
On mac OS (high sierra) with Homebrew (the most popular package manager for mac OS) installed, simply install MPICH and then try to use
find_package(MPI REQUIRED) or run CMake in find package mode:
cmake --find-package -DNAME=MPI.
$ brew unlink open-mpi # if already installed ... # homebrew output $ brew install mpich # or brew link mpich if installed ... # more homebrew output $ cmake --find-package -DNAME=MPI cmake --find-package -DNAME=MPI CMake Error at /Applications/CMake.app/Contents/share/cmake-3.11/Modules/CMakeFindPackageMode.cmake:37 (message): COMPILER_ID argument not specified. In doubt, use GNU. MPI not found. CMake Error: Problem processing arguments. Aborting. $ which mpiexec /usr/local/bin/mpiexec $ ls -l /usr/local/bin/mpiexec lrwxr-xr-x 1 ibeekman admin 35 Jun 30 21:24 /usr/local/bin/mpiexec -> ../Cellar/mpich/3.2.1_2/bin/mpiexec
I get a similar error if I call
find_package(MPI) from a
CMakeLists.txt. However, I have no such problems with Open-MPI. What gives?