101101# Link line for ScaLAPACK and PBLAS API (includes MKL::MKL and MKL::MKL_BLACS)
102102# MKL::MKL_BLACS
103103# Link line for BLACS and CPARDISO API (includes MKL::MKL)
104+ # MKL::MKL_SYCL_DISTRIBUTED_DFT
105+ # Link line for SYCL Distributed DFT library (includes MKL::MKL_SYCL::DFT, Linux only)
104106#
105107# Note: For Device API, library linking is not required.
106108# Compile options can be added from the INTERFACE_COMPILE_OPTIONS property on MKL::MKL_SYCL
@@ -445,6 +447,17 @@ elseif(MKL_THREADING STREQUAL "gnu_thread")
445447endif ()
446448
447449# Define MKL_MPI
450+ if (SYCL_COMPILER)
451+ set (MKL_SYCL_MPI_LIST intelmpi)
452+ set (DEFAULT_MKL_SYCL_MPI intelmpi)
453+ if (NOT DEFINED MKL_SYCL_MPI)
454+ set (MKL_SYCL_MPI ${MKL_MPI} )
455+ endif ()
456+ define_param(MKL_SYCL_MPI DEFAULT_MKL_SYCL_MPI MKL_SYCL_MPI_LIST STATUS )
457+ if (NOT MKL_SYCL_MPI)
458+ mkl_message(STATUS "MKL::MKL_SYCL_DISTRIBUTED_DFT target will not be available." )
459+ endif ()
460+ endif ()
448461if (NOT MKL_LINK STREQUAL "sdl" )
449462 set (DEFAULT_MKL_MPI intelmpi)
450463 if (UNIX )
@@ -624,6 +637,7 @@ else()
624637 set (MKL_SYCL mkl_sycl)
625638 endif ()
626639endif ()
640+ set (MKL_SYCL_DISTRIBUTED_DFT mkl_sycl_distributed_dft)
627641
628642set (MKL_IFACE_LIB mkl_${MKL_INTERFACE_FULL} )
629643set (MKL_CORE mkl_core)
@@ -662,7 +676,6 @@ endif()
662676set (MKL_CDFT mkl_cdft_core)
663677set (MKL_SCALAPACK mkl_scalapack_${MKL_INTERFACE} )
664678
665-
666679if (UNIX )
667680 if (MKL_LINK STREQUAL "static" OR MKL_SYCL_LINK STREQUAL "static" )
668681 set (START_GROUP "-Wl,--start-group" )
@@ -691,6 +704,11 @@ endif()
691704# Create a list of requested libraries, based on input options (MKL_LIBRARIES)
692705# Create full link-line in MKL_LINK_LINE
693706if (SYCL_COMPILER)
707+ if (UNIX )
708+ # SYCL MPI domain libraries
709+ list (APPEND MKL_SYCL_LIBRARIES ${MKL_SYCL_DISTRIBUTED_DFT} )
710+ endif ()
711+ # Main SYCL libraries
694712 list (APPEND MKL_SYCL_LIBRARIES ${MKL_SYCL} ${MKL_SYCL_IFACE_LIB} ${MKL_SYCL_THREAD} ${MKL_CORE} )
695713 list (TRANSFORM MKL_SYCL PREPEND MKL:: OUTPUT_VARIABLE MKL_SYCL_T)
696714 list (APPEND MKL_SYCL_LINK_LINE ${MKL_SYCL_LOPT} ${SYCL_EXPORT_DYNAMIC} ${NO_AS_NEEDED} ${MKL_SYCL_RPATH}
@@ -766,17 +784,21 @@ foreach(lib ${MKL_REQUESTED_LIBRARIES})
766784 NO_DEFAULT_PATH)
767785 add_library (MKL::${lib} SHARED IMPORTED )
768786 endif ()
769- if (NOT MKL_LINK STREQUAL "static" AND ${lib} MATCHES "mkl_sycl" AND ${${lib} _file} STREQUAL "${lib} _file-NOTFOUND" )
787+ if (NOT MKL_LINK STREQUAL "static" AND ( ${lib} MATCHES "mkl_sycl" AND NOT ${lib} STREQUAL "mkl_sycl_distributed_dft" ) AND ${${lib} _file} STREQUAL "${lib} _file-NOTFOUND" )
770788 list (APPEND MISSED_MKL_SYCL_LIBS ${lib} )
771789 set (MKL_SYCL_DOMAIN "" )
772790 string (REGEX REPLACE "mkl_sycl_" "" MKL_SYCL_DOMAIN ${lib} )
773791 if (WIN32 AND CMAKE_BUILD_TYPE MATCHES "Debug" )
774792 string (REGEX REPLACE "d$" "" MKL_SYCL_DOMAIN ${MKL_SYCL_DOMAIN} )
775793 endif ()
776794 string (TOUPPER ${MKL_SYCL_DOMAIN} MKL_SYCL_DOMAIN)
777- mkl_message(WARNING "Could NOT find MKL ${lib} for target MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} " )
795+ if (MKL_SYCL_DOMAIN STREQUAL "DFT" )
796+ mkl_message(STATUS "Could NOT find MKL ${lib} for targets MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} and MKL::MKL_SYCL_DISTRIBUTED_DFT" )
797+ else ()
798+ mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} " )
799+ endif ()
778800 else ()
779- if (NOT USE_MPI AND (${lib} MATCHES "mkl_scalapack" OR ${lib} MATCHES "mkl_blacs" OR ${lib} MATCHES "mkl_cdft" )
801+ if (NOT USE_MPI AND (${lib} MATCHES "mkl_scalapack" OR ${lib} MATCHES "mkl_blacs" OR ${lib} MATCHES "mkl_cdft" OR ${lib} STREQUAL "mkl_sycl_distributed_dft" )
780802 AND ${${lib} _file} STREQUAL "${lib} _file-NOTFOUND" )
781803 if (${lib} MATCHES "mkl_scalapack" )
782804 mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_SCALAPACK" )
@@ -787,6 +809,9 @@ foreach(lib ${MKL_REQUESTED_LIBRARIES})
787809 if (${lib} MATCHES "mkl_blacs" )
788810 mkl_message(STATUS "Could NOT find MKL ${lib} for targets MKL::MKL_SCALAPACK, MKL::MKL_CDFT, and MKL::MKL_BLACS" )
789811 endif ()
812+ if (${lib} STREQUAL "mkl_sycl_distributed_dft" )
813+ mkl_message(STATUS "Could NOT find MKL ${lib} for target MKL::MKL_SYCL_DISTRIBUTED_DFT" )
814+ endif ()
790815 else ()
791816 check_required_vars(${lib} _file)
792817 mkl_message(STATUS "Found ${${lib} _file}" )
@@ -820,7 +845,7 @@ foreach(lib ${MKL_REQUESTED_LIBRARIES})
820845 set_target_properties (MKL::${lib} PROPERTIES IMPORTED_LOCATION "${MKL_DLL_FILE} " )
821846 else ()
822847 if (${lib} MATCHES "mkl_sycl" AND ${${lib} _file} STREQUAL "${lib} _file-NOTFOUND" )
823- mkl_message(WARNING "Could NOT find ${MKL_DLL_GLOB} for target MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} " )
848+ mkl_message(STATUS "Could NOT find ${MKL_DLL_GLOB} for target MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} " )
824849 else ()
825850 mkl_not_found_and_return("${MKL_DLL_GLOB} not found" )
826851 endif ()
@@ -837,8 +862,9 @@ endforeach()
837862
838863# Threading selection
839864if (MKL_THREADING STREQUAL "tbb_thread" OR MKL_SYCL_THREADING STREQUAL "tbb_thread" )
865+ set (TBB_FIND_RELEASE_ONLY TRUE ) # Do not use tbb_debug
840866 find_package (TBB CONFIG COMPONENTS tbb)
841- if (NOT TBB_FOUND )
867+ if (NOT TBB_tbb_FOUND )
842868 if (MKL_THREADING STREQUAL "tbb_thread" )
843869 if (NOT MKL_LINK STREQUAL "sdl" )
844870 mkl_not_found_and_return("TBB not found for the specified MKL_THREADING: ${MKL_THREADING} " )
@@ -1016,16 +1042,21 @@ if(SYCL_COMPILER)
10161042 target_compile_options (MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${MKL_SYCL_COPT} >)
10171043 # Only dynamic link has domain specific libraries
10181044 # Domain specific targets still use mkl_sycl for static
1019- if (MKL_LINK STREQUAL "static" )
1020- target_link_libraries (MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} INTERFACE ${MKL_SYCL_LINK_LINE} ${MKL_SYCL_THREAD_LIB} ${MKL_SYCL_SUPP_LINK} )
1021- else ()
1045+ if (NOT MKL_LINK STREQUAL "static" )
10221046 list (TRANSFORM MKL_SYCL_LINK_LINE REPLACE ".*mkl_sycl.*" "TBD" )
10231047 list (REMOVE_DUPLICATES MKL_SYCL_LINK_LINE)
10241048 list (TRANSFORM MKL_SYCL_LINK_LINE REPLACE "TBD" "MKL::${lib} " )
1025- target_link_libraries (MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} INTERFACE ${MKL_SYCL_LINK_LINE} ${MKL_SYCL_THREAD_LIB} ${MKL_SYCL_SUPP_LINK} )
10261049 endif ()
1050+ target_link_libraries (MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} INTERFACE ${MKL_SYCL_LINK_LINE} ${MKL_SYCL_THREAD_LIB} ${MKL_SYCL_SUPP_LINK} )
10271051 list (APPEND LINK_TYPES MKL::MKL_SYCL::${MKL_SYCL_DOMAIN} )
10281052 endforeach (lib) # MKL_SYCL_LIBS
1053+ if (UNIX AND NOT TARGET MKL::MKL_SYCL_DISTRIBUTED_DFT AND TARGET MKL::MKL_SYCL::DFT AND MKL_SYCL_MPI
1054+ AND NOT ${${MKL_SYCL_DISTRIBUTED_DFT} _file} STREQUAL "${MKL_SYCL_DISTRIBUTED_DFT} _file-NOTFOUND" )
1055+ add_library (MKL::MKL_SYCL_DISTRIBUTED_DFT INTERFACE IMPORTED GLOBAL )
1056+ target_compile_options (MKL::MKL_SYCL_DISTRIBUTED_DFT INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${MKL_SYCL_COPT} >)
1057+ target_link_libraries (MKL::MKL_SYCL_DISTRIBUTED_DFT INTERFACE MKL::${MKL_SYCL_DISTRIBUTED_DFT} MKL::MKL_SYCL::DFT)
1058+ list (APPEND LINK_TYPES MKL::MKL_SYCL_DISTRIBUTED_DFT)
1059+ endif ()
10291060endif ()
10301061# Single target for all C, Fortran link-lines
10311062if (NOT TARGET MKL::MKL)
0 commit comments