首页 > 解决方案 > 无法为目标 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_libraryfind_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

接下来我可以尝试什么?

标签: cmake

解决方案


安装 libcublas 10 然后再次运行


推荐阅读