Open jhxu-org opened 6 years ago
On Ubuntu 18.04, I first needed to install gcc and g++ 4.9 as explained here: https://stackoverflow.com/questions/48398475/fail-to-install-gcc-4-9-in-ubuntu17-04 (gcc/g++ 5 and 6 were producing the same error for me as the one you have) Then, you'll need to link these new gcc and g++ to your cuda:
$ sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda/bin/gcc
$ sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda/bin/g++
and you need to run cmake in the following way:
cmake -DCMAKE_C_COMPILER=gcc-4.9 -DCMAKE_CXX_COMPILER=g++-4.9 ../
@grig-guz
i did as you said,but the problem still exists.
by the way, i use gtx2080ti.
my server is ubuntu 16.04,torch 0.4 When I execute the make all command,i get the error :
CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function, std::allocator > const&)'
test_cpu.cpp:(.text+0xb19): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
test_cpu.cpp:(.text+0xd15): undefined reference to >&, std::vector<std::vector<int, std::allocator >, std::allocator<std::vector<int, std::allocator > > > const&, std::vector<int, std::allocator > const&)':
test_cpu.cpp:(.text+0x15b7): undefined reference to , std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x1804): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x1a23): undefined reference to , std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x1c39): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function , std::allocator > const&)'
test_cpu.cpp:(.text+0x2223): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
test_cpu.cpp:(.text+0x2416): undefined reference to , std::allocator >::_M_create(unsigned long&, unsigned long)'
test_cpu.cpp:(.text+0x29dd): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)'
CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function , std::allocator >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
libwarpctc.so: undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status
CMakeFiles/test_cpu.dir/build.make:123: recipe for target 'test_cpu' failed
make[2]: [test_cpu] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test_cpu.dir/all' failed
make[1]: [CMakeFiles/test_cpu.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2
options_test()': test_cpu.cpp:(.text+0xa12): undefined reference to
std::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0xbff): undefined reference to
std::runtime_error::runtime_error(std::std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function
grad_check(int, int, std::vector<float, std::allocatorstd::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1727): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1942): undefined reference to
std::std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1b35): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1d4d): undefined reference to
std::inf_test()': test_cpu.cpp:(.text+0x20e5): undefined reference to
std::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x22ff): undefined reference to
std::runtime_error::runtime_error(std::std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o: In function
small_test()': test_cpu.cpp:(.text+0x27cd): undefined reference tostd::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x28fa): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x2afa): undefined reference to
std::std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)': test_cpu.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_]+0x23): undefined reference to
std::__cxx11::basic_string<char, std::char_traits