CMake 中找不到 CUDA_CUDA_LIBRARY (ADVANCED)

在编译 C++ / Cuda 的混合程序时,出现下面的 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_CUDA_LIBRARY (ADVANCED)
    linked by target "***" in directory /home/usr/

-- Configuring incomplete, errors occurred!

baidu 网上,基本找不到解决方法,最后在 github 中看到 OpenCV 编译时,也会出现这种情况,
解决办法:CMake 时, 添加这个变量:

cmake -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs 

这个问题,就解决了。


如果需要指定 make install 路径,可以使用 -DCMAKE_INSTALL_PREFIX

cmake -DCMAKE_INSTALL_PREFIX=../../lib_DIR/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值