Skip to content

Commit

Permalink
Support DPNP_WITH_REDIST for backend, cython and pybind11 extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Nov 26, 2024
1 parent 9cfa7f3 commit 450e4e8
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dpnp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")

Expand Down Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions dpnp/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/blas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/fft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/lapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/statistics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/ufunc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/vm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

0 comments on commit 450e4e8

Please sign in to comment.