【发布时间】:2019-04-18 07:41:18
【问题描述】:
从 CMAKE 3.10 开始,默认支持 CUDA 宏 (https://cmake.org/cmake/help/latest/module/FindCUDA.html)。
但我找不到变量 CUDA_INCLUDE_DIRS
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(cmake_and_cuda LANGUAGES CXX CUDA)
message(${CUDA_INCLUDE_DIRS})
错误是
-- The CXX compiler identification is GNU 5.4.0
-- The CUDA compiler identification is NVIDIA 10.0.130
-- 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
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
CMake Error at CMakeLists.txt:7 (message):
message called with incorrect number of arguments
-- Configuring incomplete, errors occurred!
See also "/home/tumh/code-samples/posts/cmake/build/CMakeFiles/CMakeOutput.log".
有什么想法吗?
【问题讨论】:
-
如果您没有使用旧版 CUDA 构建宏,您为什么希望设置像 CUDA_INCLUDE_DIRS 这样的旧版构建变量?
-
那么如何在较新版本的cmake中找到cuda包含目录?
-
这与您最初提出的问题不同——但可能类似于stackoverflow.com/a/6904431/681865
-
它看起来像原来的问题,但它不能像后来这样的问题那么受欢迎:stackoverflow.com/questions/51756562/…