diff --git a/CMakeLists.txt b/CMakeLists.txt index 5343c324a5a3..66f8488dabf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.19) # workaround to store CMAKE_CROSSCOMPILING because is getting reset by the project command if(CMAKE_CROSSCOMPILING) diff --git a/cmake/ChooseBlas.cmake b/cmake/ChooseBlas.cmake index ed6c7337acd4..d37c17b302e7 100644 --- a/cmake/ChooseBlas.cmake +++ b/cmake/ChooseBlas.cmake @@ -16,13 +16,14 @@ # under the License. set(BLAS "Open" CACHE STRING "Selected BLAS library") -set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL") +set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL;FlexiBLAS") # ---[ Root folders set(INTEL_HOME_ROOT "$ENV{HOME}/intel" CACHE PATH "Folder contains user-installed intel libs") set(INTEL_OPT_ROOT "/opt/intel" CACHE PATH "Folder contains root-installed intel libs") if(DEFINED USE_BLAS) set(BLAS "${USE_BLAS}") + message(STATUS "BLAS is set to ${USE_BLAS}") endif() if(USE_BLAS MATCHES "MKL" OR USE_BLAS MATCHES "mkl" OR NOT DEFINED USE_BLAS) find_path(MKL_INCLUDE_DIR mkl_version.h @@ -33,7 +34,15 @@ if(USE_BLAS MATCHES "MKL" OR USE_BLAS MATCHES "mkl" OR NOT DEFINED USE_BLAS) endif() endif() -if(BLAS STREQUAL "Atlas" OR BLAS STREQUAL "atlas") +if(BLAS STREQUAL "FlexiBLAS" OR BLAS STREQUAL "flexiblas") + set(BLA_VENDOR FlexiBLAS) + find_package(BLAS REQUIRED) + include_directories(SYSTEM ${BLAS_INCLUDE_DIR}) + list(APPEND mshadow_LINKER_LIBS ${BLAS_LIBRARIES}) + add_definitions(-DMSHADOW_USE_CBLAS=1) + add_definitions(-DMSHADOW_USE_MKL=0) + add_definitions(-DMXNET_USE_LAPACK=1) +elseif(BLAS STREQUAL "Atlas" OR BLAS STREQUAL "atlas") find_package(Atlas REQUIRED) include_directories(SYSTEM ${Atlas_INCLUDE_DIR}) list(APPEND mshadow_LINKER_LIBS ${Atlas_LIBRARIES})