Install openmpi and compilation failed with linking mpi_cxx

Hi, All

I am currently installing the openmpi-4.1.1 on ubuntu18.04 from the tar.gz file. However, when I use the nvcc (CUDA 11.2.2) compiler with -lmpi_cxx , it reports that this linking option does not exist.

is there anything wrong when I am building and installing the openmpi? I use the following commands when building openmpi with CUDA-aware capability.

./configure --with-cuda 
make -j8 install

I try to remove -lmpi_cxx and only keep -lmpi , the compiler reports errors like

undefined reference to `MPI::Comm::Comm()'

Thanks a lot!

Can you provide a minimal reproducer to test?

I just figure this out,
I need to enable the c++ binding of the MPI when building the openmpi.
Here are the commands

./configure --enable-mpi-cxx --with-cuda
make all install


1 Like