Reputation: 1951
On a vanilla CentOS 7 box, I have OpenMPI installed (stock version), and did:
module load mpi
to load the MPI stuff into the environment. Under this setting, cmake (I tried both 2.8 and latest 3.12) can't seem to find the MPI. Any idea how to resolve this? Thanks
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
CMake Error at /home/f7b/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/cmake-3.12.2-25n7srkgvu3elwswze6dckezvfkxqks7/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
/home/f7b/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/cmake-3.12.2-25n7srkgvu3elwswze6dckezvfkxqks7/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/f7b/spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/cmake-3.12.2-25n7srkgvu3elwswze6dckezvfkxqks7/share/cmake-3.12/Modules/FindMPI.cmake:1666 (find_package_handle_standard_args)
CMakeLists.txt:27 (find_package)
Upvotes: 5
Views: 7161
Reputation: 2177
Appending /usr/lib64/openmpi/bin/ to the PATH before running cmake worked for me.
Upvotes: 4
Reputation: 343
Try cmake version 3.9. When I built Lammps with MPI and Intel Parallel Suite, I solved the issue by using cmake 3.9 while 3.10 still had that problem. There are some discussions here.
Upvotes: 1
Reputation: 33
can you re-try after doing:
export MPI_C=`which mpicc`
export MPI_CXX=`which mpicxx`
also this might be due to the fact that 'spack' sanitizes the environment. So might want to try "spack install --dirty ..." or else put openmpi preference in packages.yaml
Also, I would guess that missing environment variables should correspond to or found under the the following paths:
module show mpi
Upvotes: 2