diff --git a/dpnp/CMakeLists.txt b/dpnp/CMakeLists.txt index d4ac718954a..07331469f13 100644 --- a/dpnp/CMakeLists.txt +++ b/dpnp/CMakeLists.txt @@ -1,6 +1,5 @@ function(build_dpnp_cython_ext _trgt _src _dest) set(options SYCL) - cmake_parse_arguments(BUILD_DPNP_EXT "${options}" "" "" ${ARGN}) add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src) message(STATUS "Using ${_trgt}") @@ -41,6 +40,11 @@ function(build_dpnp_cython_ext _trgt _src _dest) VERBATIM COMMENT "Copying Cython-generated source for target ${_trgt} to dpnp source layout" ) endif() + + if (DPNP_WITH_REDIST) + set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../") + endif() + install(TARGETS ${_trgt} LIBRARY DESTINATION ${_dest}) endfunction() diff --git a/dpnp/backend/CMakeLists.txt b/dpnp/backend/CMakeLists.txt index 1924ad64027..2a4a0fef370 100644 --- a/dpnp/backend/CMakeLists.txt +++ b/dpnp/backend/CMakeLists.txt @@ -100,6 +100,10 @@ add_library(dpnp_backend_library INTERFACE IMPORTED GLOBAL) target_include_directories(dpnp_backend_library BEFORE INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src) target_link_libraries(dpnp_backend_library INTERFACE ${_trgt}) +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../") +endif() + if (DPNP_BACKEND_TESTS) add_subdirectory(tests) endif() diff --git a/dpnp/backend/extensions/blas/CMakeLists.txt b/dpnp/backend/extensions/blas/CMakeLists.txt index 1695785e794..0aafd1ba8b4 100644 --- a/dpnp/backend/extensions/blas/CMakeLists.txt +++ b/dpnp/backend/extensions/blas/CMakeLists.txt @@ -93,6 +93,10 @@ else() target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::BLAS) endif() +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../") +endif() + install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/blas" ) diff --git a/dpnp/backend/extensions/fft/CMakeLists.txt b/dpnp/backend/extensions/fft/CMakeLists.txt index 939848a12d6..f9fd08a30cc 100644 --- a/dpnp/backend/extensions/fft/CMakeLists.txt +++ b/dpnp/backend/extensions/fft/CMakeLists.txt @@ -89,6 +89,10 @@ else() target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::DFT) endif() +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../") +endif() + install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/fft" ) diff --git a/dpnp/backend/extensions/lapack/CMakeLists.txt b/dpnp/backend/extensions/lapack/CMakeLists.txt index 8d5dd5342b5..de37e25443e 100644 --- a/dpnp/backend/extensions/lapack/CMakeLists.txt +++ b/dpnp/backend/extensions/lapack/CMakeLists.txt @@ -107,6 +107,10 @@ else() target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK) endif() +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../") +endif() + install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/lapack" ) diff --git a/dpnp/backend/extensions/statistics/CMakeLists.txt b/dpnp/backend/extensions/statistics/CMakeLists.txt index 2b784555630..26dda280008 100644 --- a/dpnp/backend/extensions/statistics/CMakeLists.txt +++ b/dpnp/backend/extensions/statistics/CMakeLists.txt @@ -84,6 +84,10 @@ if (DPNP_GENERATE_COVERAGE) target_link_options(${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping) endif() +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../") +endif() + install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/statistics" ) diff --git a/dpnp/backend/extensions/ufunc/CMakeLists.txt b/dpnp/backend/extensions/ufunc/CMakeLists.txt index cb85bd6213e..c7158548b65 100644 --- a/dpnp/backend/extensions/ufunc/CMakeLists.txt +++ b/dpnp/backend/extensions/ufunc/CMakeLists.txt @@ -103,6 +103,10 @@ if (DPNP_GENERATE_COVERAGE) target_link_options(${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping) endif() +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../") +endif() + install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/ufunc" ) diff --git a/dpnp/backend/extensions/vm/CMakeLists.txt b/dpnp/backend/extensions/vm/CMakeLists.txt index 0bbf6476aa5..79b2238b74d 100644 --- a/dpnp/backend/extensions/vm/CMakeLists.txt +++ b/dpnp/backend/extensions/vm/CMakeLists.txt @@ -120,6 +120,10 @@ else() target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::VM) endif() +if (DPNP_WITH_REDIST) + set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../") +endif() + install(TARGETS ${python_module_name} DESTINATION "dpnp/backend/extensions/vm" )