From 22558e2af81a81253d4be74440adeb08148a7f36 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 29 Sep 2023 00:04:28 +0800 Subject: [PATCH 1/6] Added GHA workflow for RPM packages --- .github/workflows/fedara.yml | 292 +++++++++++++++++++++++++++++++++++ .github/workflows/linux.yml | 14 +- 2 files changed, 293 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/fedara.yml diff --git a/.github/workflows/fedara.yml b/.github/workflows/fedara.yml new file mode 100644 index 00000000000000..3cc3988659b516 --- /dev/null +++ b/.github/workflows/fedara.yml @@ -0,0 +1,292 @@ +name: Fedora (RHEL), Python 3.9 +on: + workflow_dispatch: + pull_request: + paths-ignore: + - '**/docs/**' + - 'docs/**' + - '**/**.md' + - '**.md' + - '**/layer_tests_summary/**' + - '**/conformance/**' + push: + paths-ignore: + - '**/docs/**' + - 'docs/**' + - '**/**.md' + - '**.md' + - '**/layer_tests_summary/**' + - '**/conformance/**' + branches: + - master + - 'releases/**' + +concurrency: + # github.ref is not unique in post-commit + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-fedora33 + cancel-in-progress: true + +jobs: + Build: + defaults: + run: + shell: bash + runs-on: aks-linux-16-cores + container: + image: fedora:33 + volumes: + - /mount/caches:/mount/caches + env: + CMAKE_BUILD_TYPE: 'Release' + CMAKE_GENERATOR: 'Ninja' + CMAKE_CXX_COMPILER_LAUNCHER: ccache + CMAKE_C_COMPILER_LAUNCHER: ccache + GITHUB_WORKSPACE: '/__w/openvino/openvino' + OPENVINO_REPO: /__w/openvino/openvino/openvino + INSTALL_DIR: /__w/openvino/openvino/openvino_install + INSTALL_TEST_DIR: /__w/openvino/openvino/tests_install + BUILD_DIR: /__w/openvino/openvino/openvino_build + OPENVINO_CONTRIB_BUILD_DIR: /__w/openvino/openvino/openvino_contrib_build + CCACHE_DIR: /mount/caches/ccache/fedora33_x86_64_Release + CCACHE_TEMPDIR: /__w/openvino/openvino/ccache_temp + CCACHE_MAXSIZE: 50G + steps: + - name: Install git + run: yum update -y && yum install -y git + + - name: Clone OpenVINO + uses: actions/checkout@v4 + with: + path: ${{ env.OPENVINO_REPO }} + submodules: 'true' + + # + # Dependencies + # + + - name: Install build dependencies + run: bash ${OPENVINO_REPO}/install_build_dependencies.sh + + - name: Install python dependencies + run: | + # For Python API: build and wheel packaging + python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt + python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/src/compatibility/openvino/requirements-dev.txt + + # For running ONNX frontend unit tests + python3 -m pip install --force-reinstall -r ${OPENVINO_REPO}/src/frontends/onnx/tests/requirements.txt + + # For running TensorFlow frontend unit tests + python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow/tests/requirements.txt + + # For running TensorFlow Lite frontend unit tests + python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow_lite/tests/requirements.txt + + # For running Paddle frontend unit tests + python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/paddle/tests/requirements.txt + + # + # Build + # + + - name: CMake configure - OpenVINO + run: | + cmake \ + -G "${{ env.CMAKE_GENERATOR }}" \ + -DENABLE_CPPLINT=OFF \ + -DENABLE_NCC_STYLE=OFF \ + -DENABLE_TESTS=ON \ + -DENABLE_STRICT_DEPENDENCIES=OFF \ + -DENABLE_SYSTEM_TBB=ON \ + -DENABLE_SYSTEM_OPENCL=ON \ + -DENABLE_SYSTEM_PUGIXML=ON \ + -DENABLE_PYTHON_PACKAGING=ON \ + -DCPACK_GENERATOR=TGZ \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ + -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \ + -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \ + -S ${OPENVINO_REPO} \ + -B ${BUILD_DIR} + + - name: Clean ccache stats + run: ccache --zero-stats --show-config + + - name: Cmake build - OpenVINO + run: cmake --build ${BUILD_DIR} --parallel + + - name: Show ccache stats + run: ccache --show-stats + + - name: Cmake install - OpenVINO + run: | + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -P ${BUILD_DIR}/cmake_install.cmake + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_TEST_DIR} -DCOMPONENT=tests -P ${BUILD_DIR}/cmake_install.cmake + cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCOMPONENT=python_wheels -P ${BUILD_DIR}/cmake_install.cmake + + - name: Pack Artifacts + run: | + pushd ${INSTALL_DIR} + tar -czvf ${BUILD_DIR}/openvino_package.tar.gz * + popd + + pushd ${INSTALL_TEST_DIR} + tar -czvf ${BUILD_DIR}/openvino_tests.tar.gz * + popd + + - name: Build RPM packages + run: | + cmake -DCPACK_GENERATOR=RPM \ + -DENABLE_TESTS=OFF \ + -S ${OPENVINO_REPO} \ + -B ${BUILD_DIR} + cmake --build ${BUILD_DIR} --parallel --target package + + # + # Upload build artifacts + # + + - name: Upload openvino package + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: openvino_package + path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz + if-no-files-found: 'error' + + - name: Upload openvino RPM packages + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: openvino_rpm_packages + path: ${{ env.BUILD_DIR }}/*.rpm + if-no-files-found: 'error' + + - name: Upload openvino tests package + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: openvino_tests + path: ${{ env.BUILD_DIR }}/openvino_tests.tar.gz + if-no-files-found: 'error' + + RPM_Packages: + needs: Build + defaults: + run: + shell: bash + runs-on: ubuntu-20.04 + container: + image: fedora:33 + env: + RPM_PACKAGES_DIR: /__w/openvino/packages/ + + steps: + - name: Create Directories + run: mkdir -p ${RPM_PACKAGES_DIR} + + - name: Download OpenVINO RPM packages + uses: actions/download-artifact@v3 + with: + name: openvino_rpm_packages + path: ${{ env.RPM_PACKAGES_DIR }} + + - name: Install RPM packages & check conflicts + run: | + tee > /tmp/openvino-2023.repo << EOF + [OpenVINO] + name=Intel(R) Distribution of OpenVINO 2023 + baseurl=https://yum.repos.intel.com/openvino/2023 + enabled=1 + gpgcheck=1 + repo_gpgcheck=1 + gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + EOF + + # install previous release version + mv /tmp/openvino-2023.repo /etc/yum.repos.d + yum install -y openvino + + # install current version + yum install *.rpm + working-directory: ${{ env.RPM_PACKAGES_DIR }} + + - name: Test RPM packages + run: | + /usr/share/openvino/samples/cpp/build_samples.sh + /usr/share/openvino/samples/c/build_samples.sh + ~/openvino_cpp_samples_build/intel64/Release/hello_query_device + python3 /usr/share/openvino/samples/python/hello_query_device/hello_query_device.py + python3 -c 'from openvino import Core; Core().get_property("CPU", "AVAILABLE_DEVICES")' + python3 -c 'from openvino import Core; Core().get_property("GPU", "AVAILABLE_DEVICES")' + python3 -c 'from openvino import Core; Core().get_property("AUTO", "SUPPORTED_METRICS")' + python3 -c 'from openvino import Core; Core().get_property("MULTI", "SUPPORTED_METRICS")' + python3 -c 'from openvino import Core; Core().get_property("HETERO", "SUPPORTED_METRICS")' + python3 -c 'from openvino import Core; Core().get_property("BATCH", "SUPPORTED_METRICS")' + python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 6' + benchmark_app --help + ovc --help + + Samples: + needs: Build + defaults: + run: + shell: bash + runs-on: ubuntu-20.04 + container: + image: fedora:33 + env: + INSTALL_DIR: /__w/openvino/openvino/install + INSTALL_TEST_DIR: /__w/openvino/openvino/install/tests + BUILD_DIR: /__w/openvino/openvino/build + + steps: + - name: Create Directories + run: mkdir -p ${INSTALL_DIR} ${INSTALL_TEST_DIR} + + # + # Initialize OpenVINO + # + + - name: Download OpenVINO package + uses: actions/download-artifact@v3 + with: + name: openvino_package + path: ${{ env.INSTALL_DIR }} + + - name: Download OpenVINO tests package + uses: actions/download-artifact@v3 + with: + name: openvino_tests + path: ${{ env.INSTALL_TEST_DIR }} + + - name: Extract OpenVINO packages + run: | + pushd ${INSTALL_DIR} + tar -xzf openvino_package.tar.gz -C ${INSTALL_DIR} && rm openvino_package.tar.gz || exit 1 + popd + pushd ${INSTALL_TEST_DIR} + tar -xzf openvino_tests.tar.gz -C ${INSTALL_DIR} && rm openvino_tests.tar.gz || exit 1 + popd + + - name: Install OpenVINO dependencies + run: ${INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh -y + + - name: Build cpp samples - GCC + run: ${INSTALL_DIR}/samples/cpp/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/cpp_samples + env: + CMAKE_COMPILE_WARNING_AS_ERROR: 'ON' + + - name: Build cpp samples - Clang + run: | + yum install -y clang + ${INSTALL_DIR}/samples/cpp/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/cpp_samples_clang + env: + CMAKE_COMPILE_WARNING_AS_ERROR: 'ON' + CC: clang + CXX: clang++ + + - name: Build c samples + run: ${INSTALL_DIR}/samples/c/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/c_samples + env: + CMAKE_COMPILE_WARNING_AS_ERROR: 'ON' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c7d20c346b5641..f2e0b55c33bc8f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,8 +1,5 @@ name: Tests on Linux (Ubuntu 20.04, Python 3.11) on: - schedule: - # at 00:00 on Wednesday and Saturday - - cron: '0 0 * * 3,6' workflow_dispatch: pull_request: paths-ignore: @@ -83,12 +80,7 @@ jobs: bash ${OPENVINO_REPO}/install_build_dependencies.sh # openjdk-11-jdk - Java API # libssl1.1 - 'python3 -m pip' in self-hosted runner - # unzip - to download ninja - apt install --assume-yes --no-install-recommends openjdk-11-jdk libssl1.1 unzip - - wget https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip - unzip ninja-linux.zip - cp -v ninja /usr/local/bin/ + apt install --assume-yes --no-install-recommends openjdk-11-jdk libssl1.1 - uses: actions/setup-python@v4 with: @@ -116,10 +108,6 @@ jobs: # Build # - - name: Setup ccache - run: | - mkdir -p $CCACHE_DIR - - name: CMake configure - OpenVINO run: | cmake \ From fea3dc8a092a1df4570f43d050eba2ac0018e07a Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 29 Sep 2023 05:12:50 +0800 Subject: [PATCH 2/6] Avoid rebuild for RPM / Debian packages --- .github/workflows/fedara.yml | 67 +------------------ .github/workflows/linux.yml | 1 - CMakeLists.txt | 36 +++++----- .../compile_flags/os_flags.cmake | 6 ++ 4 files changed, 23 insertions(+), 87 deletions(-) diff --git a/.github/workflows/fedara.yml b/.github/workflows/fedara.yml index 8b42968f6b6cf5..ee6922ef18911b 100644 --- a/.github/workflows/fedara.yml +++ b/.github/workflows/fedara.yml @@ -46,7 +46,6 @@ jobs: INSTALL_DIR: /__w/openvino/openvino/openvino_install INSTALL_TEST_DIR: /__w/openvino/openvino/tests_install BUILD_DIR: /__w/openvino/openvino/openvino_build - OPENVINO_CONTRIB_BUILD_DIR: /__w/openvino/openvino/openvino_contrib_build CCACHE_DIR: /mount/caches/ccache/fedora33_x86_64_Release CCACHE_TEMPDIR: /__w/openvino/openvino/ccache_temp CCACHE_MAXSIZE: 50G @@ -208,7 +207,7 @@ jobs: yum install -y openvino # install current version - yum install --allowerasing *.rpm + yum install --allowerasing -y *.rpm working-directory: ${{ env.RPM_PACKAGES_DIR }} - name: Test RPM packages @@ -226,67 +225,3 @@ jobs: python3 -c 'from openvino.frontend import FrontEndManager; assert len(FrontEndManager().get_available_front_ends()) == 6' benchmark_app --help ovc --help - - Samples: - needs: Build - defaults: - run: - shell: bash - runs-on: ubuntu-20.04 - container: - image: fedora:33 - env: - INSTALL_DIR: /__w/openvino/openvino/install - INSTALL_TEST_DIR: /__w/openvino/openvino/install/tests - BUILD_DIR: /__w/openvino/openvino/build - - steps: - - name: Create Directories - run: mkdir -p ${INSTALL_DIR} ${INSTALL_TEST_DIR} - - # - # Initialize OpenVINO - # - - - name: Download OpenVINO package - uses: actions/download-artifact@v3 - with: - name: openvino_package - path: ${{ env.INSTALL_DIR }} - - - name: Download OpenVINO tests package - uses: actions/download-artifact@v3 - with: - name: openvino_tests - path: ${{ env.INSTALL_TEST_DIR }} - - - name: Extract OpenVINO packages - run: | - pushd ${INSTALL_DIR} - tar -xzf openvino_package.tar.gz -C ${INSTALL_DIR} && rm openvino_package.tar.gz || exit 1 - popd - pushd ${INSTALL_TEST_DIR} - tar -xzf openvino_tests.tar.gz -C ${INSTALL_DIR} && rm openvino_tests.tar.gz || exit 1 - popd - - - name: Install OpenVINO dependencies - run: ${INSTALL_DIR}/install_dependencies/install_openvino_dependencies.sh -y - - - name: Build cpp samples - GCC - run: ${INSTALL_DIR}/samples/cpp/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/cpp_samples - env: - CMAKE_COMPILE_WARNING_AS_ERROR: 'ON' - - - name: Build cpp samples - Clang - run: | - yum install -y clang - ${INSTALL_DIR}/samples/cpp/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/cpp_samples_clang - env: - CMAKE_COMPILE_WARNING_AS_ERROR: 'ON' - CC: clang - CXX: clang++ - - - name: Build c samples - run: ${INSTALL_DIR}/samples/c/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/c_samples - env: - CMAKE_COMPILE_WARNING_AS_ERROR: 'ON' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2f4026a40af1d3..7e11cd5eadb92e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -134,7 +134,6 @@ jobs: -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \ -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \ - -DCMAKE_MINIMUM_REQUIRED_VERSION=3.20 \ -S ${OPENVINO_REPO} \ -B ${BUILD_DIR} diff --git a/CMakeLists.txt b/CMakeLists.txt index e4d31492a43f4e..e3630486535dda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,32 +2,28 @@ # SPDX-License-Identifier: Apache-2.0 # -if(NOT DEFINED CMAKE_MINIMUM_REQUIRED_VERSION) - if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS) - # 3.17: 'target_link_libraries' does not work correctly when called from - # different directory where 'add_library' is called: CMake generates - # incorrect OpenVINOConfig.cmake in this case - # 3.18: add_library cannot create ALIAS for non-GLOBAL targets - set(CMAKE_MINIMUM_REQUIRED_VERSION 3.18) +if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS) + # 3.17: 'target_link_libraries' does not work correctly when called from + # different directory where 'add_library' is called: CMake generates + # incorrect OpenVINOConfig.cmake in this case + # 3.18: add_library cannot create ALIAS for non-GLOBAL targets + cmake_minimum_required(VERSION 3.18) +else() + if(CPACK_GENERATOR STREQUAL "DEB") + # we have to use CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS variable + cmake_minimum_required(VERSION 3.20) else() - if(CPACK_GENERATOR STREQUAL "DEB") - # we have to use CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS variable - set(CMAKE_MINIMUM_REQUIRED_VERSION 3.20) + if(WIN32) + # 3.16: FindPython3.cmake can find Python via -DPython3_EXECUTABLE + # 3.18: FindPython3.cmake can find Python automatically from virtualenv + cmake_minimum_required(VERSION 3.16) else() - if(WIN32) - # 3.16: FindPython3.cmake can find Python via -DPython3_EXECUTABLE - # 3.18: FindPython3.cmake can find Python automatically from virtualenv - set(CMAKE_MINIMUM_REQUIRED_VERSION 3.16) - else() - # 3.13: default choice - set(CMAKE_MINIMUM_REQUIRED_VERSION 3.13) - endif() + # 3.13: default choice + cmake_minimum_required(VERSION 3.13) endif() endif() endif() -cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION}) - if(POLICY CMP0091) cmake_policy(SET CMP0091 NEW) # Enables use of MSVC_RUNTIME_LIBRARY endif() diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index db0e6a1a53fe8a..3202def116dbe9 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -299,7 +299,13 @@ if(NOT DEFINED CMAKE_CXX_STANDARD) else() set(CMAKE_CXX_STANDARD 11) endif() +endif() + +if(NOT DEFINED CMAKE_CXX_EXTENSIONS) set(CMAKE_CXX_EXTENSIONS OFF) +endif() + +if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) set(CMAKE_CXX_STANDARD_REQUIRED ON) endif() From efcdb8828db976e0a40e5ce4c099ef9f0fe8b436 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 29 Sep 2023 13:29:33 +0800 Subject: [PATCH 3/6] Removed conditional include headers --- src/inference/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/inference/CMakeLists.txt b/src/inference/CMakeLists.txt index 99f3670e4fa918..179305e573526d 100644 --- a/src/inference/CMakeLists.txt +++ b/src/inference/CMakeLists.txt @@ -149,7 +149,6 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE # for ov_plugins.hpp $,$>,${CMAKE_CURRENT_BINARY_DIR}/$,${CMAKE_CURRENT_BINARY_DIR}> # for ie_ir_version.hpp - $<$:$> "${OpenVINO_SOURCE_DIR}/src/plugins/intel_gna/legacy/include" $ $) From 8ab5aad355e16b94573f1c658ba03c147079c21b Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 1 Oct 2023 04:45:15 +0800 Subject: [PATCH 4/6] try only post-build --- src/cmake/openvino.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index a7ae9f5f442e11..73df6bf480719d 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -284,7 +284,7 @@ if(ENABLE_PKGCONFIG_GEN) set(pkgconfig_option "--validate") endif() - add_custom_command(OUTPUT "${pkgconfig_out}" + add_custom_command(TARGET openvino POST_BUILD COMMAND "${CMAKE_COMMAND}" --config $ -D PKG_CONFIG_IN_FILE=${pkgconfig_in} -D PKG_CONFIG_OUT_FILE=${pkgconfig_out} @@ -297,13 +297,9 @@ if(ENABLE_PKGCONFIG_GEN) -D PKGCONFIG_OpenVINO_PRIVATE_DEPS=${PKGCONFIG_OpenVINO_PRIVATE_DEPS} -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg_config_gen.cmake" COMMAND "${PKG_CONFIG_EXECUTABLE}" "${pkgconfig_option}" "${pkgconfig_out}" - DEPENDS "${pkgconfig_in}" - BYPRODUCTS "${pkgconfig_out}" COMMENT "[pkg-config] creation and validation of openvino.pc" VERBATIM) - add_custom_target(ov_pkgconfig_gen ALL DEPENDS "${pkgconfig_out}") - install(FILES "${pkgconfig_out}" DESTINATION "${OV_CPACK_RUNTIMEDIR}/pkgconfig" COMPONENT ${OV_CPACK_COMP_CORE_DEV}) From 67924650cae0ff12eb1ff6e85b2c938b92c2e6f8 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 1 Oct 2023 07:09:22 +0800 Subject: [PATCH 5/6] Beautification --- cmake/developer_package/cpplint/cpplint.cmake | 9 ++----- .../frontends/frontends.cmake | 24 +++++++++---------- .../openvino/cmake/CythonConfig.cmake | 6 ++++- src/core/tests/frontend/CMakeLists.txt | 6 ++--- .../src/kernel_selector/CMakeLists.txt | 4 ++-- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/cmake/developer_package/cpplint/cpplint.cmake b/cmake/developer_package/cpplint/cpplint.cmake index d4da25ea31952f..e22c8f2e034b96 100644 --- a/cmake/developer_package/cpplint/cpplint.cmake +++ b/cmake/developer_package/cpplint/cpplint.cmake @@ -14,7 +14,6 @@ endif() if(ENABLE_CPPLINT AND NOT TARGET cpplint_all) add_custom_target(cpplint_all ALL) set_target_properties(cpplint_all PROPERTIES FOLDER cpplint) - set(CPPLINT_ALL_OUTPUT_FILES "" CACHE INTERNAL "All cpplint output files") endif() function(add_cpplint_target TARGET_NAME) @@ -58,6 +57,7 @@ function(add_cpplint_target TARGET_NAME) endif() file(RELATIVE_PATH source_file_relative "${CMAKE_CURRENT_SOURCE_DIR}" "${source_file}") + file(RELATIVE_PATH source_file_relative_root "${CMAKE_SOURCE_DIR}" "${source_file}") set(output_file "${CMAKE_CURRENT_BINARY_DIR}/cpplint/${source_file_relative}.cpplint") string(REPLACE ".." "__" output_file "${output_file}") get_filename_component(output_dir "${output_file}" DIRECTORY) @@ -81,17 +81,12 @@ function(add_cpplint_target TARGET_NAME) "${IEDevScripts_DIR}/cpplint/cpplint.py" "${IEDevScripts_DIR}/cpplint/cpplint_run.cmake" COMMENT - "[cpplint] ${source_file}" + "[cpplint] ${source_file_relative_root}" VERBATIM) list(APPEND all_output_files "${output_file}") endforeach() - set(CPPLINT_ALL_OUTPUT_FILES - ${CPPLINT_ALL_OUTPUT_FILES} ${all_output_files} - CACHE INTERNAL - "All cpplint output files") - add_custom_target(${TARGET_NAME} ALL DEPENDS ${all_output_files} COMMENT "[cpplint] ${TARGET_NAME}") diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake index 964dc6da443e81..78e62101670425 100644 --- a/cmake/developer_package/frontends/frontends.cmake +++ b/cmake/developer_package/frontends/frontends.cmake @@ -127,17 +127,17 @@ macro(ov_add_frontend) # Generate protobuf file on build time for each '.proto' file in src/proto file(GLOB proto_files ${frontend_root_dir}/src/proto/*.proto) - foreach(INFILE IN LISTS proto_files) - get_filename_component(FILE_DIR ${INFILE} DIRECTORY) - get_filename_component(FILE_WE ${INFILE} NAME_WE) + foreach(proto_file IN LISTS proto_files) + file(RELATIVE_PATH proto_file_relative "${CMAKE_SOURCE_DIR}" "${proto_file}") + get_filename_component(FILE_DIR ${proto_file} DIRECTORY) + get_filename_component(FILE_WE ${proto_file} NAME_WE) set(OUTPUT_PB_SRC ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.cc) set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.h) - set(GENERATED_PROTO ${INFILE}) add_custom_command( OUTPUT "${OUTPUT_PB_SRC}" "${OUTPUT_PB_HEADER}" COMMAND ${PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${FILE_DIR} ${FILE_WE}.proto - DEPENDS ${PROTOC_DEPENDENCY} ${GENERATED_PROTO} - COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${GENERATED_PROTO}" + DEPENDS ${PROTOC_DEPENDENCY} ${proto_file} + COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${proto_file_relative}" VERBATIM COMMAND_EXPAND_LISTS) list(APPEND PROTO_SRCS "${OUTPUT_PB_SRC}") @@ -145,15 +145,15 @@ macro(ov_add_frontend) endforeach() file(GLOB flatbuffers_schema_files ${frontend_root_dir}/src/schema/*.fbs) - foreach(INFILE IN LISTS flatbuffers_schema_files) - get_filename_component(FILE_WE ${INFILE} NAME_WE) + foreach(flatbuffers_schema_file IN LISTS flatbuffers_schema_files) + file(RELATIVE_PATH flatbuffers_schema_file_relative "${CMAKE_SOURCE_DIR}" "${flatbuffers_schema_file}") + get_filename_component(FILE_WE "${flatbuffers_schema_file}" NAME_WE) set(OUTPUT_FC_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}_generated.h) - set(GENERATED_PROTO ${INFILE}) add_custom_command( OUTPUT "${OUTPUT_FC_HEADER}" - COMMAND ${flatbuffers_COMPILER} ARGS -c --gen-mutable -o ${CMAKE_CURRENT_BINARY_DIR} ${INFILE} - DEPENDS ${flatbuffers_DEPENDENCY} ${GENERATED_PROTO} - COMMENT "Running C++ flatbuffers compiler (${flatbuffers_COMPILER}) on ${GENERATED_PROTO}" + COMMAND ${flatbuffers_COMPILER} ARGS -c --gen-mutable -o ${CMAKE_CURRENT_BINARY_DIR} ${flatbuffers_schema_file} + DEPENDS ${flatbuffers_DEPENDENCY} ${flatbuffers_schema_file} + COMMENT "Running C++ flatbuffers compiler (${flatbuffers_COMPILER}) on ${flatbuffers_schema_file_relative}" VERBATIM COMMAND_EXPAND_LISTS) list(APPEND PROTO_HDRS "${OUTPUT_FC_HEADER}") diff --git a/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake b/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake index b27dcbc7e84f2f..8d02cf9890a5be 100644 --- a/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake +++ b/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake @@ -68,7 +68,11 @@ if(CYTHON_EXIT_CODE EQUAL 0) string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+(\\.[0-9]+)?).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}") else() if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) - set(CYTHON_MESSAGE_MODE TRACE) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) + set(CYTHON_MESSAGE_MODE TRACE) + else() + set(CYTHON_MESSAGE_MODE WARNING) + endif() endif() if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) set(CYTHON_MESSAGE_MODE FATAL_ERROR) diff --git a/src/core/tests/frontend/CMakeLists.txt b/src/core/tests/frontend/CMakeLists.txt index 8f6d2a17b40b6f..dd096fed759a94 100644 --- a/src/core/tests/frontend/CMakeLists.txt +++ b/src/core/tests/frontend/CMakeLists.txt @@ -4,7 +4,7 @@ set(SRC ${CMAKE_CURRENT_SOURCE_DIR}/mock_frontend.cpp) set(MOCK1_FE_NAME openvino_mock1_frontend) -add_library(${MOCK1_FE_NAME} SHARED EXCLUDE_FROM_ALL ${SRC}) +add_library(${MOCK1_FE_NAME} SHARED ${SRC}) ov_add_library_version(${MOCK1_FE_NAME}) @@ -18,5 +18,5 @@ add_dependencies(ov_core_unit_tests ${MOCK1_FE_NAME}) ov_add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME}) install(TARGETS ${MOCK1_FE_NAME} - RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL - LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) + RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt index 81637375d811b3..e223e3ad1aa962 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt +++ b/src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt @@ -81,8 +81,8 @@ elseif((NOT ANDROID) AND UNIX) target_link_libraries(${TARGET_NAME} PRIVATE pthread) endif() -if(WIN32) - set(TUNING_CACHE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$") +if(OV_GENERATOR_MULTI_CONFIG) + set(TUNING_CACHE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$") else() set(TUNING_CACHE_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/") endif() From 9454ec513178066f8a874e860950cd404cbc0157 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 1 Oct 2023 21:17:23 +0800 Subject: [PATCH 6/6] Fixed testdata generation for mulit-config generators --- src/frontends/paddle/tests/CMakeLists.txt | 4 ++-- src/frontends/tensorflow/tests/CMakeLists.txt | 4 ++-- .../tensorflow_lite/tests/CMakeLists.txt | 4 ++-- .../commit_slider/utils/cfg_samples/e2e.json | 2 +- .../tools/mo/utils/find_ie_version.py | 21 +++++++------------ .../mock_mo_python_api/CMakeLists.txt | 4 ++-- 6 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/frontends/paddle/tests/CMakeLists.txt b/src/frontends/paddle/tests/CMakeLists.txt index e9e1155381af87..236919d7dfda8f 100644 --- a/src/frontends/paddle/tests/CMakeLists.txt +++ b/src/frontends/paddle/tests/CMakeLists.txt @@ -44,7 +44,7 @@ endif() # PDPD 2.5.1 is not compatible with tests models we use set(paddlepaddle_FOUND OFF) -set(TEST_PADDLE_MODELS_DIRNAME test_model_zoo/paddle_test_models) +set(TEST_PADDLE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/paddle_test_models) target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_PADDLE_MODELS_DIRNAME=\"${TEST_PADDLE_MODELS_DIRNAME}/\") set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.1/ppdet/modeling/ops.py") @@ -58,7 +58,7 @@ DownloadAndCheck(${PADDLEDET_OPS_URL} ${PADDLEDET_DIRNAME}/ops.py PADDLEDET_FATA # This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have # 'paddlepaddle' installed to check code style if(paddlepaddle_FOUND AND PADDLEDET_RESULT) - set(TEST_PADDLE_MODELS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_PADDLE_MODELS_DIRNAME}/) + set(TEST_PADDLE_MODELS ${TEST_MODEL_ZOO_OUTPUT_DIR}/paddle_test_models/) file(GLOB_RECURSE PADDLE_ALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/*.py) set(OUT_FILE ${TEST_PADDLE_MODELS}/generate_done.txt) diff --git a/src/frontends/tensorflow/tests/CMakeLists.txt b/src/frontends/tensorflow/tests/CMakeLists.txt index 4adb81882c2a42..ccffb195159b35 100644 --- a/src/frontends/tensorflow/tests/CMakeLists.txt +++ b/src/frontends/tensorflow/tests/CMakeLists.txt @@ -33,7 +33,7 @@ ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirement WARNING_MESSAGE "TensorFlow testing models weren't generated, some tests will fail due models not found" RESULT_VAR tensorflow_FOUND) -set(TEST_TENSORFLOW_MODELS_DIRNAME test_model_zoo/tensorflow_test_models) +set(TEST_TENSORFLOW_MODELS_DIRNAME ${TEST_MODEL_ZOO}/tensorflow_test_models) target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_MODELS_DIRNAME=\"${TEST_TENSORFLOW_MODELS_DIRNAME}/\") # If 'tensorflow' is not found, code will still be compiled @@ -41,7 +41,7 @@ target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_MODELS_DIRN # This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have # 'tensorflow' installed to check code style if (tensorflow_FOUND) - set(TEST_TENSORFLOW_MODELS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TENSORFLOW_MODELS_DIRNAME}/) + set(TEST_TENSORFLOW_MODELS ${TEST_MODEL_ZOO_OUTPUT_DIR}/tensorflow_test_models/) file(GLOB_RECURSE TENSORFLOW_GEN_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/test_models/gen_scripts/generate_*.py) file(GLOB_RECURSE TENSORFLOW_MODELS_PBTXT ${CMAKE_CURRENT_SOURCE_DIR}/test_models/models_pbtxt/*.pbtxt) diff --git a/src/frontends/tensorflow_lite/tests/CMakeLists.txt b/src/frontends/tensorflow_lite/tests/CMakeLists.txt index 8869e5b4907ec5..5e0b544db2620c 100644 --- a/src/frontends/tensorflow_lite/tests/CMakeLists.txt +++ b/src/frontends/tensorflow_lite/tests/CMakeLists.txt @@ -27,7 +27,7 @@ ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirement WARNING_MESSAGE "TensorFlow Lite testing models weren't generated, some tests will fail due models not found" RESULT_VAR tensorflow_FOUND) -set(TEST_TENSORFLOW_LITE_MODELS_DIRNAME test_model_zoo/tensorflow_lite_test_models) +set(TEST_TENSORFLOW_LITE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/tensorflow_lite_test_models) target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_LITE_MODELS_DIRNAME=\"${TEST_TENSORFLOW_LITE_MODELS_DIRNAME}/\") # If 'tensorflow' is not found, code will still be compiled @@ -35,7 +35,7 @@ target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_LITE_MODELS # This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have # 'tensorflow' installed to check code style if (tensorflow_FOUND) - set(TEST_TENSORFLOW_LITE_MODELS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TENSORFLOW_LITE_MODELS_DIRNAME}/) + set(TEST_TENSORFLOW_LITE_MODELS "${TEST_MODEL_ZOO_OUTPUT_DIR}/tensorflow_lite_test_models") file(GLOB_RECURSE TENSORFLOW_GEN_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/test_models/gen_scripts/generate_*.py) file(GLOB_RECURSE TENSORFLOW_ALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/*.py) diff --git a/src/plugins/intel_cpu/tools/commit_slider/utils/cfg_samples/e2e.json b/src/plugins/intel_cpu/tools/commit_slider/utils/cfg_samples/e2e.json index 23cffb03ba6325..0d3e87088d5d7a 100644 --- a/src/plugins/intel_cpu/tools/commit_slider/utils/cfg_samples/e2e.json +++ b/src/plugins/intel_cpu/tools/commit_slider/utils/cfg_samples/e2e.json @@ -2,7 +2,7 @@ "appPath" : "//e2e/frameworks.ai.openvino.tests/e2e_oss/", "appCmd" : "pytest test_dynamism.py ", "envVars" : [ - {"name" : "PYTHONPATH", "val" : "//bin/intel64/Release/python_api/python3.8/"}, + {"name" : "PYTHONPATH", "val" : "//bin/intel64/Release/python/"}, {"name" : "LD_LIBRARY_PATH", "val" : "//bin/intel64/Release/"}, {"name" : "MO_ROOT", "val" : "//tools/mo/openvino/tools/"}, {"name" : "OPENVINO_ROOT_DIR", "val" : "//"} diff --git a/tools/mo/openvino/tools/mo/utils/find_ie_version.py b/tools/mo/openvino/tools/mo/utils/find_ie_version.py index de9aef5d079e43..eb1886dbff1cd9 100644 --- a/tools/mo/openvino/tools/mo/utils/find_ie_version.py +++ b/tools/mo/openvino/tools/mo/utils/find_ie_version.py @@ -78,25 +78,21 @@ def find_ie_version(silent=False): if try_to_import_ie(silent=silent): return True - python_version = 'python{}.{}'.format(sys.version_info[0], sys.version_info[1]) - script_path = os.path.realpath(os.path.dirname(__file__)) # Windows bindings_paths_windows = [ # Local builds { - "module": os.path.join(script_path, '../../../../../../bin/intel64/Release/python_api/', python_version), + "module": os.path.join(script_path, '../../../../../../bin/intel64/Release/python/'), "libs": [ - os.path.join(script_path, '../../../../../../bin/intel64'), os.path.join(script_path, '../../../../../../bin/intel64/Release'), os.path.join(script_path, '../../../../../../temp/tbb/bin'), ] }, { - "module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/python_api/', python_version), + "module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/python/'), "libs": [ - os.path.join(script_path, '../../../../../../bin/intel64'), os.path.join(script_path, '../../../../../../bin/intel64/Debug'), os.path.join(script_path, '../../../../../../temp/tbb/bin'), ] @@ -107,22 +103,21 @@ def find_ie_version(silent=False): bindings_paths_linux = [ # Local builds { - "module": os.path.join(script_path, '../../../../../../bin/intel64/Release/lib/python_api/', python_version), + "module": os.path.join(script_path, '../../../../../../bin/intel64/Release/python/'), "libs": [ - os.path.join(script_path, '../../../../../../bin/intel64/Release/lib'), + os.path.join(script_path, '../../../../../../bin/intel64/Release'), ] }, - { - "module": os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo/lib/python_api/', python_version), + "module": os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo/python'), "libs": [ - os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo/lib'), + os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo'), ] }, { - "module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/lib/python_api/', python_version), + "module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/python'), "libs": [ - os.path.join(script_path, '../../../../../../bin/intel64/Debug/lib'), + os.path.join(script_path, '../../../../../../bin/intel64/Debug'), ] } ] diff --git a/tools/mo/unit_tests/mock_mo_frontend/mock_mo_python_api/CMakeLists.txt b/tools/mo/unit_tests/mock_mo_frontend/mock_mo_python_api/CMakeLists.txt index 9ae9e55a27a049..87e34e41fc2477 100644 --- a/tools/mo/unit_tests/mock_mo_frontend/mock_mo_python_api/CMakeLists.txt +++ b/tools/mo/unit_tests/mock_mo_frontend/mock_mo_python_api/CMakeLists.txt @@ -8,9 +8,9 @@ set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_OLD ${CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY} set(CMAKE_PDB_OUTPUT_DIRECTORY_OLD ${CMAKE_PDB_OUTPUT_DIRECTORY}) if(OV_GENERATOR_MULTI_CONFIG) - set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/python_api) + set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/python/openvino) else() - set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python_api) + set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python/openvino) endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY})