2727# THE POSSIBILITY OF SUCH DAMAGE.
2828# *****************************************************************************
2929
30+ find_package (Python COMPONENTS Development )
31+
3032if (WIN32 )
31- if (${CMAKE_VERSION} VERSION_LESS "3.23 " )
33+ if (${CMAKE_VERSION} VERSION_LESS "3.27 " )
3234 # this is a work-around for target_link_options inserting option after -link option, cause
3335 # linker to ignore it.
3436 set (CMAKE_CXX_LINK_FLAGS
@@ -37,6 +39,7 @@ if(WIN32)
3739 endif ()
3840endif ()
3941
42+ # TODO: reuse this library for dpnp ufunc extension build
4043set (_static_lib_sources
4144 ${CMAKE_CURRENT_SOURCE_DIR} /libtensor/source/simplify_iteration_space.cpp
4245)
@@ -67,11 +70,11 @@ add_library(${_static_lib_trgt} STATIC ${_static_lib_sources})
6770target_include_directories (
6871 ${_static_lib_trgt}
6972 PRIVATE
70- ${Python_INCLUDE_DIRS}
71- ${DPCTL_INCLUDE_DIR }
73+ # ${Python_INCLUDE_DIRS}
74+ # ${Dpctl_INCLUDE_DIR }
7275 ${CMAKE_CURRENT_SOURCE_DIR} /libtensor/include
7376)
74- target_link_libraries (${_static_lib_trgt} PRIVATE pybind11::headers ${Python_LIBRARIES} )
77+ target_link_libraries (${_static_lib_trgt} PRIVATE pybind11::headers Python::Python )
7578set_target_properties (${_static_lib_trgt} PROPERTIES POSITION_INDEPENDENT_CODE ON )
7679
7780set (_py_trgts)
@@ -94,14 +97,14 @@ set(_no_fast_math_sources
9497 # ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/clip.cpp
9598 # ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/where.cpp
9699)
97- list (
98- APPEND _no_fast_math_sources
99- # ${_elementwise_sources}
100- # ${_reduction_sources}
101- # ${_sorting_sources}
102- # ${_linalg_sources}
103- # ${_accumulator_sources}
104- )
100+ # list(
101+ # APPEND _no_fast_math_sources
102+ # ${_elementwise_sources}
103+ # ${_reduction_sources}
104+ # ${_sorting_sources}
105+ # ${_linalg_sources}
106+ # ${_accumulator_sources}
107+ # )
105108
106109foreach (_src_fn ${_no_fast_math_sources} )
107110 get_source_file_property (_cmpl_options_prop ${_src_fn} COMPILE_OPTIONS )
@@ -114,7 +117,7 @@ endforeach()
114117
115118set (_compiler_definitions "" )
116119
117- set (_linker_options "LINKER:${DPCTL_LDFLAGS } " )
120+ set (_linker_options "LINKER:${DPNP_LDFLAGS } " )
118121foreach (python_module_name ${_py_trgts} )
119122 target_compile_options (
120123 ${python_module_name}
@@ -124,6 +127,7 @@ foreach(python_module_name ${_py_trgts})
124127 ${python_module_name}
125128 PRIVATE -fsycl-device-code-split=per_kernel
126129 )
130+ # TODO: expand DPCTL_OFFLOAD_COMPRESS to the whole dpnp level
127131 if (DPCTL_OFFLOAD_COMPRESS)
128132 target_link_options (${python_module_name} PRIVATE --offload-compress )
129133 endif ()
@@ -149,22 +153,22 @@ foreach(python_module_name ${_py_trgts})
149153 PRIVATE -fprofile-instr-generate -fcoverage-mapping
150154 )
151155 endif ()
152- if (_dpctl_sycl_targets )
156+ if (_dpnp_sycl_targets )
153157 # make fat binary
154158 target_compile_options (
155159 ${python_module_name}
156- PRIVATE ${_dpctl_sycl_target_compile_options }
160+ PRIVATE ${_dpnp_sycl_target_compile_options }
157161 )
158162 target_link_options (
159163 ${python_module_name}
160- PRIVATE ${_dpctl_sycl_target_link_options }
164+ PRIVATE ${_dpnp_sycl_target_link_options }
161165 )
162166 endif ()
163167 # TODO: update source so they reference individual libraries instead of
164168 # dpctl4pybind11.hpp. It will allow to simplify dependency tree
165169 # NOTE: dpctl C-API is resolved at runtime via Python
166170 # target_link_libraries(${python_module_name} PRIVATE DpctlCAPI)
167- if (DPCTL_WITH_REDIST )
171+ if (DPNP_WITH_REDIST )
168172 set_target_properties (
169173 ${python_module_name}
170174 PROPERTIES INSTALL_RPATH "$ORIGIN/../../../.."
0 commit comments