Use system dependencies (#11419)

* Try to improve gflags

* Try to improve gflags: part 2

* Tried to use dependencies on system

* Use nlohmann_jsonConfig from system

* Enabled nlohmann_json from system

* Improvements

* handle system gflags in developer package

* Simplifications

* Simplify dependency management

* Corrected package names

* Fixed subgraphsDumper configure stage

* Try to fix rhel8

* Try to fix macosx

* Fixed VPUX build

* Fixed aliasing issues

* Suppress some wanrings

* export gflags when build it

* Fixed some LTO

* Try to fix Mac

* revert

* use gflags as private dependency

* Aligned targets in developer package

* Fixed frontends tests build on U20 with LTO

* PAssed

* Don't use pkg_search_module(zlib ..) during cross-compilation

* Removed unused variables

* Fixed finding of zlib during cross-compilation
This commit is contained in:
Ilya Lavrenov 2022-04-05 04:47:22 +03:00 committed by GitHub
parent 90366c2c60
commit 4ad20fb53f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 247 additions and 138 deletions

View File

@ -51,6 +51,7 @@ file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake") file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
foreach(component IN LISTS openvino_export_components) foreach(component IN LISTS openvino_export_components)
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake") file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
unset(${component} CACHE) unset(${component} CACHE)
endforeach() endforeach()
unset(openvino_export_components CACHE) unset(openvino_export_components CACHE)

View File

@ -7,6 +7,7 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(PKG_CONFIG_EXECUTABLE arm-linux-gnueabihf-pkg-config CACHE PATH "Path to ARM pkg-config")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -7,6 +7,7 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(PKG_CONFIG_EXECUTABLE aarch64-linux-gnu-pkg-config CACHE PATH "Path to ARM64 pkg-config")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -186,6 +186,8 @@ endif()
# Use solution folders # Use solution folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# cmake_dependent_option() supports full Condition Syntax
set(CMAKE_POLICY_DEFAULT_CMP0127 NEW)
# Enable CMAKE_<LANG>_COMPILER_ID AppleClang # Enable CMAKE_<LANG>_COMPILER_ID AppleClang
set(CMAKE_POLICY_DEFAULT_CMP0025 NEW) set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)

View File

@ -13,8 +13,8 @@ function(ie_plugin_get_file_name target_name library_name)
set("${library_name}" "${LIB_PREFIX}${target_name}${LIB_SUFFIX}" PARENT_SCOPE) set("${library_name}" "${LIB_PREFIX}${target_name}${LIB_SUFFIX}" PARENT_SCOPE)
endfunction() endfunction()
if(NOT TARGET ie_plugins) if(NOT TARGET ov_plugins)
add_custom_target(ie_plugins) add_custom_target(ov_plugins)
endif() endif()
# #
@ -102,7 +102,7 @@ function(ie_add_plugin)
add_cpplint_target(${IE_PLUGIN_NAME}_cpplint FOR_TARGETS ${IE_PLUGIN_NAME} CUSTOM_FILTERS ${custom_filter}) add_cpplint_target(${IE_PLUGIN_NAME}_cpplint FOR_TARGETS ${IE_PLUGIN_NAME} CUSTOM_FILTERS ${custom_filter})
endif() endif()
add_dependencies(ie_plugins ${IE_PLUGIN_NAME}) add_dependencies(ov_plugins ${IE_PLUGIN_NAME})
if(TARGET openvino_gapi_preproc) if(TARGET openvino_gapi_preproc)
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
add_dependencies(${IE_PLUGIN_NAME} openvino_gapi_preproc) add_dependencies(${IE_PLUGIN_NAME} openvino_gapi_preproc)

View File

@ -6,7 +6,6 @@ function(ie_generate_dev_package_config)
# dummy check that OpenCV is here # dummy check that OpenCV is here
find_package(OpenCV QUIET) find_package(OpenCV QUIET)
set(all_dev_targets gflags ov_runtime_libraries)
foreach(component IN LISTS openvino_export_components) foreach(component IN LISTS openvino_export_components)
# export all targets with prefix and use them during extra modules build # export all targets with prefix and use them during extra modules build
export(TARGETS ${${component}} NAMESPACE IE:: export(TARGETS ${${component}} NAMESPACE IE::
@ -15,6 +14,11 @@ function(ie_generate_dev_package_config)
endforeach() endforeach()
add_custom_target(ie_dev_targets DEPENDS ${all_dev_targets}) add_custom_target(ie_dev_targets DEPENDS ${all_dev_targets})
# if we've found system gflags
if(gflags_DIR)
set(gflags_BINARY_DIR "${gflags_DIR}")
endif()
configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in" configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in"
"${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake" "${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake"
INSTALL_DESTINATION share # not used INSTALL_DESTINATION share # not used
@ -30,7 +34,6 @@ function(ov_generate_dev_package_config)
# dummy check that OpenCV is here # dummy check that OpenCV is here
find_package(OpenCV QUIET) find_package(OpenCV QUIET)
set(all_dev_targets gflags ov_runtime_libraries)
foreach(component IN LISTS openvino_export_components) foreach(component IN LISTS openvino_export_components)
string(FIND "${component}" "_legacy" index) string(FIND "${component}" "_legacy" index)
if(index EQUAL -1) if(index EQUAL -1)
@ -42,6 +45,11 @@ function(ov_generate_dev_package_config)
endforeach() endforeach()
add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets}) add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets})
# if we've found system gflags
if(gflags_DIR)
set(gflags_BINARY_DIR "${gflags_DIR}")
endif()
configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in" configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in"
"${CMAKE_BINARY_DIR}/OpenVINODeveloperPackageConfig.cmake" "${CMAKE_BINARY_DIR}/OpenVINODeveloperPackageConfig.cmake"
INSTALL_DESTINATION share # not used INSTALL_DESTINATION share # not used
@ -59,8 +67,8 @@ endfunction()
function(register_extra_modules) function(register_extra_modules)
# post export # post export
openvino_developer_export_targets(COMPONENT core TARGETS inference_engine) openvino_developer_export_targets(COMPONENT core_legacy TARGETS inference_engine)
openvino_developer_export_targets(COMPONENT core TARGETS ngraph) openvino_developer_export_targets(COMPONENT core_legacy TARGETS ngraph)
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/runtime") set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/runtime")
set(OpenVINODeveloperPackage_DIR "${CMAKE_BINARY_DIR}/runtime") set(OpenVINODeveloperPackage_DIR "${CMAKE_BINARY_DIR}/runtime")
@ -81,10 +89,6 @@ function(register_extra_modules)
file(APPEND "${devconfig_file}" "add_library(${NS}::${target} ALIAS ${target})\n") file(APPEND "${devconfig_file}" "add_library(${NS}::${target} ALIAS ${target})\n")
endif() endif()
endforeach() endforeach()
if ("${NS}" STREQUAL "openvino")
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime ALIAS openvino)\n")
file(APPEND "${devconfig_file}" "add_library(${NS}::runtime::dev ALIAS openvino_dev)\n")
endif()
endfunction() endfunction()
generate_fake_dev_package("openvino") generate_fake_dev_package("openvino")
@ -137,7 +141,7 @@ ie_generate_dev_package_config()
ov_generate_dev_package_config() ov_generate_dev_package_config()
# extra modules must be registered after inference_engine library # extra modules must be registered after inference_engine library
# and all other IE common libraries (ov_runtime_libraries) are creared # and all other OpenVINO Core libraries are creared
# because 'register_extra_modules' creates fake InferenceEngineDeveloperPackageConfig.cmake # because 'register_extra_modules' creates fake InferenceEngineDeveloperPackageConfig.cmake
# with all imported developer targets # with all imported developer targets
register_extra_modules() register_extra_modules()

