Cmake报错linked by target “opencv_cudev“ in directory /home/davidhopper/opencv/opencv-3.3.0/

Cmake中的报错信息如下

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_nppi_LIBRARY (ADVANCED)
    linked by target "opencv_cudev" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudev
    linked by target "opencv_cudev" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudev
    linked by target "opencv_test_cudev" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudev/test
    linked by target "opencv_core" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/core
    linked by target "opencv_core" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/core
    linked by target "opencv_test_core" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/core
    linked by target "opencv_perf_core" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/core
    linked by target "opencv_test_cudaarithm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaarithm
    linked by target "opencv_perf_cudaarithm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaarithm
    linked by target "opencv_cudaarithm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaarithm
    linked by target "opencv_cudaarithm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaarithm
    linked by target "opencv_test_flann" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/flann
    linked by target "opencv_flann" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/flann
    linked by target "opencv_flann" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/flann
    linked by target "opencv_imgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgproc
    linked by target "opencv_imgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgproc
    linked by target "opencv_test_imgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgproc
    linked by target "opencv_perf_imgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgproc
    linked by target "opencv_test_ml" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/ml
    linked by target "opencv_ml" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/ml
    linked by target "opencv_ml" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/ml
    linked by target "opencv_test_objdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/objdetect
    linked by target "opencv_objdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/objdetect
    linked by target "opencv_objdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/objdetect
    linked by target "opencv_perf_objdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/objdetect
    linked by target "opencv_video" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/video
    linked by target "opencv_video" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/video
    linked by target "opencv_test_video" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/video
    linked by target "opencv_perf_video" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/video
    linked by target "opencv_test_viz" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/viz
    linked by target "opencv_viz" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/viz
    linked by target "opencv_viz" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/viz
    linked by target "opencv_test_cudabgsegm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudabgsegm
    linked by target "opencv_cudabgsegm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudabgsegm
    linked by target "opencv_cudabgsegm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudabgsegm
    linked by target "opencv_perf_cudabgsegm" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudabgsegm
    linked by target "opencv_test_cudafilters" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafilters
    linked by target "opencv_cudafilters" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafilters
    linked by target "opencv_cudafilters" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafilters
    linked by target "opencv_perf_cudafilters" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafilters
    linked by target "opencv_test_cudaimgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaimgproc
    linked by target "opencv_perf_cudaimgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaimgproc
    linked by target "opencv_cudaimgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaimgproc
    linked by target "opencv_cudaimgproc" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaimgproc
    linked by target "opencv_test_cudawarping" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudawarping
    linked by target "opencv_cudawarping" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudawarping
    linked by target "opencv_cudawarping" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudawarping
    linked by target "opencv_perf_cudawarping" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudawarping
    linked by target "opencv_test_dnn" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/dnn
    linked by target "opencv_dnn" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/dnn
    linked by target "opencv_dnn" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/dnn
    linked by target "opencv_perf_dnn" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/dnn
    linked by target "opencv_test_imgcodecs" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgcodecs
    linked by target "opencv_imgcodecs" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgcodecs
    linked by target "opencv_imgcodecs" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgcodecs
    linked by target "opencv_perf_imgcodecs" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/imgcodecs
    linked by target "opencv_test_photo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/photo
    linked by target "opencv_photo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/photo
    linked by target "opencv_photo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/photo
    linked by target "opencv_perf_photo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/photo
    linked by target "opencv_test_shape" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/shape
    linked by target "opencv_shape" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/shape
    linked by target "opencv_shape" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/shape
    linked by target "opencv_test_videoio" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videoio
    linked by target "opencv_videoio" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videoio
    linked by target "opencv_videoio" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videoio
    linked by target "opencv_perf_videoio" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videoio
    linked by target "opencv_test_cudacodec" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudacodec
    linked by target "opencv_cudacodec" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudacodec
    linked by target "opencv_cudacodec" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudacodec
    linked by target "opencv_perf_cudacodec" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudacodec
    linked by target "opencv_test_highgui" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/highgui
    linked by target "opencv_highgui" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/highgui
    linked by target "opencv_highgui" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/highgui
    linked by target "opencv_ts" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/ts
    linked by target "opencv_ts" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/ts
    linked by target "opencv_test_features2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/features2d
    linked by target "opencv_features2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/features2d
    linked by target "opencv_features2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/features2d
    linked by target "opencv_perf_features2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/features2d
    linked by target "opencv_test_calib3d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/calib3d
    linked by target "opencv_calib3d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/calib3d
    linked by target "opencv_calib3d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/calib3d
    linked by target "opencv_perf_calib3d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/calib3d
    linked by target "opencv_test_cudafeatures2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafeatures2d
    linked by target "opencv_perf_cudafeatures2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafeatures2d
    linked by target "opencv_cudafeatures2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafeatures2d
    linked by target "opencv_cudafeatures2d" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudafeatures2d
    linked by target "opencv_test_cudalegacy" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudalegacy
    linked by target "opencv_cudalegacy" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudalegacy
    linked by target "opencv_cudalegacy" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudalegacy
    linked by target "opencv_perf_cudalegacy" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudalegacy
    linked by target "opencv_test_cudaobjdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaobjdetect
    linked by target "opencv_cudaobjdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaobjdetect
    linked by target "opencv_cudaobjdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaobjdetect
    linked by target "opencv_perf_cudaobjdetect" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaobjdetect
    linked by target "opencv_test_cudaoptflow" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaoptflow
    linked by target "opencv_cudaoptflow" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaoptflow
    linked by target "opencv_cudaoptflow" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaoptflow
    linked by target "opencv_perf_cudaoptflow" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudaoptflow
    linked by target "opencv_test_cudastereo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudastereo
    linked by target "opencv_perf_cudastereo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudastereo
    linked by target "opencv_cudastereo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudastereo
    linked by target "opencv_cudastereo" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/cudastereo
    linked by target "opencv_test_stitching" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/stitching
    linked by target "opencv_perf_stitching" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/stitching
    linked by target "opencv_stitching" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/stitching
    linked by target "opencv_stitching" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/stitching
    linked by target "opencv_superres" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/superres
    linked by target "opencv_superres" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/superres
    linked by target "opencv_test_superres" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/superres
    linked by target "opencv_perf_superres" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/superres
    linked by target "opencv_test_videostab" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videostab
    linked by target "opencv_videostab" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videostab
    linked by target "opencv_videostab" in directory /home/davidhopper/opencv/opencv-3.3.0/modules/videostab
    linked by target "opencv_traincascade" in directory /home/davidhopper/opencv/opencv-3.3.0/apps/traincascade
    linked by target "opencv_createsamples" in directory /home/davidhopper/opencv/opencv-3.3.0/apps/createsamples
    linked by target "opencv_annotation" in directory /home/davidhopper/opencv/opencv-3.3.0/apps/annotation
    linked by target "opencv_visualisation" in directory /home/davidhopper/opencv/opencv-3.3.0/apps/visualisation
    linked by target "opencv_interactive-calibration" in directory /home/davidhopper/opencv/opencv-3.3.0/apps/interactive-calibration
    linked by target "opencv_version" in directory /home/davidhopper/opencv/opencv-3.3.0/apps/version


