make [1]:*** [CMakeFiles / test_cpu.dir / all]运行cmake

时间:2017-04-26 14:50:28

标签: gcc cmake torch

我想从https://github.com/SeanNaren/warp-ctc安装Fast parallel CTC库。但是我在链接(编译部分)中描述的下一步中进行堆叠。

如果您有非标准CUDA安装导出 CUDA_BIN_PATH = / path_to_cuda 以便CMake检测到CUDA并确保检测到 Torch ,请确保 th 位于 $ PATH

1)我怎样才能找到cuda的路径,我害怕犯错误

  CUDA_BIN_PATH=/path_to_cuda 

2)如何确保 $ PATH

因为没有它,代码不起作用。

以下是步骤:

git clone https://github.com/baidu-research/warp-ctc.git
cd warp-ctc
mkdir build 
cd build 
cmake ../



-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /root/anaconda3/bin/cc
-- Check for working C compiler: /root/anaconda3/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /root/anaconda3/bin/c++
-- Check for working CXX compiler: /root/anaconda3/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
**CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA.cmake:771 (message):
  Expecting to find librt for libcudart_static, but didn't find it.
Call Stack (most recent call first):
  CMakeLists.txt:20 (FIND_PACKAGE)**


-- Found CUDA: /usr/local/cuda (found suitable version "8.0", minimum required is "6.5") 
-- cuda found TRUE
-- Found Torch7 in /home/ahmed/torch/install
-- Torch found /home/ahmed/torch/install/share/cmake/torch
-- Building shared library with GPU support
-- Building Torch Bindings with GPU support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ahmed/warp-ctc/build

运行后

make

我收到了以下错误:

make
[ 10%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o
[ 20%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o
Scanning dependencies of target warpctc
[ 30%] Linking CXX shared library libwarpctc.so
[ 30%] Built target warpctc
Scanning dependencies of target test_cpu
[ 40%] Building CXX object CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o
[ 50%] Linking CXX executable test_cpu
/home/ahmed/torch/install/lib/libTHC.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21'
/home/ahmed/torch/install/lib/libTHC.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)@GLIBCXX_3.4.21'
/home/ahmed/torch/install/lib/libTH.so.0: undefined reference to `GOMP_parallel@GOMP_4.0'
/home/ahmed/torch/install/lib/libTHC.so: undefined reference to `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/ahmed/torch/install/lib/libTHC.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/ahmed/torch/install/lib/libTHC.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
/home/ahmed/torch/install/lib/libTHC.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status
CMakeFiles/test_cpu.dir/build.make:99: 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:127: recipe for target 'all' failed
make: *** [all] Error 2

这似乎是一个与Torch和Pytorch完全无关的CMake问题。

来自https://gitlab.kitware.com/cmake/cmake/issues/16832
Christian Pfeiffer 说&#34;您观察到的错误意味着您尝试链接使用GCC 5.1.0或更新版本构建的代码(这就是GLIBCXX_3。 4.21对应于)与GCC 4.8.5编译器,因此较旧的libstdc ++与之一起发货。更具体地说,你所获得的cutorch二进制文件并没有使用与你现在正在尝试使用的相同的GCC。 libstdc ++使用版本化符号,@ GLIBCXX_3.4.21指的是引入符号时的点。在您的特定情况下,GCC 5.1.0中的C ++ ABI更改会破坏链接过程。 &#34;

0 个答案:

没有答案