Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[BUGFIX] Fix building when USE_BLAS option is not provided (#19832)
Browse files Browse the repository at this point in the history
* Fix building when USE_BLAS option is not provided

* Fix the check for BLAS libraries in specified order priority
  • Loading branch information
akarbown authored Feb 16, 2021
1 parent 7b750a8 commit e164cee
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cmake/ChooseBlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@

set(BLAS "Open" CACHE STRING "Selected BLAS library")
set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL")
# ---[ 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}")
else()
if(USE_MKL_IF_AVAILABLE)
if(NOT MKL_FOUND)
find_package(MKL)
endif()
if(MKL_FOUND)
if (USE_MKL_IF_AVAILABLE)
# Setting up BLAS_mkl_MKLROOT for non-Ubuntu 20.04 OSes
find_path(BLAS_mkl_MKLROOT mkl PATHS $ENV{MKLROOT} ${INTEL_HOME_ROOT} ${INTEL_OPT_ROOT})
if(NOT BLAS_mkl_MKLROOT STREQUAL "BLAS_mkl_MKLROOT-NOTFOUND")
set(BLAS "MKL")
endif()
endif()
Expand Down Expand Up @@ -121,10 +123,6 @@ set(FORTRAN_DIR \\\"\$\{CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES\}\\\")
endif()
endif()
elseif(BLAS STREQUAL "MKL" OR BLAS STREQUAL "mkl")
# ---[ 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")

# ---[ MKL Options
if(UNIX)
# Single dynamic library interface leads to conflicts between intel omp and llvm omp
Expand Down

0 comments on commit e164cee

Please sign in to comment.