gpt4 book ai didi

c++ - 在 Mavericks 上使用 CUDA 编译 OpenCV 2.4.9

转载 作者:搜寻专家 更新时间:2023-10-30 23:57:45 25 4
gpt4 key购买 nike

在配置 ccmake 时我收到了这个警告:

CMake Warning (dev) at cmake/OpenCVDetectCUDA.cmake:245 
(link_directories): This command specifies the relative path

-Wl,/Developer/NVIDIA/CUDA-6.0
as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the source dir.
Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/OpenCVFindLibsPerf.cmake:24 (include) CMakeLists.txt:468 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

当我尝试制作项目时,出现此错误:

ld: warning: directory not found for option '-L-Wl,/Developer/NVIDIA/CUDA-6.0' 
ld: can't map file, errno=22 for architecture x86_64
collect2: error: ld returned 1 exit status make[2]: * [lib/libopencv_core.2.4.9.dylib]
Error 1 make[1]: [modules/core/CMakeFiles/opencv_core.dir/all]
Error 2 make: ** [all] Error 2

最佳答案

你可以试试这个:

在 cmake/FindCUDA.cmake 中注释掉这一行(#865):

#list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")

然后opencv249就可以在我的mac上用CUDA成功构建了。

关于c++ - 在 Mavericks 上使用 CUDA 编译 OpenCV 2.4.9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23327694/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com