我正在尝试构建这个项目,它具有 CUDA 作为依赖项。但是cmake脚本在系统上找不到CUDA安装:
cls ~/workspace/gpucluster/cluster/build $ cmake ..
-- The C compiler identification is GNU 4.7.1
-- The CXX compiler identification is GNU 4.7.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - 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
CMake Error at /usr/share/cmake/Modules/FindCUDA.cmake:488 (message):
Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
CMakeLists.txt:20 (find_package)
-- 配置不完整,出现错误!
我尝试将其作为环境变量添加到.bashrc
,但没有效果:
export CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-5.5
我该如何Specify CUDA_TOOLKIT_ROOT_DIR
正确?