due to Debian feature `update-alternatives`,
we link libcaffe against libblas.so.3 instead
of directly openblas or atlas.

Forwarded: yes
https://github.com/BVLC/caffe/pull/4238
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -81,7 +81,7 @@
 
 # ---[ BLAS
 if(NOT APPLE)
-  set(BLAS "Atlas" CACHE STRING "Selected BLAS library")
+  set(BLAS "Generic" CACHE STRING "Selected BLAS library")
   set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL")
 
   if(BLAS STREQUAL "Atlas" OR BLAS STREQUAL "atlas")
@@ -97,6 +97,10 @@
     include_directories(SYSTEM ${MKL_INCLUDE_DIR})
     list(APPEND Caffe_LINKER_LIBS ${MKL_LIBRARIES})
     add_definitions(-DUSE_MKL)
+  elseif(BLAS STREQUAL "Generic")
+    set(BLA_VENDOR "Generic")
+    find_package(BLAS REQUIRED)
+    list(APPEND Caffe_LINKER_LIBS ${BLAS_LIBRARIES})
   endif()
 elseif(APPLE)
   find_package(vecLib REQUIRED)
