MacOS cmake not finding brew installed mpich
Our builds are failing GitHub Actions for MacOS 10.5 while configuring cmake for mpich
from today, not completely sure what is happening. Things are working fine on my local Macs.
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/local/Cellar/cmake/3.19.6/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.19.6/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.19.6/share/cmake/Modules/FindMPI.cmake:1722 (find_package_handle_standard_args)
CMakeLists.txt:148 (find_package)
Based on some suggested fixes for such issues browsing the internet, invoked cmake by explicitly specifying the C compiler, but that got cmake to hang.
cmake <other_args> \
-DCMAKE_C_COMPILER=/usr/local/opt/mpich/bin/mpicc \
-DCMAKE_CXX_COMPILER=/usr/local/opt/mpich/bin/mpicxx
Here is some information on the environment in the build VM.
Homebrew 3.0.5
brew has installed gcc, gcc@8 and gcc@9
cmake version 3.19.6
gcc --version
Configured with: --prefix=/Applications/Xcode_12.4.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
mpicc --version
gcc-10 (Homebrew GCC 10.2.0_4) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
brew info mpich
mpich: stable 3.4.1 (bottled), HEAD
Is this an issue with find_package(MPI REQUIRED)
? Any suggestions or a workaround? Thanks.