File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed
source/module_base/test_parallel Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -396,13 +396,11 @@ if(DEFINED ENV{MKLROOT} AND NOT DEFINED MKLROOT)
396396endif ()
397397if (MKLROOT)
398398 set (MKL_INTERFACE lp64)
399+ set (ENABLE_SCALAPACK ON )
399400 find_package (MKL REQUIRED)
400401 add_definitions (-D__MKL)
401402 include_directories (${MKL_INCLUDE} ${MKL_INCLUDE} /fftw)
402- list (APPEND math_libs MKL::MKL)
403- if (TARGET MKL::MKL_SCALAPACK)
404- list (APPEND math_libs MKL::MKL_SCALAPACK)
405- endif ()
403+ list (APPEND math_libs MKL::MKL MKL::MKL_SCALAPACK)
406404 if (CMAKE_CXX_COMPILER_ID MATCHES Intel)
407405 list (APPEND math_libs ifcore)
408406 endif ()
Original file line number Diff line number Diff line change 4545endif ()
4646
4747# Incompatible with ELPA earlier than 2021.11.001
48- # Before ELPA 2021.11.001, its pkg-config file
48+ # Before ELPA 2021.11.001, its pkg-config file
4949# is named like "elpa-2021.05.002.pc".
5050if (NOT ELPA_INCLUDE_DIRS AND PKG_CONFIG_FOUND)
5151 if (DEFINED ELPA_DIR)
@@ -57,7 +57,7 @@ if(NOT ELPA_INCLUDE_DIRS AND PKG_CONFIG_FOUND)
5757 pkg_search_module(ELPA REQUIRED IMPORTED_TARGET GLOBAL elpa)
5858 endif ()
5959elseif (NOT PKG_CONFIG_FOUND)
60- message (
60+ message (STATUS
6161 "ELPA : We need pkg-config to get all information about the elpa library" )
6262endif ()
6363
Original file line number Diff line number Diff line change @@ -86,3 +86,10 @@ endif() # MKL::MKL
8686if (TARGET MKL::MKL)
8787 add_library (IntelMKL::MKL ALIAS MKL::MKL)
8888endif ()
89+
90+ # In oneAPI 2022, MKL_SCALAPACK might not be linked properly
91+ if (NOT TARGET MKL::MKL_SCALAPACK)
92+ find_library (MKL_SCALAPACK NAMES mkl_scalapack_lp64 HINTS ${MKLROOT} /lib ${MKLROOT} /lib/intel64)
93+ message (STATUS "Found MKL_SCALAPACK: ${MKL_SCALAPACK} " )
94+ add_library (MKL::MKL_SCALAPACK OBJECT IMPORTED MKL_SCALAPACK)
95+ endif ()
Original file line number Diff line number Diff line change @@ -37,10 +37,7 @@ add_test(NAME base_parallel_reduce_test
3737if (ENABLE_LCAO)
3838 # figure out the lib that provides BLACS
3939 if (MKLROOT)
40- list (APPEND BLACS_LIB MKL::MKL)
41- if (TARGET MKL::MKL_SCALAPACK)
42- list (APPEND BLACS_LIB MKL::MKL_SCALAPACK)
43- endif ()
40+ list (APPEND BLACS_LIB MKL::MKL MKL::MKL_SCALAPACK)
4441 else ()
4542 set (BLACS_LIB ScaLAPACK::ScaLAPACK)
4643 endif ()
You can’t perform that action at this time.
0 commit comments