mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
FindBLAS: Select MKL threading layer based on the OpenMP runtime library
Fixes: #28072
This commit is contained in:
@@ -507,11 +507,13 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
||||
else()
|
||||
set(BLAS_mkl_INTFACE "intel")
|
||||
endif()
|
||||
# Switch to GNU libgomp ABI regarding the OpenMP runtime (but not on Apple, where MKL does not provide it).
|
||||
if(CMAKE_Fortran_COMPILER_LOADED AND (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "LCC") AND NOT APPLE)
|
||||
# Switch to GNU libgomp ABI regarding the OpenMP runtime.
|
||||
if(OpenMP_FOUND AND NOT OpenMP_iomp5_LIBRARY)
|
||||
# Most OpenMP runtime libraries claim to support drop-in replacement of libgomp.
|
||||
set(BLAS_mkl_THREADING "gnu")
|
||||
set(BLAS_mkl_OMP "gomp")
|
||||
else()
|
||||
# Safe to select Intel OpenMP runtime when compiler doesn't directly enable OpenMP or the runtime found was already iomp5.
|
||||
set(BLAS_mkl_THREADING "intel")
|
||||
set(BLAS_mkl_OMP "iomp5")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user