编译Opencv3.3 版本遇到的Cuda版本变更导致:CUDA_nppicom_LIBRARY (ADVANCED)链接找不到的问题根本解法:

本文主要是介绍编译Opencv3.3 版本遇到的Cuda版本变更导致:CUDA_nppicom_LIBRARY (ADVANCED)链接找不到的问题根本解法:,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

前言:

Opencv 开源库的使用是必须的,但是,开源项目的特性,造成,版本的依赖性比较复杂,
尤其是针对某一款老硬件的SDK,往往随着某个开源库的使用,导致,无法编译的问题,
本文,就是在一个硬件的SDK中用到了opencv3.3的版本,在笔者目前的VS2019,CUDA11版本下编译的问题和解决。


结论:


1 出现编译错误不要慌,这是开源项目的正常正常现象
2 搞清楚现在的SDK是那年出来的
3 搞清楚哪个库出问题,去找一下这个库的原始网站或者GitHub,看一下这些年都有哪些更新,尤其是接口API是不是变了
4 网上找找有没有哪个兄弟也遇到了,并解决了
5 找不到,不要慌,把编译或者链接出错的库拿出来,在源文件夹的编译配置文件里面搜一下
6 学一点CMAKE的知识,看看是这个库的问题还是这个库依赖的库问题,一半Cmake比较准确,就是这个库问题
7 确认这个库的版本是不是和你的SDK要求的版本一致
8 确认源文件里面有没有这个库
9 找到这个缺失的库,或者,去掉这个库的编译连接配置,或者用-D 告诉编译器这个库你就别管了,都行,反正能让编译器保持继续工作就可以!


 问题:

 CUDA_nppicom_LIBRARY (ADVANCED)

