SeanNaren / warp-ctc

Pytorch Bindings for warp-ctc
Apache License 2.0
756 stars 271 forks source link

cuda92,pytorch 0.4 make error #80

Open jhxu-org opened 6 years ago

jhxu-org commented 6 years ago

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 options_test()': test_cpu.cpp:(.text+0xa12): undefined reference tostd::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' test_cpu.cpp:(.text+0xb19): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0xbff): undefined reference tostd::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' test_cpu.cpp:(.text+0xd15): undefined reference to 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 functiongrad_check(int, int, std::vector<float, std::allocator >&, 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::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1727): undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x1804): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1942): undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x1a23): undefined reference to 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 tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x1c39): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x1d4d): undefined reference tostd::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 inf_test()': test_cpu.cpp:(.text+0x20e5): undefined reference tostd::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' test_cpu.cpp:(.text+0x2223): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x22ff): undefined reference tostd::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' test_cpu.cpp:(.text+0x2416): undefined reference to 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 functionsmall_test()': test_cpu.cpp:(.text+0x27cd): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x28fa): undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)' test_cpu.cpp:(.text+0x29dd): undefined reference to std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' test_cpu.cpp:(.text+0x2afa): undefined reference tostd::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::__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 tostd::__cxx11::basic_string<char, std::char_traits, 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

grig-guz commented 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 ../
zkself commented 5 years ago

@grig-guz
i did as you said,but the problem still exists. by the way, i use gtx2080ti.