Configuring incomplete, errors occurred!
See also "/home/davidhopper/opencv/opencv-3.3.0/build/CMakeFiles/CMakeOutput.log".
See also "/home/davidhopper/opencv/opencv-3.3.0/build/CMakeFiles/CMakeError.log".

解决方案如下:

第一步骤:找到FindCUDA.cmake文件

然后找到行 find_cuda_helper_libs(nppi)

改为

find_cuda_helper_libs(nppial)
find_cuda_helper_libs(nppicc)
find_cuda_helper_libs(nppicom)
find_cuda_helper_libs(nppidei)
find_cuda_helper_libs(nppif)
find_cuda_helper_libs(nppig)
find_cuda_helper_libs(nppim)
find_cuda_helper_libs(nppist)
find_cuda_helper_libs(nppisu)
find_cuda_helper_libs(nppitc)

第二步骤:还是在FindCUDA.cmake文件内找到行

set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}")

改为

set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}")

第三步骤:还是在FindCUDA.cmake文件内找到行unset(CUDA_nppi_LIBRARY CACHE)

改为

unset(CUDA_nppial_LIBRARY CACHE)
unset(CUDA_nppicc_LIBRARY CACHE)
unset(CUDA_nppicom_LIBRARY CACHE)
unset(CUDA_nppidei_LIBRARY CACHE)
unset(CUDA_nppif_LIBRARY CACHE)
unset(CUDA_nppig_LIBRARY CACHE)
unset(CUDA_nppim_LIBRARY CACHE)
unset(CUDA_nppist_LIBRARY CACHE)
unset(CUDA_nppisu_LIBRARY CACHE)
unset(CUDA_nppitc_LIBRARY CACHE)


第四步骤:找到文件 OpenCVDetectCUDA.cmake

修改以下几行

     ...
      set(__cuda_arch_ptx "")
      if(CUDA_GENERATION STREQUAL "Fermi")
        set(__cuda_arch_bin "2.0")
      elseif(CUDA_GENERATION STREQUAL "Kepler")
        set(__cuda_arch_bin "3.0 3.5 3.7")
      ...

改为

      ...
      set(__cuda_arch_ptx "")
      if(CUDA_GENERATION STREQUAL "Kepler")
        set(__cuda_arch_bin "3.0 3.5 3.7")
      elseif(CUDA_GENERATION STREQUAL "Maxwell")
        set(__cuda_arch_bin "5.0 5.2")
      ...

OpenCVDetectCUDA.cmake文件修改后的截图如下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值