错误信息如下:

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 D:/opencv331/opencv/sources/modules/cudev
linked by target "opencv_cudev" in directory D:/opencv331/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory D:/opencv331/opencv/sources/modules/cudev/test
linked by target "opencv_core" in directory D:/opencv331/opencv/sources/modules/core
linked by target "opencv_core" in directory D:/opencv331/opencv/sources/modules/core
linked by target "opencv_test_core" in directory D:/opencv331/opencv/sources/modules/core
linked by target "opencv_perf_core" in directory D:/opencv331/opencv/sources/modules/core
linked by target "opencv_flann" in directory D:/opencv331/opencv/sources/modules/flann
linked by target "opencv_flann" in directory D:/opencv331/opencv/sources/modules/flann
linked by target "opencv_test_flann" in directory D:/opencv331/opencv/sources/modules/flann
linked by target "opencv_perf_imgproc" in directory D:/opencv331/opencv/sources/modules/imgproc
linked by target "opencv_imgproc" in directory D:/opencv331/opencv/sources/modules/imgproc
linked by target "opencv_imgproc" in directory D:/opencv331/opencv/sources/modules/imgproc
linked by target "opencv_test_imgproc" in directory D:/opencv331/opencv/sources/modules/imgproc
linked by target "opencv_ml" in directory D:/opencv331/opencv/sources/modules/ml
linked by target "opencv_ml" in directory D:/opencv331/opencv/sources/modules/ml
linked by target "opencv_test_ml" in directory D:/opencv331/opencv/sources/modules/ml
linked by target "opencv_objdetect" in directory D:/opencv331/opencv/sources/modules/objdetect
linked by target "opencv_objdetect" in directory D:/opencv331/opencv/sources/modules/objdetect
linked by target "opencv_test_objdetect" in directory D:/opencv331/opencv/sources/modules/objdetect
linked by target "opencv_perf_objdetect" in directory D:/opencv331/opencv/sources/modules/objdetect
linked by target "opencv_photo" in directory D:/opencv331/opencv/sources/modules/photo
linked by target "opencv_photo" in directory D:/opencv331/opencv/sources/modules/photo
linked by target "opencv_test_photo" in directory D:/opencv331/opencv/sources/modules/photo
linked by target "opencv_perf_photo" in directory D:/opencv331/opencv/sources/modules/photo
linked by target "opencv_video" in directory D:/opencv331/opencv/sources/modules/video
linked by target "opencv_video" in directory D:/opencv331/opencv/sources/modules/video
linked by target "opencv_test_video" in directory D:/opencv331/opencv/sources/modules/video
linked by target "opencv_perf_video" in directory D:/opencv331/opencv/sources/modules/video
linked by target "opencv_dnn" in directory D:/opencv331/opencv/sources/modules/dnn
linked by target "opencv_dnn" in directory D:/opencv331/opencv/sources/modules/dnn
linked by target "opencv_test_dnn" in directory D:/opencv331/opencv/sources/modules/dnn
linked by target "opencv_perf_dnn" in directory D:/opencv331/opencv/sources/modules/dnn
linked by target "opencv_imgcodecs" in directory D:/opencv331/opencv/sources/modules/imgcodecs
linked by target "opencv_imgcodecs" in directory D:/opencv331/opencv/sources/modules/imgcodecs
linked by target "opencv_test_imgcodecs" in directory D:/opencv331/opencv/sources/modules/imgcodecs
linked by target "opencv_perf_imgcodecs" in directory D:/opencv331/opencv/sources/modules/imgcodecs
linked by target "opencv_shape" in directory D:/opencv331/opencv/sources/modules/shape
linked by target "opencv_shape" in directory D:/opencv331/opencv/sources/modules/shape
linked by target "opencv_test_shape" in directory D:/opencv331/opencv/sources/modules/shape
linked by target "opencv_videoio" in directory D:/opencv331/opencv/sources/modules/videoio
linked by target "opencv_videoio" in directory D:/opencv331/opencv/sources/modules/videoio
linked by target "opencv_test_videoio" in directory D:/opencv331/opencv/sources/modules/videoio
linked by target "opencv_perf_videoio" in directory D:/opencv331/opencv/sources/modules/videoio
linked by target "opencv_highgui" in directory D:/opencv331/opencv/sources/modules/highgui
linked by target "opencv_highgui" in directory D:/opencv331/opencv/sources/modules/highgui
linked by target "opencv_test_highgui" in directory D:/opencv331/opencv/sources/modules/highgui
linked by target "opencv_superres" in directory D:/opencv331/opencv/sources/modules/superres
linked by target "opencv_superres" in directory D:/opencv331/opencv/sources/modules/superres
linked by target "opencv_test_superres" in directory D:/opencv331/opencv/sources/modules/superres
linked by target "opencv_perf_superres" in directory D:/opencv331/opencv/sources/modules/superres
linked by target "opencv_ts" in directory D:/opencv331/opencv/sources/modules/ts
linked by target "opencv_ts" in directory D:/opencv331/opencv/sources/modules/ts
linked by target "opencv_features2d" in directory D:/opencv331/opencv/sources/modules/features2d
linked by target "opencv_features2d" in directory D:/opencv331/opencv/sources/modules/features2d
linked by target "opencv_test_features2d" in directory D:/opencv331/opencv/sources/modules/features2d
linked by target "opencv_perf_features2d" in directory D:/opencv331/opencv/sources/modules/features2d
linked by target "opencv_calib3d" in directory D:/opencv331/opencv/sources/modules/calib3d
linked by target "opencv_calib3d" in directory D:/opencv331/opencv/sources/modules/calib3d
linked by target "opencv_test_calib3d" in directory D:/opencv331/opencv/sources/modules/calib3d
linked by target "opencv_perf_calib3d" in directory D:/opencv331/opencv/sources/modules/calib3d
linked by target "opencv_stitching" in directory D:/opencv331/opencv/sources/modules/stitching
linked by target "opencv_stitching" in directory D:/opencv331/opencv/sources/modules/stitching
linked by target "opencv_test_stitching" in directory D:/opencv331/opencv/sources/modules/stitching
linked by target "opencv_perf_stitching" in directory D:/opencv331/opencv/sources/modules/stitching
linked by target "opencv_videostab" in directory D:/opencv331/opencv/sources/modules/videostab
linked by target "opencv_videostab" in directory D:/opencv331/opencv/sources/modules/videostab
linked by target "opencv_test_videostab" in directory D:/opencv331/opencv/sources/modules/videostab
linked by target "opencv_traincascade" in directory D:/opencv331/opencv/sources/apps/traincascade
linked by target "opencv_createsamples" in directory D:/opencv331/opencv/sources/apps/createsamples
linked by target "opencv_annotation" in directory D:/opencv331/opencv/sources/apps/annotation
linked by target "opencv_visualisation" in directory D:/opencv331/opencv/sources/apps/visualisation
linked by target "opencv_interactive-calibration" in directory D:/opencv331/opencv/sources/apps/interactive-calibration
linked by target "opencv_version" in directory D:/opencv331/opencv/sources/apps/version

Generating done


 解决办法: 

1 问题分析

原因解析:

cuda9以上不再支持2.0架构,笔者系统的CUDA的版本是11.0,自然是没有这个nppicom的库的,所以,我们需求在配置中拿掉这个选项:

2 找到编译配置文件:

 D:\opencv331\opencv\sources\cmake

 【案,可以在source目录下,直接搜索报错的库名称,CUDA_nppicom_LIBRARY,也能找到makefile对应的修改的地方

CUDA的配置在,

3 找到错误的库应用:

