cmake - 无法为目标 caffe 生成安全的运行时搜索路径,因为某些目录中的文件可能与隐式目录中的库冲突
问题描述
我正在尝试安装此代码https://github.com/NVlabs/ssn_superpixelscmake ..
但在步骤中出现错误
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_cublas_LIBRARY (ADVANCED)
linked by target "caffe" in directory /home/haziq/ASTAR/scripts/ssn_superpixels/lib/video_prop_networks/lib/caffe/src/caffe
所以我删除了构建文件夹,重新创建它并 cd 进入它并运行cmake .. -DCUDA_cublas_LIBRARY=/usr/lib/x86_64-linux-gnu/libcublas.so.9.1
,但现在收到以下消息。
CMake Warning at src/caffe/CMakeLists.txt:20 (add_library):
Cannot generate a safe runtime search path for target caffe because files
in some directories may conflict with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at src/caffe/test/CMakeLists.txt:29 (add_executable):
Cannot generate a safe runtime search path for target test.testbin because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target extract_features
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target device_query because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target convert_imageset
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target test_net because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target net_speed_benchmark
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target compute_image_mean
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target train_net because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target finetune_net because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target
upgrade_net_proto_binary because files in some directories may conflict
with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target
upgrade_net_proto_text because files in some directories may conflict with
libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target
upgrade_solver_proto_text because files in some directories may conflict
with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target caffe.bin because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at python/CMakeLists.txt:9 (add_library):
Cannot generate a safe runtime search path for target pycaffe because files
in some directories may conflict with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
我在这里找到了一个帖子CMake 无法解析运行时目录路径,它提供了一个解决方案find_library
,find_package
但我的是add_library
. 无论如何,我尝试修复第一个 CMake 警告
CMake Warning at src/caffe/CMakeLists.txt:20 (add_library):
Cannot generate a safe runtime search path for target caffe because files
in some directories may conflict with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
通过编辑 src/caffe/CMakeLists.txt 的第 20 行替换add_library(caffe ${srcs})
为add_library(caffe ${srcs} NO_DEFAULT_PATH)
但现在收到此消息。
CMake Error at src/caffe/CMakeLists.txt:20 (add_library):
Cannot find source file:
NO_DEFAULT_PATH
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
接下来我可以尝试什么?
解决方案
安装 libcublas 10 然后再次运行
推荐阅读
- azure-devops - 功能状态自动更新
- html - VBA 中的 HTML 电子邮件 - 删除无序列表后的空格
- javascript - 保存输入值,即使它是空白的
- visual-studio - 为什么 JIT(即时)调试器在 Windows Server 2019 Standard 上运行时在 VS2019 Enterprise 中不可用?
- python - 从数字浮点熊猫字符串列中删除不需要的字符串
- r - 从 R 中的值获取名称(setNames 示例)
- flutter - 我怎么能做颤振自动对焦但键盘关闭
- laravel - Laravel 和 Vuejs:如何在 laravel 多页面应用程序中使用 vuejs
- javascript - 如何代理 JavaScript 创建原语
- android - 如何预加载imageView的height和width属性?