Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run cmake on Pytorch1.8 Cuda10.1 #173

Open
maxh2010 opened this issue Sep 30, 2021 · 1 comment
Open

Failed to run cmake on Pytorch1.8 Cuda10.1 #173

maxh2010 opened this issue Sep 30, 2021 · 1 comment

Comments

@maxh2010
Copy link

I just run the cmake command as:
cmake -DCMAKE_PREFIX_PATH=/opt/conda/lib/python3.7/site-packages/torch/share/cmake/Torch ../

The output is

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/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: /usr/bin/c++
-- Check for working CXX compiler: /usr/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
-- Found CUDA: /usr/local/cuda (found suitable version "10.2", minimum required is "6.5")
-- Found CUDA: /usr/local/cuda (found version "10.2")
-- Caffe2: CUDA detected: 10.2
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.2
-- Found CUDNN: /usr/lib/x86_64-linux-gnu/libcudnn.so
-- Found cuDNN: v7.6.5 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
CMake Warning at /opt/conda/lib/python3.7/site-packages/torch/share/cmake/Caffe2/public/cuda.cmake:198 (message):
Failed to compute shorthash for libnvrtc.so
Call Stack (most recent call first):
/opt/conda/lib/python3.7/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
/opt/conda/lib/python3.7/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)
CMakeLists.txt:14 (FIND_PACKAGE)

-- Autodetected CUDA architecture(s): 7.0
-- Added CUDA NVCC flags for: -gencode;arch=compute_70,code=sm_70
-- Found Torch: /opt/conda/lib/python3.7/site-packages/torch/lib/libtorch.so
-- cuda found TRUE
-- Torch found /opt/conda/lib/python3.7/site-packages/torch/share/cmake/Torch
-- Building shared library with GPU support
-- NVCC_ARCH_FLAGS-DONNX_NAMESPACE=onnx_c2-gencodearch=compute_70,code=sm_70-Xcudafe--diag_suppress=cc_clobber_ignored,--diag_suppress=integer_sign_change,--diag_suppress=useless_using_declaration,--diag_suppress=set_but_not_used,--diag_suppress=field_without_dll_interface,--diag_suppress=base_class_has_different_dll_interface,--diag_suppress=dll_interface_conflict_none_assumed,--diag_suppress=dll_interface_conflict_dllexport_assumed,--diag_suppress=implicit_return_from_non_void_function,--diag_suppress=unsigned_compare_with_zero,--diag_suppress=declared_but_not_referenced,--diag_suppress=bad_friend_decl-std=c++14-Xcompiler-fPIC--expt-relaxed-constexpr--expt-extended-lambda -O2 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 --std=c++11 -Xcompiler -fopenmp
-- Build tests
-- Building Torch Bindings with GPU support
CMake Error at CMakeLists.txt:209 (INSTALL):
INSTALL TARGETS given no LIBRARY DESTINATION for shared library target
"warpctc".

CMake Error at CMakeLists.txt:217 (ADD_TORCH_PACKAGE):
Unknown CMake command "ADD_TORCH_PACKAGE".

-- Configuring incomplete, errors occurred!
See also "/home/bml/storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/bml/storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeError.log".

@maxh2010
Copy link
Author

maxh2010 commented Sep 30, 2021

CMakeError.log

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/bml/storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_3e24c/fast"
/usr/bin/make -f CMakeFiles/cmTC_3e24c.dir/build.make CMakeFiles/cmTC_3e24c.dir/build
make[1]: Entering directory '/home/bml/.storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3e24c.dir/CheckSymbolExists.c.o
/usr/bin/cc -fPIC -o CMakeFiles/cmTC_3e24c.dir/CheckSymbolExists.c.o -c /home/bml/storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_3e24c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3e24c.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -rdynamic CMakeFiles/cmTC_3e24c.dir/CheckSymbolExists.c.o -o cmTC_3e24c
CMakeFiles/cmTC_3e24c.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x1b): undefined reference to pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_3e24c.dir/build.make:97: recipe for target 'cmTC_3e24c' failed
make[1]: *** [cmTC_3e24c] Error 1
make[1]: Leaving directory '/home/bml/.storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_3e24c/fast' failed
make: *** [cmTC_3e24c/fast] Error 2

File /home/bml/storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/bml/storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_ac587/fast"
/usr/bin/make -f CMakeFiles/cmTC_ac587.dir/build.make CMakeFiles/cmTC_ac587.dir/build
make[1]: Entering directory '/home/bml/.storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ac587.dir/CheckFunctionExists.c.o
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_ac587.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_ac587
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ac587.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_ac587.dir/CheckFunctionExists.c.o -o cmTC_ac587 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_ac587.dir/build.make:97: recipe for target 'cmTC_ac587' failed
make[1]: *** [cmTC_ac587] Error 1
make[1]: Leaving directory '/home/bml/.storage/mnt/v-u8wb7huq2nkd2m6o/package/warp-ctc-master/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_ac587/fast' failed
make: *** [cmTC_ac587/fast] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant