From 95e309668471c2808d86d8dea1ec392b8729482b Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 1 Oct 2023 23:23:06 +0400 Subject: [PATCH] Added build on RedHat system to build & test RPM packages (#20134) * Added GHA workflow for RPM packages * Avoid rebuild for RPM / Debian packages * Removed conditional include headers * try only post-build * Beautification * Fixed testdata generation for mulit-config generators --- .github/workflows/fedora.yml | 224 ++++++++++++++++++ .github/workflows/linux.yml | 18 +- CMakeLists.txt | 36 ++- .../compile_flags/os_flags.cmake | 6 + cmake/developer_package/cpplint/cpplint.cmake | 9 +- .../frontends/frontends.cmake | 24 +- .../openvino/cmake/CythonConfig.cmake | 6 +- src/cmake/openvino.cmake | 2 +- src/core/tests/frontend/CMakeLists.txt | 6 +- src/frontends/paddle/tests/CMakeLists.txt | 4 +- src/frontends/tensorflow/tests/CMakeLists.txt | 4 +- .../tensorflow_lite/tests/CMakeLists.txt | 4 +- src/inference/CMakeLists.txt | 6 +- .../commit_slider/utils/cfg_samples/e2e.json | 2 +- .../src/kernel_selector/CMakeLists.txt | 4 +- .../tools/mo/utils/find_ie_version.py | 21 +- .../mock_mo_python_api/CMakeLists.txt | 4 +- 17 files changed, 296 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/fedora.yml diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml new file mode 100644 index 00000000000000..9602180ab66c4e --- /dev/null +++ b/.github/workflows/fedora.yml @@ -0,0 +1,224 @@ +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 + 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: | + python3 -m pip install -U pip + # 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: Cmake build - OpenVINO + run: cmake --build ${BUILD_DIR} --parallel --verbose + + - 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 \ + ${BUILD_DIR} + cmake --build ${BUILD_DIR} --parallel --target package --verbose + + # + # 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 --allowerasing -y *.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 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index aefe5227b6a840..aae1d5936024a4 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -88,12 +88,7 @@ jobs: bash ${OPENVINO_REPO}/install_build_dependencies.sh # default-jdk - Java API # libssl1.1 - 'python3 -m pip' in self-hosted runner - # unzip - to download ninja - apt install --assume-yes --no-install-recommends default-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 default-jdk libssl1.1 - uses: actions/setup-python@v4 with: @@ -126,9 +121,6 @@ jobs: # Build # - - name: Setup ccache dir - run: mkdir -p ${CCACHE_DIR} - - name: CMake configure - OpenVINO run: | cmake \ @@ -145,7 +137,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} @@ -180,12 +171,11 @@ jobs: /usr/bin/python3.8 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt /usr/bin/python3.8 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/src/compatibility/openvino/requirements-dev.txt cmake -UPYTHON* \ - -DCPACK_GENERATOR=DEB \ -DENABLE_PYTHON_PACKAGING=ON \ - -DPython3_EXECUTABLE=/usr/bin/python3.8 \ -DENABLE_TESTS=OFF \ - -S ${OPENVINO_REPO} \ - -B ${BUILD_DIR} + -DPython3_EXECUTABLE=/usr/bin/python3.8 \ + -DCPACK_GENERATOR=DEB \ + ${BUILD_DIR} cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --target package - name: Cmake & Build - OpenVINO Contrib 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() 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/cmake/openvino.cmake b/src/cmake/openvino.cmake index d187c007c75d2d..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(TARGET openvino PRE_BUILD + 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} 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/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/inference/CMakeLists.txt b/src/inference/CMakeLists.txt index 99f3670e4fa918..19bf83c27e18f9 100644 --- a/src/inference/CMakeLists.txt +++ b/src/inference/CMakeLists.txt @@ -23,7 +23,10 @@ file (GLOB LIBRARY_SRC set(IE_STATIC_DEPENDENT_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/file_utils.cpp) list(REMOVE_ITEM LIBRARY_SRC ${IE_STATIC_DEPENDENT_FILES}) -if(ENABLE_IR_V7_READER) +if(BUILD_SHARED_LIBS OR ENABLE_IR_V7_READER) + # TODO: remove together with GNA plugin + # we have unconditional adding of the ENABLE_IR_V7_READER compile definition for shared libs case + # to avoid rebuild, relink during work with build tree set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/ie_network_reader.cpp PROPERTIES COMPILE_DEFINITIONS "ENABLE_IR_V7_READER") endif() @@ -149,7 +152,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" $ $) 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/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() 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})