title: linuxbrew installed cmake on a cluster cannot find lib in /usr/lib64
body: <p>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).</p>
  
  <p>When i launch the command </p>
  
  <pre><code>cmake ..
  </code></pre>
  
  <p>i get this output</p>
  
  <pre><code>-- 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".
  </code></pre>
  
  <p>and it seems there is nothing i can do to link the ATLAS libs correctly.
  The missing libs are under </p>
  
  <pre><code>/usr/lib64/atlas-sse3
  </code></pre>
  
  <p>Is it possible that there exists a limitation such that my linuxbrewed cmake cannot link to upper folders?</p>
  
  <p>In the error message it says that:</p>
  
  <pre><code>cmake/Modules/FindAtlas.cmake:42
  </code></pre>
  
  <p>I tried to modify that file adding the correct paths:</p>
  
  <pre><code>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
  )
  </code></pre>
  
  <p>and nothing happened.   </p>
  
  <p>i tried to change the PATH and LD_LIBRARY_PATH:</p>
  
  <pre><code>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/atlas-sse3
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/include/atlas-x86_64-base-sse3/
  </code></pre>
  
  <p>and nothing happened.</p>
  
  <p>I'm not a linux veteran so i apologize if i missed some important information. Any suggestion is appreciated.</p>
  
  <p>EDIT:
  this is the content of /usr/lib64/atlas3-sse3:</p>
  
  <pre><code>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
  </code></pre>