View File

@ -49,11 +49,6 @@ find_dependency(ngraph
NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
find_dependency(OpenVINODeveloperPackage
PATHS "${CMAKE_CURRENT_LIST_DIR}"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
if(TARGET openvino::runtime AND NOT TARGET IE::runtime) if(TARGET openvino::runtime AND NOT TARGET IE::runtime)
add_library(IE::runtime INTERFACE IMPORTED) add_library(IE::runtime INTERFACE IMPORTED)
set_target_properties(IE::runtime PROPERTIES set_target_properties(IE::runtime PROPERTIES
@ -71,6 +66,18 @@ foreach(component @openvino_export_components@)
include("${CMAKE_CURRENT_LIST_DIR}/${component}_dev_targets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/${component}_dev_targets.cmake")
endforeach() endforeach()
if(TARGET IE::ov_core_dev AND NOT TARGET openvino::core::dev)
add_library(openvino::core::dev INTERFACE IMPORTED)
set_target_properties(openvino::core::dev PROPERTIES
INTERFACE_LINK_LIBRARIES IE::ov_core_dev)
endif()
if(TARGET IE::runtime::dev AND NOT TARGET openvino::runtime::dev)
add_library(openvino::runtime::dev INTERFACE IMPORTED)
set_target_properties(openvino::runtime::dev PROPERTIES
INTERFACE_LINK_LIBRARIES IE::runtime::dev)
endif()
if(ENABLE_SYSTEM_PUGIXML) if(ENABLE_SYSTEM_PUGIXML)
find_dependency(PugiXML) find_dependency(PugiXML)
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE) set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE)

View File

@ -53,14 +53,11 @@ if (NOT (OpenCL_FOUND AND OpenCL_HEADERS))
endif() endif()
# try to find VA libraries # try to find VA libraries
find_package(PkgConfig QUIET) if(NOT CMAKE_CROSSCOMPILING)
find_host_package(PkgConfig QUIET)
if(PkgConfig_FOUND) if(PkgConfig_FOUND)
pkg_search_module(LIBVA QUIET libva) pkg_search_module(libva QUIET IMPORTED_TARGET libva)
endif() endif()
# TODO: pkg_search_module finds libva not in sysroot
if(ANDROID)
set(LIBVA_FOUND OFF CACHE BOOL "" FORCE)
endif() endif()
# remove OpenCV related sources # remove OpenCV related sources
@ -89,10 +86,9 @@ if(OpenCL_FOUND AND OpenCL_HEADERS)
target_link_libraries(${TARGET_NAME} PRIVATE ${OpenCL_LIB}) target_link_libraries(${TARGET_NAME} PRIVATE ${OpenCL_LIB})
target_include_directories(${TARGET_NAME} PRIVATE ${OpenCL_HEADERS}) target_include_directories(${TARGET_NAME} PRIVATE ${OpenCL_HEADERS})
if(LIBVA_FOUND) if(libva_FOUND)
target_compile_definitions(${TARGET_NAME} PRIVATE ENABLE_LIBVA) target_compile_definitions(${TARGET_NAME} PRIVATE ENABLE_LIBVA)
target_include_directories(${TARGET_NAME} PRIVATE ${LIBVA_INCLUDE_DIRS}) target_link_libraries(${TARGET_NAME} PRIVATE PkgConfig::libva)
target_link_libraries(${TARGET_NAME} PRIVATE ${LIBVA_LINK_LIBRARIES})
endif() endif()
if(WIN32) if(WIN32)

View File

@ -44,6 +44,8 @@ if [ -f /etc/lsb-release ]; then
$x86_64_specific_packages \ $x86_64_specific_packages \
libgtk2.0-dev \ libgtk2.0-dev \
pkg-config \ pkg-config \
libgflags-dev \
zlib1g-dev \
unzip \ unzip \
automake \ automake \
libtool \ libtool \
@ -77,8 +79,13 @@ if [ -f /etc/lsb-release ]; then
else else
sudo -E apt-get install -y libpng-dev sudo -E apt-get install -y libpng-dev
fi fi
if apt-cache search --names-only '^nlohmann-json3-dev'| grep -q nlohmann-json3; then
sudo -E apt-get install -y nlohmann-json3-dev
else
sudo -E apt-get install -y nlohmann-json-dev
fi
elif [ -f /etc/redhat-release ]; then elif [ -f /etc/redhat-release ]; then
# CentOS 7.x # RHEL 8
sudo -E yum install -y centos-release-scl epel-release sudo -E yum install -y centos-release-scl epel-release
sudo -E yum install -y \ sudo -E yum install -y \
wget \ wget \
@ -97,6 +104,9 @@ elif [ -f /etc/redhat-release ]; then
gcc \ gcc \
gcc-c++ \ gcc-c++ \
make \ make \
pkg-config \
gflags-devel.i686 \
zlib-devel.i686 \
glibc-static \ glibc-static \
glibc-devel \ glibc-devel \
libstdc++-static \ libstdc++-static \
@ -152,6 +162,9 @@ elif [ -f /etc/os-release ] && grep -q "raspbian" /etc/os-release; then
libboost-regex-dev \ libboost-regex-dev \
libgtk2.0-dev \ libgtk2.0-dev \
pkg-config \ pkg-config \
libgflags-dev \
zlib1g-dev \
nlohmann-json-dev \
unzip \ unzip \
automake \ automake \
libtool \ libtool \

View File

@ -91,6 +91,12 @@ if(ARM AND NOT CMAKE_CROSSCOMPILING)
add_compile_options(-march=armv7-a) add_compile_options(-march=armv7-a)
endif() endif()
if(NOT COMMAND find_host_package)
macro(find_host_package)
find_package(${ARGN})
endmacro()
endif()
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden)
@ -106,22 +112,49 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
endif() endif()
#################################### ####################################
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags" AND if(NOT TARGET gflags)
NOT DEFINED OpenVINO_SOURCE_DIR) find_package(gflags QUIET COMPONENTS nothreads_shared)
if(gflags_FOUND)
message(STATUS "gflags (${gflags_VERSION}) is found at ${gflags_DIR}")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags")
add_subdirectory(thirdparty/gflags EXCLUDE_FROM_ALL) add_subdirectory(thirdparty/gflags EXCLUDE_FROM_ALL)
endif() endif()
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib") if(NOT TARGET zlib::zlib)
if(NOT CMAKE_CROSSCOMPILING)
find_host_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_search_module(zlib QUIET
IMPORTED_TARGET
zlib)
if(zlib_FOUND)
set_target_properties(PkgConfig::zlib PROPERTIES IMPORTED_GLOBAL ON)
add_library(zlib::zlib ALIAS PkgConfig::zlib)
endif()
endif()
endif()
if(zlib_FOUND)
message(STATUS "zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib")
add_subdirectory(thirdparty/zlib EXCLUDE_FROM_ALL) add_subdirectory(thirdparty/zlib EXCLUDE_FROM_ALL)
endif() endif()
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cnpy") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cnpy")
add_subdirectory(thirdparty/cnpy EXCLUDE_FROM_ALL) add_subdirectory(thirdparty/cnpy EXCLUDE_FROM_ALL)
endif() endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json") if(NOT TARGET nlohmann_json::nlohmann_json)
find_package(nlohmann_json QUIET)
if(nlohmann_json_FOUND)
message(STATUS "nlohmann_json (${nlohmann_json_VERSION}) is found at ${nlohmann_json_DIR}")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json")
add_subdirectory(thirdparty/json EXCLUDE_FROM_ALL) add_subdirectory(thirdparty/json EXCLUDE_FROM_ALL)
endif() endif()
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils")
add_subdirectory(common/utils) add_subdirectory(common/utils)
@ -215,12 +248,10 @@ macro(ie_add_sample)
target_link_libraries(${IE_SAMPLE_NAME} PRIVATE gflags) target_link_libraries(${IE_SAMPLE_NAME} PRIVATE gflags)
endif() endif()
install( install(TARGETS ${IE_SAMPLE_NAME}
TARGETS ${IE_SAMPLE_NAME}
RUNTIME DESTINATION samples_bin/ RUNTIME DESTINATION samples_bin/
COMPONENT samples_bin COMPONENT samples_bin
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL)
)
# create global target with all samples / demo apps # create global target with all samples / demo apps
if(NOT TARGET ie_samples) if(NOT TARGET ie_samples)

