Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gcc make[1]:***[CMakeFiles/test_cpu.dir/all]运行cmake时出现错误2_Gcc_Cmake_Torch - Fatal编程技术网

Gcc make[1]:***[CMakeFiles/test_cpu.dir/all]运行cmake时出现错误2

Gcc make[1]:***[CMakeFiles/test_cpu.dir/all]运行cmake时出现错误2,gcc,cmake,torch,Gcc,Cmake,Torch,我想从安装一个快速并行CTC库。但是我在链接(编译部分中描述的以下步骤中进行堆栈 如果您有非标准CUDA安装导出CUDA\u BIN\u PATH=/PATH\u to\u CUDA,以便CMake检测CUDA并确保检测到火炬,请确保th位于$PATH 1) 我怎么才能找到通往库达的路呢?我怕在这条路上出错 CUDA_BIN_PATH=/path_to_cuda 及 2) 如何确保th位于$PATH中 因为没有这些,代码就不能工作 以下是步骤: git clone https://git

我想从安装一个快速并行CTC库。但是我在链接(编译部分中描述的以下步骤中进行堆栈

如果您有非标准CUDA安装导出CUDA\u BIN\u PATH=/PATH\u to\u CUDA,以便CMake检测CUDA并确保检测到火炬,请确保th位于$PATH

1) 我怎么才能找到通往库达的路呢?我怕在这条路上出错

  CUDA_BIN_PATH=/path_to_cuda 

2) 如何确保th位于$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
make
[10%]生成NVCC(设备)对象CMakeFiles/warpct.dir/src/warpct\u生成的\u reduce.cu.o
[20%]构建NVCC(设备)对象cmakfiles/warpctcc.dir/src/warpcc\u生成的\u ctc\u entrypoint.cu.o
目标对象的扫描依赖关系
[30%]链接CXX共享库libwarptc.so
[30%]已建立目标系统
扫描目标测试cpu的依赖项
[40%]构建CXX对象CMakeFiles/test\u cpu.dir/tests/test\u cpu.cpp.o
[50%]链接CXX可执行测试\u cpu
/home/ahmed/torch/install/lib/libTHC.so:std:uuuCXX11::basic_string::~basic_string()@GLIBCXX_3.4.21的未定义引用
/home/ahmed/torch/install/lib/libTHC.so:std:uuucx11::basic_string::_M_append(char const*,unsigned long)@GLIBCXX_3.4.21的未定义引用
/home/ahmed/torch/install/lib/libTH.so.0:对“GOMP”的未定义引用_parallel@GOMP_4.0'
/home/ahmed/torch/install/lib/libTHC.so:未定义对“std::random_device::_M_init(std:u cx11::basic_string const&)@GLIBCXX_3.4.21”的引用
/home/ahmed/torch/install/lib/libTHC.so:未定义对“std::runtime\u error::runtime\u error(std::\uu cx11::basic\u string const&)@GLIBCXX\u 3.4.21”的引用
/home/ahmed/torch/install/lib/libTHC.so:std:uuu cxx11::basic_string::_M_replace(无符号长、无符号长、字符常量*、无符号长)@GLIBCXX_3.4.21'
/home/ahmed/torch/install/lib/libTHC.so:std:uuucx11::basic_string::_M_create(unsigned long&,unsigned long)@GLIBCXX_3.4.21的未定义引用
collect2:错误:ld返回了1个退出状态
CMakeFiles/test\u cpu.dir/build.make:99:目标“test\u cpu”的配方失败
make[2]:***[test_cpu]错误1
CMakeFiles/Makefile2:67:目标“CMakeFiles/test_cpu.dir/all”的配方失败
生成[1]:***[CMakeFiles/test\u cpu.dir/all]错误2
Makefile:127:目标“全部”的配方失败
make:**[全部]错误2
这似乎是一个与Torch和Pytorch完全无关的CMake问题


Christian Pfeiffer说:“您观察到的错误意味着您试图链接使用GCC 5.1.0或更新版本构建的代码(这就是GLIBCXX_3.4.21对应的代码)使用GCC4.8.5编译器,因此更老的libstdc++也随之提供。更具体地说,您得到的cutorch二进制文件并没有使用与您现在尝试使用的相同的GCC构建。
LISSTDC++使用版本符号,使用“GLYBCXX3.3.4.21”来引用符号引入的点。在特定情况下,GCC 5.1.0中的C++ ABI更改会中断链接过程。“

我没有看到错误,我看到了一个错误。warning@talonmies,但它应该找到自由,不是吗?“希望找到libcudart_static的librt,但没有找到它。”@Talonmes,请查看我的更新我不相信你显示的错误与该警告有关,而且肯定与CUDAIt无关。在我看来,这就像是一个ABI不兼容错误。。。库
/home/ahmed/torch/install/lib/libTHC.so
是否使用相同的编译器编译?我猜情况并非如此,这是导致错误的原因。