Rocky Linux 9 x86_64 system. The default GCC version is 11.4.
GCC-Toolset-13 is installed in /opt/rh/gcc-toolset-13/root/usr/bin , and the GCC compiler version is 13.3. The environment is set up using the /opt/rh/gcc-toolset-13/enable script.
I compiled OpenMPI 5.0.9 using GCC 11.4, and compiled OpenMPI 5.0.9 with Cuda 12.9 support using GCC 13.3.
First, I successfully compiled the CPU version of GROMACS 2025 using the openmpi/5.0_gcc11 combination, and successfully compiled the CUDA version of GROMACS 2025 using the openmpi/5.0_cuda12.9_gcc13 combination.
Next, while compiling LAMMPS July 2025, I created a build folder in the LAMMPS source code directory, entered the build directory, and ran the command:
cmake -C …/cmake/presets/gcc.cmake …/cmake -D BUILD_MPI=yes -D BUILD_OMP=yes
When using the openmpi/5.0_gcc11 combination, the configuration and compilation process for the LAMMPS CPU version succeeded smoothly.
However, when using the openmpi/5.0_cuda12.9_gcc13 combination, the configuration process immediately failed with the following error:
-- Running check for auto-generated files from make-based build system
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MPI (missing: MPI_CXX_FOUND CXX)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindMPI.cmake:1837 (find_package_handle_standard_args)
CMakeLists.txt:393 (find_package)
-- Configuring incomplete, errors occurred!
It didn’t even get to adding the LAMMPS CUDA options; just -D BUILD_MPI=yes triggered the error. I’m not sure what is causing this issue. How can it be resolved? Thank you.