File tree Expand file tree Collapse file tree 11 files changed +41
-8
lines changed Expand file tree Collapse file tree 11 files changed +41
-8
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,9 @@ project(dpnp
66 DESCRIPTION "NumPy-like API accelerated by SYCL."
77)
88
9- option (DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" FALSE )
10- option (DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" FALSE )
9+ option (DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" OFF )
10+ option (DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" OFF )
11+ option (DPNP_WITH_REDIST "Build DPNP assuming DPC++ redistributable is installed into Python prefix" OFF )
1112
1213set (CMAKE_CXX_STANDARD 17)
1314set (CMAKE_CXX_STANDARD_REQUIRED True )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ if DEFINED OVERRIDE_INTEL_IPO (
1616 set " SKBUILD_ARGS = %SKBUILD_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
1717)
1818
19- FOR %%V IN (14 .0.0 14 15 .0.0 15 16 .0.0 16 17.0.0 17 ) DO @ (
19+ FOR %%V IN (17 .0.0 17 18 .0.0 18 19 .0.0 19 ) DO @ (
2020 REM set DIR_HINT if directory exists
2121 IF EXIST " %BUILD_PREFIX% \Library\lib\clang\%%V \" (
2222 SET " SYCL_INCLUDE_DIR_HINT = %BUILD_PREFIX% \Library\lib\clang\%%V "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33# This is necessary to help DPC++ find Intel libraries such as SVML, IRNG, etc in build prefix
4- export LD_LIBRARY_PATH =" $LD_LIBRARY_PATH :${BUILD_PREFIX} /lib"
4+ export LIBRARY_PATH =" $LIBRARY_PATH :${BUILD_PREFIX} /lib"
55
66# Intel LLVM must cooperate with compiler and sysroot from conda
77echo " --gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX} /${HOST} /sysroot -target ${HOST} " > icpx_for_conda.cfg
@@ -18,6 +18,7 @@ export DPL_ROOT_HINT=$PREFIX
1818export MKL_ROOT_HINT=$PREFIX
1919SKBUILD_ARGS=(-- " -DCMAKE_C_COMPILER:PATH=icx" " -DCMAKE_CXX_COMPILER:PATH=icpx" " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" )
2020SKBUILD_ARGS=(" ${SKBUILD_ARGS[@]} " " -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" )
21+ SKBUILD_ARGS=(" ${SKBUILD_ARGS[@]} " " -DDPNP_WITH_REDIST:BOOL=ON" )
2122
2223# Build wheel package
2324WHEELS_BUILD_ARGS=(" -p" " manylinux_2_28_x86_64" )
Original file line number Diff line number Diff line change 11function (build_dpnp_cython_ext _trgt _src _dest)
22 set (options SYCL)
3- cmake_parse_arguments (BUILD_DPNP_EXT "${options} " "" "" ${ARGN} )
43 add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
54 message (STATUS "Using ${_trgt} " )
65
@@ -41,15 +40,19 @@ function(build_dpnp_cython_ext _trgt _src _dest)
4140 VERBATIM COMMENT "Copying Cython-generated source for target ${_trgt} to dpnp source layout"
4241 )
4342 endif ()
43+
44+ set (_rpath_value "$ORIGIN/.." )
45+ if (DPNP_WITH_REDIST)
46+ set (_rpath_value "${_rpath_value} :$ORIGIN/../../../../" )
47+ endif ()
48+ set_target_properties (${_trgt} PROPERTIES INSTALL_RPATH ${_rpath_value} )
49+
4450 install (TARGETS ${_trgt} LIBRARY DESTINATION ${_dest} )
4551endfunction ()
4652
4753function (build_dpnp_cython_ext_with_backend _trgt _src _dest)
4854 build_dpnp_cython_ext(${_trgt} ${_src} ${_dest} )
4955 target_link_libraries (${_trgt} PRIVATE dpnp_backend_library)
50- if (UNIX )
51- set_target_properties (${_trgt} PROPERTIES INSTALL_RPATH "$ORIGIN/.." )
52- endif ()
5356endfunction ()
5457
5558add_subdirectory (backend)
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ add_library(dpnp_backend_library INTERFACE IMPORTED GLOBAL)
100100target_include_directories (dpnp_backend_library BEFORE INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} /include ${CMAKE_CURRENT_SOURCE_DIR} /src)
101101target_link_libraries (dpnp_backend_library INTERFACE ${_trgt} )
102102
103+ if (DPNP_WITH_REDIST)
104+ set_target_properties (${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../" )
105+ endif ()
106+
103107if (DPNP_BACKEND_TESTS)
104108 add_subdirectory (tests)
105109endif ()
Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ else()
9393 target_link_libraries (${python_module_name} PUBLIC MKL::MKL_SYCL::BLAS)
9494endif ()
9595
96+ if (DPNP_WITH_REDIST)
97+ set_target_properties (${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../" )
98+ endif ()
99+
96100install (TARGETS ${python_module_name}
97101 DESTINATION "dpnp/backend/extensions/blas"
98102)
Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ else()
8989 target_link_libraries (${python_module_name} PUBLIC MKL::MKL_SYCL::DFT)
9090endif ()
9191
92+ if (DPNP_WITH_REDIST)
93+ set_target_properties (${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../" )
94+ endif ()
95+
9296install (TARGETS ${python_module_name}
9397 DESTINATION "dpnp/backend/extensions/fft"
9498)
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ else()
107107 target_link_libraries (${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK)
108108endif ()
109109
110+ if (DPNP_WITH_REDIST)
111+ set_target_properties (${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../" )
112+ endif ()
113+
110114install (TARGETS ${python_module_name}
111115 DESTINATION "dpnp/backend/extensions/lapack"
112116)
Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ if (DPNP_GENERATE_COVERAGE)
8484 target_link_options (${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping)
8585endif ()
8686
87+ if (DPNP_WITH_REDIST)
88+ set_target_properties (${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../" )
89+ endif ()
90+
8791install (TARGETS ${python_module_name}
8892 DESTINATION "dpnp/backend/extensions/statistics"
8993)
Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ if (DPNP_GENERATE_COVERAGE)
103103 target_link_options (${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping)
104104endif ()
105105
106+ if (DPNP_WITH_REDIST)
107+ set_target_properties (${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../" )
108+ endif ()
109+
106110install (TARGETS ${python_module_name}
107111 DESTINATION "dpnp/backend/extensions/ufunc"
108112)
You can’t perform that action at this time.
0 commit comments