mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
FindBLAS: Revert "Do not statically link against iomp5 ... Intel MKL"
Since commit 20ab504591
(FindBLAS: Do not statically link against iomp5
in the case of Intel MKL, 2021-04-11), we no longer find MKL's BLAS when
using the GNU compiler because FindOpenMP chooses libgomp instead of
libiomp5, and mkl_intel_thread depends on the latter. Revert the change
for now. A new approach will be needed to solve the original problem.
Issue: #21811
This commit is contained in:
@@ -337,21 +337,12 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
|||||||
if(CMAKE_Fortran_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT APPLE)
|
if(CMAKE_Fortran_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT APPLE)
|
||||||
set(BLAS_mkl_INTFACE "gf")
|
set(BLAS_mkl_INTFACE "gf")
|
||||||
set(BLAS_mkl_THREADING "gnu")
|
set(BLAS_mkl_THREADING "gnu")
|
||||||
|
set(BLAS_mkl_OMP "gomp")
|
||||||
else()
|
else()
|
||||||
set(BLAS_mkl_INTFACE "intel")
|
set(BLAS_mkl_INTFACE "intel")
|
||||||
set(BLAS_mkl_THREADING "intel")
|
set(BLAS_mkl_THREADING "intel")
|
||||||
|
set(BLAS_mkl_OMP "iomp5")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(lang IN ITEMS C CXX Fortran)
|
|
||||||
if(CMAKE_${lang}_COMPILER_LOADED)
|
|
||||||
find_package(OpenMP COMPONENTS ${lang})
|
|
||||||
if(${OpenMP_${lang}_FOUND})
|
|
||||||
set(BLAS_mkl_OMP ${OpenMP_${lang}_LIBRARIES})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
set(BLAS_mkl_LM "-lm")
|
set(BLAS_mkl_LM "-lm")
|
||||||
set(BLAS_mkl_LDL "-ldl")
|
set(BLAS_mkl_LDL "-ldl")
|
||||||
endif()
|
endif()
|
||||||
@@ -416,7 +407,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
|||||||
|
|
||||||
# mkl >= 10.3
|
# mkl >= 10.3
|
||||||
list(APPEND BLAS_SEARCH_LIBS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
"${BLAS_mkl_START_GROUP} mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP}")
|
"${BLAS_mkl_START_GROUP} mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP} ${BLAS_mkl_OMP}")
|
||||||
endif()
|
endif()
|
||||||
if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
|
if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
|
||||||
# old version
|
# old version
|
||||||
@@ -425,7 +416,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
|||||||
|
|
||||||
# mkl >= 10.3
|
# mkl >= 10.3
|
||||||
list(APPEND BLAS_SEARCH_LIBS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
"${BLAS_mkl_START_GROUP} mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP}")
|
"${BLAS_mkl_START_GROUP} mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP} ${BLAS_mkl_OMP}")
|
||||||
endif()
|
endif()
|
||||||
if(BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
|
if(BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
|
||||||
list(APPEND BLAS_SEARCH_LIBS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
@@ -481,7 +472,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
|||||||
|
|
||||||
# mkl >= 10.3
|
# mkl >= 10.3
|
||||||
list(APPEND BLAS_SEARCH_LIBS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
"${BLAS_mkl_START_GROUP} mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP}")
|
"${BLAS_mkl_START_GROUP} mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP} ${BLAS_mkl_OMP}")
|
||||||
endif()
|
endif()
|
||||||
if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
|
if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
|
||||||
# old version
|
# old version
|
||||||
@@ -490,7 +481,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
|||||||
|
|
||||||
# mkl >= 10.3
|
# mkl >= 10.3
|
||||||
list(APPEND BLAS_SEARCH_LIBS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
"${BLAS_mkl_START_GROUP} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP}")
|
"${BLAS_mkl_START_GROUP} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_END_GROUP} ${BLAS_mkl_OMP}")
|
||||||
endif()
|
endif()
|
||||||
if(BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
|
if(BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
|
||||||
list(APPEND BLAS_SEARCH_LIBS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
@@ -553,7 +544,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
|||||||
${BLAS_mkl_SEARCH_SYMBOL}
|
${BLAS_mkl_SEARCH_SYMBOL}
|
||||||
""
|
""
|
||||||
"${SEARCH_LIBS}"
|
"${SEARCH_LIBS}"
|
||||||
"${BLAS_mkl_OMP};${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}"
|
"${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}"
|
||||||
"${BLAS_mkl_MKLROOT}"
|
"${BLAS_mkl_MKLROOT}"
|
||||||
"${BLAS_mkl_LIB_PATH_SUFFIXES}"
|
"${BLAS_mkl_LIB_PATH_SUFFIXES}"
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user