I have some code that compiles and links fine under CUDA v10.2, but I cannot get it to do the same when using CUDA v11.2. The compilation stages seem fine, but the final link fails. Here is the eventual link command with all the local object files and library names snipped out for brevity:
g++ -pipe -m64 -march=x86-64 -mmmx -msse -msse2 -mfpmath=sse -mno-ieee-fp -O2 -std=c++11 -L. *(snip)* /usr/local/cuda-11.2/lib64/libcufft_static_nocallback.a /usr/local/cuda-11.2/lib64/libculibos.a /usr/local/cuda-11.2/lib64/libcudart_static.a -lrt -ldl /usr/local/cuda-11.2/lib64/stubs/libnvidia-ml.so -Wl,-rpath,/usr/local/cuda-11.2/lib64 -lz -ldl -lpthread -lstdc++ -lm -lc
/usr/local/cuda-11.2/lib64/libcufft_static_nocallback.a(planner_c2c.o): In function `fftCooleyTukeyC2C::enable_l2_caching_opt()':
planner_c2c.cpp:(.text+0x1d42): undefined reference to `__cxa_throw_bad_array_new_length'
/usr/local/cuda-11.2/lib64/libcufft_static_nocallback.a(batched.o): In function `BatchedMulti::BatchedMulti(unsigned long&, unsigned long*, unsigned long, fftStaticParameters const&, devices const&, Config::Legacy&)':
batched.cpp:(.text+0x25d2): undefined reference to `__cxa_throw_bad_array_new_length'
batched.cpp:(.text+0x25d7): undefined reference to `__cxa_throw_bad_array_new_length'
batched.cpp:(.text+0x25dc): undefined reference to `__cxa_throw_bad_array_new_length'
/usr/local/cuda-11.2/lib64/libcufft_static_nocallback.a(3d.o): In function `Calc3D::make_sizes(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)':
3d.cpp:(.text+0x41b5): undefined reference to `__cxa_throw_bad_array_new_length'
/usr/local/cuda-11.2/lib64/libcufft_static_nocallback.a(3d_shuffled.o):3d_shuffled.cpp:(.text+0x3eeb): more undefined references to `__cxa_throw_bad_array_new_length' follow
collect2: error: ld returned 1 exit status
This is on a redhat 7 system with devtools 9 installed. Prior to doing the ``make’', I confirmed the following:
% scl enable devtoolset-9 'bash'
% g++ --version
g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Any suggestions on what I should look for? Thanks.