Linker errors with gcc 4.1.2 and rhel5 and CUDA2.0 Link errors

Greetings,

We’ve recently installed cuda2.0 beta 64 bit for rhel5.
We have a locally built gcc-4.1.2

We get the following link errors, it looks like it wants gcc-3.4’s libstdc++ ?
Any suggestions?

/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to operator new(unsigned long)@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_begin_catch@CXXABI_1.3' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to operator delete@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::__throw_length_error(char const*)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::__throw_bad_alloc()@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to vtable for std::bad_alloc@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::bad_alloc::~bad_alloc()@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_List_node_base::hook(std::_List_node_base*)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_pure_virtual@CXXABI_1.3’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to typeinfo for std::bad_alloc@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to vtable for __cxxabiv1::__class_type_info@CXXABI_1.3’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_List_node_base::unhook()@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_get_exception_ptr@CXXABI_1.3.1’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_Rb_tree_decrement(std::_Rb_tree_node_base*)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcublasemu.so.2: undefined reference to __gxx_personality_v0@CXXABI_1.3’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_Rb_tree_increment(std::_Rb_tree_node_base*)@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_throw@CXXABI_1.3’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __gnu_cxx::__exchange_and_add(int volatile*, int)@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to vtable for __cxxabiv1::__si_class_type_info@CXXABI_1.3' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to operator delete(void*)@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to operator new[](unsigned long)@GLIBCXX_3.4' build/linux_rhel50_64/opt/lib/libap_oculus.so: undefined reference to AprioCBase::imagePoints::dumpPoints()’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)@GLIBCXX_3.4
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_allocate_exception@CXXABI_1.3' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_rethrow@CXXABI_1.3’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::_Rb_tree_increment(std::_Rb_tree_node_base const*)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to __cxa_end_catch@CXXABI_1.3’
/usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4' /usr/local/cuda_beta2_jul/cuda/lib/libcudart.so.2: undefined reference to vtable for __cxxabiv1::__enum_type_info@CXXABI_1.3’
collect2: ld returned 1 exit status

The rhel5 cuda release is built with a stock rhel5. If you want gcc 4.1.2 support, try installing a CUDA toolkit for a distro that uses that gcc version.

RHEL5 is distributed with gcc-4.1.2

Umm, never mind then. I don’t know what the problem would be.

Found the issue:

binutils-2.18 has changed the output of --version, this causes the configure script in gcc-4.1.2/libstdc+±v3/configure to not detect that the linker is gnu ld and thus skips using the link map file which puts the version on the ABI.

I have a patch, but if you search for GNU ld version in a sed string in that configure and replace version with .* then it should work.

That was NO fun to find. I’ll file a bug against gcc.