FindMPI: Unable to find MPI in Cray environment with non-Cray wrapper compiler
I cannot get CMake to find MPI in a Cray environment when I am using a compiler other than the Cray compiler wrapper. I thought this would have been fixed by !6264 (merged), but I cannot seem to make this work.
Here's my setup:
module load PrgEnv-amd
mkdir build
cd build
CC=hipcc CXX=hipcc ../cmake-3.25.1-linux-x86_64/bin/cmake ..
Here's my CMakeLists.txt
:
project(test LANGUAGES C)
find_package(MPI REQUIRED)
Here's the output:
-- The C compiler identification is Clang 14.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rocm-5.1.0/bin/hipcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find MPI_C (missing: MPI_sci_amd,-lflangrti,-lflang,-lpgmath_LIBRARY MPI_C_WORKS)
CMake Error at .../cmake-3.25.1-linux-x86_64/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MPI (missing: MPI_C_FOUND)
Call Stack (most recent call first):
.../cmake-3.25.1-linux-x86_64/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
.../cmake-3.25.1-linux-x86_64/share/cmake-3.25/Modules/FindMPI.cmake:1837 (find_package_handle_standard_args)
CMakeLists.txt:3 (find_package)
As you can see in my path, I am using CMake 3.25.1. My module versions are listed below.
$ module list
Currently Loaded Modules:
1) craype-x86-trento 4) perftools-base/22.06.0 7) emacs/28.1 10) cray-dsmml/0.2.2 13) PrgEnv-amd/8.3.3
2) libfabric/1.15.0.0 5) xpmem/2.4.4-2.3_11.2__gff0e1d9.shasta 8) amd/5.1.0 11) cray-mpich/8.1.17 14) xalt/1.3.0
3) craype-network-ofi 6) cray-pmi/6.1.3 9) craype/2.7.16 12) cray-libsci/22.06.1.3 15) DefApps/default
I am testing this on Crusher, in case anyone has access to that machine and wants to reproduce.