在文件,FindCUDA.cmake,我们做如下修改:

 # Cuda not support nppicom from version 9 so just add a condition find_cuda_helper_libs(nppicom)if(CUDA_VERSION VERSION_LESS "11.0")find_cuda_helper_libs(nppicom)endif()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)find_cuda_helper_libs(npps)if(CUDA_VERSION VERSION_LESS "11.0")set(CUDA_nppi_LIBRARY "${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY}")else()set(CUDA_nppi_LIBRARY "${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY}")endif()

注意,

箭头处,都是笔者的修改

4 重新编译:

Configuring done

Generating done

就可以了


Ubuntu18.04+CUDA11.2+opencv4.3.0:CUDA_nppicom_LIBRARY (ADVANCED)报错解决_cuda_npps_library (advanced)-CSDN博客

OpenCV3.3+CUDA9.0+Cmake3.9 环境搭建_opencv make失败cuda compire-CSDN博客

这篇关于编译Opencv3.3 版本遇到的Cuda版本变更导致:CUDA_nppicom_LIBRARY (ADVANCED)链接找不到的问题根本解法:的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/656287

相关文章

Java编译生成多个.class文件的原理和作用

《Java编译生成多个.class文件的原理和作用》作为一名经验丰富的开发者,在Java项目中执行编译后,可能会发现一个.java源文件有时会产生多个.class文件,从技术实现层面详细剖析这一现象... 目录一、内部类机制与.class文件生成成员内部类(常规内部类)局部内部类(方法内部类)匿名内部类二、

springboot循环依赖问题案例代码及解决办法

《springboot循环依赖问题案例代码及解决办法》在SpringBoot中,如果两个或多个Bean之间存在循环依赖(即BeanA依赖BeanB,而BeanB又依赖BeanA),会导致Spring的... 目录1. 什么是循环依赖?2. 循环依赖的场景案例3. 解决循环依赖的常见方法方法 1:使用 @La

Linux卸载自带jdk并安装新jdk版本的图文教程

《Linux卸载自带jdk并安装新jdk版本的图文教程》在Linux系统中,有时需要卸载预装的OpenJDK并安装特定版本的JDK,例如JDK1.8,所以本文给大家详细介绍了Linux卸载自带jdk并... 目录Ⅰ、卸载自带jdkⅡ、安装新版jdkⅠ、卸载自带jdk1、输入命令查看旧jdkrpm -qa

Tomcat版本与Java版本的关系及说明

《Tomcat版本与Java版本的关系及说明》:本文主要介绍Tomcat版本与Java版本的关系及说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Tomcat版本与Java版本的关系Tomcat历史版本对应的Java版本Tomcat支持哪些版本的pythonJ

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

找不到Anaconda prompt终端的原因分析及解决方案

《找不到Anacondaprompt终端的原因分析及解决方案》因为anaconda还没有初始化,在安装anaconda的过程中,有一行是否要添加anaconda到菜单目录中,由于没有勾选,导致没有菜... 目录问题原因问http://www.chinasem.cn题解决安装了 Anaconda 却找不到 An

MySQL新增字段后Java实体未更新的潜在问题与解决方案

《MySQL新增字段后Java实体未更新的潜在问题与解决方案》在Java+MySQL的开发中,我们通常使用ORM框架来映射数据库表与Java对象,但有时候,数据库表结构变更(如新增字段)后,开发人员可... 目录引言1. 问题背景:数据库与 Java 实体不同步1.1 常见场景1.2 示例代码2. 不同操作

IDEA中Git版本回退的两种实现方案

《IDEA中Git版本回退的两种实现方案》作为开发者,代码版本回退是日常高频操作,IntelliJIDEA集成了强大的Git工具链,但面对reset和revert两种核心回退方案,许多开发者仍存在选择... 目录一、版本回退前置知识二、Reset方案:整体改写历史1、IDEA图形化操作(推荐)1.1、查看提

如何解决mysql出现Incorrect string value for column ‘表项‘ at row 1错误问题

《如何解决mysql出现Incorrectstringvalueforcolumn‘表项‘atrow1错误问题》:本文主要介绍如何解决mysql出现Incorrectstringv... 目录mysql出现Incorrect string value for column ‘表项‘ at row 1错误报错

电脑提示找不到openal32.dll文件怎么办? openal32.dll丢失完美修复方法

《电脑提示找不到openal32.dll文件怎么办?openal32.dll丢失完美修复方法》openal32.dll是一种重要的系统文件,当它丢失时,会给我们的电脑带来很大的困扰,很多人都曾经遇到... 在使用电脑过程中,我们常常会遇到一些.dll文件丢失的问题,而openal32.dll的丢失是其中比较