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

Commit e164cee

Browse files
authored
[BUGFIX] Fix building when USE_BLAS option is not provided (#19832)
* Fix building when USE_BLAS option is not provided * Fix the check for BLAS libraries in specified order priority
1 parent 7b750a8 commit e164cee

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

cmake/ChooseBlas.cmake

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717

1818
set(BLAS "Open" CACHE STRING "Selected BLAS library")
1919
set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL")
20+
# ---[ Root folders
21+
set(INTEL_HOME_ROOT "$ENV{HOME}/intel" CACHE PATH "Folder contains user-installed intel libs")
22+
set(INTEL_OPT_ROOT "/opt/intel" CACHE PATH "Folder contains root-installed intel libs")
2023

2124
if(DEFINED USE_BLAS)
2225
set(BLAS "${USE_BLAS}")
2326
else()
24-
if(USE_MKL_IF_AVAILABLE)
25-
if(NOT MKL_FOUND)
26-
find_package(MKL)
27-
endif()
28-
if(MKL_FOUND)
27+
if (USE_MKL_IF_AVAILABLE)
28+
# Setting up BLAS_mkl_MKLROOT for non-Ubuntu 20.04 OSes
29+
find_path(BLAS_mkl_MKLROOT mkl PATHS $ENV{MKLROOT} ${INTEL_HOME_ROOT} ${INTEL_OPT_ROOT})
30+
if(NOT BLAS_mkl_MKLROOT STREQUAL "BLAS_mkl_MKLROOT-NOTFOUND")
2931
set(BLAS "MKL")
3032
endif()
3133
endif()
@@ -121,10 +123,6 @@ set(FORTRAN_DIR \\\"\$\{CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES\}\\\")
121123
endif()
122124
endif()
123125
elseif(BLAS STREQUAL "MKL" OR BLAS STREQUAL "mkl")
124-
# ---[ Root folders
125-
set(INTEL_HOME_ROOT "$ENV{HOME}/intel" CACHE PATH "Folder contains user-installed intel libs")
126-
set(INTEL_OPT_ROOT "/opt/intel" CACHE PATH "Folder contains root-installed intel libs")
127-
128126
# ---[ MKL Options
129127
if(UNIX)
130128
# Single dynamic library interface leads to conflicts between intel omp and llvm omp

0 commit comments

Comments
 (0)