编译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

相关文章

Redis连接失败:客户端IP不在白名单中的问题分析与解决方案

《Redis连接失败:客户端IP不在白名单中的问题分析与解决方案》在现代分布式系统中,Redis作为一种高性能的内存数据库,被广泛应用于缓存、消息队列、会话存储等场景,然而,在实际使用过程中,我们可能... 目录一、问题背景二、错误分析1. 错误信息解读2. 根本原因三、解决方案1. 将客户端IP添加到Re

详谈redis跟数据库的数据同步问题

《详谈redis跟数据库的数据同步问题》文章讨论了在Redis和数据库数据一致性问题上的解决方案,主要比较了先更新Redis缓存再更新数据库和先更新数据库再更新Redis缓存两种方案,文章指出,删除R... 目录一、Redis 数据库数据一致性的解决方案1.1、更新Redis缓存、删除Redis缓存的区别二

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

element-ui下拉输入框+resetFields无法回显的问题解决

《element-ui下拉输入框+resetFields无法回显的问题解决》本文主要介绍了在使用ElementUI的下拉输入框时,点击重置按钮后输入框无法回显数据的问题,具有一定的参考价值,感兴趣的... 目录描述原因问题重现解决方案方法一方法二总结描述第一次进入页面,不做任何操作,点击重置按钮,再进行下

解决mybatis-plus-boot-starter与mybatis-spring-boot-starter的错误问题

《解决mybatis-plus-boot-starter与mybatis-spring-boot-starter的错误问题》本文主要讲述了在使用MyBatis和MyBatis-Plus时遇到的绑定异常... 目录myBATis-plus-boot-starpythonter与mybatis-spring-b

你的华为手机升级了吗? 鸿蒙NEXT多连推5.0.123版本变化颇多

《你的华为手机升级了吗?鸿蒙NEXT多连推5.0.123版本变化颇多》现在的手机系统更新可不仅仅是修修补补那么简单了,华为手机的鸿蒙系统最近可是动作频频,给用户们带来了不少惊喜... 为了让用户的使用体验变得很好,华为手机不仅发布了一系列给力的新机,还在操作系统方面进行了疯狂的发力。尤其是近期,不仅鸿蒙O

mysql主从及遇到的问题解决

《mysql主从及遇到的问题解决》本文详细介绍了如何使用Docker配置MySQL主从复制,首先创建了两个文件夹并分别配置了`my.cnf`文件,通过执行脚本启动容器并配置好主从关系,文中还提到了一些... 目录mysql主从及遇到问题解决遇到的问题说明总结mysql主从及遇到问题解决1.基于mysql

如何测试计算机的内存是否存在问题? 判断电脑内存故障的多种方法

《如何测试计算机的内存是否存在问题?判断电脑内存故障的多种方法》内存是电脑中非常重要的组件之一,如果内存出现故障,可能会导致电脑出现各种问题,如蓝屏、死机、程序崩溃等,如何判断内存是否出现故障呢?下... 如果你的电脑是崩溃、冻结还是不稳定,那么它的内存可能有问题。要进行检查,你可以使用Windows 11

什么是 Ubuntu LTS?Ubuntu LTS和普通版本区别对比

《什么是UbuntuLTS?UbuntuLTS和普通版本区别对比》UbuntuLTS是Ubuntu操作系统的一个特殊版本,旨在提供更长时间的支持和稳定性,与常规的Ubuntu版本相比,LTS版... 如果你正打算安装 Ubuntu 系统,可能会被「LTS 版本」和「普通版本」给搞得一头雾水吧?尤其是对于刚入

如何安装HWE内核? Ubuntu安装hwe内核解决硬件太新的问题

《如何安装HWE内核?Ubuntu安装hwe内核解决硬件太新的问题》今天的主角就是hwe内核(hardwareenablementkernel),一般安装的Ubuntu都是初始内核,不能很好地支... 对于追求系统稳定性,又想充分利用最新硬件特性的 Ubuntu 用户来说,HWEXBQgUbdlna(Har