diff --git a/CMakeLists.txt b/CMakeLists.txt index 50f965fc7208..b4598e53ae68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,12 +121,20 @@ if(_use_onemkl_interfaces) else() FetchContent_Declare( onemkl_interfaces_library - GIT_REPOSITORY https://github.com/oneapi-src/oneMKL.git + GIT_REPOSITORY https://github.com/uxlfoundation/oneMath.git GIT_TAG 8f4312ef966420b9b8b4b82b9d5c22e2c91a1fe7 # v0.6 ) endif() FetchContent_MakeAvailable(onemkl_interfaces_library) + if(TARGET onemath) + set(MKL_INTERFACES_LIB "onemath" CACHE INTERNAL "OneMath lib target") + elseif(TARGET onemkl) + set(MKL_INTERFACES_LIB "onemkl" CACHE INTERNAL "OneMKL lib target") + else() + message(FATAL_ERROR "Neither 'oneMath' nor 'oneMKL' found!") + endif() + message(STATUS "MKL interfaces lib target used: ${MKL_INTERFACES_LIB}") set(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib") endif() diff --git a/dpnp/backend/extensions/blas/CMakeLists.txt b/dpnp/backend/extensions/blas/CMakeLists.txt index 7a3d18457d98..d5639a24b268 100644 --- a/dpnp/backend/extensions/blas/CMakeLists.txt +++ b/dpnp/backend/extensions/blas/CMakeLists.txt @@ -84,7 +84,7 @@ if (DPNP_GENERATE_COVERAGE) endif() if(_use_onemkl_interfaces) - target_link_libraries(${python_module_name} PUBLIC onemkl) + target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB}) target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES) if(_use_onemkl_interfaces_cuda) target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_CUBLAS) diff --git a/dpnp/backend/extensions/fft/CMakeLists.txt b/dpnp/backend/extensions/fft/CMakeLists.txt index 46a6f7ceaa04..327c85a96dac 100644 --- a/dpnp/backend/extensions/fft/CMakeLists.txt +++ b/dpnp/backend/extensions/fft/CMakeLists.txt @@ -83,7 +83,7 @@ if (DPNP_GENERATE_COVERAGE) endif() if(_use_onemkl_interfaces) - target_link_libraries(${python_module_name} PUBLIC onemkl) + target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB}) target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES) else() target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::DFT) diff --git a/dpnp/backend/extensions/lapack/CMakeLists.txt b/dpnp/backend/extensions/lapack/CMakeLists.txt index 13c8b49c45f0..a196b6fac8d0 100644 --- a/dpnp/backend/extensions/lapack/CMakeLists.txt +++ b/dpnp/backend/extensions/lapack/CMakeLists.txt @@ -101,7 +101,7 @@ if (DPNP_GENERATE_COVERAGE) endif() if(_use_onemkl_interfaces) - target_link_libraries(${python_module_name} PUBLIC onemkl) + target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB}) target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES) else() target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK)