diff --git a/cmake/mshadow.cmake b/cmake/mshadow.cmake index 635286e8..035080a9 100644 --- a/cmake/mshadow.cmake +++ b/cmake/mshadow.cmake @@ -1,7 +1,7 @@ set(mshadow_LINKER_LIBS "") -set(BLAS "Open" CACHE STRING "Selected BLAS library") -set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL") +set(BLAS "openblas" CACHE STRING "Selected BLAS library") +set_property(CACHE BLAS PROPERTY STRINGS "atlas;openblas;mkl;blas") if(USE_MKL_IF_AVAILABLE) if(NOT MKL_FOUND) @@ -9,26 +9,32 @@ if(USE_MKL_IF_AVAILABLE) endif() if(MKL_FOUND) if(USE_MKLML_MKL) - set(BLAS "open") + set(BLAS "mkl") else() - set(BLAS "MKL") + set(BLAS "openblas") endif() endif() endif() -if(BLAS STREQUAL "Atlas" OR BLAS STREQUAL "atlas") +if(BLAS STREQUAL "atlas") find_package(Atlas REQUIRED) include_directories(SYSTEM ${Atlas_INCLUDE_DIR}) list(APPEND mshadow_LINKER_LIBS ${Atlas_LIBRARIES}) add_definitions(-DMSHADOW_USE_CBLAS=1) add_definitions(-DMSHADOW_USE_MKL=0) -elseif(BLAS STREQUAL "Open" OR BLAS STREQUAL "open") +elseif(BLAS STREQUAL "openblas") find_package(OpenBLAS REQUIRED) include_directories(SYSTEM ${OpenBLAS_INCLUDE_DIR}) list(APPEND mshadow_LINKER_LIBS ${OpenBLAS_LIB}) add_definitions(-DMSHADOW_USE_CBLAS=1) add_definitions(-DMSHADOW_USE_MKL=0) -elseif(BLAS STREQUAL "MKL" OR BLAS STREQUAL "mkl") +elseif(BLAS STREQUAL "blas") + set(BLA_VENDOR "Generic") + find_package(BLAS REQUIRED) + list(APPEND mshadow_LINKER_LIBS ${BLAS_LIBRARIES}) + add_definitions(-DMSHADOW_USE_CBLAS=1) + add_definitions(-DMSHADOW_USE_MKL=0) +elseif(BLAS STREQUAL "mkl") find_package(MKL REQUIRED) include_directories(SYSTEM ${MKL_INCLUDE_DIR}) list(APPEND mshadow_LINKER_LIBS ${MKL_LIBRARIES})