title: Error building caffe - undefined reference to cblas_sgemv
body: <p>I am trying to build caffe using Atlas, CUDA and cuDNN on Fedora 22 and I'm getting this error.</p>
  
  <pre><code>Linking CXX shared library ../../lib/libcaffe.so
  [ 86%] Built target caffe
  Linking CXX executable caffe
  ../lib/libcaffe.so: undefined reference to `cblas_sgemv'
  ../lib/libcaffe.so: undefined reference to `cblas_dgemm'
  ../lib/libcaffe.so: undefined reference to `cblas_sscal'
  ../lib/libcaffe.so: undefined reference to `cblas_dgemv'
  ../lib/libcaffe.so: undefined reference to `cblas_saxpy'
  ../lib/libcaffe.so: undefined reference to `cblas_ddot'
  ../lib/libcaffe.so: undefined reference to `cblas_dasum'
  ../lib/libcaffe.so: undefined reference to `cblas_sgemm'
  ../lib/libcaffe.so: undefined reference to `cblas_dscal'
  ../lib/libcaffe.so: undefined reference to `cblas_scopy'
  ../lib/libcaffe.so: undefined reference to `cblas_sasum'
  ../lib/libcaffe.so: undefined reference to `cblas_daxpy'
  ../lib/libcaffe.so: undefined reference to `cblas_dcopy'
  ../lib/libcaffe.so: undefined reference to `cblas_sdot'
  collect2: error: ld returned 1 exit status
  tools/CMakeFiles/caffe.bin.dir/build.make:109: recipe for target 'tools/caffe' failed
  make[2]: *** [tools/caffe] Error 1
  CMakeFiles/Makefile2:373: recipe for target 'tools/CMakeFiles/caffe.bin.dir/all' failed
  make[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] Error 2
  Makefile:116: recipe for target 'all' failed
  make: *** [all] Error 2
  </code></pre>
  
  <p>The fix mentioned <a href="https://github.com/BVLC/caffe/issues/2348" rel="nofollow">here</a> is to add <em>opencv_imgcodecs</em> to the list of libraries but I'm still getting the same error.</p>
  
  <p>Is this problem related to Atlas or is the fix in the Makefile? I had to edit FindAtlas.cmake earlier to get it to find the libraries on my system.</p>