Fixed missed pugixml in case of system libs + wheel package (#12464)

* Fixed missed pugixml in case of system libs + wheel package

* Fixes

* Removed useless rpath
This commit is contained in:
Ilya Lavrenov
2022-08-12 11:35:56 +04:00
committed by GitHub
parent e0b12009ea
commit 8b9aea9fad
29 changed files with 85 additions and 64 deletions

View File

@@ -51,6 +51,8 @@ macro(ov_cpack_settings)
# even for case of system TBB we have installation rules for wheels packages
# so, need to skip this explicitly
NOT item MATCHES "^tbb(_dev)?$" AND
# the same for pugixml
NOT item STREQUAL "pugixml" AND
# we have copyright file for debian package
NOT item STREQUAL OV_CPACK_COMP_LICENSING AND
# not appropriate components

View File

@@ -5,23 +5,23 @@
# Components
macro(ov_cpack_settings)
# fill a list of components which are part of NSIS or other GUI installer
set(cpack_components_all ${CPACK_COMPONENTS_ALL})
unset(CPACK_COMPONENTS_ALL)
foreach(item IN LISTS cpack_components_all)
# filter out some components, which are not needed to be wrapped to Windows package
if(# python wheels are not needed to be wrapped by NSIS installer
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS)
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
# fill a list of components which are part of NSIS or other GUI installer
set(cpack_components_all ${CPACK_COMPONENTS_ALL})
unset(CPACK_COMPONENTS_ALL)
foreach(item IN LISTS cpack_components_all)
# filter out some components, which are not needed to be wrapped to Windows package
if(# python wheels are not needed to be wrapped by NSIS installer
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS)
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
# restore the components settings
# restore the components settings
foreach(comp IN LISTS CPACK_COMPONENTS_ALL)
cpack_add_component(${comp} ${_${comp}_cpack_component_args})
endforeach()
foreach(comp IN LISTS CPACK_COMPONENTS_ALL)
cpack_add_component(${comp} ${_${comp}_cpack_component_args})
endforeach()
# override package file name
set(CPACK_PACKAGE_FILE_NAME "w_openvino_toolkit_p_${OpenVINO_VERSION}.${OpenVINO_VERSION_BUILD}_offline")
# override package file name
set(CPACK_PACKAGE_FILE_NAME "w_openvino_toolkit_p_${OpenVINO_VERSION}.${OpenVINO_VERSION_BUILD}_offline")
endmacro()

View File

@@ -52,6 +52,7 @@ if [ -f /etc/lsb-release ]; then
python3-pip \
python3-enchant \
python3-setuptools \
libpython3-dev \
`# samples` \
pkg-config \
libgflags-dev \

View File

@@ -76,7 +76,7 @@ else()
endif()
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(${PROJECT_NAME} PRIVATE openvino::runtime ${OFFLINE_TRANSFORMATIONS_LIB})
target_link_libraries(${PROJECT_NAME} PRIVATE openvino::runtime::dev openvino::runtime ${OFFLINE_TRANSFORMATIONS_LIB})
addVersionDefines(pyopenvino.cpp CI_BUILD_NUMBER)

View File

@@ -12,6 +12,7 @@ set(TBB_LIBS_DIR runtime/3rdparty/tbb/lib)
if(WIN32)
set(TBB_LIBS_DIR runtime/3rdparty/tbb/bin)
endif()
set(PUGIXML_LIBS_DIR runtime/3rdparty/pugixml/lib)
if(LINUX)
find_host_program(patchelf_program
@@ -49,15 +50,16 @@ add_custom_command(OUTPUT ${openvino_wheel_path}
COMMAND ${CMAKE_COMMAND} -E env WHEEL_VERSION=${WHEEL_VERSION}
WHEEL_BUILD=${WHEEL_BUILD}
CMAKE_BUILD_DIR=${CMAKE_BINARY_DIR}
# TODO: check whether need to add plugins path
OV_RUNTIME_LIBS_DIR=${OV_CPACK_RUNTIMEDIR}
TBB_LIBS_DIR=${TBB_LIBS_DIR}
PUGIXML_LIBS_DIR=${PUGIXML_LIBS_DIR}
PY_PACKAGES_DIR=${PY_PACKAGES_DIR}
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/setup.py" clean bdist_wheel
--dist-dir ${openvino_wheels_output_dir}
--build=${WHEEL_BUILD}
--plat-name=${WHEEL_PLATFORM}
DEPENDS ${openvino_wheel_deps}
DEPENDS ${openvino_wheel_deps}
"${CMAKE_CURRENT_SOURCE_DIR}/setup.py"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Building Python wheel ${openvino_wheel_name}"
VERBATIM)

View File

@@ -44,6 +44,7 @@ SCRIPT_DIR = Path(__file__).resolve().parents[0]
CMAKE_BUILD_DIR = os.getenv("CMAKE_BUILD_DIR", ".")
OV_RUNTIME_LIBS_DIR = os.getenv("OV_RUNTIME_LIBS_DIR", f"runtime/{LIBS_DIR}/{ARCH}/{CONFIG}")
TBB_LIBS_DIR = os.getenv("TBB_LIBS_DIR", f"runtime/3rdparty/tbb/{LIBS_DIR}")
PUGIXML_LIBS_DIR = os.getenv("PUGIXML_LIBS_DIR", f"runtime/3rdparty/pugixml/{LIBS_DIR}")
PY_PACKAGES_DIR = os.getenv("PY_PACKAGES_DIR", f"python/{PYTHON_VERSION}")
LIBS_RPATH = "$ORIGIN" if sys.platform == "linux" else "@loader_path"
@@ -82,12 +83,17 @@ LIB_INSTALL_CFG = {
"name": "batch",
"prefix": "libs.core",
"install_dir": OV_RUNTIME_LIBS_DIR,
"rpath": LIBS_RPATH,
},
"tbb_libs": {
"name": "tbb",
"prefix": "libs.tbb",
"install_dir": TBB_LIBS_DIR,
"rpath": LIBS_RPATH,
},
"pugixml_libs": {
"name": "pugixml",
"prefix": "libs.pugixml",
"install_dir": PUGIXML_LIBS_DIR,
},
}

View File

@@ -30,7 +30,7 @@ target_include_directories(${TARGET_NAME} PUBLIC
target_link_libraries(${TARGET_NAME} PRIVATE ngraph_reference
ngraph_builders
ov_shape_inference
pugixml::static
openvino::pugixml
${CMAKE_DL_LIBS}
Threads::Threads)
@@ -86,7 +86,7 @@ target_include_directories(${TARGET_NAME}_dev INTERFACE
target_compile_definitions(${TARGET_NAME}_dev INTERFACE
$<TARGET_PROPERTY:openvino_gapi_preproc,INTERFACE_COMPILE_DEFINITIONS>)
target_link_libraries(${TARGET_NAME}_dev INTERFACE ${TARGET_NAME} pugixml::static openvino::itt openvino::util)
target_link_libraries(${TARGET_NAME}_dev INTERFACE ${TARGET_NAME} openvino::itt openvino::util)
set_ie_threading_interface_for(${TARGET_NAME}_dev)
set_target_properties(${TARGET_NAME}_dev PROPERTIES EXPORT_NAME runtime::dev)

View File

@@ -38,7 +38,7 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src # For CNNNetworkNGraphImpl
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>)
$<TARGET_PROPERTY:openvino::pugixml,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_definitions(${TARGET_NAME}_obj PRIVATE $<TARGET_PROPERTY:ngraph,INTERFACE_COMPILE_DEFINITIONS>)
@@ -53,7 +53,7 @@ add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime
PRIVATE pugixml::static openvino::itt openvino::runtime::dev)
PRIVATE openvino::pugixml openvino::itt openvino::runtime::dev)
target_include_directories(${TARGET_NAME} INTERFACE
$<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>)

