Vcpkg编译darknet[full]:x64-windows 问题记录
时间:2020-07-06
作者:刘中奎
关键字:
OpenCV4
CUDA11
nppicom
CUDA_nppicom_LIBRARY (ADVANCED)
OpenCV4.1 + CUDA11
❓ 编译错误信息(CUDA_nppicom_LIBRARY (ADVANCED)
)
> vcpkg.exe install darknet[full]:x64-windows
...
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_nppicom_LIBRARY (ADVANCED)
linked by target "opencv_cudev" in directory C:/Users/16974/Desktop/works/1.package/vcpkg/buildtrees/opencv4/src/4.1.1-521dd00bd2/modules/cudev
...
☑️ 解决方案
网上大多给出的方案如OpenCV3.3+CUDA9.0+Cmake3.9 环境搭建
但OpenCV4.1版本,FindCUDA.cmake已修复了此问题。后来发现是由于cmake命令下的FindCUDA.cmake有问题…
vcpkg编译时用的FindCUDA.cmake路径是[YourRootPath]\vcpkg\downloads\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\share\cmake-3.17\Modules
,如下图所示:
注意到,CUDA 11.0
lib路径下并无nppicom
库文件,如下图所示:
所以解决方案是将nppicom注释掉即可,如下图所示:
🔚 最后,编译成功!