Added python suffix to cython-based libraries (#12862)
* Fixed dependencies in case of debian package building * Removed duplication of cython-based libraries in wheel * Fixed that TBB is not part of the wheel * Fixes for yocto
This commit is contained in:
parent
e2e01bff32
commit
142cfd173a
@ -159,12 +159,6 @@ ie_dependent_option(ENABLE_WHEEL "Build wheel packages for PyPI" ${ENABLE_WHEEL_
|
|||||||
# Build the code
|
# Build the code
|
||||||
#
|
#
|
||||||
|
|
||||||
if(ie_python_req_FOUND)
|
|
||||||
add_subdirectory(src/compatibility/openvino)
|
|
||||||
else()
|
|
||||||
message(WARNING "NOTE: Python API for OpenVINO 1.0 is disabled")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(DISABLE_PYBIND11)
|
if(DISABLE_PYBIND11)
|
||||||
message(WARNING "NOTE: Python API for OpenVINO 2.0 is disabled")
|
message(WARNING "NOTE: Python API for OpenVINO 2.0 is disabled")
|
||||||
else()
|
else()
|
||||||
@ -173,6 +167,12 @@ else()
|
|||||||
add_subdirectory(src/pyopenvino)
|
add_subdirectory(src/pyopenvino)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ie_python_req_FOUND)
|
||||||
|
add_subdirectory(src/compatibility/openvino)
|
||||||
|
else()
|
||||||
|
message(WARNING "NOTE: Python API for OpenVINO 1.0 is disabled")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_WHEEL)
|
if(ENABLE_WHEEL)
|
||||||
add_subdirectory(wheel)
|
add_subdirectory(wheel)
|
||||||
endif()
|
endif()
|
||||||
|
@ -287,7 +287,11 @@ function( cython_add_module _name )
|
|||||||
compile_pyx( ${_name} generated_file ${pyx_module_sources} )
|
compile_pyx( ${_name} generated_file ${pyx_module_sources} )
|
||||||
include_directories( ${PYTHON_INCLUDE_DIRS} )
|
include_directories( ${PYTHON_INCLUDE_DIRS} )
|
||||||
python_add_module ( ${_name} ${generated_file} ${other_module_sources} )
|
python_add_module ( ${_name} ${generated_file} ${other_module_sources} )
|
||||||
# set_target_properties(${_name} PROPERTIES PREFIX "" SUFFIX "${PYTHON_MODULE_EXTENSION}")
|
if(PYTHON_MODULE_EXTENSION)
|
||||||
|
set_target_properties(${_name} PROPERTIES PREFIX "" SUFFIX "${PYTHON_MODULE_EXTENSION}")
|
||||||
|
elseif(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
message(FATAL_ERROR "Internal error: PYTHON_MODULE_EXTENSION is not defined")
|
||||||
|
endif()
|
||||||
if( APPLE )
|
if( APPLE )
|
||||||
set_target_properties( ${_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
|
set_target_properties( ${_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
|
||||||
else()
|
else()
|
||||||
|
@ -22,7 +22,7 @@ set(PUGIXML_LIBS_DIR runtime/3rdparty/pugixml/lib)
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
#
|
#
|
||||||
|
|
||||||
foreach(_target ie_api constants _pyngraph pyopenvino ov_plugins ov_frontends py_ov_frontends)
|
foreach(_target ie_api constants _pyngraph openvino_c pyopenvino ov_plugins ov_frontends py_ov_frontends)
|
||||||
if(TARGET ${_target})
|
if(TARGET ${_target})
|
||||||
list(APPEND openvino_wheel_deps ${_target})
|
list(APPEND openvino_wheel_deps ${_target})
|
||||||
endif()
|
endif()
|
||||||
|
@ -7,24 +7,22 @@ include(cmake/ie_parallel.cmake)
|
|||||||
# pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation
|
# pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation
|
||||||
ov_find_package_tbb()
|
ov_find_package_tbb()
|
||||||
|
|
||||||
function(_ov_get_tbb_library_path tbb_lib tbb_libs_dir)
|
function(_ov_get_tbb_location tbb_target _tbb_lib_location_var)
|
||||||
if(NOT TBB_FOUND)
|
if(NOT TBB_FOUND)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# i.e. yocto case
|
# i.e. yocto case
|
||||||
get_target_property(_tbb_lib_location ${tbb_lib} INTERFACE_LINK_LIBRARIES)
|
get_target_property(_tbb_lib_location ${tbb_target} INTERFACE_LINK_LIBRARIES)
|
||||||
if(_tbb_lib_location)
|
if(_tbb_lib_location)
|
||||||
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
|
set(${_tbb_lib_location_var} "${_tbb_lib_location}" PARENT_SCOPE)
|
||||||
set(${tbb_libs_dir} "${_tbb_libs_dir}" PARENT_SCOPE)
|
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# usual imported library
|
# usual imported library
|
||||||
get_target_property(_tbb_lib_location ${tbb_lib} IMPORTED_LOCATION_RELEASE)
|
get_target_property(_tbb_lib_location ${tbb_target} IMPORTED_LOCATION_RELEASE)
|
||||||
if(_tbb_lib_location)
|
if(_tbb_lib_location)
|
||||||
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
|
set(${_tbb_lib_location_var} "${_tbb_lib_location}" PARENT_SCOPE)
|
||||||
set(${tbb_libs_dir} "${_tbb_libs_dir}" PARENT_SCOPE)
|
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -39,7 +37,8 @@ function(_ov_detect_dynamic_tbbbind_2_5 var)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# try to select proper library directory
|
# try to select proper library directory
|
||||||
_ov_get_tbb_library_path(TBB::tbb _tbb_libs_dir)
|
_ov_get_tbb_location(TBB::tbb _tbb_lib_location)
|
||||||
|
get_filename_component(_tbb_libs_dir "${_tbb_lib_location}" DIRECTORY)
|
||||||
|
|
||||||
# unset for cases if user specified different TBB_DIR / TBBROOT
|
# unset for cases if user specified different TBB_DIR / TBBROOT
|
||||||
unset(_ov_tbbbind_2_5 CACHE)
|
unset(_ov_tbbbind_2_5 CACHE)
|
||||||
@ -125,14 +124,14 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND
|
|||||||
|
|
||||||
# for system libraries we still need to install TBB libraries
|
# for system libraries we still need to install TBB libraries
|
||||||
# so, need to take locations of actual libraries and install them
|
# so, need to take locations of actual libraries and install them
|
||||||
foreach(tbb_lib IN LISTS TBB_IMPORTED_TARGETS)
|
foreach(tbb_target IN LISTS TBB_IMPORTED_TARGETS)
|
||||||
_ov_get_tbb_library_path(${tbb_lib} tbb_loc)
|
_ov_get_tbb_location(${tbb_target} tbb_lib_location)
|
||||||
# depending on the TBB, tbb_loc can be in form:
|
# depending on the TBB, tbb_lib_location can be in form:
|
||||||
# - libtbb.so.x.y
|
# - libtbb.so.x.y
|
||||||
# - libtbb.so.x
|
# - libtbb.so.x
|
||||||
# We need to install such files
|
# We need to install such files
|
||||||
get_filename_component(name_we "${tbb_loc}" NAME_WE)
|
get_filename_component(name_we "${tbb_lib_location}" NAME_WE)
|
||||||
get_filename_component(dir "${tbb_loc}" DIRECTORY)
|
get_filename_component(dir "${tbb_lib_location}" DIRECTORY)
|
||||||
# grab all tbb files matching pattern
|
# grab all tbb files matching pattern
|
||||||
file(GLOB tbb_files "${dir}/${name_we}.*")
|
file(GLOB tbb_files "${dir}/${name_we}.*")
|
||||||
foreach(tbb_file IN LISTS tbb_files)
|
foreach(tbb_file IN LISTS tbb_files)
|
||||||
|
Loading…
Reference in New Issue
Block a user