Make failure with Cuda 11.2

GROMACS version:2020.5
GROMACS modification: No
Here post your question

I’m trying to install Gromacs 2020.5 with cuda 11.2, using gcc 10.2 and openmpi 4.0.5.

After “make”, an error shows up.

[100%] Linking CXX executable …/…/bin/gmx_mpicuda512_2020
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator new(unsigned long)@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to vtable for __cxxabiv1::__vmi_class_type_info@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_begin_catch@CXXABI_1.3' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator delete@GLIBCXX_3.4
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_pure_virtual@CXXABI_1.3' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to typeinfo for std::bad_alloc@GLIBCXX_3.4’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to vtable for __cxxabiv1::__class_type_info@CXXABI_1.3' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to std::nothrow@GLIBCXX_3.4’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator delete(void*, std::nothrow_t const&)@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __gxx_personality_v0@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_guard_acquire@CXXABI_1.3' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_throw@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)@GLIBCXX_3.4.9' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to std::ios_base::Init::~Init()@GLIBCXX_3.4
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator new[](unsigned long, std::nothrow_t const&)@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to vtable for __cxxabiv1::__si_class_type_info@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator delete(void*)@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator new(unsigned long, std::nothrow_t const&)@GLIBCXX_3.4
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to operator new[](unsigned long)@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_allocate_exception@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_guard_release@CXXABI_1.3' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_rethrow@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to std::terminate()@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to __cxa_end_catch@CXXABI_1.3’
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to std::bad_alloc::~bad_alloc()@GLIBCXX_3.4' /truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to std::ios_base::Init::Init()@GLIBCXX_3.4
/truba/home/merts/sw/cuda_11.2/lib64/libcufft.so: undefined reference to `vtable for __cxxabiv1::__enum_type_info@CXXABI_1.3’
collect2: error: ld returned 1 exit status
make[2]: *** [bin/gmx_mpicuda512_2020] Error 1
make[1]: *** [src/programs/CMakeFiles/gmx.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[100%] Linking CXX static library …/…/…/…/lib/libgpu_utilstest_cuda.a
[100%] Built target gpu_utilstest_cuda
make: *** [all] Error 2

cmake options used are below:

cmake … -DCMAKE_INSTALL_PREFIX=$HOME/sw/gromacs-2020.5_gcc10.2_openmpi4.1_CUDA_AVX512 -DGMX_SIMD=AVX_512 \

-DGMX_GPU=on -DGMX_MPI=on -DGMX_DEFAULT_SUFFIX=OFF \

-DGMX_BINARY_SUFFIX=_mpicuda512_2020 -DGMX_LIBRARY_SUFFIX=_mpicuda512_2020 \

-DGMX_BUILD_OWN_FFTW=ON -DCUDA_TOOLKIT_ROOT_DIR=$HOME/sw/cuda_11.2/

I don’t think it’s directly your problem, but cuda 11.2 doesn’t support gcc 10 (see Installation Guide Linux :: CUDA Toolkit Documentation). Normally you’d have to modify the cuda headers manually to even get this far. How does it go with gcc 9?

If you still have problems, please reopen this issue: CUDA 11.2 build issues (#3880) · Issues · GROMACS / GROMACS · GitLab

Sorry for my late response! I was able to install CUDA with 11.2 with gcc 9 and also CUDA 10 with gcc 9. And everything works well for now. Currently using cuda 10 with gmx 2020.5