Could NOT find MPI (missing: MPI_MPICXX_FOUND MPICXX) (found version "3.1")

I’ve installed lammps and it works on some benchmark problems with MPI. But when I try and install some missing packages like either PKG_GRANULAR or PKG_KSPACE I get an error about missing MPI. I am confused because it does say in the output “Found MPI: TRUE (found version “3.1”)”

[fhussa@gpu002 build]$ cmake -D PKG_GRANULAR=yes ../cmake

-- Running check for auto-generated files from make-based build system
-- Found MPI: TRUE (found version "3.1")
-- Found MPI: TRUE (found version "3.1") found components: CXX
-- Could NOT find VORO (missing: VORO_LIBRARY VORO_INCLUDE_DIR) 
-- Voro++ download requested - we will build our own
-- N2P2 BUILD OPTIONS: INTERFACES=LAMMPS;COMP=gnu;PROJECT_OPTIONS= -I/usr/local/spack/opt/spack/linux-rocky9-zen2/gcc-11.5.0/openmpi-4.1.7-5yvzonrtjjhglwvrggu6sbekxtnd53hb/include;PROJECT_DEBUG=;PROJECT_CC=/usr/bin/c++;PROJECT_MPICC=/usr/bin/c++;PROJECT_CFLAGS=-fPIC  -O2 -g -DNDEBUG -std=gnu++11;PROJECT_AR=/usr/bin/gcc-ar;APP_CORE=nnp-convert;APP_TRAIN=nnp-train;APP=nnp-convert
-- MDI download requested - we will build our own
-- Trying to find PNetCDF using LD_LIBRARY_PATH (we're desperate)...
-- Could NOT find PNetCDF (missing: PNETCDF_LIBRARIES PNETCDF_INCLUDES) 
-- PLUMED download requested - we will build our own
-- QUIP download via git requested - we will build our own
CMake Error at /usr/local/spack/opt/spack/linux-rocky9-zen2/gcc-11.5.0/cmake-3.30.5-zwbvbiux6niqsxvhwzyglocwvzh6pmx5/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find MPI (missing: MPI_MPICXX_FOUND MPICXX) (found version "3.1")
Call Stack (most recent call first):
  /usr/local/spack/opt/spack/linux-rocky9-zen2/gcc-11.5.0/cmake-3.30.5-zwbvbiux6niqsxvhwzyglocwvzh6pmx5/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/spack/opt/spack/linux-rocky9-zen2/gcc-11.5.0/cmake-3.30.5-zwbvbiux6niqsxvhwzyglocwvzh6pmx5/share/cmake-3.30/Modules/FindMPI.cmake:1841 (find_package_handle_standard_args)
  Modules/Packages/SCAFACOS.cmake:6 (find_package)
  CMakeLists.txt:598 (include)


-- Configuring incomplete, errors occurred!

You have to keep in mind that MPI comes with different components.

  • You have the basic MPI interface in C with the mpicc C compiler wrapper (component = C)
  • You have the basic MPI interface in C with the mpicxx C++ compiler wrapper (component = CXX)
  • You have the (obsolete) MPI C++ interface (component = MPICXX)
  • You have the MPI Fortran interface (component = Fortran)

Your output says you have the basic C++ support, but not the C++ MPI module.
See: FindMPI — CMake 4.4.0 Documentation

You are not providing enough information about your build to say more.

1 Like

Thanks, I just got it to work by starting again from scratch. Instead of running cmake with no options I did:

#cmake -S cmake -B build
cd build
cmake -D BUILD_MPI=yes -D CMAKE_CXX_COMPILER=mpicxx ../cmake

Now everything is working, even the PKG_GPU!

So you didn’t enable the package that requested MPICXX.
None of the packages you mention does require it.
As I said, you didn’t say which LAMMPS version you have, whether you added some external packages not managed by the LAMMPS developers, and which packages you had configured exactly in the failing configuration. From the packages included in LAMMPS, only SCAFACOS requires the MPICXX component.

Let me point out again, that it is very difficult to provide meaningful assistance without having proper information. If you want good help, you have to make an effort. The guidelines post explains it.

1 Like