diff --git a/cmake/developer_package/IEDevScriptsConfig.cmake b/cmake/developer_package/IEDevScriptsConfig.cmake index 7f363e04a4b..363f67d939a 100644 --- a/cmake/developer_package/IEDevScriptsConfig.cmake +++ b/cmake/developer_package/IEDevScriptsConfig.cmake @@ -176,7 +176,7 @@ ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FO ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}) ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}) -if(CPACK_GENERATOR STREQUAL "DEB") +if(CPACK_GENERATOR MATCHES "^(DEB|RPM)$") # to make sure that lib/ is created on Debian set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Cmake install prefix" FORCE) endif() diff --git a/cmake/developer_package/clang_format/clang_format.cmake b/cmake/developer_package/clang_format/clang_format.cmake index eb05ba92b4f..e441a92cbfa 100644 --- a/cmake/developer_package/clang_format/clang_format.cmake +++ b/cmake/developer_package/clang_format/clang_format.cmake @@ -7,13 +7,13 @@ if(ENABLE_CLANG_FORMAT) find_host_program(CLANG_FORMAT NAMES ${CLANG_FORMAT_FILENAME} PATHS ENV PATH) if(CLANG_FORMAT) execute_process(COMMAND ${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION) - if(NOT CLANG_VERSION OR CLANG_VERSION STREQUAL "") + if(NOT CLANG_VERSION) message(WARNING "Supported clang-format version is 9!") set(ENABLE_CLANG_FORMAT OFF) else() string(REGEX REPLACE "[^0-9]+([0-9]+)\\..*" "\\1" CLANG_FORMAT_MAJOR_VERSION ${CLANG_VERSION}) - if(NOT ${CLANG_FORMAT_MAJOR_VERSION} EQUAL "9") - message(WARNING "Supported clang-format version is 9!") + if(NOT CLANG_FORMAT_MAJOR_VERSION EQUAL 9) + message(WARNING "Supported clang-format version is 9! Provided version ${CLANG_FORMAT_MAJOR_VERSION}") set(ENABLE_CLANG_FORMAT OFF) endif() endif() diff --git a/cmake/developer_package/features.cmake b/cmake/developer_package/features.cmake index 83e21d68d73..d3247b71599 100644 --- a/cmake/developer_package/features.cmake +++ b/cmake/developer_package/features.cmake @@ -47,8 +47,6 @@ ie_dependent_option (ENABLE_AVX2 "Enable AVX2 optimizations" ON "X86_64 OR X86" ie_dependent_option (ENABLE_AVX512F "Enable AVX512 optimizations" ON "X86_64 OR X86" OFF) -# Type of build, we add this as an explicit option to default it to ON -# FIXME: Ah this moment setting this to OFF will only build ngraph a static library ie_option (BUILD_SHARED_LIBS "Build as a shared library" ON) # Android does not support SOVERSION diff --git a/cmake/developer_package/packaging/common-libraries.cmake b/cmake/developer_package/packaging/common-libraries.cmake new file mode 100644 index 00000000000..96ef7c70651 --- /dev/null +++ b/cmake/developer_package/packaging/common-libraries.cmake @@ -0,0 +1,71 @@ +# Copyright (C) 2018-2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +include(GNUInstallDirs) + +# +# ov_common_libraries_cpack_set_dirs() +# +# Set directories for cpack +# +macro(ov_common_libraries_cpack_set_dirs) + # override default locations for common libraries + set(OV_CPACK_TOOLSDIR ${CMAKE_INSTALL_BINDIR}) # only C++ tools are here + set(OV_CPACK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) + set(OV_CPACK_LIBRARYDIR ${CMAKE_INSTALL_LIBDIR}) + set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR}) + set(OV_WHEEL_RUNTIMEDIR ${OV_CPACK_RUNTIMEDIR}) + set(OV_CPACK_ARCHIVEDIR ${CMAKE_INSTALL_LIBDIR}) + set(OV_CPACK_PLUGINSDIR ${CMAKE_INSTALL_LIBDIR}) + set(OV_CPACK_IE_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/inferenceengine${OpenVINO_VERSION}) + set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION}) + set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION}) + set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION}) + + ov_get_pyversion(pyversion) + if(pyversion) + set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages) + endif() + + # non-native stuff + set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino) # internal + set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples) + set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR}) + unset(OV_CPACK_SHAREDIR) + + # skipped during common libraries packaging + set(OV_CPACK_WHEELSDIR "tools") + + # for BW compatibility + set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR}) + set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR}) + set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR}) +endmacro() + +ov_common_libraries_cpack_set_dirs() + +# +# Override CPack components name for common libraries generator +# This is needed to change the granularity, i.e. merge several components +# into a single one +# + +macro(ov_override_component_names) + # merge C++ and C runtimes + set(OV_CPACK_COMP_CORE_C "${OV_CPACK_COMP_CORE}") + set(OV_CPACK_COMP_CORE_C_DEV "${OV_CPACK_COMP_CORE_DEV}") + # merge all pythons into a single component + set(OV_CPACK_COMP_PYTHON_OPENVINO "pyopenvino") + set(OV_CPACK_COMP_PYTHON_IE_API "${OV_CPACK_COMP_PYTHON_OPENVINO}") + set(OV_CPACK_COMP_PYTHON_NGRAPH "${OV_CPACK_COMP_PYTHON_OPENVINO}") + # merge all C / C++ samples as a single samples component + set(OV_CPACK_COMP_CPP_SAMPLES "samples") + set(OV_CPACK_COMP_C_SAMPLES "${OV_CPACK_COMP_CPP_SAMPLES}") + # move requirements.txt to core-dev + set(OV_CPACK_COMP_DEV_REQ_FILES "${OV_CPACK_COMP_CORE_DEV}") + # move core_tools to core-dev + set(OV_CPACK_COMP_CORE_TOOLS "${OV_CPACK_COMP_CORE_DEV}") +endmacro() + +ov_override_component_names() diff --git a/cmake/developer_package/packaging/debian.cmake b/cmake/developer_package/packaging/debian.cmake index 3d1b0e768dc..1d2d6b57db3 100644 --- a/cmake/developer_package/packaging/debian.cmake +++ b/cmake/developer_package/packaging/debian.cmake @@ -23,8 +23,12 @@ macro(ov_debian_cpack_set_dirs) set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION}) set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION}) + ov_get_pyversion(pyversion) + if(pyversion) + set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages) + endif() + # non-native stuff - set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR}) set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino) # internal set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples) set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR}) diff --git a/cmake/developer_package/packaging/packaging.cmake b/cmake/developer_package/packaging/packaging.cmake index 64527337b22..ae208263bc8 100644 --- a/cmake/developer_package/packaging/packaging.cmake +++ b/cmake/developer_package/packaging/packaging.cmake @@ -4,6 +4,18 @@ include(CPackComponent) +# +# ov_get_pyversion() +# +function(ov_get_pyversion pyversion) + find_package(PythonInterp 3 QUIET) + if(PYTHONINTERP_FOUND) + set(${pyversion} "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" PARENT_SCOPE) + else() + set(${pyversion} "NOT-FOUND" PARENT_SCOPE) + endif() +endfunction() + # # ov_cpack_set_dirs() # @@ -18,11 +30,15 @@ macro(ov_cpack_set_dirs) set(OV_CPACK_OPENVINO_CMAKEDIR runtime/cmake) set(OV_CPACK_DOCDIR docs) set(OV_CPACK_SAMPLESDIR samples) - set(OV_CPACK_PYTHONDIR python) set(OV_CPACK_WHEELSDIR tools) set(OV_CPACK_TOOLSDIR tools) set(OV_CPACK_DEVREQDIR tools) + ov_get_pyversion(pyversion) + if(pyversion) + set(OV_CPACK_PYTHONDIR python/${pyversion}) + endif() + if(WIN32) set(OV_CPACK_LIBRARYDIR runtime/lib/${ARCH_FOLDER}/$) set(OV_CPACK_RUNTIMEDIR runtime/bin/${ARCH_FOLDER}/$) @@ -118,14 +134,12 @@ ov_define_component_names() # - ov_add_latest_component() if(CPACK_GENERATOR STREQUAL "DEB") include(packaging/debian) -endif() - -if(CPACK_GENERATOR STREQUAL "RPM") +elseif(CPACK_GENERATOR STREQUAL "RPM") include(packaging/rpm) -endif() - -if(CPACK_GENERATOR STREQUAL "NSIS") +elseif(CPACK_GENERATOR STREQUAL "NSIS") include(packaging/nsis) +elseif(CPACK_GENERATOR MATCHES "^(CONDA-FORGE|BREW)$") + include(packaging/common-libraries) endif() macro(ie_cpack) @@ -180,14 +194,6 @@ macro(ie_cpack) set(CPACK_SYSTEM_NAME "${OS_FOLDER}") endif() - # generator specific variables - if(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|ZIP)$") - # New in version 3.18 - set(CPACK_ARCHIVE_THREADS 8) - # multiple packages are generated - set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) - endif() - # include GENERATOR dedicated per-component configuration file # NOTE: private modules need to define ov_cpack_settings macro # for custom packages configuration @@ -195,5 +201,13 @@ macro(ie_cpack) ov_cpack_settings() endif() + # generator specific variables + if(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|ZIP)$") + # New in version 3.18 + set(CPACK_ARCHIVE_THREADS 8) + # multiple packages are generated + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) + endif() + include(CPack) endmacro() diff --git a/cmake/developer_package/packaging/rpm.cmake b/cmake/developer_package/packaging/rpm.cmake index d9d5307b3ba..9ac25e12da5 100644 --- a/cmake/developer_package/packaging/rpm.cmake +++ b/cmake/developer_package/packaging/rpm.cmake @@ -23,8 +23,12 @@ macro(ov_rpm_cpack_set_dirs) set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION}) set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION}) + ov_get_pyversion(pyversion) + if(pyversion) + set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages) + endif() + # non-native stuff - set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR}) set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino-${OpenVINO_VERSION}) # internal set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples) set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR}) diff --git a/cmake/features.cmake b/cmake/features.cmake index dd6fb4c8a3b..a6f9e4c5999 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -175,7 +175,7 @@ ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Use system protobuf" OFF ie_dependent_option(ENABLE_OV_CORE_UNIT_TESTS "Enables OpenVINO core unit tests" ON "ENABLE_TESTS" OFF) ie_option(ENABLE_OPENVINO_DEBUG "Enable output for OPENVINO_DEBUG statements" OFF) -ie_option(ENABLE_REQUIREMENTS_INSTALL "Dynamic dependencies install" ON) +ie_dependent_option(ENABLE_REQUIREMENTS_INSTALL "Dynamic dependencies install" ON "ENABLE_TESTS" OFF) if(NOT BUILD_SHARED_LIBS AND ENABLE_OV_TF_FRONTEND) set(FORCE_FRONTENDS_USE_PROTOBUF ON) diff --git a/cmake/packaging/common-libraries.cmake b/cmake/packaging/common-libraries.cmake new file mode 100644 index 00000000000..efa5436c4b6 --- /dev/null +++ b/cmake/packaging/common-libraries.cmake @@ -0,0 +1,40 @@ +# Copyright (C) 2018-2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +# +# OpenVINO Core components including frontends, plugins, etc +# +macro(ov_cpack_settings) + # fill a list of components which are part of conda + 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 conda-forge + if(# python wheels are not needed to be wrapped by conda | brew packages + NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND + # skip C / C++ / Python samples + NOT item STREQUAL OV_CPACK_COMP_CPP_SAMPLES AND + NOT item STREQUAL OV_CPACK_COMP_C_SAMPLES AND + NOT item STREQUAL OV_CPACK_COMP_PYTHON_SAMPLES AND + # even for case of system TBB we have installation rules for wheels packages + # so, need to skip this explicitly since they are installed in `host` section + NOT item MATCHES "^tbb(_dev)?$" AND + # the same for pugixml + NOT item STREQUAL "pugixml" AND + # TF component is not released + NOT item STREQUAL "tensorflow" AND + # we have `license_file` field in conda meta.yml + NOT item STREQUAL OV_CPACK_COMP_LICENSING AND + # not appropriate components + NOT item STREQUAL OV_CPACK_COMP_DEPLOYMENT_MANAGER AND + NOT item STREQUAL OV_CPACK_COMP_INSTALL_DEPENDENCIES AND + NOT item STREQUAL OV_CPACK_COMP_SETUPVARS) + list(APPEND CPACK_COMPONENTS_ALL ${item}) + endif() + endforeach() + list(REMOVE_DUPLICATES CPACK_COMPONENTS_ALL) + + # override generator + set(CPACK_GENERATOR "TGZ") +endmacro() diff --git a/cmake/packaging/packaging.cmake b/cmake/packaging/packaging.cmake index 84c20682ff8..33b0f7a71e9 100644 --- a/cmake/packaging/packaging.cmake +++ b/cmake/packaging/packaging.cmake @@ -3,9 +3,11 @@ # if(CPACK_GENERATOR STREQUAL "DEB") - include(cmake/packaging/debian.cmake) + include(cmake/packaging/debian.cmake) elseif(CPACK_GENERATOR STREQUAL "RPM") - include(cmake/packaging/rpm.cmake) + include(cmake/packaging/rpm.cmake) +elseif(CPACK_GENERATOR MATCHES "^(CONDA-FORGE|BREW)$") + include(cmake/packaging/common-libraries.cmake) elseif(CPACK_GENERATOR STREQUAL "NSIS") - include(cmake/packaging/nsis.cmake) + include(cmake/packaging/nsis.cmake) endif() diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 69849d74246..073ff29d77f 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -82,12 +82,6 @@ if(ARM AND NOT CMAKE_CROSSCOMPILING) add_compile_options(-march=armv7-a) endif() -if(NOT COMMAND find_host_package) - macro(find_host_package) - find_package(${ARGN}) - endmacro() -endif() - set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_CXX_VISIBILITY_PRESET hidden) @@ -104,18 +98,29 @@ endif() #################################### if(NOT TARGET gflags) - if(NOT APPLE AND NOT DEFINED ENV{CONDA_PREFIX}) - # - conda-forge contains only dynamic libraries - # - on Apple only dynamic libraries are available - # also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU + if(APPLE OR DEFINED ENV{CONDA_PREFIX} OR DEFINED ENV{HOMEBREW_PREFIX}) + # conda-forge and brew contains only shared version of gflags + find_package(gflags QUIET COMPONENTS nothreads_shared) + else() find_package(gflags QUIET COMPONENTS nothreads_static) endif() if(gflags_FOUND) + if(NOT TARGET ${GFLAGS_TARGET}) + if(TARGET gflags_nothreads-static) + # arm cross-compilation + set(GFLAGS_TARGET gflags_nothreads-static) + else() + message(FATAL_ERROR "Failed to set GFLAGS_TARGET target") + endif() + endif() 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) + set(GFLAGS_TARGET gflags_nothreads_static) endif() +else() + set(GFLAGS_TARGET gflags) endif() if(NOT ANDROID) @@ -255,7 +260,7 @@ macro(ie_add_sample) target_link_libraries(${IE_SAMPLE_NAME} PRIVATE ${ov_link_libraries} Threads::Threads ${IE_SAMPLE_DEPENDENCIES}) if(NOT c_sample) - target_link_libraries(${IE_SAMPLE_NAME} PRIVATE gflags) + target_link_libraries(${IE_SAMPLE_NAME} PRIVATE ${GFLAGS_TARGET}) endif() install(TARGETS ${IE_SAMPLE_NAME} diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index b231c38c1c3..1105b8350e4 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -36,15 +36,23 @@ function(ov_check_python_build_conditions) find_host_package(PythonInterp 3 ${find_package_mode}) if(PYTHONINTERP_FOUND) function(_ov_find_python_libs_new) - set(PYBIND11_PYTHON_VERSION ${PYTHON_VERSION_STRING}) - list(APPEND CMAKE_MODULE_PATH "${OpenVINOPython_SOURCE_DIR}/thirdparty/pybind11/tools") + set(pybind11_tools_dir "${OpenVINOPython_SOURCE_DIR}/thirdparty/pybind11/tools") + if(EXISTS ${pybind11_tools_dir}) + list(APPEND CMAKE_MODULE_PATH ${pybind11_tools_dir}) + else() + find_package(pybind11 QUIET) + list(APPEND CMAKE_MODULE_PATH "${pybind11_DIR}") + endif() # use libraries with the same version as python itself + set(PYBIND11_PYTHON_VERSION ${PYTHON_VERSION_STRING}) find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} EXACT ${find_package_mode}) set(PYTHONLIBSNEW_FOUND ${PYTHONLIBS_FOUND} PARENT_SCOPE) endfunction() # try to find python libraries _ov_find_python_libs_new() if(PYTHONLIBSNEW_FOUND) + # clear Python_ADDITIONAL_VERSIONS to find only python library matching PYTHON_EXECUTABLE + unset(Python_ADDITIONAL_VERSIONS CACHE) find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT ${find_package_mode}) endif() if(NOT PYTHONLIBS_FOUND) @@ -147,7 +155,12 @@ ie_dependent_option(ENABLE_WHEEL "Build wheel packages for PyPI" ${ENABLE_WHEEL_ # Build the code # -add_subdirectory(thirdparty/pybind11 EXCLUDE_FROM_ALL) +find_package(pybind11 QUIET) + +if(NOT pybind11_FOUND) + add_subdirectory(thirdparty/pybind11 EXCLUDE_FROM_ALL) +endif() + add_subdirectory(src/compatibility/pyngraph) add_subdirectory(src/pyopenvino) diff --git a/src/bindings/python/src/compatibility/openvino/CMakeLists.txt b/src/bindings/python/src/compatibility/openvino/CMakeLists.txt index e3ef07f0cb8..031fabd0d2a 100644 --- a/src/bindings/python/src/compatibility/openvino/CMakeLists.txt +++ b/src/bindings/python/src/compatibility/openvino/CMakeLists.txt @@ -14,8 +14,6 @@ endif() option(ENABLE_CONDA_FOLDER "Create output folder with conda python bindings" OFF) -set(PYTHON_BRIDGE_CPACK_PATH "${OV_CPACK_PYTHONDIR}") - if(UNIX) # cython generated files requires public visibility. Force visibility required. set(CMAKE_CXX_VISIBILITY_PRESET default) @@ -68,5 +66,5 @@ endif() ie_cpack_add_component(${PYTHON_COMPONENT} HIDDEN) install(FILES requirements.txt - DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion} + DESTINATION ${OV_CPACK_PYTHONDIR} COMPONENT ${PYTHON_COMPONENT}) diff --git a/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake b/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake index 993abe50212..9157cc9b7ee 100644 --- a/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake +++ b/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake @@ -36,7 +36,7 @@ if( PYTHONINTERP_FOUND ) file(TO_CMAKE_PATH "$ENV{HOME}" ENV_HOME) find_host_program( CYTHON_EXECUTABLE NAMES cython cython.bat cython3 - HINTS ${_python_path} ${ENV_HOME}/.local/bin + HINTS ${_python_path} ${ENV_HOME}/.local/bin $ENV{HOMEBREW_OPT}/cython/bin ) else() find_host_program( CYTHON_EXECUTABLE diff --git a/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake b/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake index 76aee4022cc..6c715e7e5f5 100644 --- a/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake +++ b/src/bindings/python/src/compatibility/openvino/cmake/UseCython.cmake @@ -90,7 +90,6 @@ find_package( Cython REQUIRED NO_DEFAULT_PATH ) find_package(PythonInterp 3 REQUIRED) -find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT REQUIRED) set( CYTHON_CXX_EXTENSION "cxx" ) set( CYTHON_C_EXTENSION "c" ) @@ -285,11 +284,11 @@ function( cython_add_module _name ) endif() endforeach() compile_pyx( ${_name} generated_file ${pyx_module_sources} ) - include_directories( ${PYTHON_INCLUDE_DIRS} ) python_add_module ( ${_name} ${generated_file} ${other_module_sources} ) + target_include_directories( ${_name} PRIVATE ${PYTHON_INCLUDE_DIRS} ) if(PYTHON_MODULE_EXTENSION) set_target_properties(${_name} PROPERTIES PREFIX "" SUFFIX "${PYTHON_MODULE_EXTENSION}") - elseif(NOT CMAKE_CROSSCOMPILING) + else() message(FATAL_ERROR "Internal error: PYTHON_MODULE_EXTENSION is not defined") endif() if( APPLE ) diff --git a/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt b/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt index fea5e5070e4..63f922e6fa4 100644 --- a/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt +++ b/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt @@ -74,13 +74,13 @@ add_custom_command(TARGET ${TARGET_NAME} # install install(TARGETS ${INSTALLED_TARGETS} - RUNTIME DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}/openvino/inference_engine + RUNTIME DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/inference_engine COMPONENT ${PYTHON_COMPONENT} - LIBRARY DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}/openvino/inference_engine + LIBRARY DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/inference_engine COMPONENT ${PYTHON_COMPONENT}) install(PROGRAMS __init__.py - DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}/openvino/inference_engine + DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/inference_engine COMPONENT ${PYTHON_COMPONENT}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME} diff --git a/src/bindings/python/src/compatibility/pyngraph/CMakeLists.txt b/src/bindings/python/src/compatibility/pyngraph/CMakeLists.txt index 9ea595a7fb8..19c92c0f15d 100644 --- a/src/bindings/python/src/compatibility/pyngraph/CMakeLists.txt +++ b/src/bindings/python/src/compatibility/pyngraph/CMakeLists.txt @@ -77,11 +77,11 @@ if(OpenVINO_SOURCE_DIR OR InferenceEngineDeveloperPackage_FOUND) ie_cpack_add_component(${OV_CPACK_COMP_PYTHON_NGRAPH}_${pyversion} HIDDEN) install(TARGETS _${PROJECT_NAME} - DESTINATION ${OV_CPACK_PYTHONDIR}/${pyversion} + DESTINATION ${OV_CPACK_PYTHONDIR} COMPONENT ${OV_CPACK_COMP_PYTHON_NGRAPH}_${pyversion}) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../ngraph - DESTINATION ${OV_CPACK_PYTHONDIR}/${pyversion} + DESTINATION ${OV_CPACK_PYTHONDIR} COMPONENT ${OV_CPACK_COMP_PYTHON_NGRAPH}_${pyversion} USE_SOURCE_PERMISSIONS) diff --git a/src/bindings/python/src/pyopenvino/CMakeLists.txt b/src/bindings/python/src/pyopenvino/CMakeLists.txt index 3cf99d789a1..6ad2536b0ab 100644 --- a/src/bindings/python/src/pyopenvino/CMakeLists.txt +++ b/src/bindings/python/src/pyopenvino/CMakeLists.txt @@ -97,13 +97,13 @@ if(OpenVINO_SOURCE_DIR OR InferenceEngineDeveloperPackage_FOUND) HIDDEN) install(DIRECTORY ${OpenVINOPython_SOURCE_DIR}/src/openvino - DESTINATION ${OV_CPACK_PYTHONDIR}/${pyversion} + DESTINATION ${OV_CPACK_PYTHONDIR} COMPONENT ${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion} USE_SOURCE_PERMISSIONS PATTERN "test_utils" EXCLUDE) install(TARGETS ${PROJECT_NAME} - DESTINATION ${OV_CPACK_PYTHONDIR}/${pyversion}/openvino + DESTINATION ${OV_CPACK_PYTHONDIR}/openvino COMPONENT ${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion}) install(DIRECTORY ${OpenVINOPython_SOURCE_DIR}/tests diff --git a/src/bindings/python/src/pyopenvino/frontend/frontend_module.cmake b/src/bindings/python/src/pyopenvino/frontend/frontend_module.cmake index ed656c4a420..e6154b96b66 100644 --- a/src/bindings/python/src/pyopenvino/frontend/frontend_module.cmake +++ b/src/bindings/python/src/pyopenvino/frontend/frontend_module.cmake @@ -13,7 +13,6 @@ function(frontend_module TARGET FRAMEWORK INSTALL_COMPONENT) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/frontend/${FRAMEWORK}) set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/frontend/${FRAMEWORK}) set(CMAKE_PDB_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/frontend/${FRAMEWORK}) - set(PYTHON_BRIDGE_CPACK_PATH "${OV_CPACK_PYTHONDIR}") file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) @@ -41,6 +40,6 @@ function(frontend_module TARGET FRAMEWORK INSTALL_COMPONENT) ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/__init__.py) install(TARGETS ${TARGET_NAME} - DESTINATION ${OV_CPACK_PYTHONDIR}/${pyversion}/openvino/frontend/${FRAMEWORK} + DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/frontend/${FRAMEWORK} COMPONENT ${INSTALL_COMPONENT}) endfunction() diff --git a/src/bindings/python/src/pyopenvino/test_utils/CMakeLists.txt b/src/bindings/python/src/pyopenvino/test_utils/CMakeLists.txt index 7997d4999a3..e6f5aa9b7c5 100644 --- a/src/bindings/python/src/pyopenvino/test_utils/CMakeLists.txt +++ b/src/bindings/python/src/pyopenvino/test_utils/CMakeLists.txt @@ -8,7 +8,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/test_utils) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/test_utils) set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/test_utils) set(CMAKE_PDB_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/test_utils) -set(PYTHON_BRIDGE_CPACK_PATH "${OV_CPACK_PYTHONDIR}") file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/test_utils.cpp) @@ -49,12 +48,12 @@ add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME} # install install(TARGETS ${TARGET_NAME} - RUNTIME DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}/openvino/test_utils + RUNTIME DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/test_utils COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}/openvino/test_utils + LIBRARY DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/test_utils COMPONENT tests EXCLUDE_FROM_ALL) install(PROGRAMS ${OpenVINOPython_SOURCE_DIR}/src/openvino/test_utils/__init__.py - DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}/openvino/test_utils + DESTINATION ${OV_CPACK_PYTHONDIR}/openvino/test_utils COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/src/bindings/python/wheel/CMakeLists.txt b/src/bindings/python/wheel/CMakeLists.txt index 9dc68552aa3..68484456f8e 100644 --- a/src/bindings/python/wheel/CMakeLists.txt +++ b/src/bindings/python/wheel/CMakeLists.txt @@ -10,8 +10,7 @@ set(pyversion python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) set(WHEEL_VERSION "${OpenVINO_VERSION}" CACHE STRING "Version of this release" FORCE) set(WHEEL_BUILD "${OpenVINO_VERSION_BUILD}" CACHE STRING "Build number of this release" FORCE) -set(PYTHON_BRIDGE_CPACK_PATH "${OV_CPACK_PYTHONDIR}") -set(PY_PACKAGES_DIR ${PYTHON_BRIDGE_CPACK_PATH}/${pyversion}) +set(PY_PACKAGES_DIR ${OV_CPACK_PYTHONDIR}) set(TBB_LIBS_DIR runtime/3rdparty/tbb/lib) if(WIN32) set(TBB_LIBS_DIR runtime/3rdparty/tbb/bin) diff --git a/src/cmake/ie_parallel.cmake b/src/cmake/ie_parallel.cmake index e426dbac819..e480365fdac 100644 --- a/src/cmake/ie_parallel.cmake +++ b/src/cmake/ie_parallel.cmake @@ -98,8 +98,8 @@ macro(ov_find_package_tbb) else() _ov_pkg_config_tbb_unset() - if(CPACK_GENERATOR STREQUAL "DEB") - # debian cpack generator requires system TBB + if(CPACK_GENERATOR STREQUAL "^(DEB|RPM|CONDA-FORGE|BREW)$") + # package managers require system TBB set(message_type FATAL_ERROR) else() set(message_type WARNING) diff --git a/src/cmake/install_tbb.cmake b/src/cmake/install_tbb.cmake index f5ad585f499..69f6cbd8b7c 100644 --- a/src/cmake/install_tbb.cmake +++ b/src/cmake/install_tbb.cmake @@ -7,7 +7,7 @@ include(cmake/ie_parallel.cmake) # pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation ov_find_package_tbb() -# check whether TBB has TBBBind 2.5 with hwloc 2.5 or higher which is required +# check whether TBB has TBBBind 2.5+ with hwloc 2.5+ or higher which is required # to detect hybrid cores function(_ov_detect_dynamic_tbbbind_2_5 var) if(NOT TBB_FOUND) @@ -24,8 +24,9 @@ function(_ov_detect_dynamic_tbbbind_2_5 var) find_library(_ov_tbbbind_2_5 NAMES tbbbind_2_5 HINTS "${_tbb_libs_dir}" - "Path to TBBBind 2.5 library" - NO_DEFAULT_PATH) + "Path to TBBBind 2.5+ library" + NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH) if(_ov_tbbbind_2_5) set(${var} ON PARENT_SCOPE) @@ -35,7 +36,7 @@ endfunction() _ov_detect_dynamic_tbbbind_2_5(_ov_dynamic_tbbbind_2_5_found) if(_ov_dynamic_tbbbind_2_5_found) - message(STATUS "Static tbbbind_2_5 package usage is disabled, since oneTBB (ver. ${TBB_VERSION}) provides dynamic TBBBind 2.5") + message(STATUS "Static tbbbind_2_5 package usage is disabled, since oneTBB (ver. ${TBB_VERSION}) provides dynamic TBBBind 2.5+") set(ENABLE_TBBBIND_2_5 OFF) elseif(ENABLE_TBBBIND_2_5) # TMP: for Apple Silicon TBB does not provide TBBBind @@ -92,8 +93,8 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND set(tbb_custom ON) endif() - if(CPACK_GENERATOR STREQUAL "DEB" AND NOT ENABLE_SYSTEM_TBB) - message(FATAL_ERROR "Debian packages can be built only with system TBB. Use -DENABLE_SYSTEM_TBB=ON") + if(CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$" AND NOT ENABLE_SYSTEM_TBB) + message(FATAL_ERROR "Debian | RPM | Conda-forge | Brew packages can be built only with system TBB. Use -DENABLE_SYSTEM_TBB=ON") endif() if(ENABLE_SYSTEM_TBB) diff --git a/src/common/itt/CMakeLists.txt b/src/common/itt/CMakeLists.txt index 4008a846d29..04f6cb31d72 100644 --- a/src/common/itt/CMakeLists.txt +++ b/src/common/itt/CMakeLists.txt @@ -26,7 +26,7 @@ if(TARGET ittnotify) endif() endif() -if (CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_COMPILER_IS_GNUCXX) target_compile_options(${TARGET_NAME} PRIVATE -Wall) endif() diff --git a/src/common/offline_transformations/CMakeLists.txt b/src/common/offline_transformations/CMakeLists.txt index e74c40edee8..aec7f320d30 100644 --- a/src/common/offline_transformations/CMakeLists.txt +++ b/src/common/offline_transformations/CMakeLists.txt @@ -22,7 +22,7 @@ add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS}) target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev openvino::itt openvino::pugixml ngraph::reference openvino::runtime nlohmann_json_schema_validator) -set_source_files_properties(src/json_config.json_config.cpp INCLUDE_DIRECTORIES +set_source_files_properties(src/json_extension/json_config.cpp INCLUDE_DIRECTORIES $) set_source_files_properties(src/generate_mapping_file.cpp INCLUDE_DIRECTORIES $) diff --git a/src/common/preprocessing/CMakeLists.txt b/src/common/preprocessing/CMakeLists.txt index 036878d3d80..45edb045203 100644 --- a/src/common/preprocessing/CMakeLists.txt +++ b/src/common/preprocessing/CMakeLists.txt @@ -93,35 +93,38 @@ endif() # Create object library -add_library(${TARGET_NAME}_obj OBJECT - ${LIBRARY_SRC} - ${LIBRARY_HEADERS}) +if(ENABLE_GAPI_PREPROCESSING) + add_library(${TARGET_NAME}_obj OBJECT + ${LIBRARY_SRC} + ${LIBRARY_HEADERS}) -ie_faster_build(${TARGET_NAME}_obj - UNITY -) + ie_faster_build(${TARGET_NAME}_obj UNITY) -target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN - $ - $ - $<$:ENABLE_GAPI_PREPROCESSING>) + target_compile_definitions(${TARGET_NAME}_obj PRIVATE + IMPLEMENT_INFERENCE_ENGINE_PLUGIN + $ + $ + ENABLE_GAPI_PREPROCESSING) -target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE $ - $ - $) + target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE + $ + $ + $) -target_include_directories(${TARGET_NAME}_obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" - $ - $) + target_include_directories(${TARGET_NAME}_obj PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}" + $ + $) -set_ie_threading_interface_for(${TARGET_NAME}_obj) + set_ie_threading_interface_for(${TARGET_NAME}_obj) -add_cpplint_target(${TARGET_NAME}_obj_cpplint FOR_TARGETS ${TARGET_NAME}_obj) + add_cpplint_target(${TARGET_NAME}_obj_cpplint FOR_TARGETS ${TARGET_NAME}_obj) + + set(library_sources $) +endif() # Create module library file from object library -set(library_sources $) - if(ENABLE_GAPI_PREPROCESSING) if(BUILD_SHARED_LIBS) set(library_type MODULE) @@ -130,7 +133,6 @@ if(ENABLE_GAPI_PREPROCESSING) endif() else() set(library_type INTERFACE) - unset(library_sources) endif() add_library(${TARGET_NAME} ${library_type} ${library_sources}) @@ -177,27 +179,31 @@ target_include_directories(${TARGET_NAME} INTERFACE # Static library used for unit tests which are always built -add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL - $) +if(ENABLE_GAPI_PREPROCESSING) + add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL + $) -set_ie_threading_interface_for(${TARGET_NAME}_s) + set_ie_threading_interface_for(${TARGET_NAME}_s) -target_include_directories(${TARGET_NAME}_s INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") + target_include_directories(${TARGET_NAME}_s INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") -if(WIN32) - set_target_properties(${TARGET_NAME}_s PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}_s) + if(WIN32) + set_target_properties(${TARGET_NAME}_s PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}_s) + endif() + + target_link_libraries(${TARGET_NAME}_s PRIVATE fluid openvino::itt openvino::runtime) + + target_compile_definitions(${TARGET_NAME}_s INTERFACE USE_STATIC_IE) + + set_target_properties(${TARGET_NAME}_s PROPERTIES EXCLUDE_FROM_ALL ON) endif() -target_link_libraries(${TARGET_NAME}_s PRIVATE fluid openvino::itt openvino::runtime) - -target_compile_definitions(${TARGET_NAME}_s INTERFACE USE_STATIC_IE) - -set_target_properties(${TARGET_NAME}_s PROPERTIES EXCLUDE_FROM_ALL ON) - # LTO -set_target_properties(${TARGET_NAME}_obj ${TARGET_NAME}_s - PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) +if(TARGET ${TARGET_NAME}_obj) + set_target_properties(${TARGET_NAME}_obj ${TARGET_NAME}_s + PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) +endif() if(NOT library_type STREQUAL "INTERFACE") set_target_properties(${TARGET_NAME} diff --git a/src/core/reference/include/ngraph/runtime/reference/group_convolution.hpp b/src/core/reference/include/ngraph/runtime/reference/group_convolution.hpp index 88f9ea30309..e16d126760b 100644 --- a/src/core/reference/include/ngraph/runtime/reference/group_convolution.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/group_convolution.hpp @@ -25,44 +25,7 @@ void validate_group_convolution_parameters(const Shape& in_shape, const Strides& strides, const Strides& dilations, const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end) { - // this implementation supports 1D, 2D and 3D convolutions - NGRAPH_CHECK(in_shape.size() >= 3 && in_shape.size() <= 5, "Unsupported input rank: ", in_shape); - - NGRAPH_CHECK(in_shape.size() + 1 == f_shape.size(), "Unsupported filter rank: ", f_shape.size()); - - NGRAPH_CHECK(in_shape.size() == out_shape.size(), - "Incompatible input and output ranks: ", - in_shape.size(), - " and ", - out_shape.size()); - - const size_t groups = f_shape[filter_group_axis]; - const size_t in_channels = in_shape[in_channel_axis]; - NGRAPH_CHECK(in_channels % groups == 0, "Input channels of data batch input must be multiple of groups"); - const Shape in_group_shape = [&]() { - Shape new_shape{in_shape}; - new_shape[in_channel_axis] /= groups; - return new_shape; - }(); - - const size_t out_channels = out_shape[out_channel_axis]; - NGRAPH_CHECK(out_channels % groups == 0, "Output channels of output must be multiple of groups"); - const Shape out_group_shape = [&]() { - Shape new_shape{out_shape}; - new_shape[out_channel_axis] /= groups; - return new_shape; - }(); - - const Shape f_group_shape{std::next(f_shape.begin(), 1), std::end(f_shape)}; - validate_convolution_parameters(in_group_shape, - f_group_shape, - out_group_shape, - strides, - dilations, - pads_begin, - pads_end); -} + const CoordinateDiff& pads_end); template ::type> void group_convolution(const INPUT* in, diff --git a/src/core/reference/include/ngraph/runtime/reference/group_convolution_backprop_data.hpp b/src/core/reference/include/ngraph/runtime/reference/group_convolution_backprop_data.hpp index 4a669da5822..656efa923f8 100644 --- a/src/core/reference/include/ngraph/runtime/reference/group_convolution_backprop_data.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/group_convolution_backprop_data.hpp @@ -5,25 +5,20 @@ #pragma once #include "ngraph/runtime/reference/convolution_backprop_data.hpp" +#include "ngraph/runtime/reference/group_convolution.hpp" #include "ngraph/util.hpp" namespace ngraph { namespace runtime { namespace reference { + void infer_backward_conv_output_shape(const Shape& in_spatial_shape, const Shape& f_spatial_shape, Shape& out_spatial_shape, const Strides& strides, const Strides& dilations, const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end) { - for (size_t idx = 0; idx < in_spatial_shape.size(); idx++) { - size_t in_padded_dim = (in_spatial_shape[idx] - 1) * strides[idx] - pads_begin[idx] - pads_end[idx]; - size_t filter_dilated_dim = dilations[idx] * (f_spatial_shape[idx] - 1) + 1; - size_t out_spatial_dim = in_padded_dim + filter_dilated_dim; - out_spatial_shape.push_back(out_spatial_dim); - } -} + const CoordinateDiff& pads_end); void validate_convolution_backprop_data_parameters(const Shape& in_shape, const Shape& f_shape, @@ -31,41 +26,7 @@ void validate_convolution_backprop_data_parameters(const Shape& in_shape, const Strides& strides, const Strides& dilations, const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end) { - // this implementation supports 1D, 2D and 3D convolutions - NGRAPH_CHECK(in_shape.size() >= 3 && in_shape.size() <= 5, "Unsupported input rank: ", in_shape); - NGRAPH_CHECK(in_shape.size() == f_shape.size(), - "Incompatible input ranks: ", - in_shape.size(), - " and ", - f_shape.size()); - NGRAPH_CHECK(in_shape[in_channel_axis] == f_shape[filter_in_ch_axis], - "Incompatible input channels in data batch and filters shapes: ", - in_shape[in_channel_axis], - " and ", - f_shape[filter_in_ch_axis]); - NGRAPH_CHECK(in_shape.size() == out_shape.size(), - "Incompatible input and output ranks: ", - in_shape.size(), - " and ", - out_shape.size()); - const auto spatial_dims = in_shape.size() - 2; - NGRAPH_CHECK(strides.size() == spatial_dims, "Strides not definied for all and only spatial dimensions"); - NGRAPH_CHECK(dilations.size() == spatial_dims, "Dilations not defined for all and only spatial dimensions"); - NGRAPH_CHECK((pads_begin.size() == pads_end.size()) && (pads_begin.size() == spatial_dims), - "Pads not defined for all and only spatial dimensions"); - - Shape out_spatial_shape{std::next(out_shape.begin(), 2), std::end(out_shape)}; - Shape infered_out_spatial_shape{}; - infer_backward_conv_output_shape(Shape{std::next(in_shape.begin(), 2), std::end(in_shape)}, - Shape{std::next(f_shape.begin(), 2), std::end(f_shape)}, - infered_out_spatial_shape, - strides, - dilations, - pads_begin, - pads_end); - NGRAPH_CHECK(out_spatial_shape == infered_out_spatial_shape, "Incorrect output shape provided"); -} + const CoordinateDiff& pads_end); void validate_group_convolution_backprop_data_parameters(const Shape& in_shape, const Shape& f_shape, @@ -73,44 +34,7 @@ void validate_group_convolution_backprop_data_parameters(const Shape& in_shape, const Strides& strides, const Strides& dilations, const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end) { - // this implementation supports 1D, 2D and 3D convolutions - NGRAPH_CHECK(in_shape.size() >= 3 && in_shape.size() <= 5, "Unsupported input rank: ", in_shape); - - NGRAPH_CHECK(in_shape.size() + 1 == f_shape.size(), "Unsupported filter rank: ", f_shape.size()); - - NGRAPH_CHECK(in_shape.size() == out_shape.size(), - "Incompatible input and output ranks: ", - in_shape.size(), - " and ", - out_shape.size()); - - const size_t groups = f_shape[filter_group_axis]; - const size_t in_channels = in_shape[in_channel_axis]; - NGRAPH_CHECK(in_channels % groups == 0, "Input channels of data batch input must be multiple of groups"); - const Shape in_group_shape = [&]() { - Shape new_shape{in_shape}; - new_shape[in_channel_axis] /= groups; - return new_shape; - }(); - - const size_t out_channels = out_shape[out_channel_axis]; - NGRAPH_CHECK(out_channels % groups == 0, "Output channels of output must be multiple of groups"); - const Shape out_group_shape = [&]() { - Shape new_shape{out_shape}; - new_shape[out_channel_axis] /= groups; - return new_shape; - }(); - - const Shape f_group_shape{std::next(f_shape.begin(), 1), std::end(f_shape)}; - validate_convolution_backprop_data_parameters(in_group_shape, - f_group_shape, - out_group_shape, - strides, - dilations, - pads_begin, - pads_end); -} + const CoordinateDiff& pads_end); template void group_convolution_backprop_data(const T* in, @@ -204,8 +128,7 @@ void group_convolution_backprop_data(const INPUT* in, pads_end, output_padding); } + } // namespace reference - } // namespace runtime - -} // namespace ngraph \ No newline at end of file +} // namespace ngraph diff --git a/src/core/reference/src/runtime/reference/group_convolution.cpp b/src/core/reference/src/runtime/reference/group_convolution.cpp new file mode 100644 index 00000000000..1e048a4f111 --- /dev/null +++ b/src/core/reference/src/runtime/reference/group_convolution.cpp @@ -0,0 +1,58 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "ngraph/runtime/reference/group_convolution.hpp" + +namespace ngraph { +namespace runtime { +namespace reference { + +void validate_group_convolution_parameters(const Shape& in_shape, + const Shape& f_shape, + const Shape& out_shape, + const Strides& strides, + const Strides& dilations, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end) { + // this implementation supports 1D, 2D and 3D convolutions + NGRAPH_CHECK(in_shape.size() >= 3 && in_shape.size() <= 5, "Unsupported input rank: ", in_shape); + + NGRAPH_CHECK(in_shape.size() + 1 == f_shape.size(), "Unsupported filter rank: ", f_shape.size()); + + NGRAPH_CHECK(in_shape.size() == out_shape.size(), + "Incompatible input and output ranks: ", + in_shape.size(), + " and ", + out_shape.size()); + + const size_t groups = f_shape[filter_group_axis]; + const size_t in_channels = in_shape[in_channel_axis]; + NGRAPH_CHECK(in_channels % groups == 0, "Input channels of data batch input must be multiple of groups"); + const Shape in_group_shape = [&]() { + Shape new_shape{in_shape}; + new_shape[in_channel_axis] /= groups; + return new_shape; + }(); + + const size_t out_channels = out_shape[out_channel_axis]; + NGRAPH_CHECK(out_channels % groups == 0, "Output channels of output must be multiple of groups"); + const Shape out_group_shape = [&]() { + Shape new_shape{out_shape}; + new_shape[out_channel_axis] /= groups; + return new_shape; + }(); + + const Shape f_group_shape{std::next(f_shape.begin(), 1), std::end(f_shape)}; + validate_convolution_parameters(in_group_shape, + f_group_shape, + out_group_shape, + strides, + dilations, + pads_begin, + pads_end); +} + +} // namespace reference +} // namespace runtime +} // namespace ngraph diff --git a/src/core/reference/src/runtime/reference/group_convolution_backprop_data.cpp b/src/core/reference/src/runtime/reference/group_convolution_backprop_data.cpp new file mode 100644 index 00000000000..0687f2fccdb --- /dev/null +++ b/src/core/reference/src/runtime/reference/group_convolution_backprop_data.cpp @@ -0,0 +1,117 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "ngraph/runtime/reference/group_convolution_backprop_data.hpp" + +#include "ngraph/runtime/reference/group_convolution.hpp" + +namespace ngraph { +namespace runtime { +namespace reference { + +void infer_backward_conv_output_shape(const Shape& in_spatial_shape, + const Shape& f_spatial_shape, + Shape& out_spatial_shape, + const Strides& strides, + const Strides& dilations, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end) { + for (size_t idx = 0; idx < in_spatial_shape.size(); idx++) { + size_t in_padded_dim = (in_spatial_shape[idx] - 1) * strides[idx] - pads_begin[idx] - pads_end[idx]; + size_t filter_dilated_dim = dilations[idx] * (f_spatial_shape[idx] - 1) + 1; + size_t out_spatial_dim = in_padded_dim + filter_dilated_dim; + out_spatial_shape.push_back(out_spatial_dim); + } +} + +void validate_convolution_backprop_data_parameters(const Shape& in_shape, + const Shape& f_shape, + const Shape& out_shape, + const Strides& strides, + const Strides& dilations, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end) { + // this implementation supports 1D, 2D and 3D convolutions + NGRAPH_CHECK(in_shape.size() >= 3 && in_shape.size() <= 5, "Unsupported input rank: ", in_shape); + NGRAPH_CHECK(in_shape.size() == f_shape.size(), + "Incompatible input ranks: ", + in_shape.size(), + " and ", + f_shape.size()); + NGRAPH_CHECK(in_shape[in_channel_axis] == f_shape[filter_in_ch_axis], + "Incompatible input channels in data batch and filters shapes: ", + in_shape[in_channel_axis], + " and ", + f_shape[filter_in_ch_axis]); + NGRAPH_CHECK(in_shape.size() == out_shape.size(), + "Incompatible input and output ranks: ", + in_shape.size(), + " and ", + out_shape.size()); + const auto spatial_dims = in_shape.size() - 2; + NGRAPH_CHECK(strides.size() == spatial_dims, "Strides not definied for all and only spatial dimensions"); + NGRAPH_CHECK(dilations.size() == spatial_dims, "Dilations not defined for all and only spatial dimensions"); + NGRAPH_CHECK((pads_begin.size() == pads_end.size()) && (pads_begin.size() == spatial_dims), + "Pads not defined for all and only spatial dimensions"); + + Shape out_spatial_shape{std::next(out_shape.begin(), 2), std::end(out_shape)}; + Shape infered_out_spatial_shape{}; + infer_backward_conv_output_shape(Shape{std::next(in_shape.begin(), 2), std::end(in_shape)}, + Shape{std::next(f_shape.begin(), 2), std::end(f_shape)}, + infered_out_spatial_shape, + strides, + dilations, + pads_begin, + pads_end); + NGRAPH_CHECK(out_spatial_shape == infered_out_spatial_shape, "Incorrect output shape provided"); +} + +void validate_group_convolution_backprop_data_parameters(const Shape& in_shape, + const Shape& f_shape, + const Shape& out_shape, + const Strides& strides, + const Strides& dilations, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end) { + // this implementation supports 1D, 2D and 3D convolutions + NGRAPH_CHECK(in_shape.size() >= 3 && in_shape.size() <= 5, "Unsupported input rank: ", in_shape); + + NGRAPH_CHECK(in_shape.size() + 1 == f_shape.size(), "Unsupported filter rank: ", f_shape.size()); + + NGRAPH_CHECK(in_shape.size() == out_shape.size(), + "Incompatible input and output ranks: ", + in_shape.size(), + " and ", + out_shape.size()); + + const size_t groups = f_shape[filter_group_axis]; + const size_t in_channels = in_shape[in_channel_axis]; + NGRAPH_CHECK(in_channels % groups == 0, "Input channels of data batch input must be multiple of groups"); + const Shape in_group_shape = [&]() { + Shape new_shape{in_shape}; + new_shape[in_channel_axis] /= groups; + return new_shape; + }(); + + const size_t out_channels = out_shape[out_channel_axis]; + NGRAPH_CHECK(out_channels % groups == 0, "Output channels of output must be multiple of groups"); + const Shape out_group_shape = [&]() { + Shape new_shape{out_shape}; + new_shape[out_channel_axis] /= groups; + return new_shape; + }(); + + const Shape f_group_shape{std::next(f_shape.begin(), 1), std::end(f_shape)}; + validate_convolution_backprop_data_parameters(in_group_shape, + f_group_shape, + out_group_shape, + strides, + dilations, + pads_begin, + pads_end); +} + +} // namespace reference +} // namespace runtime +} // namespace ngraph \ No newline at end of file diff --git a/src/frontends/tensorflow/src/CMakeLists.txt b/src/frontends/tensorflow/src/CMakeLists.txt index cb2a50030b7..6f0fba7df7b 100644 --- a/src/frontends/tensorflow/src/CMakeLists.txt +++ b/src/frontends/tensorflow/src/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # -if(NOT CPACK_GENERATOR STREQUAL "DEB") +if(NOT CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$") set(linkable_frontend LINKABLE_FRONTEND) endif() diff --git a/src/inference/CMakeLists.txt b/src/inference/CMakeLists.txt index c33251f33ca..c233060fee6 100644 --- a/src/inference/CMakeLists.txt +++ b/src/inference/CMakeLists.txt @@ -198,7 +198,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 openvino::pugixml) + frontend_common::static inference_engine_transformations openvino::pugixml) target_compile_definitions(${TARGET_NAME}_s PUBLIC USE_STATIC_IE) diff --git a/src/plugins/auto/plugin.cpp b/src/plugins/auto/plugin.cpp index b1de7e57006..c64e9a4bfbe 100644 --- a/src/plugins/auto/plugin.cpp +++ b/src/plugins/auto/plugin.cpp @@ -483,7 +483,7 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons if (configIter != fullConfig.end() && configIter->second == InferenceEngine::PluginConfigParams::CUMULATIVE_THROUGHPUT) { configIter->second = InferenceEngine::PluginConfigParams::THROUGHPUT; _LogTag = "AUTO"; - LOG_INFO_TAG("CUMULATIVE Call MULTI PERFORMACE_HINT set to THROUGHPUT"); + LOG_INFO_TAG("CUMULATIVE Call MULTI PERFORMANCE_HINT set to THROUGHPUT"); } if (priorities->second.empty()) { IE_THROW() << "KEY_MULTI_DEVICE_PRIORITIES key is not set for " << GetName() << " device"; diff --git a/src/plugins/intel_cpu/src/nodes/subgraph.cpp b/src/plugins/intel_cpu/src/nodes/subgraph.cpp index e86f61e88d7..909b0a7862d 100644 --- a/src/plugins/intel_cpu/src/nodes/subgraph.cpp +++ b/src/plugins/intel_cpu/src/nodes/subgraph.cpp @@ -20,8 +20,6 @@ #include #include -#include - #include #include "emitters/cpu_generator.hpp" #include "snippets_transformations/fuse_load_store_and_convert.hpp" diff --git a/src/plugins/intel_gna/CMakeLists.txt b/src/plugins/intel_gna/CMakeLists.txt index 7938e359f2b..3a313f75a7d 100644 --- a/src/plugins/intel_gna/CMakeLists.txt +++ b/src/plugins/intel_gna/CMakeLists.txt @@ -77,7 +77,7 @@ target_compile_definitions(${TARGET_NAME}_test_static INTEGER_LOW_P USE_STATIC_IE) -target_link_libraries(${TARGET_NAME}_test_static PUBLIC inference_engine_s openvino_gapi_preproc_s inference_engine_transformations libGNA::API) +target_link_libraries(${TARGET_NAME}_test_static PUBLIC inference_engine_s inference_engine_transformations libGNA::API) target_include_directories(${TARGET_NAME}_test_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src diff --git a/src/plugins/intel_gpu/src/graph/crop.cpp b/src/plugins/intel_gpu/src/graph/crop.cpp index 7584eb59b8a..6013b037bb8 100644 --- a/src/plugins/intel_gpu/src/graph/crop.cpp +++ b/src/plugins/intel_gpu/src/graph/crop.cpp @@ -141,6 +141,8 @@ std::vector crop_inst::calc_output_layouts(const crop_node& /*node*/, co return {output_layouts[desc->output_idx]}; } +template std::vector crop_inst::calc_output_layouts(crop_node const& node, const kernel_impl_params& impl_param); + std::string crop_inst::to_string(crop_node const& node) { const auto& desc = node.get_primitive(); auto ref_in_sizes = desc->reference_input; diff --git a/src/plugins/intel_myriad/CMakeLists.txt b/src/plugins/intel_myriad/CMakeLists.txt index cd272663d8f..9f5650a9cd4 100644 --- a/src/plugins/intel_myriad/CMakeLists.txt +++ b/src/plugins/intel_myriad/CMakeLists.txt @@ -33,8 +33,7 @@ if(ENABLE_INTEL_MYRIAD) add_subdirectory(graph_transformer) add_subdirectory(myriad_plugin) - # TODO: custom installation or totally remove - if(DEFINED VPU_CLC_MA2X8X_ROOT AND NOT CPACK_GENERATOR STREQUAL "DEB") + if(DEFINED VPU_CLC_MA2X8X_ROOT AND NOT CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$") install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/custom_kernels/ DESTINATION ${OV_CPACK_PLUGINSDIR}/vpu_custom_kernels COMPONENT myriad) diff --git a/src/plugins/intel_myriad/myriad_plugin/CMakeLists.txt b/src/plugins/intel_myriad/myriad_plugin/CMakeLists.txt index 8acdda5b745..5fe1adf8366 100644 --- a/src/plugins/intel_myriad/myriad_plugin/CMakeLists.txt +++ b/src/plugins/intel_myriad/myriad_plugin/CMakeLists.txt @@ -54,8 +54,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_REL # install -# TODO: think about creation of dedicated package with device rules -if(LINUX AND NOT CPACK_GENERATOR STREQUAL "DEB") +if(LINUX AND NOT CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$") install(FILES ${mvnc_SOURCE_DIR}/src/97-myriad-usbboot.rules DESTINATION install_dependencies COMPONENT myriad) diff --git a/tests/samples_tests/smoke_tests/common/samples_common_test_clas.py b/tests/samples_tests/smoke_tests/common/samples_common_test_class.py similarity index 99% rename from tests/samples_tests/smoke_tests/common/samples_common_test_clas.py rename to tests/samples_tests/smoke_tests/common/samples_common_test_class.py index b62c2fdb6f8..0deeaa10174 100644 --- a/tests/samples_tests/smoke_tests/common/samples_common_test_clas.py +++ b/tests/samples_tests/smoke_tests/common/samples_common_test_class.py @@ -422,7 +422,7 @@ class SamplesCommonTestClass(): retcode_perf, stdout_perf, stderr_perf = shell([self.executable_path, cmd_perf]) if (retcode_perf != 0): log.error(stderr_perf) - assert retcode_perf == 0, "Execution sample for performace failed" + assert retcode_perf == 0, "Execution sample for performance failed" fps_perf = self.find_fps(stdout_perf) self.write_csv(sample_name=self.sample_name, sample_type=sample_type, cmd_perf=cmd_perf, fps_perf=fps_perf) log.info('Perf results: {}'.format(fps_perf)) diff --git a/tests/samples_tests/smoke_tests/conftest.py b/tests/samples_tests/smoke_tests/conftest.py index f48cf4ea1a9..7405ff2032f 100644 --- a/tests/samples_tests/smoke_tests/conftest.py +++ b/tests/samples_tests/smoke_tests/conftest.py @@ -15,7 +15,7 @@ import os import yaml import sys import logging as log -from common.samples_common_test_clas import Environment +from common.samples_common_test_class import Environment from common.common_utils import fix_env_conf log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/tests/samples_tests/smoke_tests/test_benchmark_app.py b/tests/samples_tests/smoke_tests/test_benchmark_app.py index deb54fc4294..6235a459b65 100644 --- a/tests/samples_tests/smoke_tests/test_benchmark_app.py +++ b/tests/samples_tests/smoke_tests/test_benchmark_app.py @@ -14,8 +14,8 @@ import os import pytest import logging as log import sys -from common.samples_common_test_clas import SamplesCommonTestClass -from common.samples_common_test_clas import get_tests +from common.samples_common_test_class import SamplesCommonTestClass +from common.samples_common_test_class import get_tests log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/tests/samples_tests/smoke_tests/test_classification_sample_async.py b/tests/samples_tests/smoke_tests/test_classification_sample_async.py index 4bc7fe9f175..8e964873e53 100644 --- a/tests/samples_tests/smoke_tests/test_classification_sample_async.py +++ b/tests/samples_tests/smoke_tests/test_classification_sample_async.py @@ -15,8 +15,8 @@ import pytest import re import sys import logging as log -from common.samples_common_test_clas import SamplesCommonTestClass -from common.samples_common_test_clas import get_tests +from common.samples_common_test_class import SamplesCommonTestClass +from common.samples_common_test_class import get_tests log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/tests/samples_tests/smoke_tests/test_hello_classification.py b/tests/samples_tests/smoke_tests/test_hello_classification.py index 092a3ec6e3f..9c6c1402348 100644 --- a/tests/samples_tests/smoke_tests/test_hello_classification.py +++ b/tests/samples_tests/smoke_tests/test_hello_classification.py @@ -16,9 +16,9 @@ import re import sys import logging as log import subprocess -from common.samples_common_test_clas import get_tests -from common.samples_common_test_clas import SamplesCommonTestClass -from common.samples_common_test_clas import Environment +from common.samples_common_test_class import get_tests +from common.samples_common_test_class import SamplesCommonTestClass +from common.samples_common_test_class import Environment from common.common_utils import shell from pathlib import Path import shutil diff --git a/tests/samples_tests/smoke_tests/test_hello_nv12_input_classification.py b/tests/samples_tests/smoke_tests/test_hello_nv12_input_classification.py index ca04aad5c5e..e0a3e6b0652 100644 --- a/tests/samples_tests/smoke_tests/test_hello_nv12_input_classification.py +++ b/tests/samples_tests/smoke_tests/test_hello_nv12_input_classification.py @@ -15,8 +15,8 @@ import pytest import re import sys import logging as log -from common.samples_common_test_clas import get_tests -from common.samples_common_test_clas import SamplesCommonTestClass +from common.samples_common_test_class import get_tests +from common.samples_common_test_class import SamplesCommonTestClass log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/tests/samples_tests/smoke_tests/test_hello_query_device.py b/tests/samples_tests/smoke_tests/test_hello_query_device.py index 603037d9b71..4446b27d695 100644 --- a/tests/samples_tests/smoke_tests/test_hello_query_device.py +++ b/tests/samples_tests/smoke_tests/test_hello_query_device.py @@ -15,8 +15,8 @@ import pytest import re import sys import logging as log -from common.samples_common_test_clas import get_tests -from common.samples_common_test_clas import SamplesCommonTestClass +from common.samples_common_test_class import get_tests +from common.samples_common_test_class import SamplesCommonTestClass log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/tests/samples_tests/smoke_tests/test_hello_reshape_ssd.py b/tests/samples_tests/smoke_tests/test_hello_reshape_ssd.py index 58f11656570..3fb0aaf13a5 100644 --- a/tests/samples_tests/smoke_tests/test_hello_reshape_ssd.py +++ b/tests/samples_tests/smoke_tests/test_hello_reshape_ssd.py @@ -14,8 +14,8 @@ import os import pytest import logging as log import sys -from common.samples_common_test_clas import get_tests -from common.samples_common_test_clas import SamplesCommonTestClass +from common.samples_common_test_class import get_tests +from common.samples_common_test_class import SamplesCommonTestClass from common.specific_samples_parsers import parse_hello_reshape_ssd log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/tests/samples_tests/smoke_tests/test_speech_sample.py b/tests/samples_tests/smoke_tests/test_speech_sample.py index 438486bcb05..c1076710665 100644 --- a/tests/samples_tests/smoke_tests/test_speech_sample.py +++ b/tests/samples_tests/smoke_tests/test_speech_sample.py @@ -14,9 +14,9 @@ import os import pytest import sys import logging as log -from common.samples_common_test_clas import SamplesCommonTestClass -from common.samples_common_test_clas import Environment -from common.samples_common_test_clas import get_tests +from common.samples_common_test_class import SamplesCommonTestClass +from common.samples_common_test_class import Environment +from common.samples_common_test_class import get_tests from common.common_utils import parse_avg_err log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index f65cc52bcd8..2d104eef8c8 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -10,9 +10,13 @@ if(ENABLE_LTO) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) endif() -add_subdirectory(ittapi) -add_subdirectory(itt_collector EXCLUDE_FROM_ALL) +if(ENABLE_PROFILING_ITT) + add_subdirectory(ittapi) + add_subdirectory(itt_collector EXCLUDE_FROM_ALL) +endif() + add_subdirectory(cnpy EXCLUDE_FROM_ALL) + if(ENABLE_INTEL_GPU) add_subdirectory(ocl) endif() @@ -54,6 +58,10 @@ if(ENABLE_SYSTEM_PUGIXML) if(TARGET pugixml::shared) # example: cross-compilation on debian set(pugixml_target pugixml::shared) + elseif(TARGET pugixml::pugixml) + # or create an alias for pugixml::pugixml shared library + # example: pugixml brew package + set(pugixml_target pugixml::pugixml) elseif(TARGET pugixml) # or create an alias for pugixml shared library # example: libpugixml-dev debian package @@ -117,8 +125,8 @@ if(ENABLE_SYSTEM_PUGIXML) DESTINATION runtime/3rdparty/pugixml/lib COMPONENT pugixml EXCLUDE_FROM_ALL) - elseif(CPACK_GENERATOR STREQUAL "DEB") - message(FATAL_ERROR "Debian package build requires shared Pugixml library") + elseif(CPACK_GENERATOR MATCHES "^(DEB|RPM)$") + message(FATAL_ERROR "Debian | RPM package build requires shared Pugixml library") endif() set_target_properties(${pugixml_target} PROPERTIES IMPORTED_GLOBAL ON) @@ -151,39 +159,50 @@ endif() # Fluid, G-API, OpenCV HAL # -add_library(ocv_hal INTERFACE) -target_include_directories(ocv_hal INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/ocv") +if(ENABLE_GAPI_PREPROCESSING) + add_library(ocv_hal INTERFACE) + target_include_directories(ocv_hal INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/ocv") -add_subdirectory(ade EXCLUDE_FROM_ALL) -add_subdirectory(fluid/modules/gapi EXCLUDE_FROM_ALL) + add_subdirectory(ade EXCLUDE_FROM_ALL) + add_subdirectory(fluid/modules/gapi EXCLUDE_FROM_ALL) -if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND NOT OV_COMPILER_IS_CLANG) - target_compile_options(fluid PRIVATE "-Wno-maybe-uninitialized") + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND NOT OV_COMPILER_IS_CLANG) + target_compile_options(fluid PRIVATE "-Wno-maybe-uninitialized") + endif() + + set_target_properties(ade fluid PROPERTIES FOLDER thirdparty) + openvino_developer_export_targets(COMPONENT openvino_common TARGETS ade fluid) + + ov_install_static_lib(ade ${OV_CPACK_COMP_CORE}) + ov_install_static_lib(fluid ${OV_CPACK_COMP_CORE}) endif() -set_target_properties(ade fluid PROPERTIES FOLDER thirdparty) -openvino_developer_export_targets(COMPONENT openvino_common TARGETS ade fluid) - -ov_install_static_lib(ade ${OV_CPACK_COMP_CORE}) -ov_install_static_lib(fluid ${OV_CPACK_COMP_CORE}) - # # Gflags # -if(NOT APPLE AND NOT DEFINED ENV{CONDA_PREFIX}) - # - conda-forge contains only dynamic libraries +if(NOT APPLE OR CPACK_GENERATOR MATCHES "^(BREW|CONDA-FORGE)$") # - on Apple only dynamic libraries are available # also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU - find_package(gflags QUIET COMPONENTS nothreads_static) + + if(CPACK_GENERATOR MATCHES "^(BREW|CONDA-FORGE)$" OR DEFINED ENV{HOMEBREW_PREFIX}) + # conda-forge and brew contains only shared version of gflags + find_package(gflags QUIET COMPONENTS nothreads_shared) + else() + find_package(gflags QUIET COMPONENTS nothreads_static) + endif() endif() if(gflags_FOUND) - if(TARGET gflags_nothreads-static) + if(TARGET gflags) + set_target_properties(gflags PROPERTIES IMPORTED_GLOBAL ON) + elseif(TARGET gflags_nothreads-static) + # debian_9_arm case set_target_properties(gflags_nothreads-static PROPERTIES IMPORTED_GLOBAL ON) add_library(gflags ALIAS gflags_nothreads-static) - elseif(TARGET gflags) - set_target_properties(gflags PROPERTIES IMPORTED_GLOBAL ON) + elseif(TARGET ${GFLAGS_TARGET}) + set_target_properties(${GFLAGS_TARGET} PROPERTIES IMPORTED_GLOBAL ON) + add_library(gflags ALIAS ${GFLAGS_TARGET}) else() message(FATAL_ERROR "Internal error: failed to find imported target 'gflags'") endif() @@ -198,10 +217,19 @@ endif() # if(ENABLE_TESTS) - add_subdirectory(gtest EXCLUDE_FROM_ALL) + # TODO: migrate to official version of googltest + # find_package(GTest QUIET) - openvino_developer_export_targets(COMPONENT tests - TARGETS gmock gmock_main gtest gtest_main) + if(GTest_FOUND) + foreach(gtest_target gtest gtest_main gmock gmock_main) + set_target_properties(GTest::${gtest_target} PROPERTIES IMPORTED_GLOBAL ON) + add_library(${gtest_target} ALIAS GTest::${gtest_target}) + endforeach() + else() + add_subdirectory(gtest EXCLUDE_FROM_ALL) + openvino_developer_export_targets(COMPONENT tests + TARGETS gmock gmock_main gtest gtest_main) + endif() endif() # @@ -270,17 +298,17 @@ ov_install_static_lib(nlohmann_json_schema_validator ${OV_CPACK_COMP_CORE}) # Install # -if(CPACK_GENERATOR STREQUAL "DEB") - # These libraries are dependencies for openvino-samples-2022.1 package +if(CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$") + # These libraries are dependencies for openvino-samples package if(NOT gflags_FOUND) - message(FATAL_ERROR "gflags must be used as a debian package. Install libgflags-dev") + message(FATAL_ERROR "gflags must be used as a ${CPACK_GENERATOR} package. Install libgflags-dev") endif() if(NOT zlib_FOUND) - message(FATAL_ERROR "zlib must be used as a debian package. Install zlib1g-dev") + message(FATAL_ERROR "zlib must be used as a ${CPACK_GENERATOR} package. Install zlib1g-dev") endif() if(NOT ENABLE_SYSTEM_PUGIXML) - message(FATAL_ERROR "Pugixml must be used as a debian package. Install libpugixml-dev") + message(FATAL_ERROR "Pugixml must be used as a ${CPACK_GENERATOR} package. Install libpugixml-dev") endif() else() install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gflags diff --git a/thirdparty/gtest/CMakeLists.txt b/thirdparty/gtest/CMakeLists.txt index 703b4338123..dc4da093f1f 100644 --- a/thirdparty/gtest/CMakeLists.txt +++ b/thirdparty/gtest/CMakeLists.txt @@ -2,36 +2,28 @@ # SPDX-License-Identifier: Apache-2.0 # -# -# Adds compiler flags to C / C++ sources -# -macro(add_compiler_flags) - foreach(flag ${ARGN}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") - endforeach() -endmacro() - # # Google Tests framework # + set(gtest_force_shared_crt ON CACHE BOOL "disable static CRT for google test") set(BUILD_SHARED_LIBS OFF) set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) + add_subdirectory(gtest EXCLUDE_FROM_ALL) get_target_property(gtest_include_dirs gtest INTERFACE_INCLUDE_DIRECTORIES) set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${gtest_include_dirs}") get_target_property(gmock_include_dirs gtest INTERFACE_INCLUDE_DIRECTORIES) -set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${gmock_include_dirs};${gmock_SOURCE_DIR}/include") +set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + "${gmock_include_dirs};${gmock_SOURCE_DIR}/include") set(gtest_targets gtest gtest_main gmock gmock_main) foreach(target IN LISTS gtest_targets) - -# If we have specified /Z7 option, remove -Zi option which comes from gtest + # If we have specified /Z7 option, remove -Zi option which comes from gtest if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") get_target_property(_target_cxx_flags ${target} COMPILE_OPTIONS) if(_target_cxx_flags) @@ -51,5 +43,5 @@ foreach(target IN LISTS gtest_targets) ov_disable_all_warnings(${target}) endforeach() -set_target_properties(gtest gtest_main gmock gmock_main +set_target_properties(${gtest_targets} PROPERTIES FOLDER thirdparty) diff --git a/thirdparty/itt_collector/CMakeLists.txt b/thirdparty/itt_collector/CMakeLists.txt index 57d6c55c39d..44c0531b6cf 100644 --- a/thirdparty/itt_collector/CMakeLists.txt +++ b/thirdparty/itt_collector/CMakeLists.txt @@ -14,6 +14,6 @@ # limitations under the License. # ****************************************************************************** -if(ENABLE_PROFILING_ITT AND SELECTIVE_BUILD STREQUAL "COLLECT") +if(SELECTIVE_BUILD STREQUAL "COLLECT") add_subdirectory(sea_itt_lib) endif() diff --git a/thirdparty/ittapi/CMakeLists.txt b/thirdparty/ittapi/CMakeLists.txt index 7a0947ec9d6..9d597bc77f5 100644 --- a/thirdparty/ittapi/CMakeLists.txt +++ b/thirdparty/ittapi/CMakeLists.txt @@ -2,28 +2,26 @@ # SPDX-License-Identifier: Apache-2.0 # -if(ENABLE_PROFILING_ITT) - if(DEFINED INTEL_VTUNE_DIR OR DEFINED ENV{INTEL_VTUNE_DIR}) - find_package(ITT - PATHS "${OpenVINO_SOURCE_DIR}/src/common/itt/cmake" - NO_DEFAULT_PATH) - if(NOT ITT_FOUND) - message(WARNING "Profiling option enabled, but no ITT library was found under INTEL_VTUNE_DIR") - endif() - else() - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ittapi ${CMAKE_BINARY_DIR}/_deps/ittapi EXCLUDE_FROM_ALL) - - target_compile_definitions(ittnotify INTERFACE ENABLE_PROFILING_ITT) - if(CMAKE_COMPILER_IS_GNUCXX) - target_compile_options(ittnotify PRIVATE -Wno-undef) - endif() - - # override INTERFACE_INCLUDE_DIRECTORIES - set_property(TARGET ittnotify PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $ - $) - - openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittnotify) - ov_install_static_lib(ittnotify ${OV_CPACK_COMP_CORE}) +if(DEFINED INTEL_VTUNE_DIR OR DEFINED ENV{INTEL_VTUNE_DIR}) + find_package(ITT + PATHS "${OpenVINO_SOURCE_DIR}/src/common/itt/cmake" + NO_DEFAULT_PATH) + if(NOT ITT_FOUND) + message(WARNING "Profiling option enabled, but no ITT library was found under INTEL_VTUNE_DIR") endif() +else() + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ittapi ${CMAKE_BINARY_DIR}/_deps/ittapi EXCLUDE_FROM_ALL) + + target_compile_definitions(ittnotify INTERFACE ENABLE_PROFILING_ITT) + if(CMAKE_COMPILER_IS_GNUCXX) + target_compile_options(ittnotify PRIVATE -Wno-undef) + endif() + + # override INTERFACE_INCLUDE_DIRECTORIES + set_property(TARGET ittnotify PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $) + + openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittnotify) + ov_install_static_lib(ittnotify ${OV_CPACK_COMP_CORE}) endif() diff --git a/thirdparty/ittapi/ittapi b/thirdparty/ittapi/ittapi index ca5e389079a..96a01335dbc 160000 --- a/thirdparty/ittapi/ittapi +++ b/thirdparty/ittapi/ittapi @@ -1 +1 @@ -Subproject commit ca5e389079a08764b72c95f4ecfe6ee64f9c8848 +Subproject commit 96a01335dbc560b9224f52f0cc25c28ca0f1b564 diff --git a/thirdparty/json/CMakeLists.txt b/thirdparty/json/CMakeLists.txt index 4dd63086805..e3d3816eeba 100644 --- a/thirdparty/json/CMakeLists.txt +++ b/thirdparty/json/CMakeLists.txt @@ -14,6 +14,11 @@ set(JSON_VALIDATOR_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) add_subdirectory(nlohmann_json_schema_validator EXCLUDE_FROM_ALL) set_target_properties(nlohmann_json_schema_validator PROPERTIES FOLDER thirdparty) +if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) + target_compile_options(nlohmann_json_schema_validator PRIVATE -Wno-switch -Wno-deprecated-declarations) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + target_compile_options(nlohmann_json_schema_validator PRIVATE /wd4996) +endif() # WA for CentOS with gcc < 4.9: override defitions to remove boost usage set_property(TARGET nlohmann_json_schema_validator PROPERTY COMPILE_DEFINITIONS "") diff --git a/thirdparty/json/nlohmann_json b/thirdparty/json/nlohmann_json index fec56a1a16c..bc889afb4c5 160000 --- a/thirdparty/json/nlohmann_json +++ b/thirdparty/json/nlohmann_json @@ -1 +1 @@ -Subproject commit fec56a1a16c6e1c1b1f4e116a20e79398282626c +Subproject commit bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d diff --git a/thirdparty/json/nlohmann_json_schema_validator b/thirdparty/json/nlohmann_json_schema_validator index b1ef8628326..27fc1d09450 160000 --- a/thirdparty/json/nlohmann_json_schema_validator +++ b/thirdparty/json/nlohmann_json_schema_validator @@ -1 +1 @@ -Subproject commit b1ef8628326cf0b53612f12784fd245e5e4382f1 +Subproject commit 27fc1d094503623dfe39365ba82581507524545c diff --git a/thirdparty/onnx/CMakeLists.txt b/thirdparty/onnx/CMakeLists.txt index 8c8429b1185..19f00e62cad 100644 --- a/thirdparty/onnx/CMakeLists.txt +++ b/thirdparty/onnx/CMakeLists.txt @@ -29,6 +29,9 @@ set(ONNX_USE_LITE_PROTO ${ONNX_USE_LITE_PROTO_DEFAULT} CACHE BOOL "Use protobuf set(ONNX_ML ON CACHE BOOL "Use ONNX ML" FORCE) set(ONNX_CUSTOM_PROTOC_EXECUTABLE ${PROTOC_EXECUTABLE}) +# clear Python_ADDITIONAL_VERSIONS to find only python library matching PYTHON_EXECUTABLE +unset(Python_ADDITIONAL_VERSIONS CACHE) + # build targets function(ov_onnx_build_static) diff --git a/tools/compile_tool/CMakeLists.txt b/tools/compile_tool/CMakeLists.txt index c3c615e81fa..a6280b19949 100644 --- a/tools/compile_tool/CMakeLists.txt +++ b/tools/compile_tool/CMakeLists.txt @@ -43,7 +43,7 @@ ie_cpack_add_component(${OV_CPACK_COMP_CORE_TOOLS} HIDDEN DEPENDS ${OV_CPACK_COMP_CORE}) -if(CPACK_GENERATOR MATCHES "DEB") +if(CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$") install(TARGETS compile_tool RUNTIME DESTINATION ${OV_CPACK_TOOLSDIR} COMPONENT ${OV_CPACK_COMP_CORE_TOOLS}) diff --git a/tools/legacy/benchmark_app/statistics_report.cpp b/tools/legacy/benchmark_app/statistics_report.cpp index 8ad8443804f..6f2a9454ad6 100644 --- a/tools/legacy/benchmark_app/statistics_report.cpp +++ b/tools/legacy/benchmark_app/statistics_report.cpp @@ -53,7 +53,7 @@ void StatisticsReport::dump() { slog::info << "Statistics report is stored to " << dumper.getFilename() << slog::endl; } -void StatisticsReport::dumpPerformanceCountersRequest(CsvDumper& dumper, const PerformaceCounters& perfCounts) { +void StatisticsReport::dumpPerformanceCountersRequest(CsvDumper& dumper, const PerformanceCounters& perfCounts) { auto performanceMapSorted = perfCountersSorted(perfCounts); long long total = 0L; @@ -96,7 +96,7 @@ void StatisticsReport::dumpPerformanceCountersRequest(CsvDumper& dumper, const P dumper.endLine(); } -void StatisticsReport::dumpPerformanceCounters(const std::vector& perfCounts) { +void StatisticsReport::dumpPerformanceCounters(const std::vector& perfCounts) { if ((_config.report_type.empty()) || (_config.report_type == noCntReport)) { slog::info << "Statistics collecting for performance counters was not " "requested. No reports are dumped." diff --git a/tools/legacy/benchmark_app/statistics_report.hpp b/tools/legacy/benchmark_app/statistics_report.hpp index bb4877da89a..3d5abc2d34b 100644 --- a/tools/legacy/benchmark_app/statistics_report.hpp +++ b/tools/legacy/benchmark_app/statistics_report.hpp @@ -21,7 +21,7 @@ static constexpr char detailedCntReport[] = "detailed_counters"; /// @brief Responsible for collecting of statistics and dumping to .csv file class StatisticsReport { public: - typedef std::map PerformaceCounters; + typedef std::map PerformanceCounters; typedef std::vector> Parameters; struct Config { @@ -54,10 +54,10 @@ public: void dump(); - void dumpPerformanceCounters(const std::vector& perfCounts); + void dumpPerformanceCounters(const std::vector& perfCounts); private: - void dumpPerformanceCountersRequest(CsvDumper& dumper, const PerformaceCounters& perfCounts); + void dumpPerformanceCountersRequest(CsvDumper& dumper, const PerformanceCounters& perfCounts); // configuration of current benchmark execution const Config _config;