[问题解决]CUDA_nppicom_LIBRARY (ADVANCED) linked by target “opencv_cudev“ in directory /workspace/softwa

报错信息如下:

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 /workspace/software/opencv_contrib-4.1.0/modules/cudev
    linked by target "opencv_cudev" in directory /workspace/software/opencv_contrib-4.1.0/modules/cudev
    linked by target "opencv_test_cudev" in directory /workspace/software/opencv_contrib-4.1.0/modules/cudev/test
    linked by target "opencv_core" in directory /workspace/software/opencv-4.1.0/modules/core
    linked by target "opencv_core" in directory /workspace/software/opencv-4.1.0/modules/core
    linked by target "opencv_test_core" in directory /workspace/software/opencv-4.1.0/modules/core
    linked by target "opencv_perf_core" in directory /workspace/software/opencv-4.1.0/modules/core
    linked by target "opencv_cudaarithm" in directory /workspace/software/opencv_contrib-4.1.0/modules/cudaarithm
    linked by target "opencv_cudaarithm" in directory /workspace/software/opencv_contrib-4.1.0/modules/cudaarithm
    linked by target "opencv_test_cudaarithm" in directory /workspace/software/opencv_contrib-4.1.0/modules/cudaarithm
    linked by target "opencv_perf_cudaarithm" in directory /workspace/software/opencv_contrib-4.1.0/modules/cudaarithm
    linked by target "opencv_flann" in directory /workspace/software/opencv-4.1.0/modules/flann
    linked by target "opencv_flann" in directory /workspace/software/opencv-4.1.0/modules/flann
    linked by target "opencv_test_flann" in directory /workspace/software/opencv-4.1.0/modules/flann
    linked by target "opencv_imgproc" in directory /workspace/software/opencv-4.1.0/modules/imgproc
    linked by target "opencv_imgproc" in directory /workspace/software/opencv-4.1.0/modules/imgproc
    linked by target "opencv_perf_imgproc" in directory /workspace/software/opencv-4.1.0/modules/imgproc
    linked by target "opencv_test_imgproc" in directory /workspace/software/opencv-4.1.0/modules/imgproc
    linked by target "opencv_ml" in directory /workspace/software/opencv-4.1.0/modules/ml
    linked by target "opencv_ml" in directory /workspace/software/opencv-4.1.0/modules/ml
    linked by target "opencv_test_ml" in directory /workspace/softwar

在编译Opencv4.4 GPU之前的版本时,遇到了如题的问题,首先搜索,按照网上其他帖子的说法修改:

vim ./cmake/OpenCVDetectCUDA.cmake

vim ./cmake/FindCUDA.cmake

按照OpenCV3.3+CUDA9.0+Cmake3.9 环境搭建_Kmiracler的博客-CSDN博客

这个帖子的方法修改,但是完成之后还是报错,于是重新寻找解决方法。

偶然间找到,cmake的时候加上下面这句就可以正常了

-D CUDA_nppicom_LIBRARY=true 

总配置语句如下:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv4  -D WITH_GTK_2_X=ON -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_GENERATE_PKGCONFIG=YES -D OPENCV_EXTRA_MODULES_PATH=/workspace/software/opencv_contrib-4.1.0/modules .. -D WITH_CUDA=1 -D BUILD_opencv_xfeatures2d=OFF -D WITH_FFMPEG=ON -D WITH_OPENGL=ON -D WITH_NVCUVID=ON -D CUDA_nppicom_LIBRARY=true ..

所以解决方式就是在原有语句后面加一个:

-D CUDA_nppicom_LIBRARY=true

你可能感兴趣的:(C++,opencv,图像处理/计算机视觉,linux,opencv,计算机视觉,人工智能)