我安装了两个版本的 CUDA:7.0 和 7.5。它们分别位于/usr/local/cuda-7.0
和/usr/local/cuda-7.5
。我还有一个/usr/local/cuda
指向的符号链接/usr/local/cuda-7.5
。我还安装了 OpenCV 3.0,它是我从源代码编译的。
在我的 C++ 项目中,我的CMakeLists.txt
文件包含行find_package(OpenCV REQUIRED)
。但是,运行时cmake
,出现以下错误:
Trying to find version: 7.0
CMake Error at /usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find CUDA: Found unsuitable version "7.5", but required is exact
version "7.0" (found /usr/local/cuda)
Call Stack (most recent call first):
/usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:372 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.2/Modules/FindCUDA.cmake:855 (find_package_handle_standard_args)
/usr/local/share/OpenCV/OpenCVConfig.cmake:49 (find_package)
/usr/local/share/OpenCV/OpenCVConfig.cmake:274 (find_host_package)
CMakeLists.txt:8 (find_package)
我很困惑这到底想告诉我什么。是不是因为 OpenCV 是用 CUDA 7.0 编译的,所以当我运行 时find_package(OpenCV REQUIRED)
,它也会尝试查找 CUDA 7.0,但只能找到 CUDA 7.5?如果是这样,那么为什么它找不到 CUDA 7.0,因为我已经安装了它?还是与符号链接有关?或者可能是FindCUDA.cmake
?
谢谢你的帮助!