Hello all,
I’m a PhD student in AME department, and is taking CSCI596 this semester. I have a question about a problem I met when I’m trying to compile a C++ program using Cmake. This program reqiures MPI for running in parallel.
I have load these modules before I compile the code
module load gcc/8.3.0
module load openmpi/4.0.2
module load cmake
export LD_PRELOAD=/spack/apps/gcc/8.3.0/lib64/libstdc++.so.6
And when I tried to check mpirun --version
it seems no problem:
mpirun (Open MPI) 4.0.2
However, when I tried to use Cmake , it fails at the line
find_package(MPI REQUIRED)
ibtorch;/home1/haotianh/rl_new/eigen-3.4.0;/spack/apps/linux-centos7-x86_64/gcc-8.3.0" ..
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /spack/apps/linux-centos7-x86_64/gcc-8.3.0/cmake-3.16.2-ejzgeuxnaazwznsodm7t422o5mgubobq/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
/spack/apps/linux-centos7-x86_64/gcc-8.3.0/cmake-3.16.2-ejzgeuxnaazwznsodm7t422o5mgubobq/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/spack/apps/linux-centos7-x86_64/gcc-8.3.0/cmake-3.16.2-ejzgeuxnaazwznsodm7t422o5mgubobq/share/cmake-3.16/Modules/FindMPI.cmake:1688 (find_package_handle_standard_args)
CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home1/haotianh/rl_new/build/CMakeFiles/CMakeOutput.log".
See also "/home1/haotianh/rl_new/build/CMakeFiles/CMakeError.log".
I’d like to ask you whether you can help me with this? Thank you so much!
Yours sincerely,
Haotian