diff --git a/CMakeLists.txt b/CMakeLists.txt index 974d19df6335..02b15ba98c39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,16 +28,43 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_MODULE_PATH}) find_package(IntelDPCPP REQUIRED) -find_package(TBB REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) +find_package(TBB QUIET) +if(TBB_FOUND) + find_package(TBB REQUIRED) +else() + find_package(TBB REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) +endif() set(MKL_ARCH "intel64") set(MKL_LINK "dynamic") -set(MKL_INTERFACE_FULL "intel_ilp64") set(MKL_THREADING "tbb_thread") -find_package(MKL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) +set(MKL_VERSION_2024 FALSE) +find_package(MKL QUIET) +if(MKL_FOUND) + if(MKL_VERSION VERSION_GREATER_EQUAL "2024.0.0") + set(MKL_VERSION_2024 TRUE) + set(MKL_INTERFACE "ilp64") + find_package(MKL REQUIRED) + endif() +endif() + +if(NOT MKL_VERSION_2024) + set(MKL_INTERFACE_FULL "intel_ilp64") + find_package(MKL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) +endif() set(ONEDPL_PAR_BACKEND tbb) -find_package(oneDPL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) +find_package(oneDPL QUIET) +if(oneDPL_FOUND) + if(oneDPL_VERSION VERSION_GREATER_EQUAL "2022.3.0") + find_package(oneDPL REQUIRED) + else() + find_package(oneDPL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) + endif() +else() + find_package(oneDPL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH) +endif() + include(GNUInstallDirs) diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt index 8aeadc38c376..18f084d54478 100644 --- a/dpnp/backend/CMakeLists.txt +++ b/dpnp/backend/CMakeLists.txt @@ -89,7 +89,12 @@ if(DPNP_GENERATE_COVERAGE) target_link_options(${_trgt} PRIVATE -fprofile-instr-generate -fcoverage-mapping) endif() -target_link_libraries(${_trgt} PUBLIC MKL::MKL_DPCPP) +if (MKL_VERSION_2024) + target_link_libraries(${_trgt} PUBLIC MKL::MKL_SYCL) +else() + target_link_libraries(${_trgt} PUBLIC MKL::MKL_DPCPP) +endif() + target_link_libraries(${_trgt} PUBLIC oneDPL) if (UNIX) diff --git a/dpnp/backend/extensions/lapack/CMakeLists.txt b/dpnp/backend/extensions/lapack/CMakeLists.txt index e54de4068c01..0c90b4f0ca52 100644 --- a/dpnp/backend/extensions/lapack/CMakeLists.txt +++ b/dpnp/backend/extensions/lapack/CMakeLists.txt @@ -69,7 +69,11 @@ if (DPNP_GENERATE_COVERAGE) target_link_options(${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping) endif() -target_link_libraries(${python_module_name} PUBLIC MKL::MKL_DPCPP) +if (MKL_VERSION_2024) + target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK) +else() + target_link_libraries(${python_module_name} PUBLIC MKL::MKL_DPCPP) +endif() install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/lapack" diff --git a/dpnp/backend/extensions/vm/CMakeLists.txt b/dpnp/backend/extensions/vm/CMakeLists.txt index a81dbe1df686..6c8e21fa535d 100644 --- a/dpnp/backend/extensions/vm/CMakeLists.txt +++ b/dpnp/backend/extensions/vm/CMakeLists.txt @@ -67,7 +67,11 @@ if (DPNP_GENERATE_COVERAGE) target_link_options(${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping) endif() -target_link_libraries(${python_module_name} PUBLIC MKL::MKL_DPCPP) +if (MKL_VERSION_2024) + target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::VM) +else() + target_link_libraries(${python_module_name} PUBLIC MKL::MKL_DPCPP) +endif() install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/vm"