0

I'm trying to build caffe on a GGPU cluster. I've installed a lot of dependencies in a subfolder of my home using linuxbrew. One of those dependencies is an updated version of cmake(needed).

When i launch the command

cmake ..

i get this output

-- 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".

and it seems there is nothing i can do to link the ATLAS libs correctly. The missing libs are under

/usr/lib64/atlas-sse3

Is it possible that there exists a limitation such that my linuxbrewed cmake cannot link to upper folders?

In the error message it says that:

cmake/Modules/FindAtlas.cmake:42

I tried to modify that file adding the correct paths:

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
)

and nothing happened.

i tried to change the PATH and 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/

and nothing happened.

I'm not a linux veteran so i apologize if i missed some important information. Any suggestion is appreciated.

EDIT: this is the content of /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
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
NLK511
  • 23
  • 7
  • Missed variable are filled with path to library, possible names for which are: `alapack_r`, `alapack`, and `lapack_atlas`. Is library with one of the given name exists under `/usr/lib64/atlas-sse3`? If so, what is its exact path (with file extension)? – Tsyvarev Jan 19 '16 at 18:35
  • i've edited the post – NLK511 Jan 19 '16 at 18:41
  • So, there is not such library file in the directory. Probably, you use inccorect library installation. Or find script is outdated. – Tsyvarev Jan 19 '16 at 18:44
  • thanks man, you put on the right track and i solved the problem! – NLK511 Jan 19 '16 at 20:06

1 Answers1

0

It seems that lapack is bundled in atlas, for this reason FindAtlas.cmake is not able to find alapack_r, alapck or lapack_atlas.

It is enough to edit caffe_folder/cmake/Module/FindAtlas.cmake, look for Atlas_LAPACK_LIBRARY NAMES and add clapack to the list of libs.

It completely solve the problem.

NLK511
  • 23
  • 7
  • 1
    Another possibility is to set cache variable `Atlas_LAPACK_LIBRARY` manually, e.g., as parameter `-D` for cmake. In any case this looks like a bug in `FindAtlas.cmake` script. – Tsyvarev Jan 19 '16 at 22:04