View File

@ -10,7 +10,7 @@ file (GLOB HDR ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
ie_add_sample(NAME ${TARGET_NAME} ie_add_sample(NAME ${TARGET_NAME}
SOURCES ${SRC} SOURCES ${SRC}
HEADERS ${HDR} HEADERS ${HDR}
DEPENDENCIES nlohmann_json format_reader ie_samples_utils) DEPENDENCIES nlohmann_json::nlohmann_json format_reader ie_samples_utils)
# Optional OpenCL dependnency # Optional OpenCL dependnency
@ -63,7 +63,6 @@ endif()
find_package(OpenCV COMPONENTS core QUIET) find_package(OpenCV COMPONENTS core QUIET)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR") message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR")
target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json_schema_validator)
else() else()
target_compile_definitions(${TARGET_NAME} PRIVATE USE_OPENCV) target_compile_definitions(${TARGET_NAME} PRIVATE USE_OPENCV)
target_link_libraries(${TARGET_NAME} PRIVATE opencv_core) target_link_libraries(${TARGET_NAME} PRIVATE opencv_core)

View File

@ -14,7 +14,7 @@ target_include_directories(${TARGET_NAME}
find_package(OpenVINO REQUIRED COMPONENTS Runtime) find_package(OpenVINO REQUIRED COMPONENTS Runtime)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime gflags) target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime PRIVATE gflags)
if(COMMAND add_clang_format_target) if(COMMAND add_clang_format_target)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -101,7 +101,7 @@ if [ "$os" == "ubuntu18.04" ] ; then
pkgs_opencv_req=(libgtk-3-0 libgl1) pkgs_opencv_req=(libgtk-3-0 libgl1)
pkgs_python=(python3 python3-dev python3-venv python3-setuptools python3-pip) pkgs_python=(python3 python3-dev python3-venv python3-setuptools python3-pip)
pkgs_dev=(cmake g++ gcc libc6-dev make curl sudo) pkgs_dev=(cmake pkg-config libgflags-dev zlib1g-dev nlohmann-json-dev g++ gcc libc6-dev make curl sudo)
pkgs_myriad=(libusb-1.0-0) pkgs_myriad=(libusb-1.0-0)
pkgs_cl_compiler=(libtinfo5) pkgs_cl_compiler=(libtinfo5)
pkgs_opencv_opt=( pkgs_opencv_opt=(
@ -122,7 +122,7 @@ elif [ "$os" == "ubuntu20.04" ] ; then
pkgs_opencv_req=(libgtk-3-0 libgl1) pkgs_opencv_req=(libgtk-3-0 libgl1)
pkgs_python=(python3 python3-dev python3-venv python3-setuptools python3-pip) pkgs_python=(python3 python3-dev python3-venv python3-setuptools python3-pip)
pkgs_dev=(cmake g++ gcc libc6-dev make curl sudo) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev libgflags-dev zlib1g-dev nlohmann-json3-dev make curl sudo)
pkgs_myriad=(libusb-1.0-0) pkgs_myriad=(libusb-1.0-0)
pkgs_cl_compiler=(libtinfo5) pkgs_cl_compiler=(libtinfo5)
pkgs_opencv_opt=( pkgs_opencv_opt=(
@ -143,7 +143,7 @@ elif [ "$os" == "rhel8" ] ; then
pkgs_opencv_req=(gtk3) pkgs_opencv_req=(gtk3)
pkgs_python=(python3 python3-devel python3-setuptools python3-pip) pkgs_python=(python3 python3-devel python3-setuptools python3-pip)
pkgs_dev=(gcc gcc-c++ make glibc libstdc++ libgcc cmake curl sudo) pkgs_dev=(gcc gcc-c++ make glibc libstdc++ libgcc cmake pkg-config gflags-devel.i686 zlib-devel.i686 curl sudo)
pkgs_myriad=() pkgs_myriad=()
pkgs_opencv_opt=( pkgs_opencv_opt=(
gstreamer1 gstreamer1

View File

@ -4,8 +4,6 @@
add_definitions(-DPROJECT_ROOT_DIR="${CMAKE_CURRENT_SOURCE_DIR}") add_definitions(-DPROJECT_ROOT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(ov_runtime_libraries)
include(cmake/install_tbb.cmake) include(cmake/install_tbb.cmake)
# CC library should be registered before other cc targets # CC library should be registered before other cc targets
@ -14,7 +12,9 @@ add_subdirectory(common)
add_subdirectory(core) add_subdirectory(core)
add_subdirectory(frontends) add_subdirectory(frontends)
# TODO: remove ngraph/ngraph.hpp usage # TODO: remove ngraph/ngraph.hpp usage
if(ENABLE_TESTS)
add_subdirectory(core/tests) add_subdirectory(core/tests)
endif()
add_subdirectory(bindings) add_subdirectory(bindings)
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
@ -25,7 +25,7 @@ endif()
add_subdirectory(plugins) add_subdirectory(plugins)
add_subdirectory(inference) add_subdirectory(inference)
include(cmake/openvino.cmake) include(cmake/openvino.cmake)
# preprocessing has dependency on ov_runtime for static build # preprocessing has dependency on `openvino` for static build
add_subdirectory(common/preprocessing) add_subdirectory(common/preprocessing)
if(ENABLE_TESTS) if(ENABLE_TESTS)

View File

@ -28,7 +28,6 @@ else()
add_subdirectory(src/compatibility/pyngraph) add_subdirectory(src/compatibility/pyngraph)
add_subdirectory(src/pyopenvino) add_subdirectory(src/pyopenvino)
endif() endif()
if(ENABLE_WHEEL) if(ENABLE_WHEEL)

View File

@ -2,6 +2,10 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
if(NOT TARGET py_ov_frontends)
add_custom_target(py_ov_frontends)
endif()
function(frontend_module TARGET FRAMEWORK INSTALL_COMPONENT) function(frontend_module TARGET FRAMEWORK INSTALL_COMPONENT)
set(TARGET_NAME ${TARGET}) set(TARGET_NAME ${TARGET})
@ -18,6 +22,7 @@ function(frontend_module TARGET FRAMEWORK INSTALL_COMPONENT)
pybind11_add_module(${TARGET_NAME} MODULE ${SOURCES}) pybind11_add_module(${TARGET_NAME} MODULE ${SOURCES})
add_dependencies(${TARGET_NAME} pyopenvino) add_dependencies(${TARGET_NAME} pyopenvino)
add_dependencies(py_ov_frontends ${TARGET_NAME})
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
"${PYTHON_SOURCE_DIR}/pyopenvino/utils/") "${PYTHON_SOURCE_DIR}/pyopenvino/utils/")

View File

@ -25,7 +25,7 @@ endif()
# create target for openvino.wheel # create target for openvino.wheel
set(openvino_wheel_deps ie_api) set(openvino_wheel_deps ie_api)
foreach(_target ov_runtime_libraries ie_plugins _pyngraph pyopenvino py_paddle_frontend py_tensorflow_frontend py_onnx_frontend) foreach(_target ie_api constants _pyngraph pyopenvino ov_plugins py_ov_frontends)
if(TARGET ${_target}) if(TARGET ${_target})
list(APPEND openvino_wheel_deps ${_target}) list(APPEND openvino_wheel_deps ${_target})
endif() endif()

View File

@ -87,7 +87,7 @@ target_link_libraries(${TARGET_NAME}_dev INTERFACE ${TARGET_NAME} pugixml::stati
set_ie_threading_interface_for(${TARGET_NAME}_dev) set_ie_threading_interface_for(${TARGET_NAME}_dev)
set_target_properties(${TARGET_NAME}_dev PROPERTIES EXPORT_NAME runtime::dev) set_target_properties(${TARGET_NAME}_dev PROPERTIES EXPORT_NAME runtime::dev)
openvino_developer_export_targets(COMPONENT core TARGETS ${TARGET_NAME}_dev) openvino_developer_export_targets(COMPONENT core TARGETS openvino::runtime::dev)
# Install static libraries for case BUILD_SHARED_LIBS=OFF # Install static libraries for case BUILD_SHARED_LIBS=OFF
ov_install_static_lib(${TARGET_NAME}_dev core) ov_install_static_lib(${TARGET_NAME}_dev core)

View File

@ -11,5 +11,3 @@ add_subdirectory(legacy)
add_subdirectory(transformations) add_subdirectory(transformations)
add_subdirectory(offline_transformations) add_subdirectory(offline_transformations)
add_subdirectory(low_precision_transformations) add_subdirectory(low_precision_transformations)
add_dependencies(ov_runtime_libraries openvino_gapi_preproc)

View File

@ -50,4 +50,4 @@ ov_install_static_lib(${TARGET_NAME} core)
file(GLOB_RECURSE hdrs ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) file(GLOB_RECURSE hdrs ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${hdrs}) add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${hdrs})
openvino_developer_export_targets(COMPONENT core TARGETS openvino::conditional_compilation) openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::conditional_compilation)

View File

@ -36,4 +36,4 @@ target_include_directories(${TARGET_NAME} PUBLIC
ov_install_static_lib(${TARGET_NAME} openvino_common) ov_install_static_lib(${TARGET_NAME} openvino_common)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
openvino_developer_export_targets(COMPONENT core TARGETS openvino::itt) openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::itt)

View File

@ -65,7 +65,7 @@ set_target_properties(${TARGET_NAME} ${TARGET_NAME}_obj
# developer package # developer package
openvino_developer_export_targets(COMPONENT core TARGETS ${TARGET_NAME}) openvino_developer_export_targets(COMPONENT core_legacy TARGETS ${TARGET_NAME})
# install # install

View File

@ -21,7 +21,7 @@ add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime::dev target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime::dev
PRIVATE openvino::itt pugixml::static openvino::runtime ngraph::reference PRIVATE openvino::itt pugixml::static openvino::runtime ngraph::reference
nlohmann_json_schema_validator nlohmann_json) nlohmann_json_schema_validator)
target_include_directories(${TARGET_NAME} PUBLIC ${PUBLIC_HEADERS_DIR} target_include_directories(${TARGET_NAME} PUBLIC ${PUBLIC_HEADERS_DIR}
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

@ -4,8 +4,6 @@
#pragma once #pragma once
#include <transformations_visibility.hpp>
#include <ngraph/pass/graph_rewrite.hpp> #include <ngraph/pass/graph_rewrite.hpp>
namespace ngraph { namespace ngraph {

View File

@ -9,7 +9,6 @@
#include <type_traits> #include <type_traits>
#include "openvino/frontend/extension/decoder_transformation.hpp" #include "openvino/frontend/extension/decoder_transformation.hpp"
#include "openvino/frontend/visibility.hpp"
namespace ov { namespace ov {
namespace frontend { namespace frontend {

View File

@ -34,14 +34,14 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
ie_mark_target_as_cc(${TARGET_NAME}) ie_mark_target_as_cc(${TARGET_NAME})
# LTO
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
if(ENABLE_FUNCTIONAL_TESTS) if(ENABLE_FUNCTIONAL_TESTS)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
# LTO
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
# install # install
ov_install_static_lib(${TARGET_NAME} core) ov_install_static_lib(${TARGET_NAME} core)

View File

@ -25,7 +25,7 @@ ie_faster_build(${TARGET_NAME}_obj
PCH PRIVATE "src/precomp.hpp" PCH PRIVATE "src/precomp.hpp"
) )
target_link_libraries(${TARGET_NAME}_obj PRIVATE ngraph_reference openvino::itt ngraph::builder ov_core_dev) target_link_libraries(${TARGET_NAME}_obj PRIVATE ngraph_reference openvino::itt ngraph::builder openvino::core::dev)
target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}> target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>
"${CMAKE_CURRENT_SOURCE_DIR}/src") "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

@ -37,11 +37,25 @@ set_property(SOURCE ${MIXED_SRC}
source_group("src" FILES ${LIBRARY_SRC}) source_group("src" FILES ${LIBRARY_SRC})
source_group("include" FILES ${PUBLIC_HEADERS}) source_group("include" FILES ${PUBLIC_HEADERS})
#
# Create ov_core_dev library # Create ov_core_dev library
#
add_library(ov_core_dev INTERFACE) add_library(ov_core_dev INTERFACE)
add_library(openvino::core::dev ALIAS ov_core_dev)
target_include_directories(ov_core_dev INTERFACE $<BUILD_INTERFACE:${OpenVINO_SOURCE_DIR}/src/core/dev_api>) target_include_directories(ov_core_dev INTERFACE $<BUILD_INTERFACE:${OpenVINO_SOURCE_DIR}/src/core/dev_api>)
set_target_properties(ov_core_dev PROPERTIES EXPORT_NAME core::dev)
openvino_developer_export_targets(COMPONENT core TARGETS openvino::core::dev)
# Install static libraries for case BUILD_SHARED_LIBS=OFF
ov_install_static_lib(ov_core_dev core)
#
# Create static or shared library depending on BUILD_SHARED_LIBS # Create static or shared library depending on BUILD_SHARED_LIBS
#
add_library(ngraph_obj OBJECT ${LIBRARY_SRC} ${PUBLIC_HEADERS}) add_library(ngraph_obj OBJECT ${LIBRARY_SRC} ${PUBLIC_HEADERS})
target_compile_definitions(ngraph_obj PRIVATE IMPLEMENT_OPENVINO_API) target_compile_definitions(ngraph_obj PRIVATE IMPLEMENT_OPENVINO_API)
@ -52,7 +66,7 @@ ie_faster_build(ngraph_obj
addVersionDefines(src/version.cpp CI_BUILD_NUMBER) addVersionDefines(src/version.cpp CI_BUILD_NUMBER)
target_link_libraries(ngraph_obj PRIVATE ngraph::builder ngraph::reference openvino::util pugixml::static ov_shape_inference ov_core_dev) target_link_libraries(ngraph_obj PRIVATE ngraph::builder ngraph::reference openvino::util pugixml::static ov_shape_inference openvino::core::dev)
ie_mark_target_as_cc(ngraph_obj) ie_mark_target_as_cc(ngraph_obj)
@ -104,7 +118,6 @@ target_include_directories(ngraph_obj PUBLIC $<BUILD_INTERFACE:${OV_CORE_INCLUDE
add_library(ngraph INTERFACE) add_library(ngraph INTERFACE)
target_link_libraries(ngraph INTERFACE openvino::runtime) target_link_libraries(ngraph INTERFACE openvino::runtime)
# Add an alias so that library can be used inside the build tree, e.g. when testing # Add an alias so that library can be used inside the build tree, e.g. when testing
add_library(ngraph::ngraph ALIAS ngraph)
add_library(openvino::core ALIAS ngraph) add_library(openvino::core ALIAS ngraph)
target_include_directories(ngraph INTERFACE $<BUILD_INTERFACE:${OV_CORE_INCLUDE_PATH}>) target_include_directories(ngraph INTERFACE $<BUILD_INTERFACE:${OV_CORE_INCLUDE_PATH}>)

View File

@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ENABLE_SANITIZER) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ENABLE_SANITIZER)
# gold linker on ubuntu20.04 may fail to link binaries build with sanitizer # gold linker on ubuntu20.04 may fail to link binaries build with sanitizer
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")

View File

@ -1,6 +1,7 @@
# Copyright (C) 2018-2022 Intel Corporation # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
if (ENABLE_OV_PADDLE_FRONTEND) if (ENABLE_OV_PADDLE_FRONTEND)
add_subdirectory(paddle) add_subdirectory(paddle)
endif() endif()

View File

@ -9,7 +9,8 @@ list(FILTER SRC EXCLUDE REGEX standalone_build)
add_executable(${TARGET_NAME} ${SRC}) add_executable(${TARGET_NAME} ${SRC})
target_link_libraries(${TARGET_NAME} PRIVATE frontend_shared_test_classes openvino_paddle_frontend openvino::runtime) target_link_libraries(${TARGET_NAME} PRIVATE cnpy frontend_shared_test_classes
openvino_paddle_frontend openvino::runtime)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -1,6 +1,7 @@
# Copyright (C) 2018-2022 Intel Corporation # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
set(TARGET_NAME "paddle_fe_standalone_build_test") set(TARGET_NAME "paddle_fe_standalone_build_test")
add_library(${TARGET_NAME} STATIC standalone_build_test.cpp) add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)

View File

@ -7,7 +7,10 @@ if(ENABLE_LTO)
endif() endif()
add_subdirectory(common) add_subdirectory(common)
if(ENABLE_TESTS)
add_subdirectory(tests) add_subdirectory(tests)
endif()
if(ENABLE_OV_ONNX_FRONTEND) if(ENABLE_OV_ONNX_FRONTEND)
add_subdirectory(onnx) add_subdirectory(onnx)

View File

@ -37,7 +37,7 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME}_obj PUBLIC OPENVINO_STATIC_LIBRARY) target_compile_definitions(${TARGET_NAME}_obj PUBLIC OPENVINO_STATIC_LIBRARY)
endif() endif()
target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::util ov_core_dev) target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::util openvino::core::dev)
set_target_properties(${TARGET_NAME}_obj PROPERTIES set_target_properties(${TARGET_NAME}_obj PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF) INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)

View File

@ -82,7 +82,6 @@ TEST(TransposeSinkingTest, PoolAdd1) {
ngraph::Shape input_shape{1, 3, 3, 1}; // NHWC (N=1, H=3, W=3, C=1) ngraph::Shape input_shape{1, 3, 3, 1}; // NHWC (N=1, H=3, W=3, C=1)
auto input_type = ngraph::element::f32; auto input_type = ngraph::element::f32;
auto output_type = ngraph::element::f32;
auto X = make_shared<Parameter>(input_type, input_shape); // NHWC auto X = make_shared<Parameter>(input_type, input_shape); // NHWC
@ -123,7 +122,6 @@ TEST(TransposeSinkingTest, PoolAdd2) {
ngraph::Shape input_shape{1, 3, 3, 1}; // NHWC (N=1, H=3, W=3, C=1) ngraph::Shape input_shape{1, 3, 3, 1}; // NHWC (N=1, H=3, W=3, C=1)
auto input_type = ngraph::element::f32; auto input_type = ngraph::element::f32;
auto output_type = ngraph::element::f32;
auto X = make_shared<Parameter>(input_type, input_shape); // NHWC auto X = make_shared<Parameter>(input_type, input_shape); // NHWC
@ -178,7 +176,6 @@ TEST(TransposeSinkingTest, PoolAdd3) {
ngraph::Shape input_shape{1, 3, 3, 1}; // NHWC (N=1, H=3, W=3, C=1) ngraph::Shape input_shape{1, 3, 3, 1}; // NHWC (N=1, H=3, W=3, C=1)
auto input_type = ngraph::element::f32; auto input_type = ngraph::element::f32;
auto output_type = ngraph::element::f32;
auto X = make_shared<Parameter>(input_type, input_shape); // NHWC auto X = make_shared<Parameter>(input_type, input_shape); // NHWC
@ -371,7 +368,6 @@ TEST(TransposeSinkingTest, MultiOutput) {
ngraph::Shape shape_nchw{1, 1, 4, 6}; ngraph::Shape shape_nchw{1, 1, 4, 6};
auto input_type = ngraph::element::f32; auto input_type = ngraph::element::f32;
auto output_type = ngraph::element::f32;
auto X = make_shared<Parameter>(input_type, shape_nchw); // NCHW auto X = make_shared<Parameter>(input_type, shape_nchw); // NCHW
@ -441,7 +437,6 @@ TEST(TransposeSinkingTest, AlexnetPattern) {
ngraph::Shape shape_nchw{1, 96, 55, 55}; ngraph::Shape shape_nchw{1, 96, 55, 55};
auto input_type = ngraph::element::f32; auto input_type = ngraph::element::f32;
auto output_type = ngraph::element::f32;
// X // X
auto X = make_shared<Parameter>(input_type, shape_nhwc); // NHWC auto X = make_shared<Parameter>(input_type, shape_nhwc); // NHWC

View File

@ -2,4 +2,6 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
add_subdirectory(frontend/shared) add_subdirectory(frontend/shared)

View File

@ -15,9 +15,17 @@ add_subdirectory(test_builtin_extensions_2)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../..) target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../..)
target_link_libraries(${TARGET_NAME} PUBLIC engines_test_util openvino::runtime target_link_libraries(${TARGET_NAME}
offline_transformations cnpy commonTestUtils ngraph_test_util openvino::util PUBLIC
nlohmann_json_schema_validator test_builtin_extensions_1 test_builtin_extensions_2) engines_test_util offline_transformations
commonTestUtils ngraph_test_util openvino::util
openvino::runtime
PRIVATE
cnpy
# TODO: replace with nlohmann_json::nlohmann_json
# but LTO fails for some reason
nlohmann_json_schema_validator
test_builtin_extensions_1 test_builtin_extensions_2)
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${TARGET_NAME}
PRIVATE PRIVATE

View File

@ -7,7 +7,7 @@
#include <common_test_utils/graph_comparator.hpp> #include <common_test_utils/graph_comparator.hpp>
#include <extension/json_config.hpp> #include <extension/json_config.hpp>
#include <extension/json_transformation.hpp> #include <extension/json_transformation.hpp>
#include <nlohmann/json-schema.hpp> #include <nlohmann/json.hpp>
#include <ostream> #include <ostream>
#include "utils.hpp" #include "utils.hpp"

View File

@ -7,7 +7,7 @@ set(TARGET_NAME "test_builtin_extensions_1")
file(GLOB LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) file(GLOB LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) file(GLOB LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
set(DEPENDENCIES nlohmann_json openvino::runtime::dev offline_transformations) set(DEPENDENCIES openvino::runtime::dev offline_transformations)
set(DEFINITIONS) set(DEFINITIONS)
if (ENABLE_OV_ONNX_FRONTEND) if (ENABLE_OV_ONNX_FRONTEND)

View File

@ -5,7 +5,6 @@
#pragma once #pragma once
#include <extension/json_transformation.hpp> #include <extension/json_transformation.hpp>
#include <nlohmann/json.hpp>
#include <openvino/frontend/node_context.hpp> #include <openvino/frontend/node_context.hpp>
class TestExtension1 : public ov::frontend::JsonTransformationExtension { class TestExtension1 : public ov::frontend::JsonTransformationExtension {

View File

@ -10,8 +10,7 @@ file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
# Create library # Create library
add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS}) add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS})
target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json openvino::runtime::dev target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev offline_transformations)
offline_transformations)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -5,7 +5,6 @@
#pragma once #pragma once
#include <extension/json_transformation.hpp> #include <extension/json_transformation.hpp>
#include <nlohmann/json.hpp>
class TestExtension1 : public ov::frontend::JsonTransformationExtension { class TestExtension1 : public ov::frontend::JsonTransformationExtension {
public: public:

View File

@ -145,7 +145,7 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE
$<TARGET_PROPERTY:${TARGET_NAME}_transformations,INTERFACE_INCLUDE_DIRECTORIES> $<TARGET_PROPERTY:${TARGET_NAME}_transformations,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:${TARGET_NAME}_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>) $<TARGET_PROPERTY:${TARGET_NAME}_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt openvino::util ov_core_dev) target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt openvino::util openvino::core::dev)
set_ie_threading_interface_for(${TARGET_NAME}_obj) set_ie_threading_interface_for(${TARGET_NAME}_obj)
if (TBBBIND_2_5_FOUND) if (TBBBIND_2_5_FOUND)
@ -183,7 +183,7 @@ if (TBBBIND_2_5_FOUND)
endif() endif()
target_include_directories(${TARGET_NAME}_s PUBLIC target_include_directories(${TARGET_NAME}_s PUBLIC
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_INCLUDE_DIRECTORIES> $<TARGET_PROPERTY:${TARGET_NAME}_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:${TARGET_NAME}_legacy,SOURCE_DIR>/src>) $<BUILD_INTERFACE:$<TARGET_PROPERTY:${TARGET_NAME}_legacy,SOURCE_DIR>/src>)

View File

@ -53,6 +53,7 @@ ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
# install # install
if(LINUX) if(LINUX)
install(FILES ${mvnc_SOURCE_DIR}/src/97-myriad-usbboot.rules install(FILES ${mvnc_SOURCE_DIR}/src/97-myriad-usbboot.rules
DESTINATION install_dependencies DESTINATION install_dependencies

View File

@ -4,7 +4,7 @@
set(TARGET_NAME subgraphsDumper) set(TARGET_NAME subgraphsDumper)
list(APPEND DEPENDENCIES list(APPEND LIBRARIES
gflags gflags
inference_engine inference_engine
funcTestUtils funcTestUtils
@ -40,7 +40,7 @@ addIeTargetTest(
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
LINK_LIBRARIES LINK_LIBRARIES
PRIVATE PRIVATE
${DEPENDENCIES} ${LIBRARIES}
DEPENDENCIES DEPENDENCIES
${DEPENDENCIES} ${DEPENDENCIES}
ADD_CPPLINT ADD_CPPLINT

View File

@ -22,20 +22,16 @@ addIeTargetTest(
) )
# try to find VA libraries # try to find VA libraries
find_package(PkgConfig QUIET) if(NOT CMAKE_CROSSCOMPILING)
find_host_package(PkgConfig QUIET)
if(PkgConfig_FOUND) if(PkgConfig_FOUND)
pkg_search_module(LIBVA QUIET libva) pkg_search_module(libva QUIET IMPORTED_TARGET libva)
endif()
endif() endif()
# TODO: pkg_search_module finds libva not in sysroot if(libva_FOUND)
if(ANDROID)
set(LIBVA_FOUND OFF CACHE BOOL "" FORCE)
endif()
if(LIBVA_FOUND)
target_compile_definitions(${TARGET_NAME} PRIVATE ENABLE_LIBVA) target_compile_definitions(${TARGET_NAME} PRIVATE ENABLE_LIBVA)
target_include_directories(${TARGET_NAME} PRIVATE ${LIBVA_INCLUDE_DIRS}) target_link_libraries(${TARGET_NAME} PRIVATE PkgConfig::libva)
target_link_libraries(${TARGET_NAME} PRIVATE ${LIBVA_LINK_LIBRARIES})
endif() endif()
if(WIN32) if(WIN32)

View File

@ -30,5 +30,3 @@ addIeTargetTest(
) )
set_ie_threading_interface_for(${TARGET_NAME}) set_ie_threading_interface_for(${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})

View File

@ -16,4 +16,5 @@ file(GLOB_RECURSE all_util_src "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURR
add_clang_format_target(ngraph_test_util_clang FOR_SOURCES ${all_util_src}) add_clang_format_target(ngraph_test_util_clang FOR_SOURCES ${all_util_src})
# developer package # developer package
openvino_developer_export_targets(COMPONENT core TARGETS ngraph_test_util)
openvino_developer_export_targets(COMPONENT tests TARGETS ngraph_test_util)

View File

@ -4,5 +4,4 @@
if(ENABLE_IR_V7_READER) if(ENABLE_IR_V7_READER)
add_subdirectory(ir_reader_v7) add_subdirectory(ir_reader_v7)
add_dependencies(ov_runtime_libraries inference_engine_ir_v7_reader)
endif() endif()

View File

@ -39,8 +39,6 @@ target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME}) ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
if(WIN32) if(WIN32)
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}) set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})
endif() endif()

View File

@ -12,7 +12,6 @@ endif()
add_subdirectory(ittapi) add_subdirectory(ittapi)
add_subdirectory(itt_collector EXCLUDE_FROM_ALL) add_subdirectory(itt_collector EXCLUDE_FROM_ALL)
add_subdirectory(zlib EXCLUDE_FROM_ALL)
add_subdirectory(cnpy EXCLUDE_FROM_ALL) add_subdirectory(cnpy EXCLUDE_FROM_ALL)
if(ENABLE_INTEL_GPU) if(ENABLE_INTEL_GPU)
add_subdirectory(ocl) add_subdirectory(ocl)
@ -22,13 +21,34 @@ add_subdirectory(xbyak EXCLUDE_FROM_ALL)
openvino_developer_export_targets(COMPONENT openvino_common TARGETS xbyak) openvino_developer_export_targets(COMPONENT openvino_common TARGETS xbyak)
ov_install_static_lib(xbyak openvino_common) ov_install_static_lib(xbyak openvino_common)
#
# zlib
#
if(NOT CMAKE_CROSSCOMPILING)
find_host_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_search_module(zlib QUIET
IMPORTED_TARGET GLOBAL
zlib)
if(zlib_FOUND)
add_library(zlib::zlib ALIAS PkgConfig::zlib)
message(STATUS "zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}")
endif()
endif()
endif()
if(NOT zlib_FOUND)
add_subdirectory(zlib EXCLUDE_FROM_ALL)
endif()
# #
# Pugixml # Pugixml
# #
if(ENABLE_SYSTEM_PUGIXML) if(ENABLE_SYSTEM_PUGIXML)
find_package(PugiXML REQUIRED) find_package(PugiXML REQUIRED)
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE) set_target_properties(pugixml PROPERTIES IMPORTED_GLOBAL ON)
add_library(pugixml::static ALIAS pugixml) add_library(pugixml::static ALIAS pugixml)
else() else()
function(ie_build_pugixml) function(ie_build_pugixml)
@ -64,8 +84,14 @@ ov_install_static_lib(fluid openvino_common)
# Gflags # Gflags
# #
find_package(gflags QUIET COMPONENTS nothreads_shared)
if(gflags_FOUND)
set_target_properties(gflags PROPERTIES IMPORTED_GLOBAL ON)
message(STATUS "gflags (${gflags_VERSION}) is found at ${gflags_DIR}")
else()
add_subdirectory(gflags EXCLUDE_FROM_ALL) add_subdirectory(gflags EXCLUDE_FROM_ALL)
openvino_developer_export_targets(COMPONENT openvino_common TARGETS gflags) openvino_developer_export_targets(COMPONENT openvino_common TARGETS gflags)
endif()
# #
# Google Tests framework # Google Tests framework
@ -145,6 +171,16 @@ ov_install_static_lib(nlohmann_json_schema_validator openvino_common)
# Install # Install
# #
if(CPACK_GENERATOR STREQUAL "DEB")
# These libraries are dependencies for openvino-samples-2022.1 package
if(NOT gflags_FOUND)
message(FATAL_ERROR "gflags must be used as a debian package. Install libflags-dev")
endif()
if(NOT zlib_FOUND)
message(FATAL_ERROR "zlib must be used as a debian package. Install zlib1g-dev")
endif()
else()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gflags install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gflags
DESTINATION "samples/cpp/thirdparty" DESTINATION "samples/cpp/thirdparty"
COMPONENT cpp_samples COMPONENT cpp_samples
@ -155,12 +191,13 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/zlib
COMPONENT cpp_samples COMPONENT cpp_samples
USE_SOURCE_PERMISSIONS) USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cnpy
DESTINATION "samples/cpp/thirdparty"
COMPONENT cpp_samples
USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/json install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/json
DESTINATION "samples/cpp/thirdparty" DESTINATION "samples/cpp/thirdparty"
COMPONENT cpp_samples COMPONENT cpp_samples
USE_SOURCE_PERMISSIONS) USE_SOURCE_PERMISSIONS)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cnpy
DESTINATION "samples/cpp/thirdparty"
COMPONENT cpp_samples
USE_SOURCE_PERMISSIONS)