View File

@@ -19,9 +19,8 @@ source_group("include" FILES ${PUBLIC_HEADERS})
add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime::dev
PRIVATE openvino::itt pugixml::static openvino::runtime ngraph::reference
nlohmann_json_schema_validator)
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev openvino::itt openvino::pugixml ngraph::reference
openvino::runtime nlohmann_json_schema_validator )
target_include_directories(${TARGET_NAME} PUBLIC ${PUBLIC_HEADERS_DIR}
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

@@ -73,7 +73,7 @@ ie_faster_build(ngraph_obj
addVersionDefines(src/version.cpp CI_BUILD_NUMBER)
target_link_libraries(ngraph_obj PRIVATE ngraph::builder ngraph::reference openvino::util
pugixml::static ov_shape_inference openvino::core::dev)
openvino::pugixml ov_shape_inference openvino::core::dev)
ie_mark_target_as_cc(ngraph_obj)

View File

@@ -565,7 +565,6 @@ target_link_libraries(ov_core_unit_tests PRIVATE ngraph_test_util
ngraph::builder
openvino::util
ov_shape_inference
pugixml::static
${CMAKE_DL_LIBS}
Threads::Threads
openvino::conditional_compilation

View File

@@ -4,6 +4,6 @@
ov_add_frontend(NAME ir
FILEDESCRIPTION "FrontEnd to load OpenVINO IR file format"
LINK_LIBRARIES pugixml::static
LINK_LIBRARIES openvino::pugixml
# TODO: remove dependency below in CVS-69781
openvino::runtime::dev)

View File

@@ -101,7 +101,7 @@ target_include_directories(${TARGET_NAME}_plugin_api INTERFACE
target_compile_definitions(${TARGET_NAME}_plugin_api INTERFACE
$<TARGET_PROPERTY:openvino_gapi_preproc,INTERFACE_COMPILE_DEFINITIONS>)
target_link_libraries(${TARGET_NAME}_plugin_api INTERFACE pugixml::static openvino::itt openvino::util)
target_link_libraries(${TARGET_NAME}_plugin_api INTERFACE openvino::pugixml openvino::itt openvino::util)
set_ie_threading_interface_for(${TARGET_NAME}_plugin_api)
@@ -131,7 +131,7 @@ target_compile_definitions(${TARGET_NAME}_obj PRIVATE
target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE
$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:openvino::pugixml,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:frontend_common::static,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:xbyak,INTERFACE_INCLUDE_DIRECTORIES>)
@@ -192,7 +192,7 @@ if(WIN32)
endif()
target_link_libraries(${TARGET_NAME}_s PRIVATE openvino::itt ${CMAKE_DL_LIBS} ngraph
frontend_common::static openvino_gapi_preproc_s inference_engine_transformations pugixml::static)
frontend_common::static openvino_gapi_preproc_s inference_engine_transformations openvino::pugixml)
target_compile_definitions(${TARGET_NAME}_s PUBLIC USE_STATIC_IE)

View File

@@ -18,7 +18,7 @@ ie_faster_build(${TARGET_NAME}
UNITY
)
target_link_libraries(${TARGET_NAME} PRIVATE pugixml::static)
target_link_libraries(${TARGET_NAME} PRIVATE openvino::pugixml)
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

View File

@@ -44,6 +44,7 @@ endif()
target_link_libraries(${TARGET_NAME} PRIVATE dnnl
ov_shape_inference
openvino::pugixml
inference_engine_snippets)
target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_EXTENSION_API)
@@ -68,7 +69,7 @@ ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
if(BUILD_SHARED_LIBS)
add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
link_system_libraries(${TARGET_NAME}_obj PUBLIC dnnl)
link_system_libraries(${TARGET_NAME}_obj PUBLIC dnnl openvino::pugixml)
target_include_directories(${TARGET_NAME}_obj
PRIVATE

View File

@@ -2449,7 +2449,7 @@ void TransposeWeightsFromNCHWToNHWCPass::run() {
}
int PassManager::run(int index) {
#if defined PLOT || defined ENABLE_V7_SERIALIZE
#if defined PLOT
auto dumpNetworkAfterPass = [&index, this] (std::shared_ptr<Pass> pass) {
std::string name = std::string("gna_passes_") + (index < 10 ? "0" : "") + std::to_string(index) + "_" + pass->getName();
#ifdef PLOT
@@ -2457,9 +2457,6 @@ int PassManager::run(int index) {
saveGraphToDot(network, out, [](const CNNLayerPtr layer,
ordered_properties &printed_properties,
ordered_properties &node_properties) {});
#endif
#ifdef ENABLE_V7_SERIALIZE
network.serialize(name + ".xml", name + ".bin");
#endif
};
#else

View File

@@ -36,8 +36,7 @@ ie_add_plugin(NAME ${TARGET_NAME}
target_compile_options(${TARGET_NAME} PRIVATE
$<$<CONFIG:Release>:$<IF:$<CXX_COMPILER_ID:MSVC>,/Os,-Os>>)
target_link_libraries(${TARGET_NAME} PRIVATE openvino_intel_gpu_graph
pugixml::static)
target_link_libraries(${TARGET_NAME} PRIVATE openvino_intel_gpu_graph openvino::pugixml)
target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include/)

View File

@@ -42,13 +42,13 @@ function(add_graph_transformer_target TARGET_NAME STATIC_IE)
target_include_directories(${TARGET_NAME}
PUBLIC
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:openvino::pugixml,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:mvnc,INTERFACE_INCLUDE_DIRECTORIES>)
if(STATIC_IE)
target_link_libraries(${TARGET_NAME} PUBLIC vpu_common_lib_test_static)
else()
target_link_libraries(${TARGET_NAME} PUBLIC pugixml::static vpu_common_lib)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::pugixml vpu_common_lib)
endif()
target_link_libraries(${TARGET_NAME}

View File

@@ -16,7 +16,7 @@ set(LINK_LIBRARIES
openvino::conditional_compilation
sharedTestClasses
offline_transformations
pugixml::static
openvino::pugixml
openvino::runtime::dev
)
@@ -195,9 +195,9 @@ function(ie_headers_compilation_with_custom_flags)
target_compile_definitions(${target_name} PRIVATE $<TARGET_PROPERTY:inference_engine,INTERFACE_COMPILE_DEFINITIONS>)
if(IE_TEST_PLUGIN_API)
# ngraph, pugixml::static, openvino::itt, openvino_gapi_preproc headers
# ngraph, openvino::pugixml, openvino::itt, openvino_gapi_preproc headers
target_include_directories(${target_name} SYSTEM PRIVATE
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:openvino::pugixml,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:openvino::itt,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(${target_name} PRIVATE
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)

View File

@@ -8,7 +8,7 @@ list(APPEND LIBRARIES
gflags
inference_engine
funcTestUtils
pugixml::static
openvino::pugixml
)
list(APPEND DEFINITIONS)

View File

@@ -7,14 +7,16 @@ set(TARGET_NAME subgraphsDumperTests)
addIeTargetTest(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
ADDITIONAL_SOURCE_DIRS ${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers
ADDITIONAL_SOURCE_DIRS
# TODO: create static library for matchers instead of duplication
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers
INCLUDES
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper/include
LINK_LIBRARIES
PRIVATE
funcTestUtils
openvino::runtime
pugixml::static
openvino::pugixml
ADD_CPPLINT
)

View File

@@ -49,7 +49,7 @@ addIeTarget(
${PUBLIC_HEADERS_DIR}
LINK_LIBRARIES
PUBLIC
pugixml::static
openvino::pugixml
funcTestUtils
ngraph_test_util
ngraphFunctions

View File

@@ -18,7 +18,6 @@ addIeTarget(
${CMAKE_CURRENT_SOURCE_DIR}/src
LINK_LIBRARIES
PRIVATE
pugixml::static
funcTestUtils
ngraphFunctions
inference_engine_legacy

View File

@@ -9,8 +9,6 @@
#include <thread>
#include "pugixml.hpp"
#include <openvino/pass/serialize.hpp>
#include <ngraph/opsets/opset.hpp>

View File

@@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "pugixml.hpp"
#include "shared_test_classes/base/snippets_test_utils.hpp"
#include "exec_graph_info.hpp"

View File

@@ -23,7 +23,7 @@ addIeTarget(
openvino::runtime::dev
PRIVATE
ngraphFunctions
pugixml::static
openvino::pugixml
INCLUDES
PUBLIC
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>

View File

@@ -22,7 +22,6 @@ function(add_helpers target_name)
target_include_directories(${target_name}
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}"
$<TARGET_PROPERTY:ie_samples_utils,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:pugixml::static,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:inference_engine_legacy,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")

View File

@@ -35,7 +35,7 @@ target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLU
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/")
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev
inference_engine_legacy pugixml::static openvino::itt)
inference_engine_legacy openvino::pugixml openvino::itt)
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

View File

@@ -50,22 +50,39 @@ if(ENABLE_SYSTEM_PUGIXML)
# try system pugixml first
find_package(PugiXML QUIET)
if(PugiXML_FOUND)
set_target_properties(pugixml PROPERTIES IMPORTED_GLOBAL ON)
if(TARGET pugixml::static)
# sometimes pugixml::static target already exists, just need to make it global
set_target_properties(pugixml::static PROPERTIES IMPORTED_GLOBAL ON)
# example: building using conda environment
set(pugixml_target pugixml::static)
elseif(TARGET pugixml)
# or create an alias for pugixml shared library
# example: libpugixml-dev debian package
set(pugixml_target pugixml)
else()
# or create an alias
add_library(pugixml::static ALIAS pugixml)
message(FATAL_ERROR "Failed to detect pugixml library target name")
endif()
# we need to install dynamic library for wheel package
get_target_property(target_type ${pugixml_target} TYPE)
if(target_type STREQUAL "SHARED_LIBRARY")
ie_cpack_add_component(pugixml HIDDEN)
get_target_property(pugixml_loc ${pugixml_target} IMPORTED_LOCATION_NOCONFIG)
install(FILES ${pugixml_loc}
DESTINATION runtime/3rdparty/pugixml/lib
COMPONENT pugixml EXCLUDE_FROM_ALL)
endif()
set_target_properties(${pugixml_target} PROPERTIES IMPORTED_GLOBAL ON)
# create an alias for real target which can be shared or static
add_library(openvino::pugixml ALIAS ${pugixml_target})
else()
# reset to prevent improper code generation in OpenVINODeveloperPackage
set(ENABLE_SYSTEM_PUGIXML OFF CACHE BOOL "" FORCE)
endif()
endif()
if(NOT TARGET pugixml::static)
# use OpenVINO pugixml copy if system one if not found
if(NOT TARGET openvino::pugixml)
# use OpenVINO pugixml copy if system one is not found
function(ie_build_pugixml)
function(ie_build_pugixml_static)
set(BUILD_SHARED_LIBS OFF)
@@ -73,7 +90,8 @@ if(NOT TARGET pugixml::static)
endfunction()
ie_build_pugixml_static()
set_property(TARGET pugixml-static PROPERTY EXPORT_NAME pugixml)
openvino_developer_export_targets(COMPONENT openvino_common TARGETS pugixml::static)
add_library(openvino::pugixml ALIAS pugixml-static)
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::pugixml)
ov_install_static_lib(pugixml-static openvino_common)
endfunction()