diff --git a/.ci/azure/android_arm64.yml b/.ci/azure/android_arm64.yml index f0b143f81c6..94d72dca2b3 100644 --- a/.ci/azure/android_arm64.yml +++ b/.ci/azure/android_arm64.yml @@ -107,7 +107,7 @@ jobs: - script: | set -e - $(OPENVINO_REPO_DIR)/install_build_dependencies.sh + sudo -E $(OPENVINO_REPO_DIR)/install_build_dependencies.sh # Move into contrib install_build_dependencies.sh sudo apt --assume-yes install scons crossbuild-essential-arm64 libprotoc-dev protobuf-compiler default-jdk # Speed up build diff --git a/.ci/azure/linux.yml b/.ci/azure/linux.yml index 69929657139..d1bbd7ea4d1 100644 --- a/.ci/azure/linux.yml +++ b/.ci/azure/linux.yml @@ -152,7 +152,7 @@ jobs: - script: | set -e - $(REPO_DIR)/install_build_dependencies.sh + sudo -E $(REPO_DIR)/install_build_dependencies.sh # Move jdk into contrib # 'clang' compiler is to check that samples can be built using it sudo apt --assume-yes install openjdk-11-jdk libbz2-dev clang diff --git a/.ci/azure/linux_arm64.yml b/.ci/azure/linux_arm64.yml index da966d97e5e..3dc27635cb9 100644 --- a/.ci/azure/linux_arm64.yml +++ b/.ci/azure/linux_arm64.yml @@ -127,7 +127,7 @@ jobs: - script: | set -e - $(OPENVINO_REPO_DIR)/install_build_dependencies.sh + sudo -E $(OPENVINO_REPO_DIR)/install_build_dependencies.sh export CCACHE_TEMPDIR=$(TMP_DIR)/ccache export CCACHE_BASEDIR=$(Pipeline.Workspace) export CCACHE_MAXSIZE=50G diff --git a/.ci/azure/linux_conditional_compilation.yml b/.ci/azure/linux_conditional_compilation.yml index 5693492db1e..5b04b98e977 100644 --- a/.ci/azure/linux_conditional_compilation.yml +++ b/.ci/azure/linux_conditional_compilation.yml @@ -85,7 +85,7 @@ jobs: - script: | set -e - $(REPO_DIR)/install_build_dependencies.sh + sudo -E $(REPO_DIR)/install_build_dependencies.sh wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz tar -xzf Python-3.10.6.tgz cd Python-3.10.6 || exit diff --git a/.ci/azure/linux_coverity.yml b/.ci/azure/linux_coverity.yml index 490a99152f3..e2948d89dc0 100644 --- a/.ci/azure/linux_coverity.yml +++ b/.ci/azure/linux_coverity.yml @@ -79,7 +79,7 @@ jobs: - script: | set -e - $(REPO_DIR)/install_build_dependencies.sh + sudo -E $(REPO_DIR)/install_build_dependencies.sh # Move jdk into contrib sudo apt --assume-yes install openjdk-11-jdk # Speed up build diff --git a/.ci/azure/linux_cuda.yml b/.ci/azure/linux_cuda.yml index bd9f011100a..9fa878a85d5 100644 --- a/.ci/azure/linux_cuda.yml +++ b/.ci/azure/linux_cuda.yml @@ -121,7 +121,7 @@ jobs: sudo docker run --volume $(REPO_DIR)/../:/root/repos --volume $(WORK_DIR):/root/w openvino.azurecr.io/openvino_ci/cuda-ubuntu2004:2022.1 bash -c " - /root/repos/openvino/install_build_dependencies.sh && + sudo -E /root/repos/openvino/install_build_dependencies.sh && python3 -m pip install -r /root/repos/openvino/src/bindings/python/requirements.txt && cd /root/w/build && cmake -GNinja diff --git a/.ci/azure/linux_debian.yml b/.ci/azure/linux_debian.yml index f5a0d3aa177..8bbd31c9533 100644 --- a/.ci/azure/linux_debian.yml +++ b/.ci/azure/linux_debian.yml @@ -118,7 +118,7 @@ jobs: - script: | set -e - $(REPO_DIR)/install_build_dependencies.sh + sudo -E $(REPO_DIR)/install_build_dependencies.sh # Move jdk into contrib # 'clang' compiler is to check that samples can be built using it sudo apt --assume-yes install openjdk-11-jdk clang diff --git a/.ci/azure/linux_onnxruntime.yml b/.ci/azure/linux_onnxruntime.yml index 92b5dce7065..13a5b4abfce 100644 --- a/.ci/azure/linux_onnxruntime.yml +++ b/.ci/azure/linux_onnxruntime.yml @@ -92,7 +92,7 @@ jobs: - script: | set -e - $(REPO_DIR)/install_build_dependencies.sh + sudo -E $(REPO_DIR)/install_build_dependencies.sh wget https://www.python.org/ftp/python/"$PYTHON_VERSION"/Python-"$PYTHON_VERSION".tgz tar -xzf Python-"$PYTHON_VERSION".tgz cd Python-"$PYTHON_VERSION" || exit diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 001051d3373..9e2870338aa 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -260,8 +260,8 @@ if(ENABLE_OPENCV) CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9") AND X86_64) set(OPENCV_SUFFIX "centos7") set(OPENCV_HASH "5fa76985c84fe7c64531682ef0b272510c51ac0d0565622514edf1c88b33404a") - elseif((LINUX_OS_NAME MATCHES "CentOS 8" OR - LINUX_OS_NAME MATCHES "CentOS 9") AND X86_64) + elseif((LINUX_OS_NAME STREQUAL "CentOS 8" OR + LINUX_OS_NAME STREQUAL "CentOS 9") AND X86_64) set(OPENCV_SUFFIX "centos8") set(OPENCV_HASH "db087dfd412eedb8161636ec083ada85ff278109948d1d62a06b0f52e1f04202") elseif(LINUX_OS_NAME STREQUAL "Ubuntu 16.04" AND X86_64) diff --git a/cmake/developer_package/clang_format/clang_format.cmake b/cmake/developer_package/clang_format/clang_format.cmake index e441a92cbfa..d1459370a47 100644 --- a/cmake/developer_package/clang_format/clang_format.cmake +++ b/cmake/developer_package/clang_format/clang_format.cmake @@ -3,22 +3,23 @@ # if(ENABLE_CLANG_FORMAT) - set(CLANG_FORMAT_FILENAME clang-format-9 clang-format) + set(clang_format_required_version 9) + set(CLANG_FORMAT_FILENAME clang-format-${clang_format_required_version} 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) - message(WARNING "Supported clang-format version is 9!") + message(WARNING "Supported clang-format version is ${clang_format_required_version}!") 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) + if(NOT CLANG_FORMAT_MAJOR_VERSION EQUAL clang_format_required_version) message(WARNING "Supported clang-format version is 9! Provided version ${CLANG_FORMAT_MAJOR_VERSION}") set(ENABLE_CLANG_FORMAT OFF) endif() endif() else() - message(WARNING "Supported clang-format version is not found!") + message(WARNING "Supported clang-format-${clang_format_required_version} is not found!") set(ENABLE_CLANG_FORMAT OFF) endif() endif() diff --git a/cmake/packaging/debian.cmake b/cmake/packaging/debian.cmake index e633b46aebc..8e7ad277e26 100644 --- a/cmake/packaging/debian.cmake +++ b/cmake/packaging/debian.cmake @@ -320,13 +320,18 @@ macro(ov_cpack_settings) set(samples_build_deps "cmake, g++, gcc, libc6-dev, make") set(samples_build_deps_suggest "libopencv-core-dev, libopencv-imgproc-dev, libopencv-imgcodecs-dev") + if(LINUX_OS_NAME MATCHES "^(Ubuntu 18.04|Debian 9)$") + set(json_library "nlohmann-json-dev") + else() + set(json_library "nlohmann-json3-dev") + endif() # c_samples / cpp_samples set(CPACK_COMPONENT_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Samples") set(CPACK_COMPONENT_SAMPLES_DEPENDS "${OV_CPACK_COMP_CORE_DEV}") set(CPACK_DEBIAN_SAMPLES_PACKAGE_NAME "openvino-samples-${cpack_name_ver}") set(CPACK_DEBIAN_SAMPLES_PACKAGE_SUGGESTS "${samples_build_deps_suggest}, ${all_plugins_suggest}") - set(CPACK_DEBIAN_SAMPLES_PACKAGE_DEPENDS "libgflags-dev, nlohmann-json3-dev, zlib1g-dev") + set(CPACK_DEBIAN_SAMPLES_PACKAGE_DEPENDS "libgflags-dev, zlib1g-dev, ${json_library}") # can be skipped with --no-install-recommends set(CPACK_DEBIAN_SAMPLES_PACKAGE_RECOMMENDS "${samples_build_deps}") set(CPACK_DEBIAN_SAMPLES_PACKAGE_ARCHITECTURE "all") diff --git a/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in b/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in index c930331b0f8..5945816d955 100644 --- a/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in +++ b/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in @@ -91,9 +91,10 @@ endif() if(ENABLE_SYSTEM_PUGIXML) set(_ov_pugixml_pkgconfig_interface "@pugixml_FOUND@") + set(_ov_pugixml_cmake_interface "@PugiXML_FOUND@") if(_ov_pugixml_pkgconfig_interface) find_dependency(PkgConfig) - else() + elseif(_ov_pugixml_cmake_interface) find_dependency(PugiXML) endif() if(PugiXML_FOUND) @@ -127,6 +128,17 @@ if(ENABLE_SYSTEM_PUGIXML) endif() endif() endif() + + # debian 9 case: no cmake, no pkg-config files + if(NOT TARGET IE::pugixml) + find_library(PUGIXML_LIBRARY NAMES pugixml DOC "Path to pugixml library") + if(PUGIXML_LIBRARY) + add_library(IE::pugixml INTERFACE IMPORTED GLOBAL) + set_target_properties(IE::pugixml PROPERTIES INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}") + else() + message(FATAL_ERROR "Failed to find system pugixml in OpenVINO Developer Package") + endif() + endif() endif() # inherit OpenCV from main IE project if enabled diff --git a/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in b/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in index 2372ae7e6bf..ebc27ebc6de 100644 --- a/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in +++ b/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in @@ -63,9 +63,10 @@ endforeach() if(ENABLE_SYSTEM_PUGIXML) set(_ov_pugixml_pkgconfig_interface "@pugixml_FOUND@") + set(_ov_pugixml_cmake_interface "@PugiXML_FOUND@") if(_ov_pugixml_pkgconfig_interface) find_dependency(PkgConfig) - else() + elseif(_ov_pugixml_cmake_interface) find_dependency(PugiXML) endif() if(PugiXML_FOUND) @@ -99,6 +100,17 @@ if(ENABLE_SYSTEM_PUGIXML) endif() endif() endif() + + # debian 9 case: no cmake, no pkg-config files + if(NOT TARGET openvino::pugixml) + find_library(PUGIXML_LIBRARY NAMES pugixml DOC "Path to pugixml library") + if(PUGIXML_LIBRARY) + add_library(openvino::pugixml INTERFACE IMPORTED GLOBAL) + set_target_properties(openvino::pugixml PROPERTIES INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}") + else() + message(FATAL_ERROR "Failed to find system pugixml in OpenVINO Developer Package") + endif() + endif() endif() # inherit OpenCV from main OpenVINO project if enabled diff --git a/install_build_dependencies.sh b/install_build_dependencies.sh index 5ee32c75844..8865a6f3f1b 100755 --- a/install_build_dependencies.sh +++ b/install_build_dependencies.sh @@ -19,8 +19,14 @@ yes_or_no() { done } +if [ $EUID -ne 0 ]; then + echo "ERROR: this script must be run as root to install 3rd party packages." >&2 + echo "Please try again with \"sudo -E $0\", or as root." >&2 + exit 1 +fi + # install dependencies -if [ -f /etc/lsb-release ]; then +if [ -f /etc/lsb-release ] || [ -f /etc/debian_version ] ; then # Ubuntu host_cpu=$(uname -m) if [ "$host_cpu" = "x86_64" ]; then @@ -33,123 +39,128 @@ if [ -f /etc/lsb-release ]; then cmake_packages=(cmake) fi - sudo -E apt update - sudo -E apt-get install -y \ - build-essential \ - "${cmake_packages[@]}" \ - ccache \ - curl \ - wget \ - libssl-dev \ - ca-certificates \ - git \ - git-lfs \ - "${x86_64_specific_packages[@]}" \ - libgtk2.0-dev \ - unzip \ - shellcheck \ - patchelf \ - fdupes \ - lintian \ - file \ - gzip \ - `# openvino` \ - libtbb-dev \ - libpugixml-dev \ - `# gpu plugin extensions` \ - libva-dev \ - `# python` \ - python3-pip \ - python3-venv \ - python3-enchant \ - python3-setuptools \ - libpython3-dev \ - `# samples` \ - pkg-config \ - libgflags-dev \ - zlib1g-dev \ - `# hddl` \ - libudev1 \ - libusb-1.0-0 \ - `# myriad` \ - libusb-1.0-0-dev \ - `# cl_compiler` \ - libtinfo5 + apt update + apt-get install -y \ + build-essential \ + "${cmake_packages[@]}" \ + ccache \ + curl \ + wget \ + libssl-dev \ + ca-certificates \ + git \ + "${x86_64_specific_packages[@]}" \ + libgtk2.0-dev \ + unzip \ + shellcheck \ + patchelf \ + fdupes \ + lintian \ + file \ + gzip \ + `# openvino` \ + libtbb-dev \ + libpugixml-dev \ + `# gpu plugin extensions` \ + libva-dev \ + `# python` \ + python3-pip \ + python3-venv \ + python3-enchant \ + python3-setuptools \ + libpython3-dev \ + `# samples` \ + pkg-config \ + libgflags-dev \ + zlib1g-dev \ + `# hddl` \ + libudev1 \ + libusb-1.0-0 \ + `# myriad` \ + libusb-1.0-0-dev \ + `# cl_compiler` \ + libtinfo5 + # git-lfs is not available on debian9 + if apt-cache search --names-only '^git-lfs'| grep -q git-lfs; then + apt-get install -y git-lfs + fi # hddl - if apt-cache search --names-only '^libjson-c3'| grep -q libjson-c3; then + if apt-cache search --names-only '^libboost-filesystem1.65.1' | grep -q libboost-filesystem1.65.1 ; then # ubuntu 18.04 - sudo -E apt-get install -y \ + apt-get install -y \ libjson-c3 \ libboost-filesystem1.65.1 \ libboost-program-options1.65.1 \ libboost-system1.65.1 elif apt-cache search --names-only '^libjson-c4'| grep -q libjson-c4; then # ubuntu 20.04 - sudo -E apt-get install -y \ + apt-get install -y \ libjson-c4 \ libboost-filesystem1.71.0 \ libboost-program-options1.71.0 fi # for python3-enchant if apt-cache search --names-only 'libenchant1c2a'| grep -q libenchant1c2a; then - sudo -E apt-get install -y libenchant1c2a + apt-get install -y libenchant1c2a fi # samples if apt-cache search --names-only '^nlohmann-json3-dev'| grep -q nlohmann-json3; then - sudo -E apt-get install -y nlohmann-json3-dev + apt-get install -y nlohmann-json3-dev else - sudo -E apt-get install -y nlohmann-json-dev + apt-get install -y nlohmann-json-dev fi elif [ -f /etc/redhat-release ]; then # RHEL 8 / CentOS 7 - sudo -E yum install -y centos-release-scl epel-release - sudo -E yum install -y \ - wget \ - curl \ - cmake3 \ - tar \ - xz \ - p7zip \ - ccache \ - rpm-build \ - rpmlint \ - ShellCheck \ - unzip \ - which \ - ca-certificates \ - git \ - git-lfs \ - boost-devel \ - python3-pip \ - python3-devel \ - libtool \ - tbb-devel \ - pugixml-devel \ - gcc \ - gcc-c++ \ - make \ - patchelf \ - fdupes \ - libusbx-devel \ - file \ - zlib-devel \ - gflags-devel \ - libva-devel + yum update + yum install -y centos-release-scl epel-release + yum install -y \ + wget \ + curl \ + cmake3 \ + tar \ + xz \ + p7zip \ + ccache \ + openssl-devel \ + rpm-build \ + rpmlint \ + ShellCheck \ + unzip \ + which \ + ca-certificates \ + git \ + git-lfs \ + boost-devel \ + python3-pip \ + python3-devel \ + libtool \ + tbb-devel \ + pugixml-devel \ + gcc \ + gcc-c++ \ + make \ + patchelf \ + fdupes \ + libusbx-devel \ + file \ + zlib-devel \ + gflags-devel \ + libva-devel elif [ -f /etc/os-release ] && grep -q "raspbian" /etc/os-release; then # Raspbian - sudo -E apt update - sudo -E apt-get install -y \ - build-essential \ - wget \ - libssl-dev \ - ca-certificates \ - git \ - pkg-config \ - libgflags-dev \ - zlib1g-dev \ - nlohmann-json-dev \ - unzip \ - libusb-1.0-0-dev + apt update + apt-get install -y \ + build-essential \ + wget \ + libssl-dev \ + ca-certificates \ + git \ + pkg-config \ + libgflags-dev \ + zlib1g-dev \ + nlohmann-json-dev \ + unzip \ + libusb-1.0-0-dev else echo "Unknown OS, please install build dependencies manually" fi @@ -161,6 +172,6 @@ if [ ! "$(printf '%s\n' "$required_cmake_ver" "$current_cmake_ver" | sort -V | h installed_cmake_ver=3.23.2 wget "https://github.com/Kitware/CMake/releases/download/v${installed_cmake_ver}/cmake-${installed_cmake_ver}.tar.gz" tar xf cmake-${installed_cmake_ver}.tar.gz - (cd cmake-${installed_cmake_ver} && ./bootstrap --parallel="$(nproc --all)" && make --jobs="$(nproc --all)" && sudo make install) - rm -rf cmake-${installed_cmake_ver} cmake-${installed_cmake_ver}.tar.gz + (cd cmake-${installed_cmake_ver} && ./bootstrap --parallel="$(nproc --all)" && make --jobs="$(nproc --all)" && make install) + rm -rf "cmake-${installed_cmake_ver}" "cmake-${installed_cmake_ver}.tar.gz" fi diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 5e07092e692..ed7c211ec8c 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -66,7 +66,7 @@ function(ov_check_python_build_conditions) # check pyopenvino requirements to OV 2.0 API ov_check_pip_packages(REQUIREMENTS_FILE ${ov_python_req} RESULT_VAR ov_python_req_FOUND - WARNING_MESSAGE "install python3 -m install -r ${ov_python_req} for OV API 2.0 requirements" + WARNING_MESSAGE "install python3 -m pip install -r ${ov_python_req} for OV API 2.0 requirements" MESSAGE_MODE TRACE) # ov_python_req are not mandatory for build set(ov_python_req_FOUND ON) diff --git a/src/common/legacy/src/network_serializer_v7.cpp b/src/common/legacy/src/network_serializer_v7.cpp index 743e82a86d7..7bdf3ecdaf9 100644 --- a/src/common/legacy/src/network_serializer_v7.cpp +++ b/src/common/legacy/src/network_serializer_v7.cpp @@ -265,7 +265,7 @@ std::size_t FillXmlDoc(const InferenceEngine::CNNNetwork& network, pugi::xml_doc // no need to print this information for executable graph information serialization because it is not IR. if (!execGraphInfoSerialization) { netXml.append_attribute("version").set_value("6"); - netXml.append_attribute("batch").set_value(network.getBatchSize()); + netXml.append_attribute("batch").set_value(static_cast(network.getBatchSize())); } pugi::xml_node layers = netXml.append_child("layers"); @@ -285,7 +285,7 @@ std::size_t FillXmlDoc(const InferenceEngine::CNNNetwork& network, pugi::xml_doc layer.append_attribute("name").set_value(node->name.c_str()); layer.append_attribute("type").set_value(node->type.c_str()); layer.append_attribute("precision").set_value(precision.name()); - layer.append_attribute("id").set_value(i); + layer.append_attribute("id").set_value(static_cast(i)); if (!execGraphInfoSerialization) { UpdateStdLayerParams(node); @@ -307,10 +307,10 @@ std::size_t FillXmlDoc(const InferenceEngine::CNNNetwork& network, pugi::xml_doc const DataPtr d = node->insData[iport].lock(); pugi::xml_node port = input.append_child("port"); - port.append_attribute("id").set_value(iport); + port.append_attribute("id").set_value(static_cast(iport)); for (auto dim : d->getDims()) { - port.append_child("dim").text().set(dim); + port.append_child("dim").text().set(static_cast(dim)); } } } @@ -319,11 +319,11 @@ std::size_t FillXmlDoc(const InferenceEngine::CNNNetwork& network, pugi::xml_doc for (size_t oport = 0; oport < node->outData.size(); oport++) { pugi::xml_node port = output.append_child("port"); - port.append_attribute("id").set_value(node->insData.size() + oport); + port.append_attribute("id").set_value(static_cast(node->insData.size() + oport)); port.append_attribute("precision").set_value(node->outData[oport]->getPrecision().name()); for (const auto dim : node->outData[oport]->getDims()) { - port.append_child("dim").text().set(dim); + port.append_child("dim").text().set(static_cast(dim)); } } } @@ -333,8 +333,8 @@ std::size_t FillXmlDoc(const InferenceEngine::CNNNetwork& network, pugi::xml_doc if (!dataIt.second) continue; size_t dataSize = dataIt.second->byteSize(); pugi::xml_node data = blobsNode.append_child(dataIt.first.c_str()); - data.append_attribute("offset").set_value(dataOffset); - data.append_attribute("size").set_value(dataSize); + data.append_attribute("offset").set_value(static_cast(dataOffset)); + data.append_attribute("size").set_value(static_cast(dataSize)); data.append_attribute("precision").set_value(dataIt.second->getTensorDesc().getPrecision().name()); dataOffset += dataSize; @@ -364,11 +364,11 @@ std::size_t FillXmlDoc(const InferenceEngine::CNNNetwork& network, pugi::xml_doc << inputTo.first << "during serialization of IR"; } pugi::xml_node edge = edges.append_child("edge"); - edge.append_attribute("from-layer").set_value(itFrom->second); - edge.append_attribute("from-port").set_value(oport + node->insData.size()); + edge.append_attribute("from-layer").set_value(static_cast(itFrom->second)); + edge.append_attribute("from-port").set_value(static_cast(oport + node->insData.size())); - edge.append_attribute("to-layer").set_value(itTo->second); - edge.append_attribute("to-port").set_value(iport); + edge.append_attribute("to-layer").set_value(static_cast(itTo->second)); + edge.append_attribute("to-port").set_value(static_cast(iport)); } } } diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index f9f18b4eb65..db618e3fe48 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -181,7 +181,7 @@ public: void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { check_attribute_name(name); - m_node.append_attribute(name.c_str()).set_value(adapter.get()); + m_node.append_attribute(name.c_str()).set_value(static_cast(adapter.get())); } void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { @@ -275,17 +275,18 @@ class XmlSerializer : public ngraph::AttributeVisitor { for (const auto& input_description : input_descriptions) { pugi::xml_node input = port_map.append_child("input"); - input.append_attribute("external_port_id").set_value(input_description->m_input_index); + input.append_attribute("external_port_id") + .set_value(static_cast(input_description->m_input_index)); input.append_attribute("internal_layer_id") .set_value(parameter_mapping[input_description->m_body_parameter_index].c_str()); if (auto slice_input = ov::as_type_ptr(input_description)) { - input.prepend_attribute("axis").set_value(slice_input->m_axis); - input.append_attribute("start").set_value(slice_input->m_start); - input.append_attribute("end").set_value(slice_input->m_end); - input.append_attribute("stride").set_value(slice_input->m_stride); - input.append_attribute("part_size").set_value(slice_input->m_part_size); + input.prepend_attribute("axis").set_value(static_cast(slice_input->m_axis)); + input.append_attribute("start").set_value(static_cast(slice_input->m_start)); + input.append_attribute("end").set_value(static_cast(slice_input->m_end)); + input.append_attribute("stride").set_value(static_cast(slice_input->m_stride)); + input.append_attribute("part_size").set_value(static_cast(slice_input->m_part_size)); } else if (auto merged_input = ov::as_type_ptr(input_description)) { pugi::xml_node back_edges = m_xml_node.parent().child("back_edges"); @@ -314,17 +315,18 @@ class XmlSerializer : public ngraph::AttributeVisitor { for (const auto& output_description : output_descriptions) { pugi::xml_node output = port_map.append_child("output"); - output.append_attribute("external_port_id").set_value(input_count + output_description->m_output_index); + output.append_attribute("external_port_id") + .set_value(static_cast(input_count + output_description->m_output_index)); output.append_attribute("internal_layer_id") .set_value(result_mapping[output_description->m_body_value_index].c_str()); if (auto concat_output = ov::as_type_ptr(output_description)) { - output.prepend_attribute("axis").set_value(concat_output->m_axis); - output.append_attribute("start").set_value(concat_output->m_start); - output.append_attribute("end").set_value(concat_output->m_end); - output.append_attribute("stride").set_value(concat_output->m_stride); - output.append_attribute("part_size").set_value(concat_output->m_part_size); + output.prepend_attribute("axis").set_value(static_cast(concat_output->m_axis)); + output.append_attribute("start").set_value(static_cast(concat_output->m_start)); + output.append_attribute("end").set_value(static_cast(concat_output->m_end)); + output.append_attribute("stride").set_value(static_cast(concat_output->m_stride)); + output.append_attribute("part_size").set_value(static_cast(concat_output->m_part_size)); } } } @@ -426,8 +428,8 @@ public: const int64_t size = a->get()->size(); int64_t offset = m_constant_write_handler.write(static_cast(a->get()->get_ptr()), size); - m_xml_node.append_attribute("offset").set_value(offset); - m_xml_node.append_attribute("size").set_value(size); + m_xml_node.append_attribute("offset").set_value(static_cast(offset)); + m_xml_node.append_attribute("size").set_value(static_cast(size)); } } else if (const auto& a = ngraph::as_type>(&adapter)) { @@ -480,7 +482,7 @@ public: m_xml_node.append_attribute(name.c_str()).set_value(adapter.get().c_str()); } void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { - m_xml_node.append_attribute(name.c_str()).set_value(adapter.get()); + m_xml_node.append_attribute(name.c_str()).set_value(static_cast(adapter.get())); } void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { m_xml_node.append_attribute(name.c_str()).set_value(adapter.get()); @@ -793,7 +795,7 @@ void ngfunction_2_ir(pugi::xml_node& netXml, if (!deterministic || !is_name_auto_generated(f)) { netXml.append_attribute("name").set_value(f.get_friendly_name().c_str()); } - netXml.append_attribute("version").set_value(version); + netXml.append_attribute("version").set_value(static_cast(version)); pugi::xml_node layers = netXml.append_child("layers"); const std::unordered_map layer_ids = create_layer_ids(f); diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/ops_cache.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/ops_cache.cpp index 7b271999370..e656008b8f8 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/ops_cache.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/ops_cache.cpp @@ -126,12 +126,12 @@ void OPCache::serialize_meta_info(const LayerTestsUtils::OPInfo &info, const std for (const auto &model : info.found_in_models) { pugi::xml_node model_node = models.append_child("model"); model_node.append_attribute("name").set_value(model.first.c_str()); - model_node.append_attribute("count").set_value(model.second); + model_node.append_attribute("count").set_value(static_cast(model.second)); } auto ports_info = root.append_child("ports_info"); for (const auto &port : info.ports_info) { auto port_node = ports_info.append_child("port"); - port_node.append_attribute("id").set_value(port.first); + port_node.append_attribute("id").set_value(static_cast(port.first)); if (port.second.min == std::numeric_limits::min()) { port_node.append_attribute("max").set_value("undefined"); port_node.append_attribute("min").set_value("undefined"); diff --git a/src/tests/ie_test_utils/functional_test_utils/src/summary/api_summary.cpp b/src/tests/ie_test_utils/functional_test_utils/src/summary/api_summary.cpp index 6a85fb32951..73fc383ce3b 100644 --- a/src/tests/ie_test_utils/functional_test_utils/src/summary/api_summary.cpp +++ b/src/tests/ie_test_utils/functional_test_utils/src/summary/api_summary.cpp @@ -200,11 +200,11 @@ void ApiSummary::saveReport() { for (const auto& stat_device : stat_entity.second) { pugi::xml_node entry = currentEntity.append_child(stat_device.first.c_str()); entry.append_attribute("implemented").set_value(stat_device.second.isImplemented); - entry.append_attribute("passed").set_value(stat_device.second.passed); - entry.append_attribute("failed").set_value(stat_device.second.failed); - entry.append_attribute("skipped").set_value(stat_device.second.skipped); - entry.append_attribute("crashed").set_value(stat_device.second.crashed); - entry.append_attribute("hanged").set_value(stat_device.second.hanged); + entry.append_attribute("passed").set_value(static_cast(stat_device.second.passed)); + entry.append_attribute("failed").set_value(static_cast(stat_device.second.failed)); + entry.append_attribute("skipped").set_value(static_cast(stat_device.second.skipped)); + entry.append_attribute("crashed").set_value(static_cast(stat_device.second.crashed)); + entry.append_attribute("hanged").set_value(static_cast(stat_device.second.hanged)); entry.append_attribute("passrate").set_value(stat_device.second.getPassrate()); } } diff --git a/src/tests/ie_test_utils/functional_test_utils/src/summary/op_summary.cpp b/src/tests/ie_test_utils/functional_test_utils/src/summary/op_summary.cpp index df30ad35e5a..06adc1d8231 100644 --- a/src/tests/ie_test_utils/functional_test_utils/src/summary/op_summary.cpp +++ b/src/tests/ie_test_utils/functional_test_utils/src/summary/op_summary.cpp @@ -302,11 +302,11 @@ void OpSummary::saveReport() { opList.insert(name); pugi::xml_node entry = currentDeviceNode.append_child(name.c_str()); entry.append_attribute("implemented").set_value(it.second.isImplemented); - entry.append_attribute("passed").set_value(it.second.passed); - entry.append_attribute("failed").set_value(it.second.failed); - entry.append_attribute("skipped").set_value(it.second.skipped); - entry.append_attribute("crashed").set_value(it.second.crashed); - entry.append_attribute("hanged").set_value(it.second.hanged); + entry.append_attribute("passed").set_value(static_cast(it.second.passed)); + entry.append_attribute("failed").set_value(static_cast(it.second.failed)); + entry.append_attribute("skipped").set_value(static_cast(it.second.skipped)); + entry.append_attribute("crashed").set_value(static_cast(it.second.crashed)); + entry.append_attribute("hanged").set_value(static_cast(it.second.hanged)); entry.append_attribute("passrate").set_value(it.second.getPassrate()); } @@ -317,11 +317,11 @@ void OpSummary::saveReport() { if (opList.find(item.first) == opList.end()) { entry = currentDeviceNode.append_child(item.first.c_str()); entry.append_attribute("implemented").set_value(item.second.isImplemented); - entry.append_attribute("passed").set_value(item.second.passed); - entry.append_attribute("failed").set_value(item.second.failed); - entry.append_attribute("skipped").set_value(item.second.skipped); - entry.append_attribute("crashed").set_value(item.second.crashed); - entry.append_attribute("hanged").set_value(item.second.hanged); + entry.append_attribute("passed").set_value(static_cast(item.second.passed)); + entry.append_attribute("failed").set_value(static_cast(item.second.failed)); + entry.append_attribute("skipped").set_value(static_cast(item.second.skipped)); + entry.append_attribute("crashed").set_value(static_cast(item.second.crashed)); + entry.append_attribute("hanged").set_value(static_cast(item.second.hanged)); entry.append_attribute("passrate").set_value(item.second.getPassrate()); } else { entry = currentDeviceNode.child(item.first.c_str()); @@ -336,11 +336,11 @@ void OpSummary::saveReport() { (implStatus || obj.isImplemented) ? entry.attribute("implemented").set_value(true) : entry.attribute("implemented").set_value(false); - entry.attribute("passed").set_value(obj.passed); - entry.attribute("failed").set_value(obj.failed); - entry.attribute("skipped").set_value(obj.skipped); - entry.attribute("crashed").set_value(obj.crashed); - entry.attribute("hanged").set_value(obj.hanged); + entry.attribute("passed").set_value(static_cast(obj.passed)); + entry.attribute("failed").set_value(static_cast(obj.failed)); + entry.attribute("skipped").set_value(static_cast(obj.skipped)); + entry.attribute("crashed").set_value(static_cast(obj.crashed)); + entry.attribute("hanged").set_value(static_cast(obj.hanged)); entry.attribute("passrate").set_value(obj.getPassrate()); } } diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 0015ea411d5..a7cd5f416c1 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -77,6 +77,8 @@ if(ENABLE_SYSTEM_PUGIXML) else() message(FATAL_ERROR "Failed to detect pugixml library target name") endif() + # to property generate OpenVINO Developer packages files + set(PugiXML_FOUND ${PugiXML_FOUND} CACHE BOOL "" FORCE) elseif(PkgConfig_FOUND AND NOT ANDROID) # U18 case when cmake interface is not available pkg_search_module(pugixml QUIET @@ -97,6 +99,17 @@ if(ENABLE_SYSTEM_PUGIXML) endif() endif() + # debian 9 case: no cmake, no pkg-config files + if(NOT TARGET ${pugixml_target}) + find_library(PUGIXML_LIBRARY NAMES pugixml DOC "Path to pugixml library") + if(PUGIXML_LIBRARY) + add_library(pugixml INTERFACE IMPORTED GLOBAL) + set_target_properties(pugixml PROPERTIES INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}") + set(pugixml_target pugixml) + set(PugiXML_FOUND ON) + endif() + endif() + if(TARGET ${pugixml_target}) # we need to install dynamic library for wheel package get_target_property(target_type ${pugixml_target} TYPE)