View File

@ -13,7 +13,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
PRIVATE -Wno-all) PRIVATE -Wno-all)
endif() endif()
target_link_libraries(${TARGET_NAME} PUBLIC zlib) target_link_libraries(${TARGET_NAME} PUBLIC zlib::zlib)
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER thirdparty) set_target_properties(${TARGET_NAME} PROPERTIES FOLDER thirdparty)

View File

@ -49,6 +49,7 @@ set(lib_hdrs
set(lib_ext_hdrs "zlib/zlib.h" "zlib/zconf.h") set(lib_ext_hdrs "zlib/zlib.h" "zlib/zconf.h")
add_library(${TARGET_NAME} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs}) add_library(${TARGET_NAME} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
add_library(${TARGET_NAME}::${TARGET_NAME} ALIAS ${TARGET_NAME})
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/zlib") target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/zlib")

View File

@ -27,11 +27,12 @@ if (CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(${TARGET_NAME} PRIVATE -Wall) target_compile_options(${TARGET_NAME} PRIVATE -Wall)
endif() endif()
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime format_reader gflags)
find_package(OpenCV COMPONENTS core QUIET) find_package(OpenCV COMPONENTS core QUIET)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR") message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR")
target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json_schema_validator openvino::runtime format_reader gflags)
else() else()
target_compile_definitions(${TARGET_NAME} PRIVATE USE_OPENCV) target_compile_definitions(${TARGET_NAME} PRIVATE USE_OPENCV)
target_link_libraries(${TARGET_NAME} PRIVATE opencv_core openvino::runtime format_reader gflags) target_link_libraries(${TARGET_NAME} PRIVATE opencv_core)
endif() endif()