linuxbrew 在集群上安装的 cmake 在 /usr/lib64 中找不到 lib

linuxbrew installed cmake on a cluster cannot find lib in /usr/lib64

我正在尝试在 GGPU 集群上构建 caffe。我使用 linuxbrew 在我家的子文件夹中安装了很多依赖项。这些依赖项之一是 cmake 的更新版本(需要)。

当我启动命令时

cmake ..

我得到这个输出

-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
-- Found gflags  (include: /home/cgvg/.linuxbrew/include, library: /home/cgvg/.linuxbrew/lib/libgflags.so)
-- Found glog    (include: /home/cgvg/.linuxbrew/include, library: /home/cgvg/.linuxbrew/lib/libglog.so)
-- Found PROTOBUF Compiler: /home/cgvg/.linuxbrew/bin/protoc
-- Found lmdb    (include: /home/cgvg/.linuxbrew/include, library: /home/cgvg/.linuxbrew/lib/liblmdb.a)
-- Found LevelDB (include: /home/cgvg/.linuxbrew/include, library: /home/cgvg/.linuxbrew/lib/libleveldb.so)
-- Found Snappy  (include: /home/cgvg/.linuxbrew/include, library: /home/cgvg/.linuxbrew/lib/libsnappy.so)
-- CUDA detected: 7.5
-- Automatic GPU detection failed. Building for all known architectures.
-- Added CUDA NVCC flags for: sm_20 sm_21 sm_30 sm_35 sm_50
-- OpenCV found (/home/cgvg/sottile/opencv/share/OpenCV)
CMake Error at /home/cgvg/.linuxbrew/Cellar/cmake/3.4.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Atlas (missing: Atlas_LAPACK_LIBRARY)
Call Stack (most recent call first):
  /home/cgvg/.linuxbrew/Cellar/cmake/3.4.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindAtlas.cmake:42 (find_package_handle_standard_args)
  cmake/Dependencies.cmake:88 (find_package)
  CMakeLists.txt:38 (include)


-- Configuring incomplete, errors occurred!
See also "/home/cgvg/sottile/caffe/build/CMakeFiles/CMakeOutput.log".
See also "/home/cgvg/sottile/caffe/build/CMakeFiles/CMakeError.log".

似乎我无法正确 link ATLAS 库。 缺少的库在

/usr/lib64/atlas-sse3

是否存在限制,使得我的 linuxbrewed cmake 无法 link 到上层文件夹?

在错误消息中说:

cmake/Modules/FindAtlas.cmake:42

我试图修改该文件并添加正确的路径:

set(Atlas_INCLUDE_SEARCH_PATHS
  /usr/include
  $ENV{Atlas_ROOT_DIR}
  $ENV{Atlas_ROOT_DIR}/include
)

set(Atlas_LIB_SEARCH_PATHS
  /usr/lib64/atlas
  /usr/lib64/atlas-sse3 
  $ENV{Atlas_ROOT_DIR}
  $ENV{Atlas_ROOT_DIR}/lib
)

什么也没发生。

我试图改变 PATH 和 LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/atlas-sse3
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/include/atlas-x86_64-base-sse3/

什么也没发生。

我不是 linux 老手,所以如果我错过了一些重要信息,我深表歉意。任何建议表示赞赏。

编辑: 这是/usr/lib64/atlas3-sse3的内容:

libatlas.a       libcblas.so.3.0    libf77blas.so.3.0  libptcblas.so.3
libatlas.so      libclapack.so      liblapack.a        libptcblas.so.3.0
libatlas.so.3    libclapack.so.3    liblapack.so       libptf77blas.a
libatlas.so.3.0  libclapack.so.3.0  liblapack.so.3     libptf77blas.so
libcblas.a       libf77blas.a       liblapack.so.3.0   libptf77blas.so.3
libcblas.so      libf77blas.so      libptcblas.a       libptf77blas.so.3.0
libcblas.so.3    libf77blas.so.3    libptcblas.so
libatlas.a       libcblas.so.3.0    libf77blas.so.3.0  libptcblas.so.3
libatlas.so      libclapack.so      liblapack.a        libptcblas.so.3.0
libatlas.so.3    libclapack.so.3    liblapack.so       libptf77blas.a
libatlas.so.3.0  libclapack.so.3.0  liblapack.so.3     libptf77blas.so
libcblas.a       libf77blas.a       liblapack.so.3.0   libptf77blas.so.3
libcblas.so      libf77blas.so      libptcblas.a       libptf77blas.so.3.0
libcblas.so.3    libf77blas.so.3    libptcblas.so

lapack 似乎捆绑在 atlas 中,因此 FindAtlas.cmake 无法找到 alapack_r、alapck 或 lapack_atlas.

编辑 caffe_folder/cmake/Module/FindAtlas.cmake 就足够了,查找 Atlas_LAPACK_LIBRARY NAMES 并将 clapack 添加到库列表中。

彻底解决问题