cmake不能在CentOS 7上找到默认的MPI安装?

时间:2018-09-24 18:40:20

标签: cmake mpi

在香草CentOS 7盒子上,我安装了OpenMPI(普通版),并且做到了:

module load mpi

将MPI内容加载到环境中。在此设置下,cmake(我尝试使用2.8和最新的3.12)似乎找不到MPI。任何想法如何解决这个问题?谢谢

-- 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)

3 个答案:

答案 0 :(得分:1)

  • 您安装了openmpi-devel吗?
  • 执行“哪个mpicc”会得到什么?
  • 您可以在执行以下操作后重试:

    export MPI_C =`哪个mpicc`

    export MPI_CXX =`哪个mpicxx`

  • 这也可能是由于'spack'清洁了环境。因此,可能要尝试“ spack install --dirty ...”,或者将openmpi首选项放入packages.yaml

  • 此外,我猜缺少的环境变量应该对应于以下路径或在以下路径下找到:

    模块显示mpi

答案 1 :(得分:0)

尝试cmake 3.9版。当我使用MPI和Intel Parallel Suite构建Lammps时,我通过使用cmake 3.9解决了该问题,而3.10仍然存在该问题。 here中有一些讨论。

答案 2 :(得分:0)

在运行cmake之前,将/ usr / lib64 / openmpi / bin /附加到PATH对我有用。