返回

cmake-无法计算libnvrtc的shorthash

发布时间:2022-08-27 05:39:28 439
# c++# linux

我正在使用cmake构建一个使用libtorch的项目,但我收到了以下警告:

$ cmake -DCMAKE_PREFIX_PATH=/home/user/libtorch ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- 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-11.7 (found version "11.7") 
-- The CUDA compiler identification is NVIDIA 11.7.64
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-11.7/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Caffe2: CUDA detected: 11.7
-- Caffe2: CUDA nvcc is: /usr/local/cuda-11.7/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-11.7
-- Caffe2: Header version is: 11.7
-- Found CUDNN: /usr/local/cuda-11.7/lib64/libcudnn.so  
-- Found cuDNN: v8.4.1  (include: /usr/local/cuda-11.7/include, library: /usr/local/cuda-11.7/lib64/libcudnn.so) CMake Warning at /home/user/libtorch/share/cmake/Caffe2/public/cuda.cmake:208 (message):   Failed to compute shorthash for libnvrtc.so Call Stack (most recent call first):   /home/user/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)   /home/user/libtorch/share/cmake/Torch/TorchConfig.cmake:68 (find_package)   CMakeLists.txt:11 (find_package)


-- Autodetected CUDA architecture(s):  8.6
-- Added CUDA NVCC flags for: -gencode;arch=compute_86,code=sm_86
-- Found Torch: /home/user/libtorch/lib/libtorch.so  
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: program_options regex 
-- Configuring done
-- Generating done

这是我的CMakeLists.txt:

 cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
 
 # set the project name
 project(example VERSION 1.0)
 
 # specify the C++ standard
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED True)
 
 # libtorch
 find_package(Torch REQUIRED)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
 
 # C++ Boost
 SET(BOOST_USE_STATIC_LIBS OFF)
 SET(BOOST_USE_MULTITHREADED ON)
 SET(BOOST_USE_STATIC_RUNTIME OFF)
 FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options regex)
 INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
 
 # local source files here
 SET(TARGET_SRC
     src/example.cpp
     src/util.cpp)
 
 # add the executable
 add_executable(example src/main.cpp ${TARGET_SRC})
 
 # set local header files
 target_include_directories(example PUBLIC ${CMAKE_SOURCE_DIR}/include)
 
 # lib header files
 target_include_directories(example PUBLIC ${CMAKE_SOURCE_DIR}/lib)
 
 # link libraries
 TARGET_LINK_LIBRARIES(example pthread Boost::program_options Boost::regex "${TORCH_LIBRARIES}")
 
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像