Compare commits
90 Commits
dev_111020
...
releases/2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4d9b68609 | ||
|
|
a8984f3761 | ||
|
|
a8a6e8f60a | ||
|
|
71ebd41475 | ||
|
|
3e8f2cc58b | ||
|
|
e8c1a59329 | ||
|
|
b371b52680 | ||
|
|
7ea2d668ad | ||
|
|
07f95e37b1 | ||
|
|
cd9aece3d7 | ||
|
|
2e6a746722 | ||
|
|
b37376100a | ||
|
|
0ed9857b97 | ||
|
|
6f801e5b34 | ||
|
|
5d5bbce492 | ||
|
|
4795391b73 | ||
|
|
f507ac0364 | ||
|
|
3347f930cb | ||
|
|
4dfeba454b | ||
|
|
f128545a2a | ||
|
|
2376b3b1a4 | ||
|
|
ca6f8fc9cf | ||
|
|
c6f2f9739c | ||
|
|
7d58dd59b6 | ||
|
|
5e81820a5b | ||
|
|
1d8112bba6 | ||
|
|
08794e70fe | ||
|
|
99384c7846 | ||
|
|
fc1e019ff5 | ||
|
|
8b4a953993 | ||
|
|
99c746f2c3 | ||
|
|
6b8f778d46 | ||
|
|
3d48b7f078 | ||
|
|
5c683584fc | ||
|
|
cf3e15bed5 | ||
|
|
106d5653c2 | ||
|
|
39447e08e7 | ||
|
|
176bdf5137 | ||
|
|
f730bf9ae9 | ||
|
|
422127e33d | ||
|
|
1e1eafe09d | ||
|
|
d2e3e1fc00 | ||
|
|
2a57c7bbe4 | ||
|
|
10274c0908 | ||
|
|
cb71090389 | ||
|
|
0335cdbbc6 | ||
|
|
ff878ffe92 | ||
|
|
8f507a07f5 | ||
|
|
a09de25dd2 | ||
|
|
86f96a8f3a | ||
|
|
6966e383d3 | ||
|
|
ab1a3e8d84 | ||
|
|
29d9462a9b | ||
|
|
c067ed1b9a | ||
|
|
bff2fe0b2f | ||
|
|
fd532c2611 | ||
|
|
1d68caf96f | ||
|
|
7bd3738afd | ||
|
|
5767a54fa2 | ||
|
|
56326a3d2d | ||
|
|
1baf72a780 | ||
|
|
c22e65e8a6 | ||
|
|
3964168205 | ||
|
|
a416a80c86 | ||
|
|
81152e07f3 | ||
|
|
a14fdef9b6 | ||
|
|
ce3bea3c07 | ||
|
|
707a0833d8 | ||
|
|
71cde81827 | ||
|
|
f4ed2572a5 | ||
|
|
ec02bc4dbd | ||
|
|
5a05e52d40 | ||
|
|
fee727f415 | ||
|
|
01c3951887 | ||
|
|
7715d033d2 | ||
|
|
1da3539bc1 | ||
|
|
ec8527f21e | ||
|
|
1c35875a60 | ||
|
|
1e392b0180 | ||
|
|
a05b7c76b2 | ||
|
|
3a9c731c2b | ||
|
|
641f1425df | ||
|
|
e67dffa6a3 | ||
|
|
7b85eef15f | ||
|
|
ea0f6fce5a | ||
|
|
6959f6671f | ||
|
|
322bc3498b | ||
|
|
6effe67358 | ||
|
|
759c91d547 | ||
|
|
5abbe2fec5 |
@@ -1,53 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
Analyze GTest logs
|
||||
"""
|
||||
|
||||
import re
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
def get_passed_tests(log_file_path):
|
||||
"""Gets passed tests with OK status"""
|
||||
ok_test_line_pattern = "[ OK ] "
|
||||
ok_tests = []
|
||||
with open(log_file_path) as log_file_obj:
|
||||
for line in log_file_obj.readlines():
|
||||
if ok_test_line_pattern in line:
|
||||
ok_tests.append(line.split(ok_test_line_pattern)[1])
|
||||
return ok_tests
|
||||
|
||||
|
||||
def get_total_time(tests):
|
||||
"""Gets total execution time (sec)"""
|
||||
re_compile_time = re.compile(r".+ \(([0-9]+) ms\)")
|
||||
total_time = 0.0
|
||||
for test in tests:
|
||||
re_time = re_compile_time.match(test)
|
||||
if re_time:
|
||||
total_time += int(re_time.group(1)) / 1000
|
||||
else:
|
||||
print("No time in the test line:", test)
|
||||
return total_time
|
||||
|
||||
|
||||
def main():
|
||||
"""The main entry point function"""
|
||||
arg_parser = ArgumentParser()
|
||||
arg_parser.add_argument(
|
||||
"--log-file", metavar="PATH", default="gtest.log", help="Path to GTest log file"
|
||||
)
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
passed_tests = get_passed_tests(args.log_file)
|
||||
print("PASSED tests count:", len(passed_tests))
|
||||
print("Total execution time of passed tests (sec):", get_total_time(passed_tests))
|
||||
|
||||
print("\nPASSED tests:")
|
||||
print("".join(sorted(passed_tests)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,6 +0,0 @@
|
||||
TransposeOpTest.NHWC2NCHW
|
||||
TransposeOpTest.NCHW2NHWC
|
||||
TransposeOpTest.TwoDim_int16
|
||||
GatherOpTest.Gather_axis1_indices2d_int16
|
||||
SoftmaxOperator.ThreeDimsAxis1
|
||||
SoftmaxOperator.ThreeDimsAxis0
|
||||
@@ -1 +0,0 @@
|
||||
rel-1.8.1
|
||||
@@ -1,67 +1,32 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: openvino_contrib
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
|
||||
jobs:
|
||||
- job: Lin
|
||||
strategy:
|
||||
matrix:
|
||||
Dynamic:
|
||||
CMAKE_BUILD_SHARED_LIBS: 'ON'
|
||||
Static:
|
||||
CMAKE_BUILD_SHARED_LIBS: 'OFF'
|
||||
maxParallel: 2
|
||||
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 90
|
||||
|
||||
pool:
|
||||
name: LIN_VMSS_VENV_F16S_U20_WU2
|
||||
name: LIN_VMSS_VENV_F8S_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
WORKERS_NUMBER: 8
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(REPO_DIR)/../openvino_contrib
|
||||
MODELS_PATH: $(REPO_DIR)/../testdata
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
BUILD_SAMPLES_DIR: $(WORK_DIR)/build_samples
|
||||
BUILD_LAYER_TESTS_DIR: $(WORK_DIR)/build_layer_tests
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
INSTALL_TEST_DIR: $(INSTALL_DIR)/tests
|
||||
LAYER_TESTS_DIR: $(INSTALL_TEST_DIR)/layer_tests
|
||||
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
|
||||
BIN_DIR: $(REPO_DIR)/bin/intel64/$(BUILD_TYPE)
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
which python3
|
||||
python3 --version
|
||||
which java
|
||||
java -version
|
||||
gcc --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
@@ -70,15 +35,11 @@ jobs:
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
|
||||
rm -rf $(BUILD_SAMPLES_DIR) ; mkdir $(BUILD_SAMPLES_DIR)
|
||||
echo TargetBranch: $(System.PullRequest.TargetBranch)
|
||||
echo SourceBranch: $(Build.SourceBranch)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- checkout: self
|
||||
@@ -87,32 +48,13 @@ jobs:
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- checkout: openvino_contrib
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino_contrib
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
$(REPO_DIR)/install_build_dependencies.sh
|
||||
# Move jdk into contrib
|
||||
sudo apt --assume-yes install openjdk-11-jdk
|
||||
# For opencv-python: python3-setuptools and pip upgrade
|
||||
python3 -m pip install --upgrade pip
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/requirements.txt
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/wheel/requirements-dev.txt
|
||||
# For running Python API tests
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||
# For running PaddlePaddle frontend unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/frontend/paddlepaddle/requirements_dev.txt
|
||||
# For running ONNX frontend unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/requirements_test_onnx.txt
|
||||
# For MO unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements.txt
|
||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements_dev.txt
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
# Speed up tests
|
||||
@@ -120,184 +62,90 @@ jobs:
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
# Should be after 'Install dependencies' because Git lfs is not installed
|
||||
- checkout: testdata
|
||||
clean: true
|
||||
lfs: true
|
||||
path: testdata
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
# CMake must get Python 3.x version by default
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DVERBOSE_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_PYTHON=ON
|
||||
-DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS)
|
||||
-DENABLE_GNA=$(CMAKE_BUILD_SHARED_LIBS)
|
||||
-DENABLE_CLDNN=$(CMAKE_BUILD_SHARED_LIBS)
|
||||
-DPYTHON_EXECUTABLE=/usr/bin/python3.8
|
||||
-DENABLE_WHEEL=ON
|
||||
-DENABLE_TESTS=ON
|
||||
-DNGRAPH_ONNX_FRONTEND_ENABLE=ON
|
||||
-DENABLE_FASTER_BUILD=ON
|
||||
-DENABLE_STRICT_DEPENDENCIES=OFF
|
||||
-DENABLE_REQUIREMENTS_INSTALL=OFF
|
||||
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
|
||||
$(REPO_DIR)
|
||||
cmakeArgs: -GNinja -DVERBOSE_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DENABLE_TESTS=ON $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/inference-engine/temp/
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Lin'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List bin files'
|
||||
displayName: 'List files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
$(REPO_DIR)/tests/layer_tests
|
||||
workingDirectory: $(BUILD_LAYER_TESTS_DIR)
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_LAYER_TESTS_DIR)
|
||||
displayName: 'Build Layer Tests'
|
||||
|
||||
- script: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_LAYER_TESTS_DIR)
|
||||
displayName: 'Install Layer Tests'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
mkdir $(INSTALL_DIR)/opencv/
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake
|
||||
cp -R $(REPO_DIR)/inference-engine/temp/opencv_4.5.2_ubuntu20/opencv/* $(INSTALL_DIR)/opencv/
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: $(INSTALL_DIR)/samples/cpp/build_samples.sh
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build cpp samples'
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
- script: $(INSTALL_DIR)/samples/c/build_samples.sh
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build c samples'
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
- script: rm -fr $(BUILD_DIR)
|
||||
displayName: 'Clean build dir'
|
||||
continueOnError: false
|
||||
|
||||
# Skip test_onnx/test_zoo_models and test_onnx/test_backend due to long execution time
|
||||
- script: |
|
||||
export DATA_PATH=$(MODELS_PATH)
|
||||
export MODELS_PATH=$(MODELS_PATH)
|
||||
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py
|
||||
displayName: 'nGraph Python Bindings Tests'
|
||||
continueOnError: false
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
- script: |
|
||||
export MO_ROOT=$(INSTALL_DIR)/tools/model_optimizer
|
||||
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tools/model_optimizer/unit_tests --junitxml=TEST-ModelOptimizer.xml
|
||||
displayName: 'Model Optimizer UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(INSTALL_TEST_DIR)
|
||||
- script: $(BIN_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/paddlepaddle_tests --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-PaddlePaddle.xml
|
||||
displayName: 'PaddlePaddle Frontend UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/tensorflow_tests --gtest_print_time=1 --gtest_output=xml:TEST-Tensorflow.xml
|
||||
displayName: 'Tensorflow Frontend UT'
|
||||
continueOnError: false
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
# . $(SETUPVARS) && python3 $(WORK_DIR)/gtest-parallel/gtest_parallel.py $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --workers=16 --dump_json_test_results=InferenceEngineUnitTests.json --gtest_filter=*smoke* -- --gtest_print_time=1
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
|
||||
- script: $(BIN_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
|
||||
displayName: 'IE UT old'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
- script: $(BIN_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
displayName: 'IE UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
- script: $(BIN_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
displayName: 'CPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml
|
||||
- script: $(BIN_DIR)/gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml
|
||||
displayName: 'GNA UT'
|
||||
continueOnError: false
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
- script: $(BIN_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
displayName: 'VPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
- script: $(BIN_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
displayName: 'ONNX Importer UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
- script: $(BIN_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
displayName: 'IE FuncTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/templateFuncTests --gtest_filter=*smoke* --gtest_output=xml:TEST-templateFuncTests.xml
|
||||
displayName: 'TEMPLATE FuncTests'
|
||||
continueOnError: false
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
- script: $(BIN_DIR)/cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
displayName: 'CPU FuncTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: $(BIN_DIR)/MklDnnBehaviorTests --gtest_output=xml:TEST-MklDnnBehaviorTests.xml
|
||||
displayName: 'MklDnnBehaviorTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(MODELS_PATH)
|
||||
export MODELS_PATH=$(MODELS_PATH)
|
||||
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
git clone https://github.com/openvinotoolkit/testdata.git
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Clone testdata'
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(WORK_DIR)/testdata
|
||||
export MODELS_PATH=$(WORK_DIR)/testdata
|
||||
python3 $(WORK_DIR)/gtest-parallel/gtest-parallel $(BIN_DIR)/MklDnnFunctionalTests --workers=$(WORKERS_NUMBER) --dump_json_test_results=MklDnnFunctionalTests.json --gtest_filter=*smoke* -- --gtest_print_time=1
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'MklDnnFunctionalTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(WORK_DIR)/testdata
|
||||
export MODELS_PATH=$(WORK_DIR)/testdata
|
||||
$(BIN_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
displayName: 'IE CAPITests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(MODELS_PATH)
|
||||
export MODELS_PATH=$(MODELS_PATH)
|
||||
export DATA_PATH=$(WORK_DIR)/testdata
|
||||
export MODELS_PATH=$(WORK_DIR)/testdata
|
||||
export LD_LIBRARY_PATH=$(BIN_DIR)/lib
|
||||
export PYTHONPATH=$(BIN_DIR)/lib/python_api/python3.6
|
||||
env
|
||||
cd $(REPO_DIR)/inference-engine/ie_bridges/python/tests
|
||||
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest --junitxml=TEST-PythonAPI.xml
|
||||
pytest pytest --junitxml=TEST-PythonAPI.xml
|
||||
displayName: 'Python API Tests'
|
||||
continueOnError: false
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
|
||||
- script: |
|
||||
. $(SETUPVARS)
|
||||
python3 -m pip install -r requirements.txt
|
||||
export MO_ROOT=$(INSTALL_DIR)/tools/model_optimizer
|
||||
export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH
|
||||
python3 -m pytest tensorflow_tests/test_tf_Roll.py --ir_version=10 --junitxml=TEST-tf_Roll.xmlTEST
|
||||
workingDirectory: $(LAYER_TESTS_DIR)
|
||||
displayName: 'Layer Tests'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: always()
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
jobs:
|
||||
- job: LinCC
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 90
|
||||
|
||||
pool:
|
||||
name: LIN_VMSS_VENV_F16S_U20_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(REPO_DIR)/../openvino_contrib
|
||||
MODELS_PATH: $(REPO_DIR)/../testdata
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
cat /etc/fstab
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
$(REPO_DIR)/install_build_dependencies.sh
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/requirements.txt
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DVERBOSE_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_FASTER_BUILD=ON
|
||||
-DENABLE_PROFILING_ITT=ON
|
||||
-DSELECTIVE_BUILD=COLLECT
|
||||
$(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build LinCC'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List bin files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
@@ -1,113 +0,0 @@
|
||||
jobs:
|
||||
- job: Lin
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 90
|
||||
|
||||
pool:
|
||||
name: LIN_VMSS_VENV_F16S_U20_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
BUILD_SAMPLES_DIR: $(WORK_DIR)/build_samples
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
cat /etc/fstab
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
|
||||
rm -rf $(BUILD_SAMPLES_DIR) ; mkdir $(BUILD_SAMPLES_DIR)
|
||||
echo TargetBranch: $(System.PullRequest.TargetBranch)
|
||||
echo SourceBranch: $(Build.SourceBranch)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
$(REPO_DIR)/install_build_dependencies.sh
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DVERBOSE_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_FASTER_BUILD=ON
|
||||
-DENABLE_STRICT_DEPENDENCIES=OFF
|
||||
-DENABLE_REQUIREMENTS_INSTALL=OFF
|
||||
$(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/inference-engine/temp/
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
wget https://scan.coverity.com/download/linux64 --post-data "token=$(COVERITY_TOKEN)&project=openvino" -O coverity_tool.tgz
|
||||
tar xvf coverity_tool.tgz
|
||||
rm coverity_tool.tgz
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install coverity tool'
|
||||
|
||||
- script: $(WORK_DIR)/cov-analysis*/bin/cov-build --dir $(BUILD_DIR)/cov-int ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Lin with Coverity'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List bin files'
|
||||
|
||||
- script: tar -C $(BUILD_DIR) -czvf openvino.tgz cov-int
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Pack cov-int folder for submission'
|
||||
|
||||
- publish: $(BUILD_DIR)/openvino.tgz
|
||||
artifact: openvino.tgz
|
||||
continueOnError: true
|
||||
displayName: 'Publish submission'
|
||||
|
||||
- script: |
|
||||
curl --form token=$(COVERITY_TOKEN) \
|
||||
--form email=$(COVERITY_USER) \
|
||||
--form file=@openvino.tgz \
|
||||
--form version="$(Build.SourceVersion)" \
|
||||
--form description="https://github.com/openvinotoolkit/openvino/runs/$(Build.BuildNumber)" \
|
||||
https://scan.coverity.com/builds?project=openvino
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Submit for analysis'
|
||||
@@ -1,179 +0,0 @@
|
||||
resources:
|
||||
repositories:
|
||||
- repository: openvino_contrib
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
|
||||
jobs:
|
||||
- job: Lin_lohika
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 90
|
||||
|
||||
pool:
|
||||
name: LIN_LOHIKA
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(REPO_DIR)/../openvino_contrib
|
||||
MODELS_PATH: $(REPO_DIR)/../testdata
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
BUILD_SAMPLES_DIR: $(WORK_DIR)/build_samples
|
||||
BUILD_LAYER_TESTS_DIR: $(WORK_DIR)/build_layer_tests
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
INSTALL_TEST_DIR: $(INSTALL_DIR)/tests
|
||||
LAYER_TESTS_DIR: $(INSTALL_TEST_DIR)/layer_tests
|
||||
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
cat /etc/fstab
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
|
||||
rm -rf $(BUILD_SAMPLES_DIR) ; mkdir $(BUILD_SAMPLES_DIR)
|
||||
echo TargetBranch: $(System.PullRequest.TargetBranch)
|
||||
echo SourceBranch: $(Build.SourceBranch)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- checkout: openvino_contrib
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino_contrib
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
$(REPO_DIR)/install_build_dependencies.sh
|
||||
# Move jdk into contrib
|
||||
sudo apt --assume-yes install openjdk-11-jdk
|
||||
# For opencv-python: python3-setuptools and pip upgrade
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/requirements.txt
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/wheel/requirements-dev.txt
|
||||
# For running Python API tests
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||
# For running PaddlePaddle frontend unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/frontend/paddlepaddle/requirements_dev.txt
|
||||
# For running ONNX frontend unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/requirements_test_onnx.txt
|
||||
# For MO unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements.txt
|
||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements_dev.txt
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
# Speed up tests
|
||||
git clone https://github.com/google/gtest-parallel.git
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
# Should be after 'Install dependencies' because Git lfs is not installed
|
||||
- checkout: testdata
|
||||
clean: true
|
||||
lfs: true
|
||||
path: testdata
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
# CMake must get Python 3.x version by default
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DVERBOSE_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_PYTHON=ON
|
||||
-DPYTHON_EXECUTABLE=/usr/bin/python3.8
|
||||
-DENABLE_WHEEL=ON
|
||||
-DENABLE_TESTS=ON
|
||||
-DNGRAPH_ONNX_FRONTEND_ENABLE=ON
|
||||
-DENABLE_FASTER_BUILD=ON
|
||||
-DENABLE_STRICT_DEPENDENCIES=OFF
|
||||
-DENABLE_REQUIREMENTS_INSTALL=OFF
|
||||
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
|
||||
$(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/inference-engine/temp/
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Lin'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List bin files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
mkdir $(INSTALL_DIR)/opencv/
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake
|
||||
cp -R $(REPO_DIR)/inference-engine/temp/opencv_4.5.2_ubuntu20/opencv/* $(INSTALL_DIR)/opencv/
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: rm -fr $(BUILD_DIR)
|
||||
displayName: 'Clean build dir'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(INSTALL_TEST_DIR)
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: always()
|
||||
inputs:
|
||||
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
|
||||
testResultsFiles: '**/TEST-*.xml'
|
||||
#searchFolder: '$(BUILD_DIR)'
|
||||
mergeTestResults: false # Optional
|
||||
#failTaskOnFailedTests: false # Optional
|
||||
#testRunTitle: 'Pre/Post-Commit' # Optional
|
||||
buildPlatform: 'x64' # Optional
|
||||
buildConfiguration: 'Linux' # Optional
|
||||
#publishRunAttachments: true # Optional
|
||||
@@ -1,70 +1,25 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
jobs:
|
||||
- job: OpenVINO_ONNX_CI
|
||||
strategy:
|
||||
matrix:
|
||||
Release:
|
||||
BUILD_TYPE: 'Release'
|
||||
TOX_COMMAND: 'tox && tox -e zoo_models'
|
||||
Debug:
|
||||
BUILD_TYPE: 'Debug'
|
||||
TOX_COMMAND: 'tox'
|
||||
maxParallel: 2
|
||||
- job: nGraph_ONNX_Lin
|
||||
|
||||
# About 300% of total time
|
||||
timeoutInMinutes: 90
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 60
|
||||
|
||||
pool:
|
||||
name: LIN_VMSS_VENV_ONNX_U20_WU2
|
||||
name: LIN_VMSS_VENV_F8S_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
WORKERS_NUMBER: 8
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
MODELS_DIR: /mount/cinfsshare/onnxtestdata
|
||||
TMP_DIR: /mnt/tmp
|
||||
ONNX_MODEL_ZOO_SHA: "d58213534f2a4d1c4b19ba62b3bb5f544353256e"
|
||||
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
BIN_DIR: $(REPO_DIR)/bin/intel64/$(BUILD_TYPE)
|
||||
INSTALL_DIR: $(WORK_DIR)/install
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
cat /etc/fstab
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
sudo mkdir -p $(MODELS_DIR)
|
||||
sudo apt --assume-yes install nfs-common
|
||||
sudo mount -vvv -t nfs cinfsshare.file.core.windows.net:/cinfsshare/onnxtestdata $(MODELS_DIR) -o vers=4,minorversion=1,sec=sys
|
||||
mkdir -p $(MODELS_DIR)/models_data
|
||||
displayName: 'Make dirs'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
@@ -72,22 +27,69 @@ jobs:
|
||||
path: openvino
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
sudo apt --assume-yes install git-lfs uidmap
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sudo sh get-docker.sh
|
||||
workingDirectory: $(WORK_DIR)
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
which python3
|
||||
python3 --version
|
||||
gcc --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
vmstat -s
|
||||
df
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- script: |
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
|
||||
# For running Python API tests
|
||||
python3 -m pip install -r ./inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||
displayName: 'Install dependencies'
|
||||
enabled: false
|
||||
|
||||
- script: runtime/bindings/python/tests/test_onnx/model_zoo_preprocess.sh -d $(MODELS_DIR)/models_data -o -s "$(ONNX_MODEL_ZOO_SHA)"
|
||||
displayName: 'Update models'
|
||||
condition: ne(variables['BUILD_TYPE'], 'Debug')
|
||||
- script: |
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install Ninja'
|
||||
enabled: false
|
||||
|
||||
- script: sudo docker build --tag=openvino-onnx-ci-image --file=.ci/openvino-onnx/Dockerfile --build-arg BUILD_TYPE=$(BUILD_TYPE) --build-arg PROTOBUF_LITE=$(PROTOBUF_LITE) .
|
||||
displayName: 'Docker build $(BUILD_TYPE)'
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
# CMake must get Python 3.x version by default
|
||||
cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_VPU=OFF -DENABLE_GNA=OFF -DENABLE_OPENCV=OFF -DENABLE_CPPLINT=OFF -DENABLE_TESTS=OFF -DENABLE_BEH_TESTS=OFF -DENABLE_FUNCTIONAL_TESTS=OFF -DENABLE_MKL_DNN=ON -DENABLE_CLDNN=OFF -DENABLE_PROFILING_ITT=OFF -DENABLE_SAMPLES=OFF -DENABLE_SPEECH_DEMO=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DNGRAPH_ONNX_IMPORT_ENABLE=ON -DNGRAPH_INTERPRETER_ENABLE=ON -DNGRAPH_DEBUG_ENABLE=OFF -DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=ON -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
enabled: false
|
||||
|
||||
- script: sudo fallocate -l 64G /swapfile ; sudo mkswap /swapfile ; sudo swapon /swapfile ; df ; free -h
|
||||
displayName: 'Create swap'
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build'
|
||||
enabled: false
|
||||
|
||||
- script: sudo docker run --name openvino-onnx-ci-container --volume $(MODELS_DIR)/models_data/model_zoo/onnx_model_zoo_$(ONNX_MODEL_ZOO_SHA):/root/.onnx/model_zoo/onnx_model_zoo --volume $(MODELS_DIR)/msft:/root/.onnx/model_zoo/MSFT openvino-onnx-ci-image /bin/bash -c "$(TOX_COMMAND)"
|
||||
displayName: 'Docker run $(BUILD_TYPE)'
|
||||
- script: make install
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
enabled: false
|
||||
|
||||
- script: |
|
||||
ls -alR $(REPO_DIR)/bin/
|
||||
ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List files'
|
||||
enabled: false
|
||||
|
||||
- script: docker build --tag=openvino-onnx-ci-image --file=$(REPO_DIR)/.ci/openvino-onnx/Dockerfile .
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Docker build'
|
||||
enabled: false
|
||||
|
||||
- script: docker run --name openvino-onnx-ci-container openvino-onnx-ci-image
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Docker run tests'
|
||||
enabled: false
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
jobs:
|
||||
- job: onnxruntime
|
||||
timeoutInMinutes: 90
|
||||
|
||||
pool:
|
||||
name: LIN_VMSS_VENV_ONNX_U20_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
ONNXRUNTIME_REPO_DIR: $(REPO_DIR)/../onnxruntime
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
MODELS_DIR: /mount/cinfsshare/onnxtestdata
|
||||
TMP_DIR: /mnt/tmp
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg/openvino
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
ONNXRUNTIME_UTILS: $(REPO_DIR)/.ci/azure/ci_utils/onnxruntime
|
||||
ONNXRUNTIME_BUILD_DIR: $(ONNXRUNTIME_REPO_DIR)/build
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
cat /etc/fstab
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
sudo rm -rf $(TMP_DIR) ; sudo mkdir $(TMP_DIR) ; sudo chmod 777 -R $(TMP_DIR)
|
||||
sudo mkdir -p $(MODELS_DIR)
|
||||
sudo apt --assume-yes install nfs-common
|
||||
sudo mount -vvv -t nfs cinfsshare.file.core.windows.net:/cinfsshare/onnxtestdata $(MODELS_DIR) -o vers=4,minorversion=1,sec=sys
|
||||
displayName: 'Make dirs'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- script: |
|
||||
branch=`tr -s '\n ' < $(ONNXRUNTIME_UTILS)/version`
|
||||
git clone --branch $branch --single-branch --recursive https://github.com/microsoft/onnxruntime.git $(ONNXRUNTIME_REPO_DIR)
|
||||
displayName: 'Clone onnxruntime'
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
$(REPO_DIR)/install_build_dependencies.sh
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/requirements.txt
|
||||
# For running Python API tests
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
# Speed up tests
|
||||
git clone https://github.com/google/gtest-parallel.git
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
# CMake must get Python 3.x version by default
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_PYTHON=ON
|
||||
-DPYTHON_EXECUTABLE=/usr/bin/python3.8
|
||||
-DENABLE_VPU=OFF
|
||||
-DENABLE_GNA=OFF
|
||||
-DENABLE_OPENCV=OFF
|
||||
-DENABLE_CPPLINT=OFF
|
||||
-DENABLE_TESTS=OFF
|
||||
-DENABLE_MKL_DNN=ON
|
||||
-DENABLE_CLDNN=OFF
|
||||
-DENABLE_PROFILING_ITT=OFF
|
||||
-DENABLE_SAMPLES=OFF
|
||||
-DNGRAPH_ONNX_FRONTEND_ENABLE=ON
|
||||
-DOPENVINO_DEBUG_ENABLE=OFF
|
||||
$(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Lin ONNX'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List bin files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
CXXFLAGS="-Wno-error=deprecated-declarations" ./build.sh --config RelWithDebInfo --use_openvino CPU_FP32 --build_shared_lib --parallel --skip_tests --build_dir $(ONNXRUNTIME_BUILD_DIR)
|
||||
workingDirectory: $(ONNXRUNTIME_REPO_DIR)
|
||||
displayName: 'Build Lin ONNX Runtime'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
skip_tests=`tr -s '\n ' ':' < $(ONNXRUNTIME_UTILS)/skip_tests`
|
||||
./onnxruntime_test_all --gtest_filter=-$skip_tests
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_test_all'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
./onnxruntime_shared_lib_test
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_shared_lib_test'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
./onnxruntime_global_thread_pools_test
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_global_thread_pools_test'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
./onnxruntime_api_tests_without_env
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_api_tests_without_env'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
./onnx_test_runner "$(ONNXRUNTIME_REPO_DIR)/cmake/external/onnx/onnx/backend/test/data/pytorch-converted"
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run pytorch-converted tests'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/setupvars.sh
|
||||
./onnx_test_runner "$(ONNXRUNTIME_REPO_DIR)/cmake/external/onnx/onnx/backend/test/data/pytorch-operator"
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run pytorch-operator tests'
|
||||
@@ -1,28 +1,7 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: openvino_contrib
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
|
||||
jobs:
|
||||
- job: Mac
|
||||
# About 250% of total time (perfomace of Mac hosts is unstable, 360 is max)
|
||||
timeoutInMinutes: 360
|
||||
# About 200% of total time (perfomace of Mac hosts is unstable)
|
||||
timeoutInMinutes: 240
|
||||
|
||||
pool:
|
||||
vmImage: 'macOS-10.15'
|
||||
@@ -31,25 +10,22 @@ jobs:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
WORKERS_NUMBER: 3
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(REPO_DIR)/../openvino_contrib
|
||||
MODELS_PATH: $(REPO_DIR)/../testdata
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
INSTALL_TEST_DIR: $(INSTALL_DIR)/tests
|
||||
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
|
||||
BIN_DIR: $(REPO_DIR)/bin/intel64/$(BUILD_TYPE)
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
echo cmake info ; which cmake ; cmake --version
|
||||
which python3
|
||||
python3 --version
|
||||
which java
|
||||
java -version
|
||||
gcc --version
|
||||
xcrun --sdk macosx --show-sdk-version
|
||||
env
|
||||
sysctl -a
|
||||
@@ -66,17 +42,6 @@ jobs:
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- checkout: openvino_contrib
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino_contrib
|
||||
|
||||
- checkout: testdata
|
||||
clean: true
|
||||
lfs: true
|
||||
path: testdata
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.7'
|
||||
@@ -84,7 +49,6 @@ jobs:
|
||||
- script: |
|
||||
brew install cython
|
||||
brew install automake
|
||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/requirements_test_onnx.txt
|
||||
# Speed up build
|
||||
brew install ninja
|
||||
# Speed up tests
|
||||
@@ -96,76 +60,73 @@ jobs:
|
||||
export PATH="/usr/local/opt/cython/bin:$PATH"
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
cmake -GNinja -DVERBOSE_BUILD=ON -DENABLE_REQUIREMENTS_INSTALL=OFF -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules $(REPO_DIR)
|
||||
# Disable errors with Ninja
|
||||
export CXXFLAGS="-Wno-error=unused-command-line-argument"
|
||||
export CFLAGS="-Wno-error=unused-command-line-argument"
|
||||
cmake -GNinja -DVERBOSE_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=ON $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'CMake'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/inference-engine/temp/
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Mac'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List bin files'
|
||||
displayName: 'List files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
mkdir $(INSTALL_DIR)/opencv/
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake
|
||||
cp -R $(REPO_DIR)/inference-engine/temp/opencv_4.5.2_osx/opencv/* $(INSTALL_DIR)/opencv/
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: ls -alR $(INSTALL_DIR)
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU*:IE_CPU.onnx_model_sigmoid:IE_CPU/GRUSequenceOp.onnx_model_gru* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(INSTALL_TEST_DIR)
|
||||
- script: $(BIN_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU*:IE_CPU.onnx_model_sigmoid --gtest_output=xml:TEST-NGraphUT.xml
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_filter=-MKLDNNGraphStructureTests.TestNoRedundantReordersBeforeDWConvolution:TestConvolution/MKLDNNGraphConvolutionTests.TestsConvolution/0:TestConvolutionDefaultPrimitivesPriority/MKLDNNGraphConvolutionTests.TestsConvolution/0 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
|
||||
- script: $(BIN_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
|
||||
displayName: 'IE UT old'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
- script: $(BIN_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
displayName: 'IE UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
- script: $(BIN_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
displayName: 'CPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
- script: $(BIN_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
displayName: 'VPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
- script: $(BIN_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
displayName: 'ONNX Importer UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
- script: $(BIN_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
displayName: 'IE FuncTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke*:-smoke_LPT/ReduceMinTransformation.CompareWithRefImpl/f32_Shape* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
- script: $(BIN_DIR)/cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
displayName: 'CPU FuncTests'
|
||||
continueOnError: false
|
||||
enabled: false
|
||||
|
||||
- script: $(BIN_DIR)/MklDnnBehaviorTests --gtest_output=xml:TEST-MklDnnBehaviorTests.xml
|
||||
displayName: 'MklDnnBehaviorTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(MODELS_PATH)
|
||||
export MODELS_PATH=$(MODELS_PATH)
|
||||
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
git clone --single-branch --branch releases/2021/2 https://github.com/openvinotoolkit/testdata.git
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Clone testdata'
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(WORK_DIR)/testdata
|
||||
export MODELS_PATH=$(WORK_DIR)/testdata
|
||||
python3 $(WORK_DIR)/gtest-parallel/gtest-parallel $(BIN_DIR)/MklDnnFunctionalTests --workers=$(WORKERS_NUMBER) --dump_json_test_results=MklDnnFunctionalTests.json --gtest_filter=*smoke*:-smoke_MobileNet/ModelTransformationsTest.LPT/mobilenet_v2_tf_depthwise_batch1_inPluginDisabled_inTestDisabled_asymmetric* -- --gtest_print_time=1
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'MklDnnFunctionalTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
export DATA_PATH=$(WORK_DIR)/testdata
|
||||
export MODELS_PATH=$(WORK_DIR)/testdata
|
||||
$(BIN_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
displayName: 'IE CAPITests'
|
||||
continueOnError: false
|
||||
|
||||
|
||||
@@ -1,24 +1,3 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: openvino_contrib
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/openvino_contrib
|
||||
|
||||
- repository: testdata
|
||||
type: github
|
||||
endpoint: openvinotoolkit
|
||||
name: openvinotoolkit/testdata
|
||||
|
||||
jobs:
|
||||
- job: Win
|
||||
# About 150% of total time
|
||||
@@ -31,26 +10,19 @@ jobs:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
WORKERS_NUMBER: 8
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(REPO_DIR)\..\openvino_contrib
|
||||
MODELS_PATH: $(REPO_DIR)\..\testdata
|
||||
WORK_DIR: $(Pipeline.Workspace)\_w
|
||||
BUILD_DIR: D:\build
|
||||
BUILD_SAMPLES_DIR: D:\build_samples
|
||||
BIN_DIR: $(REPO_DIR)\bin\intel64
|
||||
MSVS_VARS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
||||
MSVC_COMPILER_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe
|
||||
INSTALL_DIR: $(WORK_DIR)\install_pkg
|
||||
INSTALL_TEST_DIR: $(INSTALL_DIR)\tests
|
||||
SETUPVARS: $(INSTALL_DIR)\setupvars.bat
|
||||
IB_DIR: C:\Program Files (x86)\IncrediBuild
|
||||
IB_TESTCONSOLE: $(IB_DIR)\IBTestConsole.exe
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
powershell -command "Invoke-RestMethod -Headers @{\"Metadata\"=\"true\"} -Method GET -Uri http://169.254.169.254/metadata/instance/compute?api-version=2019-06-01 | format-custom"
|
||||
where python3
|
||||
python3 --version
|
||||
where python
|
||||
python --version
|
||||
where java
|
||||
@@ -65,152 +37,130 @@ jobs:
|
||||
- script: |
|
||||
rd /Q /S $(WORK_DIR) & mkdir $(WORK_DIR)
|
||||
rd /Q /S $(BUILD_DIR) & mkdir $(BUILD_DIR)
|
||||
rd /Q /S $(BUILD_SAMPLES_DIR) & mkdir $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- script: |
|
||||
certutil -urlcache -split -f https://openvinoweb.z5.web.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
|
||||
call install_ib_console.bat
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install IncrediBuild'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- checkout: openvino_contrib
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino_contrib
|
||||
|
||||
- checkout: testdata
|
||||
clean: true
|
||||
lfs: true
|
||||
path: testdata
|
||||
|
||||
- script: |
|
||||
python -m pip install --upgrade pip
|
||||
rem For running Python API tests
|
||||
python -m pip install -r $(REPO_DIR)\inference-engine\ie_bridges\python\src\requirements-dev.txt
|
||||
rem For running PaddlePaddle frontend unit tests
|
||||
python -m pip install -r $(REPO_DIR)\ngraph\test\frontend\paddlepaddle\requirements_dev.txt
|
||||
rem For running ONNX frontend unit tests
|
||||
python -m pip install -r $(REPO_DIR)\ngraph\test\requirements_test_onnx.txt
|
||||
rem For MO unit tests
|
||||
python -m pip install -r $(REPO_DIR)\model-optimizer\requirements.txt
|
||||
python -m pip install -r $(REPO_DIR)\model-optimizer\requirements_dev.txt
|
||||
rem Speed up build
|
||||
certutil -urlcache -split -f https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip ninja-win.zip
|
||||
certutil -urlcache -split -f https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip ninja-win.zip
|
||||
powershell -command "Expand-Archive -Force ninja-win.zip"
|
||||
git clone https://github.com/google/gtest-parallel.git
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- script: |
|
||||
certutil -urlcache -split -f https://incredibuilddiag1wu2.blob.core.windows.net/incredibuild/IBSetupConsole_9_5_0.exe IBSetupConsole_9_5_0.exe
|
||||
call IBSetupConsole_9_5_0.exe /Install /Components=Agent,oneuse /Coordinator=11.1.0.4 /AGENT:OPENFIREWALL=ON /AGENT:AUTOSELECTPORTS=ON /ADDTOPATH=ON /AGENT:INSTALLADDINS=OFF
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install IncrediBuild'
|
||||
|
||||
- script: |
|
||||
echo Stop IncrediBuild_Agent && net stop IncrediBuild_Agent
|
||||
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Xoreax\IncrediBuild\Builder /f /v LastEnabled /d 0 && echo Start IncrediBuild_Agent && net start IncrediBuild_Agent
|
||||
displayName: 'Start IncrediBuild'
|
||||
|
||||
- script: |
|
||||
set PATH=$(WORK_DIR)\ninja-win;%PATH%
|
||||
call "$(MSVS_VARS_PATH)" && cmake -GNinja -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DENABLE_TEMPLATE_PLUGIN=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
call "$(MSVS_VARS_PATH)" && cmake -GNinja -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'CMake'
|
||||
|
||||
- script: dir $(REPO_DIR)\inference-engine\temp\ /s
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: |
|
||||
set PATH=$(WORK_DIR)\ninja-win;%PATH%
|
||||
call "$(MSVS_VARS_PATH)" && "C:\Program Files (x86)\IncrediBuild\BuildConsole.exe" /COMMAND="ninja"
|
||||
call "$(MSVS_VARS_PATH)" && "C:\Program Files (x86)\IncrediBuild\BuildConsole.exe" /COMMAND="ninja" /MaxCPUS=40
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Win - IB'
|
||||
displayName: 'Build Win'
|
||||
|
||||
- script: echo Stop IncrediBuild_Agent && net stop IncrediBuild_Agent
|
||||
displayName: Stop IncrediBuild
|
||||
continueOnError: true
|
||||
- script: dir $(REPO_DIR)\bin\ /s
|
||||
displayName: 'List bin files'
|
||||
displayName: 'List files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake && xcopy $(REPO_DIR)\inference-engine\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: $(INSTALL_DIR)\samples\cpp\build_samples_msvc.bat
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build cpp samples'
|
||||
|
||||
- script: $(INSTALL_DIR)\samples\c\build_samples_msvc.bat
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build c samples'
|
||||
|
||||
- script: rd /Q /S $(BUILD_DIR)
|
||||
displayName: 'Clean build dir'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(INSTALL_TEST_DIR)
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\paddlepaddle_tests --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-PaddlePaddle.xml
|
||||
displayName: 'PaddlePaddle Frontend UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\tensorflow_tests --gtest_print_time=1 --gtest_output=xml:TEST-Tensorflow.xml
|
||||
displayName: 'Tensorflow Frontend UT'
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
|
||||
displayName: 'IE UT old'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
set PATH=$(IB_DIR);%PATH%
|
||||
call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\InferenceEngineUnitTests.exe --gtest_output=xml:TEST-InferenceEngineUnitTests-IB.xml
|
||||
displayName: 'IE UT old - IB'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml
|
||||
displayName: 'IE UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml
|
||||
displayName: 'CPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml
|
||||
displayName: 'GNA UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml
|
||||
displayName: 'VPU UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml
|
||||
displayName: 'ONNX Importer UT'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml
|
||||
displayName: 'IE FuncTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\templateFuncTests --gtest_output=xml:TEST-templateFuncTests.xml
|
||||
displayName: 'TEMPLATE FuncTests'
|
||||
continueOnError: false
|
||||
|
||||
# call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke* --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
- script: |
|
||||
set PATH=$(IB_DIR);%PATH%
|
||||
call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio*:*smoke_GRUSequenceCommonZeroClip/GRUSequenceTest.CompareWithRefs/mode=CONVERT_TO_TI_MAX_SEQ_LEN_CONST_seq_lengths* --gtest_output=xml:TEST-cpuFuncTests-IB.xml /testlevel=24
|
||||
displayName: 'CPU FuncTests - IB'
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
displayName: 'CPU FuncTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
set DATA_PATH=$(MODELS_PATH)
|
||||
set MODELS_PATH=$(MODELS_PATH)
|
||||
call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;%PATH%
|
||||
$(BIN_DIR)\MklDnnBehaviorTests --gtest_output=xml:TEST-MklDnnBehaviorTests.xml
|
||||
displayName: 'MklDnnBehaviorTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
git clone https://github.com/openvinotoolkit/testdata.git
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Clone testdata'
|
||||
|
||||
# Add for gtest-parallel, it hangs now (CVS-33386)
|
||||
#python $(BUILD_DIR)\gtest-parallel\gtest-parallel $(BIN_DIR)\MklDnnFunctionalTests --workers=$(WORKERS_NUMBER) --dump_json_test_results=MklDnnFunctionalTests.json --gtest_filter=*smoke* -- --gtest_print_time=1
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;$(REPO_DIR)\inference-engine\temp\opencv_4.5.0\opencv\bin;%PATH%
|
||||
set DATA_PATH=$(BUILD_DIR)\testdata
|
||||
set MODELS_PATH=$(BUILD_DIR)\testdata
|
||||
$(BIN_DIR)\MklDnnFunctionalTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-MklDnnFunctionalTests.xml
|
||||
displayName: 'MklDnnFunctionalTests'
|
||||
continueOnError: false
|
||||
|
||||
- script: |
|
||||
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;$(REPO_DIR)\inference-engine\temp\opencv_4.5.0\opencv\bin;%PATH%
|
||||
set DATA_PATH=$(BUILD_DIR)\testdata
|
||||
set MODELS_PATH=$(BUILD_DIR)\testdata
|
||||
$(BIN_DIR)\InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml
|
||||
displayName: 'IE CAPITests'
|
||||
continueOnError: false
|
||||
|
||||
@@ -225,9 +175,4 @@ jobs:
|
||||
#testRunTitle: 'Pre/Post-Commit' # Optional
|
||||
buildPlatform: 'x64' # Optional
|
||||
buildConfiguration: 'Windows' # Optional
|
||||
#publishRunAttachments: true # Optional
|
||||
|
||||
- script: echo Stop IncrediBuild_Agent && net stop IncrediBuild_Agent
|
||||
displayName: Stop IncrediBuild
|
||||
continueOnError: true
|
||||
enabled: false
|
||||
#publishRunAttachments: true # Optional
|
||||
@@ -1,88 +0,0 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- releases/*
|
||||
paths:
|
||||
exclude:
|
||||
- docs/*
|
||||
|
||||
jobs:
|
||||
- job: WinCC
|
||||
# About 150% of total time
|
||||
timeoutInMinutes: 60
|
||||
|
||||
pool:
|
||||
name: WIN_VMSS_VENV_F8S_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
OPENVINO_CONTRIB_REPO_DIR: $(REPO_DIR)\..\openvino_contrib
|
||||
MODELS_PATH: $(REPO_DIR)\..\testdata
|
||||
WORK_DIR: $(Pipeline.Workspace)\_w
|
||||
BUILD_DIR: D:\build
|
||||
MSVS_VARS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
||||
MSVC_COMPILER_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe
|
||||
INSTALL_DIR: $(WORK_DIR)\install_pkg
|
||||
SETUPVARS: $(INSTALL_DIR)\setupvars.bat
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
powershell -command "Invoke-RestMethod -Headers @{\"Metadata\"=\"true\"} -Method GET -Uri http://169.254.169.254/metadata/instance/compute?api-version=2019-06-01 | format-custom"
|
||||
where python3
|
||||
python3 --version
|
||||
where python
|
||||
python --version
|
||||
where java
|
||||
java -version
|
||||
wmic computersystem get TotalPhysicalMemory
|
||||
wmic cpu list
|
||||
wmic logicaldisk get description,name
|
||||
wmic VOLUME list
|
||||
set
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rd /Q /S $(WORK_DIR) & mkdir $(WORK_DIR)
|
||||
rd /Q /S $(BUILD_DIR) & mkdir $(BUILD_DIR)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- script: |
|
||||
rem Speed up build
|
||||
certutil -urlcache -split -f https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip ninja-win.zip
|
||||
powershell -command "Expand-Archive -Force ninja-win.zip"
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- script: |
|
||||
set PATH=$(WORK_DIR)\ninja-win;%PATH%
|
||||
call "$(MSVS_VARS_PATH)" && cmake -GNinja -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'CMake'
|
||||
|
||||
- script: dir $(REPO_DIR)\inference-engine\temp\ /s
|
||||
displayName: 'List temp SDKs'
|
||||
|
||||
- script: call "$(MSVS_VARS_PATH)" && $(WORK_DIR)\ninja-win\ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Win CC'
|
||||
|
||||
- script: dir $(REPO_DIR)\bin\ /s
|
||||
displayName: 'List bin files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
@@ -1,9 +1,6 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
LABEL version=2021.03.30.1
|
||||
|
||||
# Build configuration arguments
|
||||
ARG BUILD_TYPE=Release
|
||||
LABEL version=2020.07.09.1
|
||||
|
||||
ARG http_proxy
|
||||
ARG https_proxy
|
||||
@@ -54,26 +51,33 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
|
||||
COPY . /openvino/
|
||||
WORKDIR /openvino/build
|
||||
RUN cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DENABLE_VPU=OFF \
|
||||
-DENABLE_GNA=OFF \
|
||||
-DENABLE_OPENCV=OFF \
|
||||
-DENABLE_CPPLINT=OFF \
|
||||
-DENABLE_TESTS=OFF \
|
||||
-DENABLE_BEH_TESTS=OFF \
|
||||
-DENABLE_FUNCTIONAL_TESTS=OFF \
|
||||
-DENABLE_MKL_DNN=ON \
|
||||
-DENABLE_CLDNN=OFF \
|
||||
-DENABLE_PROFILING_ITT=OFF \
|
||||
-DENABLE_SAMPLES=OFF \
|
||||
-DENABLE_SPEECH_DEMO=OFF \
|
||||
-DENABLE_PYTHON=ON \
|
||||
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
|
||||
-DNGRAPH_ONNX_FRONTEND_ENABLE=ON \
|
||||
-DOPENVINO_DEBUG_ENABLE=OFF \
|
||||
-DNGRAPH_ONNX_IMPORT_ENABLE=ON \
|
||||
-DNGRAPH_INTERPRETER_ENABLE=ON \
|
||||
-DNGRAPH_DEBUG_ENABLE=OFF \
|
||||
-DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/openvino/dist
|
||||
RUN make -j $(nproc) install
|
||||
|
||||
# Run tests via tox
|
||||
WORKDIR /openvino/runtime/bindings/python
|
||||
ENV OpenVINO_DIR=/openvino/dist/runtime/cmake
|
||||
ENV LD_LIBRARY_PATH=/openvino/dist/runtime/lib:/openvino/dist/runtime/3rdparty/tbb/lib
|
||||
ENV PYTHONPATH=/openvino/bin/intel64/${BUILD_TYPE}/lib/python_api/python3.8:${PYTHONPATH}
|
||||
WORKDIR /openvino/ngraph/python
|
||||
ENV NGRAPH_CPP_BUILD_PATH=/openvino/dist
|
||||
ENV LD_LIBRARY_PATH=/openvino/dist/lib
|
||||
ENV NGRAPH_ONNX_IMPORT_ENABLE=TRUE
|
||||
ENV PYTHONPATH=/openvino/bin/intel64/Release/lib/python_api/python3.8:${PYTHONPATH}
|
||||
RUN git clone --recursive https://github.com/pybind/pybind11.git -b v2.5.0 --depth 1
|
||||
CMD tox
|
||||
|
||||
171
.ci/openvino-onnx/Jenkinsfile
vendored
171
.ci/openvino-onnx/Jenkinsfile
vendored
@@ -3,18 +3,12 @@
|
||||
|
||||
DOCKER_CONTAINER_NAME= "openvino-onnx-ci-container"
|
||||
DOCKER_IMAGE_TAG = "openvino-onnx-ci-image"
|
||||
ONNX_MODEL_ZOO_SHA = "d58213534f2a4d1c4b19ba62b3bb5f544353256e"
|
||||
|
||||
BACKEND_CONFIGURATIONS = [
|
||||
[ name: "Release", build_type: "Release" ],
|
||||
[ name: "Debug", build_type: "Debug" ],
|
||||
]
|
||||
|
||||
// workaround for aborting previous builds on PR update
|
||||
@NonCPS
|
||||
def stopPreviousRunningBuilds() {
|
||||
def jobname = env.JOB_NAME
|
||||
if (jobname.startsWith("onnx-ci/openvino onnx ci/openvino/PR")){
|
||||
if (jobname.startsWith("onnx/openvino_ci/PR")){
|
||||
def buildnum = env.BUILD_NUMBER.toInteger()
|
||||
def job = Jenkins.instance.getItemByFullName(jobname)
|
||||
def job_newest = job.builds.first()
|
||||
@@ -29,7 +23,7 @@ BACKEND_CONFIGURATIONS = [
|
||||
|
||||
}
|
||||
|
||||
def getGitPrInfo(String project, String workdir) {
|
||||
def getGitPrInfo(String project) {
|
||||
def gitPrInfo = [
|
||||
prAuthorEmail : "",
|
||||
commitAuthorEmail : "",
|
||||
@@ -37,7 +31,7 @@ def getGitPrInfo(String project, String workdir) {
|
||||
commitSubject : ""
|
||||
]
|
||||
try {
|
||||
dir ("${workdir}/${project}") {
|
||||
dir ("${WORKDIR}/${project}") {
|
||||
gitPrInfo.prAuthorEmail = sh (script: 'git log -1 --pretty="format:%ae" ', returnStdout: true).trim()
|
||||
gitPrInfo.commitAuthorEmail = sh (script: 'git log -1 --pretty="format:%ce" ', returnStdout: true).trim()
|
||||
gitPrInfo.commitSubject = sh (script: 'git log -1 --pretty="format:%H" ', returnStdout: true).trim()
|
||||
@@ -70,144 +64,89 @@ def notifyByEmail(def gitPrInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
def gitSubmoduleUpdate(String repository_name, String workdir) {
|
||||
dir ("${workdir}/${repository_name}") {
|
||||
def gitSubmoduleUpdate(String repository_name) {
|
||||
dir ("${WORKDIR}/${repository_name}") {
|
||||
sh label: "Init ${repository_name} submodules",
|
||||
script:
|
||||
"""
|
||||
git submodule init && git submodule update \
|
||||
--init \
|
||||
--no-fetch \
|
||||
--recursive
|
||||
--recursive
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
def prepare_repository(String workdir) {
|
||||
dir("${workdir}") {
|
||||
println "Preparing repository in directory: ${workdir}"
|
||||
checkout scm
|
||||
gitSubmoduleUpdate(PROJECT_NAME, workdir)
|
||||
}
|
||||
}
|
||||
|
||||
def updateModels() {
|
||||
def buildDockerImage() {
|
||||
sh """
|
||||
./runtime/bindings/python/tests/test_onnx/model_zoo_preprocess.sh -d ${HOME}/ONNX_CI/models_data -o -s ${ONNX_MODEL_ZOO_SHA}
|
||||
docker build --tag=${DOCKER_IMAGE_TAG} --file=.ci/openvino-onnx/Dockerfile \
|
||||
--build-arg http_proxy=http://proxy-chain.intel.com:911/ \
|
||||
--build-arg https_proxy=http://proxy-chain.intel.com:912/ .
|
||||
"""
|
||||
}
|
||||
|
||||
def get_docker_container_name(Map configuration){
|
||||
println "RUN get_docker_container_name for ${configuration.name}"
|
||||
String docker_container_name = "${DOCKER_CONTAINER_NAME}_${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}"
|
||||
return docker_container_name
|
||||
}
|
||||
|
||||
def buildDockerImage(Map configuration, String workdir) {
|
||||
String docker_image_tag = "${DOCKER_IMAGE_TAG}_${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}".toLowerCase()
|
||||
println "docker_image_tag: ${docker_image_tag}"
|
||||
updateModels()
|
||||
def runTests() {
|
||||
sh """
|
||||
docker build --tag=${docker_image_tag} \
|
||||
--build-arg BUILD_TYPE=${configuration.build_type} \
|
||||
--file=.ci/openvino-onnx/Dockerfile \
|
||||
--build-arg http_proxy=${HTTP_PROXY} \
|
||||
--build-arg https_proxy=${HTTPS_PROXY} .
|
||||
docker run --name ${DOCKER_CONTAINER_NAME} \
|
||||
--volume ${HOME}/ONNX_CI/onnx-models-28-Oct/.onnx/model_zoo:/root/.onnx/model_zoo \
|
||||
--volume ${HOME}/ONNX_CI/onnx-models/.onnx/model_zoo/MSFT:/root/.onnx/model_zoo/MSFT \
|
||||
${DOCKER_IMAGE_TAG}
|
||||
"""
|
||||
}
|
||||
|
||||
def runTests(Map configuration, String workdir) {
|
||||
println "Run tests for ${configuration.name}"
|
||||
String docker_image_tag = "${DOCKER_IMAGE_TAG}_${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}".toLowerCase()
|
||||
|
||||
String docker_container_name = get_docker_container_name(configuration)
|
||||
|
||||
// Run only basic unit tests in Debug configuration
|
||||
if (configuration.build_type == "Debug") {
|
||||
sh """
|
||||
docker run --name ${docker_container_name} ${docker_image_tag}
|
||||
"""
|
||||
pipeline {
|
||||
agent {
|
||||
label "OpenVino"
|
||||
}
|
||||
|
||||
// Run unit-tests AND large model tests by default
|
||||
else {
|
||||
sh """
|
||||
docker run --name ${docker_container_name} \
|
||||
--volume ${HOME}/ONNX_CI/models_data/model_zoo/onnx_model_zoo_${ONNX_MODEL_ZOO_SHA}:/root/.onnx/model_zoo/onnx_model_zoo \
|
||||
--volume ${HOME}/ONNX_CI/data/model_zoo/MSFT:/root/.onnx/model_zoo/MSFT \
|
||||
${docker_image_tag} /bin/bash -c "tox && tox -e zoo_models"
|
||||
"""
|
||||
environment {
|
||||
PROJECT_NAME = "openvino"
|
||||
WORKDIR = "${WORKSPACE}/${BUILD_NUMBER}"
|
||||
}
|
||||
}
|
||||
|
||||
def getConfigurationsMap() {
|
||||
def configurationsMap = [:]
|
||||
for (backend in BACKEND_CONFIGURATIONS) {
|
||||
def configuration = backend.clone()
|
||||
configurationsMap[configuration.name] = {
|
||||
stage(configuration.name) { CONFIGURATION_WORKFLOW(configuration) }
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout true
|
||||
timeout(activity: true, time: 10, unit: 'MINUTES')
|
||||
}
|
||||
return configurationsMap
|
||||
}
|
||||
|
||||
CONFIGURATION_WORKFLOW = { configuration ->
|
||||
node("OpenVINO") {
|
||||
String workdir = "${HOME}/workspace/${BUILD_NUMBER}_${env.CHANGE_ID}_${configuration.name}"
|
||||
try {
|
||||
PROJECT_NAME = "openvino"
|
||||
stage("Clone repository") {
|
||||
prepare_repository(workdir)
|
||||
}
|
||||
stage("Prepare Docker environment") {
|
||||
dir("${workdir}") {
|
||||
buildDockerImage(configuration, workdir)
|
||||
stages {
|
||||
stage("Clone repository") {
|
||||
steps{
|
||||
stopPreviousRunningBuilds()
|
||||
dir("${WORKDIR}") {
|
||||
checkout scm
|
||||
}
|
||||
gitSubmoduleUpdate(PROJECT_NAME)
|
||||
}
|
||||
stage("Run tests") {
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
runTests(configuration, workdir)
|
||||
}
|
||||
stage("Prepare Docker environment") {
|
||||
steps{
|
||||
dir("${WORKDIR}") {
|
||||
buildDockerImage()
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
// Set result to ABORTED if exception contains exit code of a process interrupted by SIGTERM
|
||||
if ("$e".contains("143")) {
|
||||
currentBuild.result = "ABORTED"
|
||||
} else {
|
||||
currentBuild.result = "FAILURE"
|
||||
}
|
||||
def gitPrInfo = getGitPrInfo(PROJECT_NAME, workdir)
|
||||
stage("Run tests") {
|
||||
options {
|
||||
timeout(time: 15, unit: 'MINUTES')
|
||||
}
|
||||
steps{
|
||||
runTests()
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
script {
|
||||
gitPrInfo = getGitPrInfo(PROJECT_NAME)
|
||||
notifyByEmail(gitPrInfo)
|
||||
}
|
||||
}
|
||||
finally {
|
||||
stage("Cleanup") {
|
||||
String docker_container_name = get_docker_container_name(configuration)
|
||||
cleanup {
|
||||
dir("${WORKDIR}") {
|
||||
deleteDir()
|
||||
sh """
|
||||
docker rm -f ${docker_container_name}
|
||||
rm -rf ${workdir}
|
||||
docker image prune -f
|
||||
docker rm -f ${DOCKER_CONTAINER_NAME}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
options {
|
||||
skipDefaultCheckout true
|
||||
timeout(activity: true, time: 120, unit: 'MINUTES')
|
||||
}
|
||||
stages {
|
||||
stage('Parallel CI') {
|
||||
steps {
|
||||
stopPreviousRunningBuilds()
|
||||
script {
|
||||
parallelStagesMap = getConfigurationsMap()
|
||||
parallel parallelStagesMap
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import logging
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import requests
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import argparse
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import requests
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import datetime
|
||||
@@ -486,7 +486,7 @@ class Watchdog:
|
||||
self._queue_message(message, message_severity='warning', pr=pr)
|
||||
elif build_delta > _BUILD_DURATION_THRESHOLD:
|
||||
# CI job take too long, possibly froze - communicate failure
|
||||
message = ('ONNX CI job build #{}, for PR #{} started, '
|
||||
message = ('ONNX CI job build #{}, for PR #{} started,'
|
||||
'but did not finish in designated time of {} '
|
||||
'minutes!'.format(build_number, pr_number,
|
||||
str(_BUILD_DURATION_THRESHOLD.seconds / 60)))
|
||||
|
||||
14
.ci/pot/Jenkinsfile
vendored
14
.ci/pot/Jenkinsfile
vendored
@@ -1,14 +0,0 @@
|
||||
#!groovy
|
||||
|
||||
|
||||
properties([
|
||||
parameters([
|
||||
string(defaultValue: '',
|
||||
description: 'Pipeline shared library version (branch/tag/commit). Determined automatically if empty',
|
||||
name: 'library_version')
|
||||
])
|
||||
])
|
||||
|
||||
loadOpenVinoLibrary {
|
||||
potEntrypoint(this)
|
||||
}
|
||||
19
.gitattributes
vendored
19
.gitattributes
vendored
@@ -2,6 +2,7 @@
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
@@ -10,7 +11,9 @@
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
*.py text eol=lf
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
@@ -33,6 +36,7 @@
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
@@ -41,6 +45,7 @@
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
@@ -58,21 +63,9 @@
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
|
||||
*.PNG filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
*.vsdx filter=lfs diff=lfs merge=lfs -text
|
||||
*.bmp filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
#POT attributes
|
||||
tools/pot/tests/data/test_cases_refs/* filter=lfs diff=lfs merge=lfs -text
|
||||
tools/pot/tests/data/models/*/* filter=lfs diff=lfs merge=lfs -text
|
||||
tools/pot/tests/data/reference_models/* filter=lfs diff=lfs merge=lfs -text
|
||||
tools/pot/tests/data/video/* filter=lfs diff=lfs merge=lfs -text
|
||||
tools/pot/tests/data/reference_fake_quantize_conf/* filter=lfs diff=lfs merge=lfs -text
|
||||
/tools/pot/tests/** -pot_package
|
||||
/tools/pot/tools/auxilary/** -pot_package
|
||||
/tools/pot/tools/run_series_experiments.py -pot_package
|
||||
/tools/pot/.pylintrc -pot_package
|
||||
/tools/pot/README_dev.md -pot_package
|
||||
|
||||
26
.github/dependabot.yml
vendored
26
.github/dependabot.yml
vendored
@@ -1,17 +1,13 @@
|
||||
# See help here: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-and-disabling-version-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
# Enable version updates for nGraph Python API
|
||||
- package-ecosystem: pip
|
||||
directory: "/runtime/bindings/python"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: "13:00"
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- postrational
|
||||
labels:
|
||||
- "category: dependencies"
|
||||
|
||||
- package-ecosystem: pip
|
||||
directory: "/ngraph/python"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: "13:00"
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- postrational
|
||||
labels:
|
||||
- dependencies
|
||||
|
||||
77
.github/org_control/check_org.py
vendored
77
.github/org_control/check_org.py
vendored
@@ -1,17 +1,16 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
Check GitHub organization and invite members
|
||||
"""
|
||||
|
||||
# pylint: disable=fixme,no-member,too-many-locals
|
||||
# pylint: disable=fixme,no-member
|
||||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
import github_api
|
||||
from configs import Config
|
||||
from github_api import GithubOrgApi, get_dev_emails
|
||||
from ldap_api import LdapApi, print_user_info, InfoLevel
|
||||
|
||||
|
||||
def main():
|
||||
@@ -20,74 +19,32 @@ def main():
|
||||
arg_parser.add_argument("--cfg-file", metavar="PATH", default=Config.default_cfg_path,
|
||||
help=f"Path to json configuration file, e.g. {Config.default_cfg_path}")
|
||||
arg_parser.add_argument("--teams", action="store_true", help="Check GitHub teams")
|
||||
arg_parser.add_argument("--no-ldap", action="store_true", help="Don't use LDAP info")
|
||||
args, unknown_args = arg_parser.parse_known_args()
|
||||
|
||||
Config(args.cfg_file, unknown_args)
|
||||
gh_api = GithubOrgApi()
|
||||
gh_api = github_api.GithubOrgApi()
|
||||
|
||||
if args.teams:
|
||||
gh_api.get_org_teams()
|
||||
return
|
||||
else:
|
||||
dev_emails = github_api.get_dev_emails()
|
||||
print(f'\nDeveloper emails {len(dev_emails)}:', '; '.join(dev_emails))
|
||||
|
||||
cfg_emails = get_dev_emails()
|
||||
print(f'\nCfg developer emails {len(cfg_emails)}:', '; '.join(sorted(cfg_emails)))
|
||||
org_emails = gh_api.get_org_emails()
|
||||
print(f'\nOrg emails {len(org_emails)}:', '; '.join(org_emails))
|
||||
|
||||
dev_emails = set()
|
||||
dev_emails.update(cfg_emails)
|
||||
org_pendig_invitation_emails = gh_api.get_org_invitation_emails()
|
||||
|
||||
if not args.no_ldap:
|
||||
ldap_api = LdapApi()
|
||||
ldap_emails = ldap_api.get_user_emails()
|
||||
dev_emails.update(ldap_emails)
|
||||
print(f'\nLDAP developer emails {len(ldap_emails)}:', '; '.join(sorted(ldap_emails)))
|
||||
invite_emails = dev_emails.difference(org_emails).difference(org_pendig_invitation_emails)
|
||||
print(f'\nInvite emails {len(invite_emails)}:', '; '.join(invite_emails))
|
||||
|
||||
cfg_emails_no_in_ldap = ldap_api.get_absent_emails(cfg_emails)
|
||||
print(f'\nCfg developer emails - absent in LDAP at all {len(cfg_emails_no_in_ldap)}:',
|
||||
'; '.join(sorted(cfg_emails_no_in_ldap)))
|
||||
no_in_dev_emails = org_emails.difference(dev_emails)
|
||||
print(f'\nOrg members - no in developers list {len(no_in_dev_emails)}:',
|
||||
'; '.join(no_in_dev_emails))
|
||||
|
||||
cfg_ldap_inters = cfg_emails.intersection(ldap_emails)
|
||||
print(f'\nCfg developer emails - present in LDAP developers {len(cfg_ldap_inters)}:',
|
||||
'; '.join(sorted(cfg_ldap_inters)))
|
||||
valid_github_users = gh_api.get_valid_github_users(invite_emails)
|
||||
|
||||
org_emails, org_logins_no_intel_email = gh_api.get_org_emails()
|
||||
print(f'\nOrg emails {len(org_emails)}:', '; '.join(sorted(org_emails)))
|
||||
|
||||
org_emails_no_in_ldap = set()
|
||||
if not args.no_ldap:
|
||||
org_ldap_diff = org_emails.difference(ldap_emails)
|
||||
print(f'\nOrg member emails - absent in LDAP developers {len(org_ldap_diff)}:',
|
||||
'; '.join(sorted(org_ldap_diff)))
|
||||
|
||||
for email in org_ldap_diff:
|
||||
user_info = ldap_api.get_user_info_by_email(email)
|
||||
if user_info:
|
||||
print_user_info(user_info, InfoLevel.PDL)
|
||||
else:
|
||||
org_emails_no_in_ldap.add(email)
|
||||
|
||||
org_pendig_invitation_emails = gh_api.get_org_invitation_emails()
|
||||
invite_emails = dev_emails.difference(org_emails).difference(org_pendig_invitation_emails)
|
||||
print(f'\nInvite emails {len(invite_emails)}:', '; '.join(sorted(invite_emails)))
|
||||
|
||||
valid_github_users = gh_api.get_valid_github_users(invite_emails)
|
||||
gh_api.invite_users(valid_github_users)
|
||||
|
||||
print('\nCheck accounts below and remove from the GitHub organization and cfg list')
|
||||
|
||||
cfg_emails_no_in_org = sorted(cfg_emails.difference(org_emails))
|
||||
print(f'\nCfg developer emails - absent in GitHub organization {len(cfg_emails_no_in_org)}:',
|
||||
'; '.join(cfg_emails_no_in_org))
|
||||
|
||||
org_emails_no_in_dev = sorted(org_emails.difference(dev_emails))
|
||||
print(f'\nOrg member emails - absent in cfg and LDAP developers {len(org_emails_no_in_dev)}:',
|
||||
'; '.join(org_emails_no_in_dev))
|
||||
|
||||
print(f'\nOrg member emails - absent in LDAP at all {len(org_emails_no_in_ldap)}:',
|
||||
'; '.join(sorted(org_emails_no_in_ldap)))
|
||||
|
||||
print(f'\nOrg member logins - absent Intel email {len(org_logins_no_intel_email)}:',
|
||||
'; '.join(sorted(org_logins_no_intel_email)))
|
||||
gh_api.invite_users(valid_github_users)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
218
.github/org_control/check_pr.py
vendored
218
.github/org_control/check_pr.py
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
@@ -8,7 +8,6 @@ Check GitHub PRs and set labels by type and categories, e.g. 'ExternalPR', 'cate
|
||||
# pylint: disable=fixme,no-member
|
||||
|
||||
import re
|
||||
import sys
|
||||
import datetime
|
||||
from argparse import ArgumentParser
|
||||
from enum import Enum
|
||||
@@ -19,11 +18,10 @@ from configs import Config
|
||||
|
||||
class PrType(Enum):
|
||||
"""Constants for type of GitHub pull request by author membership"""
|
||||
|
||||
EXTERNAL = "ExternalPR"
|
||||
INTEL = "ExternalIntelPR"
|
||||
ORG = "OpenvinoPR"
|
||||
BAD = "BadPR"
|
||||
EXTERNAL = 'ExternalPR'
|
||||
INTEL = 'ExternalIntelPR'
|
||||
ORG = 'OpenvinoPR'
|
||||
BAD = 'BadPR'
|
||||
|
||||
|
||||
def get_pr_labels(pull):
|
||||
@@ -35,23 +33,13 @@ def get_pr_labels(pull):
|
||||
|
||||
|
||||
def set_pr_labels(pull, labels):
|
||||
"""Sets new PR labels (all previously set labels are removed)"""
|
||||
"""Sets PR labels"""
|
||||
if not labels or Config().DRY_RUN:
|
||||
return
|
||||
print("Set PR labels:", labels)
|
||||
# set_labels() should accept list but fails with empty "AssertionError:"
|
||||
print(f'Set PR labels:', labels)
|
||||
pull.set_labels(labels)
|
||||
|
||||
|
||||
def add_pr_labels(pull, labels):
|
||||
"""Adds PR labels"""
|
||||
if not labels or Config().DRY_RUN:
|
||||
return
|
||||
print("Add PR labels:", labels)
|
||||
for label in labels:
|
||||
pull.add_to_labels(label)
|
||||
|
||||
|
||||
def get_pr_type_by_labels(pull):
|
||||
"""Gets PR type using labels"""
|
||||
pr_lables = get_pr_labels(pull)
|
||||
@@ -60,19 +48,19 @@ def get_pr_type_by_labels(pull):
|
||||
if not pr_types_labels:
|
||||
return None
|
||||
if len(pr_types_labels) > 1:
|
||||
print(f"Duplicated labels: {pr_types_labels}")
|
||||
print(f'Duplicated labels: {pr_types_labels}')
|
||||
return PrType.BAD
|
||||
return PrType(PrType(pr_types_labels.pop()))
|
||||
|
||||
|
||||
def get_label_by_team_name_re(team_name):
|
||||
"""Generates label by PR reviwer team name using regular expressions"""
|
||||
if "admins" in team_name:
|
||||
return "category: ci"
|
||||
re_compile_label = re.compile(rf"{Config().GITHUB_REPO}-(.+)-maintainers")
|
||||
if 'admins' in team_name:
|
||||
return 'category: ci'
|
||||
re_compile_label = re.compile(rf'{Config().GITHUB_REPO}-(.+)-maintainers')
|
||||
re_label = re_compile_label.match(team_name)
|
||||
if re_label:
|
||||
return f"category: {re_label.group(1).strip()}"
|
||||
return f'category: {re_label.group(1).strip()}'
|
||||
return None
|
||||
|
||||
|
||||
@@ -92,113 +80,17 @@ def get_category_labels(pull):
|
||||
return labels
|
||||
|
||||
|
||||
def get_pr_info_str(pull):
|
||||
"""Gets info about PR using a few workarounds"""
|
||||
pr_title = pull.title.encode("ASCII", "ignore").decode()
|
||||
|
||||
# Workaround for PyGithub issue: https://github.com/PyGithub/PyGithub/issues/512
|
||||
pr_created_at = pull.created_at.replace(tzinfo=datetime.timezone.utc).astimezone()
|
||||
|
||||
return (
|
||||
f"PR: {pull.number} - {pr_title} - Created: {pr_created_at} - "
|
||||
f"Labels: {get_pr_labels(pull)} - Type: {get_pr_type_by_labels(pull)}"
|
||||
)
|
||||
|
||||
|
||||
def update_labels(gh_api, pull, non_org_intel_pr_users, non_org_pr_users):
|
||||
"""Checks and updates labels"""
|
||||
print("Check and update labels:")
|
||||
pr_type_by_labels = get_pr_type_by_labels(pull)
|
||||
add_labels = []
|
||||
|
||||
# Checks PR source type
|
||||
if gh_api.is_org_user(pull.user):
|
||||
print(" - Org user")
|
||||
elif github_api.is_intel_email(pull.user.email) or github_api.is_intel_company(
|
||||
pull.user.company
|
||||
):
|
||||
print(" - Non org user with Intel email or company")
|
||||
non_org_intel_pr_users.add(pull.user)
|
||||
if pr_type_by_labels is not PrType.INTEL:
|
||||
print(f'NO "{PrType.INTEL.value}" label: ', end="")
|
||||
github_api.print_users(pull.user)
|
||||
add_labels.append(PrType.INTEL.value)
|
||||
elif github_api.is_user_ignored(pull.user):
|
||||
print(" - IGNORED non org user with NO Intel email or company")
|
||||
else:
|
||||
print(" - Non org user with NO Intel email or company")
|
||||
non_org_pr_users.add(pull.user)
|
||||
if pr_type_by_labels is not PrType.EXTERNAL:
|
||||
print(f'NO "{PrType.EXTERNAL.value}" label: ', end="")
|
||||
github_api.print_users(pull.user)
|
||||
add_labels.append(PrType.EXTERNAL.value)
|
||||
|
||||
add_labels += get_category_labels(pull)
|
||||
add_pr_labels(pull, add_labels)
|
||||
|
||||
|
||||
def get_wrong_commits(pull):
|
||||
"""Returns commits with incorrect user and email"""
|
||||
pr_author_email = (pull.user.email or "").lower()
|
||||
print("GitHub PR author email:", pr_author_email)
|
||||
print("Check commits:")
|
||||
wrong_commits = set()
|
||||
for commit in pull.get_commits():
|
||||
# import pprint; pprint.pprint(commit.raw_data)
|
||||
print("Commit SHA:", commit.sha)
|
||||
# Use raw data because commit author can be non GitHub user
|
||||
commit_author_email = (commit.raw_data["commit"]["author"]["email"] or "").lower()
|
||||
commit_committer_email = (commit.raw_data["commit"]["committer"]["email"] or "").lower()
|
||||
print(" Commit author email:", commit_author_email)
|
||||
print(" Commit committer email:", commit_committer_email)
|
||||
if not github_api.is_valid_user(commit.author):
|
||||
print(
|
||||
" ERROR: User with the commit author email is absent in GitHub:",
|
||||
commit.raw_data["commit"]["author"]["name"],
|
||||
)
|
||||
wrong_commits.add(commit.sha)
|
||||
if not github_api.is_valid_user(commit.committer):
|
||||
print(
|
||||
" ERROR: User with the commit committer email is absent in GitHub:",
|
||||
commit.raw_data["commit"]["committer"]["name"],
|
||||
)
|
||||
wrong_commits.add(commit.sha)
|
||||
if not commit.raw_data["commit"]["verification"]["verified"]:
|
||||
print(
|
||||
" WARNING: The commit is not verified. Reason:",
|
||||
commit.raw_data["commit"]["verification"]["reason"],
|
||||
)
|
||||
if pr_author_email != commit_author_email or pr_author_email != commit_committer_email:
|
||||
print(" WARNING: Commit emails and GitHub PR author public email are differnt")
|
||||
return wrong_commits
|
||||
|
||||
|
||||
def main():
|
||||
"""The main entry point function"""
|
||||
arg_parser = ArgumentParser()
|
||||
arg_parser.add_argument(
|
||||
"--cfg-file",
|
||||
metavar="PATH",
|
||||
default=Config.default_cfg_path,
|
||||
help=f"Path to json configuration file, e.g. {Config.default_cfg_path}",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--pr", metavar="NUMBER", help="Get GitHub pull request with the number"
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--pr-state",
|
||||
default="open",
|
||||
choices=["open", "closed"],
|
||||
help="Set GitHub pull request state",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--newer", metavar="MINUTES", help="Get newly created GitHub pull request only"
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--check-commits",
|
||||
action="store_true",
|
||||
help="Check and compare git commit email with GitHub account email",
|
||||
)
|
||||
arg_parser.add_argument("--cfg-file", metavar="PATH", default=Config.default_cfg_path,
|
||||
help=f"Path to json configuration file, e.g. {Config.default_cfg_path}")
|
||||
arg_parser.add_argument("--pr", metavar="NUMBER",
|
||||
help="Get GitHub pull request with the number")
|
||||
arg_parser.add_argument("--pr-state", default="open", choices=["open", "closed"],
|
||||
help="Set GitHub pull request state")
|
||||
arg_parser.add_argument("--newer", metavar="MINUTES",
|
||||
help="Get newly created GitHub pull request only")
|
||||
args, unknown_args = arg_parser.parse_known_args()
|
||||
|
||||
Config(args.cfg_file, unknown_args)
|
||||
@@ -208,52 +100,50 @@ def main():
|
||||
pulls = [gh_api.repo.get_pull(int(args.pr))]
|
||||
else:
|
||||
pulls = gh_api.repo.get_pulls(state=args.pr_state)
|
||||
print(f"\nPRs count ({args.pr_state}):", pulls.totalCount)
|
||||
print(f'\nPRs count ({args.pr_state}):', pulls.totalCount)
|
||||
|
||||
if args.newer:
|
||||
pr_created_after = (
|
||||
datetime.datetime.now() - datetime.timedelta(minutes=int(args.newer))
|
||||
).astimezone()
|
||||
print("Checking PRs created after:", pr_created_after)
|
||||
|
||||
pr_created_after = datetime.datetime.now() - datetime.timedelta(minutes=int(args.newer))
|
||||
print('PRs created after:', pr_created_after)
|
||||
non_org_intel_pr_users = set()
|
||||
non_org_pr_users = set()
|
||||
wrong_pulls = {}
|
||||
|
||||
for pull in pulls:
|
||||
pr_created_at = pull.created_at.replace(tzinfo=datetime.timezone.utc).astimezone()
|
||||
if args.newer and pr_created_at <= pr_created_after:
|
||||
print(f"\nIGNORE: {get_pr_info_str(pull)}")
|
||||
if args.newer and pull.created_at <= pr_created_after:
|
||||
print(f'\nIGNORE: {pull} - Created: {pull.created_at}')
|
||||
continue
|
||||
pr_lables = get_pr_labels(pull)
|
||||
pr_type_by_labels = get_pr_type_by_labels(pull)
|
||||
set_labels = []
|
||||
print(f'\n{pull} - Created: {pull.created_at} - Labels: {pr_lables} -',
|
||||
f'Type: {pr_type_by_labels}', end='')
|
||||
|
||||
print(f"\n{get_pr_info_str(pull)}")
|
||||
if args.check_commits:
|
||||
wrong_commits = get_wrong_commits(pull)
|
||||
if wrong_commits:
|
||||
wrong_pulls[pull.number] = wrong_commits
|
||||
# Checks PR source type
|
||||
if gh_api.is_org_user(pull.user):
|
||||
print(' - Org user')
|
||||
elif github_api.is_intel_email(pull.user.email) or \
|
||||
github_api.is_intel_company(pull.user.company):
|
||||
print(' - Non org user with Intel email or company')
|
||||
non_org_intel_pr_users.add(pull.user)
|
||||
if pr_type_by_labels is not PrType.INTEL:
|
||||
print(f'NO "{PrType.INTEL.value}" label: ', end='')
|
||||
github_api.print_users(pull.user)
|
||||
set_labels.append(PrType.INTEL.value)
|
||||
else:
|
||||
update_labels(gh_api, pull, non_org_intel_pr_users, non_org_pr_users)
|
||||
print(f' - Non org user with NO Intel email or company')
|
||||
non_org_pr_users.add(pull.user)
|
||||
if pr_type_by_labels is not PrType.EXTERNAL:
|
||||
print(f'NO "{PrType.EXTERNAL.value}" label: ', end='')
|
||||
github_api.print_users(pull.user)
|
||||
set_labels.append(PrType.EXTERNAL.value)
|
||||
|
||||
if wrong_pulls:
|
||||
for pull_number, wrong_commits in wrong_pulls.items():
|
||||
print(
|
||||
f"\nERROR: Remove or replace wrong commits in the PR {pull_number}:\n ",
|
||||
"\n ".join(wrong_commits),
|
||||
)
|
||||
print(
|
||||
"\nAbout commit signature verification:\n ",
|
||||
"https://docs.github.com/en/github/authenticating-to-github/"
|
||||
"managing-commit-signature-verification/about-commit-signature-verification",
|
||||
)
|
||||
sys.exit(1)
|
||||
set_labels += get_category_labels(pull)
|
||||
set_pr_labels(pull, set_labels)
|
||||
|
||||
if non_org_intel_pr_users:
|
||||
print("\nNon org user with Intel email or company:")
|
||||
github_api.print_users(non_org_intel_pr_users)
|
||||
if non_org_pr_users:
|
||||
print("\nNon org user with NO Intel email or company:")
|
||||
github_api.print_users(non_org_pr_users)
|
||||
print(f'\nNon org user with Intel email or company:')
|
||||
github_api.print_users(non_org_intel_pr_users)
|
||||
print(f'\nNon org user with NO Intel email or company:')
|
||||
github_api.print_users(non_org_pr_users)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
7
.github/org_control/config.json
vendored
7
.github/org_control/config.json
vendored
@@ -6,9 +6,7 @@
|
||||
"openvino-ci",
|
||||
"openvino-pushbot",
|
||||
"lab-nerval",
|
||||
"lab-nerval-onnx-ci",
|
||||
"onnx-watchdog-agent",
|
||||
"dependabot"
|
||||
"lab-nerval-onnx-ci"
|
||||
],
|
||||
"EMAILS_FILE_PATH": "dev_emails-test.txt",
|
||||
"PROXIES": {
|
||||
@@ -33,7 +31,6 @@
|
||||
"openvino-mo-maintainers": "category: MO",
|
||||
"openvino-ngraph-maintainers": "category: nGraph",
|
||||
"openvino-tests-maintainers": "category: IE Tests",
|
||||
"openvino-tools-maintainers": "category: tools",
|
||||
"openvino-configuration-mgmt": "category: dependency_changes"
|
||||
"openvino-tools-maintainers": "category: tools"
|
||||
}
|
||||
}
|
||||
|
||||
20
.github/org_control/configs.py
vendored
20
.github/org_control/configs.py
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
@@ -57,19 +57,19 @@ class Config:
|
||||
for name, value in self._json_cfg.items():
|
||||
if hasattr(self, name):
|
||||
raise ConfigException(f'Duplicating prosperity: {name}')
|
||||
property_value = self._args.get(name) or os.getenv(name)
|
||||
if property_value:
|
||||
prosperity_value = self._args.get(name) or os.getenv(name)
|
||||
if prosperity_value:
|
||||
# Try to set prosperity_value as Python literal structures, e.g. DRY_RUN=False
|
||||
try:
|
||||
property_value = ast.literal_eval(property_value)
|
||||
prosperity_value = ast.literal_eval(prosperity_value)
|
||||
except Exception:
|
||||
pass
|
||||
if not isinstance(property_value, type(value)):
|
||||
if not isinstance(prosperity_value, type(value)):
|
||||
raise ConfigException(f'Python type of {name} parameter must be {type(value)}')
|
||||
else:
|
||||
property_value = value
|
||||
setattr(self, name, property_value)
|
||||
Config.properties[name] = property_value
|
||||
prosperity_value = value
|
||||
setattr(self, name, prosperity_value)
|
||||
Config.properties[name] = prosperity_value
|
||||
|
||||
self.set_proxy()
|
||||
|
||||
@@ -78,7 +78,7 @@ class Config:
|
||||
try:
|
||||
with open(self._file_path) as conf:
|
||||
self._json_cfg = json.load(conf)
|
||||
except Exception:
|
||||
except:
|
||||
print('Failed to load configuration from:', self._file_path)
|
||||
raise
|
||||
|
||||
@@ -105,7 +105,7 @@ class Config:
|
||||
def _test():
|
||||
"""Test and debug"""
|
||||
print('Config.default_cfg_path:', Config.default_cfg_path)
|
||||
cfg = Config(cli_args=['DRY_RUN', 'PROXIES={"NO_PROXY": "localhost"}'])
|
||||
cfg = Config(cli_args=['DRY_RUN=True'])
|
||||
print('Config.properties:', cfg.get_properties())
|
||||
|
||||
|
||||
|
||||
17
.github/org_control/github_api.py
vendored
17
.github/org_control/github_api.py
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
@@ -11,6 +11,7 @@ import re
|
||||
import time
|
||||
|
||||
from github import Github, GithubException, RateLimitExceededException, IncompletableObject
|
||||
from github import UnknownObjectException
|
||||
from github.PaginatedList import PaginatedList
|
||||
|
||||
from configs import Config
|
||||
@@ -109,13 +110,17 @@ class GithubOrgApi:
|
||||
def is_org_user(self, user):
|
||||
"""Checks that user is a member of GitHub organization"""
|
||||
if is_valid_user(user):
|
||||
# user.get_organization_membership(self.github_org) doesn't work with org members
|
||||
# permissions, GITHUB_TOKEN must be org owner now
|
||||
return self.github_org.has_in_members(user)
|
||||
try:
|
||||
membership = user.get_organization_membership(self.github_org)
|
||||
# membership.role can be 'member' or 'admin'
|
||||
if membership.state == 'active' and membership.role:
|
||||
return True
|
||||
except UnknownObjectException:
|
||||
pass
|
||||
return False
|
||||
|
||||
def get_org_emails(self):
|
||||
"""Gets and prints emails of all GitHub organization members"""
|
||||
"""Gets and prints all emails of GitHub organization members"""
|
||||
org_members = self.github_org.get_members()
|
||||
org_emails = set()
|
||||
org_members_fix = set()
|
||||
@@ -141,7 +146,7 @@ class GithubOrgApi:
|
||||
'; '.join(org_logins_fix_intel_email))
|
||||
print(f'\nOrg members - no real name {len(org_emails_fix_name)}:',
|
||||
'; '.join(org_emails_fix_name))
|
||||
return (org_emails, org_logins_fix_intel_email)
|
||||
return org_emails
|
||||
|
||||
def get_org_invitation_emails(self):
|
||||
"""Gets GitHub organization teams prints info"""
|
||||
|
||||
236
.github/org_control/ldap_api.py
vendored
236
.github/org_control/ldap_api.py
vendored
@@ -1,236 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
"""
|
||||
Gets info about users and groups via LDAP
|
||||
"""
|
||||
|
||||
# pylint: disable=fixme,no-member
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from ldap3 import Server, Connection, ALL, SUBTREE
|
||||
|
||||
from configs import Config
|
||||
|
||||
|
||||
class LdapApiException(Exception):
|
||||
"""Base LDAP API exception"""
|
||||
|
||||
|
||||
class InfoLevel(Enum):
|
||||
"""Constants for printing user info from LDAP"""
|
||||
PDL = 'PDL' # Public Distribution List (group of e-mail addresses)
|
||||
FULL = 'Full'
|
||||
|
||||
|
||||
def print_user_info(info, info_level=None):
|
||||
"""Pretty-print of a user info data structure (dict). info_level is the InfoLevel Enum"""
|
||||
if not info or not info.get('mail'):
|
||||
raise LdapApiException('ERROR: No info or absent mail')
|
||||
|
||||
def get_membership():
|
||||
if info_level == InfoLevel.PDL:
|
||||
membership_info = ' PDLs:'
|
||||
elif info_level == InfoLevel.FULL:
|
||||
membership_info = ' memberOf :'
|
||||
else:
|
||||
return ''
|
||||
# Grouping groups by purpose
|
||||
if info_level == InfoLevel.PDL:
|
||||
sort_key = lambda i: i.split(',', 1)[0].lower()
|
||||
else:
|
||||
sort_key = lambda i: i.split(',', 1)[1] + i.split(',', 1)[0].lower()
|
||||
for item in sorted(info['memberOf'], key=sort_key):
|
||||
if info_level == InfoLevel.PDL and 'OU=Delegated' not in item:
|
||||
continue
|
||||
membership_info += f'\n {item}'
|
||||
return membership_info
|
||||
|
||||
try:
|
||||
text_info = \
|
||||
f'\n{info["cn"]} <{info["mail"]}>; {info["sAMAccountName"]}; {info["employeeID"]}' \
|
||||
f'\n Org group: {info["intelSuperGroupDescr"]} ({info["intelSuperGroupShortName"]}) /'\
|
||||
f' {info["intelGroupDescr"]} ({info["intelGroupShortName"]}) /' \
|
||||
f' {info["intelDivisionDescr"]} ({info["intelDivisionShortName"]}) /' \
|
||||
f' {info["intelOrgUnitDescr"]}' \
|
||||
f'\n Manager: {info["manager"]}' \
|
||||
f'\n Location: {info["intelRegionCode"]} / {info["co"]} / {info["intelSiteCode"]} /' \
|
||||
f' {info["intelBldgCode"]} ({info["intelSiteName"]}) /' \
|
||||
f' {info["physicalDeliveryOfficeName"]}' \
|
||||
f'\n Other: {info["employeeType"]} | {info["intelExportCountryGroup"]} |' \
|
||||
f' {info["whenCreated"]} | {info["intelCostCenterDescr"]} | {info["jobDescription"]}'
|
||||
except Exception as exc:
|
||||
raise LdapApiException(f'ERROR: Failed to get info about "{info["mail"]}". ' \
|
||||
f'Exception occurred:\n{repr(exc)}') from exc
|
||||
print(text_info)
|
||||
|
||||
membership = get_membership()
|
||||
if info_level == InfoLevel.PDL and membership:
|
||||
print(membership)
|
||||
elif info_level == InfoLevel.FULL:
|
||||
for key in sorted(info):
|
||||
if isinstance(info[key], list):
|
||||
if key == 'memberOf':
|
||||
print(membership)
|
||||
else:
|
||||
print(f' {key} :')
|
||||
for item in info[key]:
|
||||
print(' ', item)
|
||||
else:
|
||||
print(f' {key} : {info[key]}')
|
||||
|
||||
|
||||
class LdapApi:
|
||||
"""LDAP API for getting user info and emails"""
|
||||
|
||||
_binary_blobs = ['thumbnailPhoto', 'msExchUMSpokenName', 'msExchBlockedSendersHash']
|
||||
_check_existing = [
|
||||
'intelExportCountryGroup',
|
||||
'physicalDeliveryOfficeName',
|
||||
'intelSuperGroupShortName',
|
||||
'intelGroupShortName',
|
||||
'intelDivisionShortName',
|
||||
]
|
||||
|
||||
null = '<null>'
|
||||
|
||||
def __init__(self):
|
||||
self._cfg = Config()
|
||||
self.server = Server(self._cfg.LDAP_SERVER, get_info=ALL)
|
||||
self.connection = Connection(self.server,
|
||||
user=self._cfg.LDAP_USER,
|
||||
password=self._cfg.LDAP_PASSWORD,
|
||||
auto_bind=True)
|
||||
self.connection.bind()
|
||||
|
||||
def get_user_emails(self, groups=None):
|
||||
"""Gets emails of LDAP groups and sub-groups"""
|
||||
print('\nGet emails from LDAP groups:')
|
||||
processed_ldap_members = {}
|
||||
|
||||
def process_group_members(member, parent_group):
|
||||
if member in processed_ldap_members:
|
||||
processed_ldap_members[member]['parent_groups'].append(parent_group)
|
||||
print('\nWARNING: Ignore LDAP member to avoid duplication and recursive cycling '
|
||||
f'of PDLs: {member}\n '
|
||||
f'email: {processed_ldap_members[member].get("email")}\n parent_groups:')
|
||||
for group in processed_ldap_members[member].get('parent_groups', []):
|
||||
print(7 * ' ', group)
|
||||
|
||||
return
|
||||
processed_ldap_members[member] = {'email': None, 'parent_groups': [parent_group]}
|
||||
|
||||
# AD moves terminated users to the boneyard OU in case the user returns,
|
||||
# so it can be reactivated with little effort.
|
||||
# After 30 days it is removed and the unix personality becomes unlinked.
|
||||
if 'OU=Boneyard' in member:
|
||||
return
|
||||
self.connection.search(member, r'(objectClass=*)', SUBTREE,
|
||||
attributes=['cn', 'member', 'mail'])
|
||||
|
||||
#print(self.connection.entries)
|
||||
if not self.connection.response:
|
||||
raise LdapApiException(f'ERROR: empty response. LDAP member: {member}')
|
||||
|
||||
# Check that the member is worker.
|
||||
# The response can contain several items, but the first item is valid only
|
||||
if 'OU=Workers' in member:
|
||||
if self.connection.response[0]['attributes']['mail']:
|
||||
processed_ldap_members[member]['email'] = \
|
||||
self.connection.response[0]['attributes']['mail'].lower()
|
||||
return
|
||||
raise LdapApiException(f'ERROR: no mail. LDAP worker: {member}\n'
|
||||
f'{self.connection.entries}')
|
||||
|
||||
if len(self.connection.response) > 1:
|
||||
raise LdapApiException(f'ERROR: multiple responses for {member}: '
|
||||
f'{len(self.connection.response)}\n'
|
||||
f'{self.connection.entries}')
|
||||
|
||||
if self.connection.response[0]['attributes']['member']:
|
||||
for group_member in self.connection.response[0]['attributes']['member']:
|
||||
process_group_members(group_member, member)
|
||||
else:
|
||||
print(f'\nERROR: no members in LDAP group: {member}\n{self.connection.entries}')
|
||||
|
||||
for group in groups or self._cfg.LDAP_PDLs:
|
||||
print('\nProcess ROOT LDAP group:', group)
|
||||
process_group_members(group, 'ROOT')
|
||||
return {
|
||||
member.get('email') for member in processed_ldap_members.values() if member.get('email')
|
||||
}
|
||||
|
||||
|
||||
def _get_user_info(self, query):
|
||||
"""Gets user info from LDAP as dict matching key and values pairs from query"""
|
||||
query_filter = ''.join(f'({key}={value})' for key, value in query.items())
|
||||
|
||||
for domain in self._cfg.LDAP_DOMAINS:
|
||||
search_base = f'OU=Workers,DC={domain},DC=corp,DC=intel,DC=com'
|
||||
self.connection.search(
|
||||
search_base,
|
||||
f'(&(objectcategory=person)(objectclass=user)(intelflags=1){query_filter})',
|
||||
SUBTREE,
|
||||
attributes=['*'])
|
||||
|
||||
if self.connection.response:
|
||||
if len(self.connection.response) > 1:
|
||||
raise LdapApiException(f'ERROR: multiple responses for {query_filter}: '
|
||||
f'{len(self.connection.response)}\n'
|
||||
f'{self.connection.entries}')
|
||||
info = self.connection.response[0]['attributes']
|
||||
|
||||
# remove long binary blobs
|
||||
for blob in LdapApi._binary_blobs:
|
||||
info[blob] = b''
|
||||
for key in LdapApi._check_existing:
|
||||
if not info.get(key):
|
||||
info[key] = LdapApi.null
|
||||
return info
|
||||
return {}
|
||||
|
||||
|
||||
def get_user_info_by_idsid(self, idsid):
|
||||
"""Gets user info from LDAP as dict using account name for searching"""
|
||||
return self._get_user_info({'sAMAccountName': idsid})
|
||||
|
||||
|
||||
def get_user_info_by_name(self, name):
|
||||
"""Gets user info from LDAP as dict using common name for searching"""
|
||||
return self._get_user_info({'cn': name})
|
||||
|
||||
|
||||
def get_user_info_by_email(self, email):
|
||||
"""Gets user info from LDAP as dict using emails for searching"""
|
||||
return self._get_user_info({'mail': email})
|
||||
|
||||
|
||||
def get_absent_emails(self, emails):
|
||||
"""Checks users by email in LDAP and returns absent emails"""
|
||||
absent_emails = set()
|
||||
for email in emails:
|
||||
if not self.get_user_info_by_email(email):
|
||||
absent_emails.add(email)
|
||||
return absent_emails
|
||||
|
||||
|
||||
def _test():
|
||||
"""Test and debug"""
|
||||
ldap = LdapApi()
|
||||
|
||||
emails = ldap.get_user_emails()
|
||||
print(f'\nLDAP emails count: {len(emails)}\n{"; ".join(emails)}')
|
||||
|
||||
emails = ['foo@intel.com']
|
||||
|
||||
for email in emails:
|
||||
info = ldap.get_user_info_by_email(email)
|
||||
if info:
|
||||
print_user_info(info, InfoLevel.PDL)
|
||||
else:
|
||||
print(f'\n{email} - not found')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
_test()
|
||||
1
.github/org_control/requirements-dev.txt
vendored
1
.github/org_control/requirements-dev.txt
vendored
@@ -1 +0,0 @@
|
||||
pylint==2.5.3
|
||||
1
.github/org_control/requirements.txt
vendored
1
.github/org_control/requirements.txt
vendored
@@ -1,2 +1 @@
|
||||
PyGithub==1.51
|
||||
ldap3==2.7
|
||||
|
||||
1
.github/org_control/requirements_dev.txt
vendored
Normal file
1
.github/org_control/requirements_dev.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
pylint==2.3.0
|
||||
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
@@ -1,6 +0,0 @@
|
||||
### Details:
|
||||
- *item1*
|
||||
- *...*
|
||||
|
||||
### Tickets:
|
||||
- *ticket-id*
|
||||
47
.github/workflows/build_doc.yml
vendored
47
.github/workflows/build_doc.yml
vendored
@@ -1,47 +0,0 @@
|
||||
name: Documentation
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Build_Doc:
|
||||
if: github.repository == 'openvinotoolkit/openvino'
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone OpenVINO
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
lfs: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev graphviz texlive
|
||||
python3 -m pip install lxml
|
||||
# install doxygen
|
||||
mkdir doxygen
|
||||
cd doxygen
|
||||
git clone https://github.com/doxygen/doxygen.git
|
||||
cd doxygen
|
||||
git checkout Release_1_9_1
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . -j`nproc`
|
||||
sudo make install
|
||||
|
||||
- name: CMake doc
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DENABLE_DOCS=ON ..
|
||||
|
||||
- name: Build doc
|
||||
run: cmake --build . --target openvino_docs
|
||||
working-directory: build
|
||||
|
||||
- name: 'Upload doc'
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: openvino_doc
|
||||
path: build/docs/html/
|
||||
17
.github/workflows/check_pr_commits.yml
vendored
17
.github/workflows/check_pr_commits.yml
vendored
@@ -1,17 +0,0 @@
|
||||
name: PR Commits
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
Checks:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Clone OpenVINO
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: python3 -m pip install -r ./.github/org_control/requirements.txt
|
||||
|
||||
- name: PR commits
|
||||
run: python3 ./.github/org_control/check_pr.py --pr=${{ github.event.number }} --check-commits DRY_RUN
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
72
.github/workflows/code_style.yml
vendored
72
.github/workflows/code_style.yml
vendored
@@ -2,50 +2,42 @@ name: Code Style
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
clang-format:
|
||||
runs-on: ubuntu-20.04
|
||||
nGraph:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install clang-format-9
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt --assume-yes install clang-format-9
|
||||
- name: Install clang-format-3.9
|
||||
run: sudo apt --assume-yes install clang-format-3.9
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
|
||||
# Add for -DENABLE_PYTHON=ON, no cython
|
||||
python3 -m pip install -r ./inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||
|
||||
# Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector
|
||||
- name: CMake
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT ..
|
||||
cmake ..
|
||||
|
||||
- name: Check code style
|
||||
run: cmake --build . --target clang_format_check_all -j8
|
||||
run: make style-check
|
||||
working-directory: build
|
||||
|
||||
- name: Create code style diff
|
||||
if: failure()
|
||||
run: |
|
||||
cmake --build . --target clang_format_fix_all -j8
|
||||
git diff > code_style_diff.diff
|
||||
working-directory: build
|
||||
ngraph/maint/apply-code-format.sh
|
||||
git diff >ngraph_code_style_diff.patch
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: code_style_diff
|
||||
path: build/code_style_diff.diff
|
||||
name: ngraph_code_style_diff
|
||||
path: ngraph_code_style_diff.patch
|
||||
|
||||
ShellCheck:
|
||||
runs-on: ubuntu-18.04
|
||||
@@ -55,44 +47,46 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install ShellCheck
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt --assume-yes install shellcheck
|
||||
run: sudo apt --assume-yes install shellcheck
|
||||
|
||||
- name: Install dependencies
|
||||
run: python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
|
||||
run: |
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
|
||||
|
||||
- name: CMake
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DENABLE_VPU=OFF ..
|
||||
cmake ..
|
||||
|
||||
- name: ShellCheck
|
||||
run: cmake --build . --target ie_shellcheck -j8
|
||||
run: make ie_shellcheck
|
||||
working-directory: build
|
||||
|
||||
NamingConventionCheck:
|
||||
Java:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
submodules: recursive
|
||||
java-version: '11'
|
||||
|
||||
- name: Install Clang dependency
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt --assume-yes install libclang-9-dev
|
||||
wget -nc https://github.com/google/google-java-format/releases/download/google-java-format-1.9/google-java-format-1.9-all-deps.jar
|
||||
|
||||
- name: Install Python-based dependencies
|
||||
run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt
|
||||
|
||||
- name: CMake
|
||||
- name: Check code style
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DENABLE_VPU=OFF ..
|
||||
java -jar google-java-format-1.9-all-deps.jar --set-exit-if-changed -a -i $(find . -type f -name "*.java")
|
||||
|
||||
- name: Naming convention check
|
||||
run: cmake --build . --target ncc_all -j8
|
||||
working-directory: build
|
||||
- name: Create code style diff
|
||||
if: failure()
|
||||
run: |
|
||||
git diff >java_code_style_diff.patch
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: java_code_style_diff
|
||||
path: java_code_style_diff.patch
|
||||
|
||||
4
.github/workflows/files_size.yml
vendored
4
.github/workflows/files_size.yml
vendored
@@ -2,7 +2,7 @@ name: Files Size
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Check_Files_Size:
|
||||
Check-Files-Size:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -14,4 +14,4 @@ jobs:
|
||||
- name: git lfs ls-files
|
||||
run: |
|
||||
git lfs ls-files --size
|
||||
|
||||
|
||||
|
||||
2
.github/workflows/mo.yml
vendored
2
.github/workflows/mo.yml
vendored
@@ -41,7 +41,6 @@ jobs:
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements_dev.txt
|
||||
# requrements for CMake
|
||||
sudo apt update
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
working-directory: model-optimizer
|
||||
|
||||
@@ -63,4 +62,3 @@ jobs:
|
||||
mkdir ../mo-ut-logs
|
||||
python3 -m xmlrunner discover -p *_test.py --output=../mo-ut-logs
|
||||
working-directory: model-optimizer
|
||||
|
||||
|
||||
77
.github/workflows/py_checks.yml
vendored
77
.github/workflows/py_checks.yml
vendored
@@ -1,77 +0,0 @@
|
||||
name: IE Python Checks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'inference-engine/ie_bridges/python/**'
|
||||
- 'samples/python/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'inference-engine/ie_bridges/python/**'
|
||||
- 'samples/python/**'
|
||||
jobs:
|
||||
linters:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.6'
|
||||
- name: Install dependencies
|
||||
run: python -m pip install -r inference-engine/ie_bridges/python/requirements_dev.txt
|
||||
- name: Run Flake on samples
|
||||
run: python -m flake8 ./ --config=setup.cfg
|
||||
working-directory: samples/python
|
||||
- name: Create code style diff for samples
|
||||
if: failure()
|
||||
run: |
|
||||
python -m black -l 160 -S ./
|
||||
git diff > samples_diff.diff
|
||||
working-directory: samples/python
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: samples_diff
|
||||
path: samples_diff.diff
|
||||
- name: Run Flake on src
|
||||
run: python -m flake8 ./ --config=../setup.cfg
|
||||
working-directory: inference-engine/ie_bridges/python/src
|
||||
- name: Create code style diff for Python src
|
||||
if: failure()
|
||||
run: |
|
||||
python -m black -l 160 -S ./
|
||||
git diff > src_diff.diff
|
||||
working-directory: inference-engine/ie_bridges/python/src
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: src_diff
|
||||
path: src_diff.diff
|
||||
- name: Run Flake on wheel
|
||||
run: python -m flake8 ./ --config=../setup.cfg
|
||||
working-directory: inference-engine/ie_bridges/python/wheel
|
||||
- name: Create code style diff for wheel
|
||||
if: failure()
|
||||
run: |
|
||||
python -m black -l 160 -S ./
|
||||
git diff > wheel_diff.diff
|
||||
working-directory: inference-engine/ie_bridges/python/wheel
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: wheel_diff
|
||||
path: wheel_diff.diff
|
||||
|
||||
- name: Run MyPy
|
||||
run: python -m mypy ./ --config-file ./setup.cfg
|
||||
working-directory: inference-engine/ie_bridges/python
|
||||
- name: Run Bandit
|
||||
run: python -m bandit -r ./ -f screen
|
||||
working-directory: inference-engine/ie_bridges/python
|
||||
|
||||
|
||||
16
.gitignore
vendored
16
.gitignore
vendored
@@ -1,8 +1,7 @@
|
||||
# build/artifact dirs
|
||||
_*
|
||||
# but ensure we don't skip __init__.py and __main__.py
|
||||
# but ensure we don't skip __init__.py
|
||||
!__init__.py
|
||||
!__main__.py
|
||||
|
||||
# developer tools
|
||||
*.idea
|
||||
@@ -26,7 +25,6 @@ inference-engine/report
|
||||
docs/template_plugin/html/
|
||||
CMakeLists.txt.user
|
||||
docs/IE_PLUGIN_DG/html/
|
||||
inference-engine/ie_bridges/python/wheel/.env
|
||||
|
||||
*.project
|
||||
*.cproject
|
||||
@@ -59,3 +57,15 @@ __pycache__
|
||||
/model-optimizer/*.mapping
|
||||
/model-optimizer/*.dat
|
||||
/model-optimizer/*.svg
|
||||
|
||||
# ngraph
|
||||
ngraph/src/CPackConfig.cmake
|
||||
ngraph/src/CPackSourceConfig.cmake
|
||||
ngraph/src/VERSION
|
||||
ngraph/src/gtest/
|
||||
ngraph/src/json/
|
||||
ngraph/src/ngraphConfig.cmake
|
||||
ngraph/src/ngraphConfigVersion.cmake
|
||||
ngraph/src/protobuf/
|
||||
ngraph/src/src/
|
||||
ngraph/src/test/
|
||||
|
||||
65
.gitmodules
vendored
65
.gitmodules
vendored
@@ -1,61 +1,16 @@
|
||||
[submodule "inference-engine/thirdparty/ade"]
|
||||
path = inference-engine/thirdparty/ade
|
||||
url = https://github.com/opencv/ade.git
|
||||
ignore = dirty
|
||||
[submodule "inference-engine/thirdparty/mkl-dnn"]
|
||||
path = inference-engine/thirdparty/mkl-dnn
|
||||
url = https://github.com/openvinotoolkit/oneDNN.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/xbyak"]
|
||||
path = thirdparty/xbyak
|
||||
url = https://github.com/herumi/xbyak.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/zlib/zlib"]
|
||||
path = thirdparty/zlib/zlib
|
||||
url = https://github.com/madler/zlib.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/pugixml"]
|
||||
path = thirdparty/pugixml
|
||||
url = https://github.com/zeux/pugixml.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ade"]
|
||||
path = thirdparty/ade
|
||||
url = https://github.com/opencv/ade.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/gflags/gflags"]
|
||||
path = thirdparty/gflags/gflags
|
||||
url = https://github.com/gflags/gflags.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/gtest/gtest"]
|
||||
path = thirdparty/gtest/gtest
|
||||
[submodule "inference-engine/tests/ie_test_utils/common_test_utils/gtest"]
|
||||
path = inference-engine/tests/ie_test_utils/common_test_utils/gtest
|
||||
url = https://github.com/openvinotoolkit/googletest.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ocl/icd_loader"]
|
||||
path = thirdparty/ocl/icd_loader
|
||||
url = https://github.com/KhronosGroup/OpenCL-ICD-Loader.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ocl/cl_headers"]
|
||||
path = thirdparty/ocl/cl_headers
|
||||
url = https://github.com/KhronosGroup/OpenCL-Headers.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ocl/clhpp_headers"]
|
||||
path = thirdparty/ocl/clhpp_headers
|
||||
url = https://github.com/KhronosGroup/OpenCL-CLHPP.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/onnx"]
|
||||
path = thirdparty/onnx/onnx
|
||||
url = https://github.com/onnx/onnx.git
|
||||
[submodule "thirdparty/protobuf"]
|
||||
path = thirdparty/protobuf/protobuf
|
||||
url = https://github.com/protocolbuffers/protobuf.git
|
||||
[submodule "runtime/bindings/python/thirdparty/pybind11"]
|
||||
path = runtime/bindings/python/thirdparty/pybind11
|
||||
url = https://github.com/pybind/pybind11.git
|
||||
[submodule "thirdparty/ittapi/ittapi"]
|
||||
path = thirdparty/ittapi/ittapi
|
||||
url = https://github.com/intel/ittapi.git
|
||||
[submodule "ncc"]
|
||||
path = cmake/developer_package/ncc_naming_style/ncc
|
||||
url = https://github.com/nithinn/ncc.git
|
||||
[submodule "thirdparty/onednn_gpu"]
|
||||
path = thirdparty/onednn_gpu
|
||||
url = https://github.com/oneapi-src/oneDNN.git
|
||||
[submodule "tools/pot/thirdparty/open_model_zoo"]
|
||||
path = tools/pot/thirdparty/open_model_zoo
|
||||
url = https://github.com/openvinotoolkit/open_model_zoo.git
|
||||
[submodule "inference-engine/samples/thirdparty/gflags"]
|
||||
path = inference-engine/samples/thirdparty/gflags
|
||||
url = https://github.com/gflags/gflags.git
|
||||
ignore = dirty
|
||||
227
CMakeLists.txt
227
CMakeLists.txt
@@ -1,107 +1,218 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||
|
||||
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
|
||||
project(OpenVINO)
|
||||
|
||||
set(IE_MAIN_SOURCE_DIR ${OpenVINO_SOURCE_DIR}/inference-engine)
|
||||
|
||||
find_package(IEDevScripts REQUIRED
|
||||
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
|
||||
list(APPEND CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake")
|
||||
|
||||
include(CTest)
|
||||
include(cmake/features.cmake)
|
||||
include(features)
|
||||
|
||||
# include developer package
|
||||
include(developer_package)
|
||||
|
||||
# These options are shared with 3rdparty plugins by means of developer package
|
||||
include(cmake/dependencies.cmake)
|
||||
|
||||
if(ENABLE_COVERAGE)
|
||||
include(cmake/coverage.cmake)
|
||||
endif()
|
||||
include(check_features)
|
||||
include(dependencies)
|
||||
|
||||
# resolving dependencies for the project
|
||||
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
|
||||
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
|
||||
message (STATUS "OpenVINO_SOURCE_DIR ................... " ${OpenVINO_SOURCE_DIR})
|
||||
message (STATUS "OpenVINO_MAIN_SOURCE_DIR .............. " ${OpenVINO_MAIN_SOURCE_DIR})
|
||||
message (STATUS "IE_MAIN_SOURCE_DIR .................... " ${IE_MAIN_SOURCE_DIR})
|
||||
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
|
||||
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
|
||||
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
|
||||
|
||||
# remove file with exported developer targets to force its regeneration
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/ngraph/ngraphTargets.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
|
||||
foreach(component IN LISTS openvino_export_components)
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
||||
unset(${component} CACHE)
|
||||
endforeach()
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/targets_developer.cmake")
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/targets.cmake")
|
||||
|
||||
#
|
||||
# Build
|
||||
#
|
||||
|
||||
function(openvino_developer_export_targets)
|
||||
cmake_parse_arguments(EXPORT "" "COMPONENT" "TARGETS" ${ARGN})
|
||||
function(build_ngraph)
|
||||
function(ngraph_set option value)
|
||||
if(NOT DEFINED ${option})
|
||||
set(${option} ${value} CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(EXPORT_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "openvino_developer_export_targets has unparsed arguments: ${EXPORT_UNPARSED_ARGUMENTS}")
|
||||
set(NGRAPH_BUILD_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CACHE STRING "" FORCE)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OpenVINO_MAIN_SOURCE_DIR}/ngraph/cmake/Modules/")
|
||||
|
||||
if (ENABLE_SANITIZER)
|
||||
ngraph_set(NGRAPH_ADDRESS_SANITIZER TRUE)
|
||||
else ()
|
||||
ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
|
||||
endif ()
|
||||
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
|
||||
|
||||
if(ENABLE_TESTS AND NOT ANDROID)
|
||||
ngraph_set(NGRAPH_UNIT_TEST_ENABLE TRUE)
|
||||
else()
|
||||
ngraph_set(NGRAPH_UNIT_TEST_ENABLE FALSE)
|
||||
endif()
|
||||
|
||||
set(${EXPORT_COMPONENT} "${${EXPORT_COMPONENT}};${EXPORT_TARGETS}")
|
||||
if(NOT (ANDROID OR WINDOWS_STORE OR (MSVC AND (ARM OR AARCH64)) ))
|
||||
ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE TRUE)
|
||||
else()
|
||||
ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE FALSE)
|
||||
endif()
|
||||
ngraph_set(NGRAPH_INTERPRETER_ENABLE TRUE)
|
||||
|
||||
if(TREAT_WARNING_AS_ERROR)
|
||||
ngraph_set(NGRAPH_WARNINGS_AS_ERRORS ON)
|
||||
else()
|
||||
ngraph_set(NGRAPH_WARNINGS_AS_ERRORS OFF)
|
||||
endif()
|
||||
|
||||
if(COVERAGE)
|
||||
ngraph_set(NGRAPH_CODE_COVERAGE_ENABLE ON)
|
||||
else()
|
||||
ngraph_set(NGRAPH_CODE_COVERAGE_ENABLE OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SANITIZER)
|
||||
ngraph_set(NGRAPH_ADDRESS_SANITIZER_ENABLE ON)
|
||||
else()
|
||||
ngraph_set(NGRAPH_ADDRESS_SANITIZER_ENABLE OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_THREAD_SANITIZER)
|
||||
ngraph_set(NGRAPH_THREAD_SANITIZER_ENABLE ON)
|
||||
else()
|
||||
ngraph_set(NGRAPH_THREAD_SANITIZER_ENABLE OFF)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
|
||||
ie_add_compiler_flags(-Wno-error=uninitialized -Wno-error=literal-conversion)
|
||||
elseif(UNIX)
|
||||
ie_add_compiler_flags(-Wno-error=maybe-uninitialized -Wno-error=return-type -fPIC)
|
||||
endif()
|
||||
if(ANDROID)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=defaulted-function-deleted -Wno-error=unused-command-line-argument")
|
||||
endif()
|
||||
|
||||
# WA for GCC 7.0
|
||||
if (UNIX)
|
||||
ie_add_compiler_flags(-Wno-error=return-type -Wno-undef)
|
||||
elseif(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146 /wd4703 /wd4244 /wd4819")
|
||||
endif()
|
||||
|
||||
if(ENABLE_LTO)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||
endif()
|
||||
|
||||
ie_cpack_add_component(ngraph)
|
||||
|
||||
set(SDL_cmake_included ON)
|
||||
# set(NGRAPH_COMPONENT_PREFIX "deployment_tools/ngraph/")
|
||||
add_subdirectory(ngraph)
|
||||
set(NGRAPH_LIBRARIES ngraph PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/openvino_targets_developer.cmake")
|
||||
|
||||
unset(OpenVINODeveloperPackageTargets CACHE)
|
||||
|
||||
function(openvino_developer_export_targets)
|
||||
set(OpenVINODeveloperPackageTargets "${OpenVINODeveloperPackageTargets};${ARGV}")
|
||||
|
||||
# to allow exporting of aliased targets with the original names
|
||||
foreach(target_name IN LISTS ${EXPORT_COMPONENT})
|
||||
foreach(target_name ${OpenVINODeveloperPackageTargets})
|
||||
if(TARGET "${target_name}")
|
||||
get_target_property(original_name ${target_name} ALIASED_TARGET)
|
||||
if(TARGET "${original_name}")
|
||||
message(STATUS "The name ${target_name} is an ALIAS for ${original_name}. "
|
||||
"It will be exported to the InferenceEngineDeveloperPackage with the original name.")
|
||||
list(REMOVE_ITEM ${EXPORT_COMPONENT} ${target_name})
|
||||
list(APPEND ${EXPORT_COMPONENT} ${original_name})
|
||||
list(REMOVE_ITEM OpenVINODeveloperPackageTargets ${target_name})
|
||||
list(APPEND OpenVINODeveloperPackageTargets ${original_name})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_DUPLICATES ${EXPORT_COMPONENT})
|
||||
set(${EXPORT_COMPONENT} "${${EXPORT_COMPONENT}}" CACHE INTERNAL
|
||||
"A list of OpenVINO ${EXPORT_COMPONENT} exported targets" FORCE)
|
||||
|
||||
list(APPEND openvino_export_components ${EXPORT_COMPONENT})
|
||||
list(REMOVE_DUPLICATES openvino_export_components)
|
||||
set(openvino_export_components "${openvino_export_components}" CACHE INTERNAL
|
||||
"A list of OpenVINO exported components" FORCE)
|
||||
list(REMOVE_DUPLICATES OpenVINODeveloperPackageTargets)
|
||||
set(OpenVINODeveloperPackageTargets "${OpenVINODeveloperPackageTargets}" CACHE INTERNAL
|
||||
"Paths to extra Inference Engine plugins" FORCE)
|
||||
endfunction()
|
||||
|
||||
ie_cpack_add_component(ngraph REQUIRED)
|
||||
ie_cpack_add_component(ngraph_dev REQUIRED DEPENDS ngraph)
|
||||
|
||||
# add target with processed tests model zoo
|
||||
include(cmake/test_model_zoo.cmake)
|
||||
|
||||
add_subdirectory(thirdparty)
|
||||
add_subdirectory(openvino)
|
||||
add_subdirectory(ngraph)
|
||||
|
||||
build_ngraph()
|
||||
|
||||
add_subdirectory(inference-engine)
|
||||
add_subdirectory(runtime)
|
||||
|
||||
# for Template plugin
|
||||
openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph_backend interpreter_backend)
|
||||
include(cmake/extra_modules.cmake)
|
||||
|
||||
if(ENABLE_SAMPLES)
|
||||
add_subdirectory(samples)
|
||||
endif()
|
||||
add_subdirectory(model-optimizer)
|
||||
add_subdirectory(docs)
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(scripts)
|
||||
|
||||
#
|
||||
# CPack
|
||||
# Shellcheck
|
||||
#
|
||||
|
||||
ie_shellcheck_process(DIRECTORY "${OpenVINO_MAIN_SOURCE_DIR}"
|
||||
SKIP "${OpenVINO_MAIN_SOURCE_DIR}/bin"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/build"
|
||||
"${IE_MAIN_SOURCE_DIR}/tests/ie_test_utils/common_test_utils/gtest"
|
||||
"${IE_MAIN_SOURCE_DIR}/samples/thirdparty"
|
||||
"${IE_MAIN_SOURCE_DIR}/thirdparty"
|
||||
"${IE_MAIN_SOURCE_DIR}/temp"
|
||||
# TODO fix and enable back:
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/install_dependencies"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/demo"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/ngraph"
|
||||
"${IE_MAIN_SOURCE_DIR}/scripts")
|
||||
|
||||
#
|
||||
# cpack
|
||||
#
|
||||
|
||||
# install setupvars
|
||||
|
||||
ie_cpack_add_component(setupvars REQUIRED)
|
||||
|
||||
if(UNIX)
|
||||
install(PROGRAMS scripts/setupvars/setupvars.sh
|
||||
DESTINATION bin
|
||||
COMPONENT setupvars)
|
||||
elseif(WIN32)
|
||||
install(PROGRAMS scripts/setupvars/setupvars.bat
|
||||
DESTINATION bin
|
||||
COMPONENT setupvars)
|
||||
endif()
|
||||
|
||||
# install install_dependencies
|
||||
|
||||
if(UNIX)
|
||||
ie_cpack_add_component(install_dependencies REQUIRED)
|
||||
install(DIRECTORY scripts/install_dependencies/
|
||||
DESTINATION install_dependencies
|
||||
COMPONENT install_dependencies)
|
||||
endif()
|
||||
|
||||
# install files for demo
|
||||
|
||||
ie_cpack_add_component(demo_scripts REQUIRED DEPENDS core)
|
||||
|
||||
if(UNIX)
|
||||
install(DIRECTORY scripts/demo/
|
||||
DESTINATION deployment_tools/demo
|
||||
COMPONENT demo_scripts
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN *.bat EXCLUDE)
|
||||
elseif(WIN32)
|
||||
install(DIRECTORY scripts/demo/
|
||||
DESTINATION deployment_tools/demo
|
||||
COMPONENT demo_scripts
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN *.sh EXCLUDE)
|
||||
endif()
|
||||
|
||||
ie_cpack(${IE_CPACK_COMPONENTS_ALL})
|
||||
|
||||
22
CODEOWNERS
22
CODEOWNERS
@@ -14,7 +14,7 @@ azure-pipelines.yml @openvinotoolkit/openvino-admins
|
||||
/tests/ @openvinotoolkit/openvino-tests-maintainers
|
||||
|
||||
# OpenVINO Scripts
|
||||
/scripts/ @openvinotoolkit/openvino-scripts-maintainers
|
||||
/scripts/ @openvinotoolkit/openvino-admins @openvinotoolkit/openvino-scripts-maintainers
|
||||
|
||||
# IE Core:
|
||||
/inference-engine/ @openvinotoolkit/openvino-ie-maintainers
|
||||
@@ -30,13 +30,13 @@ azure-pipelines.yml @openvinotoolkit/openvino-admins
|
||||
|
||||
# IE GPU:
|
||||
/inference-engine/src/cldnn_engine/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/inference-engine/src/inference_engine/include/gpu/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/inference-engine/src/inference_engine/include/cldnn/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/inference-engine/include/gpu/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/inference-engine/include/cldnn/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
/inference-engine/thirdparty/clDNN/ @openvinotoolkit/openvino-ie-gpu-maintainers @openvinotoolkit/openvino-ie-gpu-developers
|
||||
|
||||
# IE VPU:
|
||||
/inference-engine/src/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
/inference-engine/src/inference_engine/include/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
/inference-engine/include/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
/inference-engine/thirdparty/movidius/ @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
/inference-engine/tests_deprecated/unit/engines/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
/inference-engine/tests_deprecated/functional/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
@@ -44,15 +44,16 @@ azure-pipelines.yml @openvinotoolkit/openvino-admins
|
||||
/inference-engine/tests/functional/plugin/myriad/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
/inference-engine/tests/unit/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
/inference-engine/tests/unit/engines/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
/inference-engine/tools/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
/inference-engine/scripts/run_tests_myriad_multistick.sh @openvinotoolkit/openvino-ie-vpu-maintainers
|
||||
|
||||
# IE GNA:
|
||||
/inference-engine/src/gna_plugin/ @openvinotoolkit/openvino-ie-gna-maintainers
|
||||
/inference-engine/src/inference_engine/include/gna/ @openvinotoolkit/openvino-ie-gna-maintainers
|
||||
/inference-engine/include/gna/ @openvinotoolkit/openvino-ie-gna-maintainers
|
||||
|
||||
# IE MULTI:
|
||||
/inference-engine/src/multi_device/ @openvinotoolkit/openvino-ie-multi-maintainers
|
||||
/inference-engine/src/inference_engine/include/multi-device/ @openvinotoolkit/openvino-ie-multi-maintainers
|
||||
/inference-engine/include/multi-device/ @openvinotoolkit/openvino-ie-multi-maintainers
|
||||
|
||||
# IE Tests:
|
||||
/inference-engine/tests/ @openvinotoolkit/openvino-ie-tests-maintainers
|
||||
@@ -66,18 +67,9 @@ azure-pipelines.yml @openvinotoolkit/openvino-admins
|
||||
# nGraph:
|
||||
/ngraph/ @openvinotoolkit/openvino-ngraph-maintainers
|
||||
|
||||
# POT Tools
|
||||
/tools/pot/ @openvinotoolkit/openvino-pot-maintainers
|
||||
|
||||
# Tools
|
||||
/tools/ @openvinotoolkit/openvino-tools-maintainers
|
||||
|
||||
# Documentation
|
||||
/docs/ @openvinotoolkit/openvino-docs-maintainers
|
||||
/docs/template_plugin/ @openvinotoolkit/openvino-ie-template-maintainers
|
||||
*.md @openvinotoolkit/openvino-docs-maintainers
|
||||
|
||||
# Control 3d party dependencies
|
||||
**/*requirements*.* @openvino-configuration-mgmt
|
||||
**/setup.py @openvino-configuration-mgmt
|
||||
/scripts/install_dependencies/ @openvino-configuration-mgmt
|
||||
|
||||
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -2,18 +2,14 @@
|
||||
|
||||
properties([
|
||||
parameters([
|
||||
booleanParam(defaultValue: false,
|
||||
booleanParam(defaultValue: true,
|
||||
description: 'Cancel the rest of parallel stages if one of them fails and return status immediately',
|
||||
name: 'failFast'),
|
||||
booleanParam(defaultValue: true,
|
||||
description: 'Whether to propagate commit status to GitHub',
|
||||
name: 'propagateStatus'),
|
||||
string(defaultValue: '',
|
||||
description: 'Pipeline shared library version (branch/tag/commit). Determined automatically if empty',
|
||||
name: 'library_version')
|
||||
])
|
||||
])
|
||||
|
||||
loadOpenVinoLibrary {
|
||||
entrypoint(this)
|
||||
}
|
||||
|
||||
24
README.md
24
README.md
@@ -1,14 +1,12 @@
|
||||
# OpenVINO™ Toolkit
|
||||
[](https://github.com/openvinotoolkit/openvino/releases/tag/2021.4.1)
|
||||
# [OpenVINO™ Toolkit](https://01.org/openvinotoolkit) - Deep Learning Deployment Toolkit repository
|
||||
[](https://github.com/openvinotoolkit/openvino/releases/tag/2021.2)
|
||||
[](LICENSE)
|
||||

|
||||

|
||||
[](https://pepy.tech/project/openvino)
|
||||

|
||||
|
||||
This toolkit allows developers to deploy pre-trained deep learning models
|
||||
through a high-level C++ Inference Engine API integrated with application logic.
|
||||
|
||||
This open source version includes several components: namely [Model Optimizer], [nGraph] and
|
||||
This open source version includes several components: namely [Model Optimizer], [ngraph] and
|
||||
[Inference Engine], as well as CPU, GPU, MYRIAD, multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics.
|
||||
It supports pre-trained models from the [Open Model Zoo], along with 100+ open
|
||||
source and public models in popular formats such as Caffe\*, TensorFlow\*,
|
||||
@@ -16,7 +14,7 @@ MXNet\* and ONNX\*.
|
||||
|
||||
## Repository components:
|
||||
* [Inference Engine]
|
||||
* [nGraph]
|
||||
* [ngraph]
|
||||
* [Model Optimizer]
|
||||
|
||||
## License
|
||||
@@ -28,10 +26,9 @@ and release your contribution under these terms.
|
||||
* Docs: https://docs.openvinotoolkit.org/
|
||||
* Wiki: https://github.com/openvinotoolkit/openvino/wiki
|
||||
* Issue tracking: https://github.com/openvinotoolkit/openvino/issues
|
||||
* Storage: https://storage.openvinotoolkit.org/
|
||||
* Additional OpenVINO™ modules: https://github.com/openvinotoolkit/openvino_contrib
|
||||
* [Intel® Distribution of OpenVINO™ toolkit Product Page](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html)
|
||||
* [Intel® Distribution of OpenVINO™ toolkit Release Notes](https://software.intel.com/en-us/articles/OpenVINO-RelNotes)
|
||||
* Additional OpenVINO modules: https://github.com/openvinotoolkit/openvino_contrib
|
||||
* [HomePage](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html)
|
||||
* [OpenVINO™ Release Notes](https://software.intel.com/en-us/articles/OpenVINO-RelNotes)
|
||||
|
||||
## Support
|
||||
Please report questions, issues and suggestions using:
|
||||
@@ -43,9 +40,8 @@ Please report questions, issues and suggestions using:
|
||||
---
|
||||
\* Other names and brands may be claimed as the property of others.
|
||||
|
||||
[Open Model Zoo]:https://github.com/openvinotoolkit/open_model_zoo
|
||||
[Open Model Zoo]:https://github.com/opencv/open_model_zoo
|
||||
[Inference Engine]:https://software.intel.com/en-us/articles/OpenVINO-InferEngine
|
||||
[Model Optimizer]:https://software.intel.com/en-us/articles/OpenVINO-ModelOptimizer
|
||||
[nGraph]:https://docs.openvinotoolkit.org/latest/openvino_docs_nGraph_DG_DevGuide.html
|
||||
[tag on StackOverflow]:https://stackoverflow.com/search?q=%23openvino
|
||||
|
||||
[ngraph]:https://docs.openvinotoolkit.org/latest/openvino_docs_nGraph_DG_DevGuide.html
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
@@ -51,12 +51,6 @@ endfunction()
|
||||
set(VALIDATED_LIBRARIES "" CACHE INTERNAL "")
|
||||
|
||||
function(_ie_add_api_validator_post_build_step)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
# since _ie_add_api_validator_post_build_step
|
||||
# is currently run only on shared libraries, we have nothing to test
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(UWP_API_VALIDATOR_APIS "${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/x64/UniversalDDIs.xml")
|
||||
set(UWP_API_VALIDATOR_EXCLUSION "${UWP_SDK_PATH}/BinaryExclusionlist.xml")
|
||||
|
||||
@@ -94,12 +88,9 @@ function(_ie_add_api_validator_post_build_step)
|
||||
|
||||
macro(api_validator_get_target_name)
|
||||
get_target_property(IS_IMPORTED ${target} IMPORTED)
|
||||
get_target_property(orig_target ${target} ALIASED_TARGET)
|
||||
if(IS_IMPORTED)
|
||||
get_target_property(target_location ${target} LOCATION)
|
||||
get_filename_component(target_name "${target_location}" NAME_WE)
|
||||
elseif(TARGET "${orig_target}")
|
||||
set(target_name ${orig_target})
|
||||
else()
|
||||
set(target_name ${target})
|
||||
endif()
|
||||
@@ -117,7 +108,7 @@ function(_ie_add_api_validator_post_build_step)
|
||||
-D UWP_API_VALIDATOR_EXCLUSION=${UWP_API_VALIDATOR_EXCLUSION}
|
||||
-D UWP_API_VALIDATOR_OUTPUT=${output_file}
|
||||
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
-P "${IEDevScripts_DIR}/api_validator/api_validator_run.cmake"
|
||||
-P "${OpenVINO_MAIN_SOURCE_DIR}/cmake/api_validator/api_validator_run.cmake"
|
||||
BYPRODUCTS ${output_file}
|
||||
COMMENT "[apiValidator] Check ${target_name} for OneCore compliance"
|
||||
VERBATIM)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
|
||||
35
cmake/check_features.cmake
Normal file
35
cmake/check_features.cmake
Normal file
@@ -0,0 +1,35 @@
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if (VERBOSE_BUILD)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
#64 bits platform
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
message(STATUS "Detected 64 bit architecture")
|
||||
SET(ARCH_64 ON)
|
||||
else()
|
||||
message(STATUS "Detected 32 bit architecture")
|
||||
SET(ARCH_64 OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_AVX512F)
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND (MSVC_VERSION VERSION_LESS 1920))
|
||||
# 1920 version of MSVC 2019. In MSVC 2017 AVX512F not work
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6))
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10))
|
||||
# TBD: clarify which AppleClang version supports avx512
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9))
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
print_enabled_features()
|
||||
@@ -1,99 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(OV_COVERAGE_BASE_DIRECTORY "${OpenVINO_SOURCE_DIR}")
|
||||
|
||||
ie_coverage_clean(REPOSITORY "openvino"
|
||||
DIRECTORY "${OV_COVERAGE_GCDA_DATA_DIRECTORY}")
|
||||
ie_coverage_capture(INFO_FILE "openvino"
|
||||
BASE_DIRECTORY "${OV_COVERAGE_BASE_DIRECTORY}"
|
||||
DIRECTORY "${OV_COVERAGE_GCDA_DATA_DIRECTORY}")
|
||||
|
||||
# Generate reports
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "inference_engine"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/inference_engine/*"
|
||||
"${OV_COVERAGE_BASE_DIRECTORY}/plugin_api/*")
|
||||
ie_coverage_genhtml(INFO_FILE "inference_engine"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "inference_engine_ir_v10_reader"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/readers/ir_reader/*"
|
||||
"${OV_COVERAGE_BASE_DIRECTORY}/readers/reader_api/*")
|
||||
ie_coverage_genhtml(INFO_FILE "inference_engine_ir_v10_reader"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "inference_engine_legacy"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/legacy_api/*")
|
||||
ie_coverage_genhtml(INFO_FILE "inference_engine_legacy"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "hetero_plugin"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/hetero_plugin/*")
|
||||
ie_coverage_genhtml(INFO_FILE "hetero_plugin"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "multi_device"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/multi_device/*")
|
||||
ie_coverage_genhtml(INFO_FILE "multi_device"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "preprocessing"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/preprocessing/*")
|
||||
ie_coverage_genhtml(INFO_FILE "preprocessing"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "inference_engine_transformations"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/inference_engine_transformations/*")
|
||||
ie_coverage_genhtml(INFO_FILE "inference_engine_transformations"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "inference_engine_snippets"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/snippets/*")
|
||||
ie_coverage_genhtml(INFO_FILE "inference_engine_snippets"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "low_precision_transformations"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/low_precision_transformations/*")
|
||||
ie_coverage_genhtml(INFO_FILE "low_precision_transformations"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "template_plugin"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/template_plugin/*")
|
||||
ie_coverage_genhtml(INFO_FILE "template_plugin"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
if(ENABLE_MKL_DNN)
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "mkldnn_plugin"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/mkldnn_plugin/*")
|
||||
ie_coverage_genhtml(INFO_FILE "mkldnn_plugin"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
endif()
|
||||
|
||||
if(ENABLE_CLDNN)
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "cldnn_engine"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/cldnn_engine/*")
|
||||
ie_coverage_genhtml(INFO_FILE "cldnn_engine"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
endif()
|
||||
|
||||
if(ENABLE_GNA)
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "gna_plugin"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/gna_plugin/*")
|
||||
ie_coverage_genhtml(INFO_FILE "gna_plugin"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
endif()
|
||||
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "ngraph"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/ngraph/core/*")
|
||||
ie_coverage_genhtml(INFO_FILE "ngraph"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
|
||||
if(NGRAPH_ONNX_FRONTEND_ENABLE)
|
||||
ie_coverage_extract(INPUT "openvino" OUTPUT "onnx"
|
||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/ngraph/frontend/onnx/*"
|
||||
"${OV_COVERAGE_BASE_DIRECTORY}/ngraph/frontend/onnx/*")
|
||||
ie_coverage_genhtml(INFO_FILE "onnx"
|
||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||
endif()
|
||||
211
cmake/coverage/coverage.cmake
Normal file
211
cmake/coverage/coverage.cmake
Normal file
@@ -0,0 +1,211 @@
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(NOT TARGET ie_coverage_clean)
|
||||
add_custom_target(ie_coverage_clean)
|
||||
set_target_properties(ie_coverage_clean PROPERTIES FOLDER coverage)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ie_coverage_init)
|
||||
add_custom_target(ie_coverage_init)
|
||||
set_target_properties(ie_coverage_init PROPERTIES FOLDER coverage)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ie_coverage)
|
||||
add_custom_target(ie_coverage)
|
||||
set_target_properties(ie_coverage PROPERTIES FOLDER coverage)
|
||||
endif()
|
||||
|
||||
set(IE_COVERAGE_REPORTS "${CMAKE_BINARY_DIR}/coverage")
|
||||
set(IE_COVERAGE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/coverage")
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
#
|
||||
# ie_coverage_clean(REPOSITORY <repo> DIRECTORY <dir>)
|
||||
#
|
||||
function(ie_coverage_clean)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "REPOSITORY;DIRECTORY" "" ${ARGN})
|
||||
|
||||
add_custom_target(ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
|
||||
COMMAND lcov --zerocounters --quiet
|
||||
--directory "${IE_COVERAGE_DIRECTORY}"
|
||||
COMMENT "Add zero counters for coverage for ${IE_COVERAGE_REPOSITORY}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(ie_coverage_clean_${IE_COVERAGE_REPOSITORY}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "IE_COVERAGE_REPORTS=${IE_COVERAGE_REPORTS}"
|
||||
-D "IE_COVERAGE_DIRECTORY=${IE_COVERAGE_DIRECTORY}"
|
||||
-D "CMAKE_BINARY_DIRECTORY=${CMAKE_BINARY_DIR}"
|
||||
-D "CMAKE_SOURCE_DIRECTORY=${CMAKE_SOURCE_DIR}"
|
||||
-P "${IE_COVERAGE_SCRIPT_DIR}/coverage_clean.cmake"
|
||||
COMMENT "Clean previously created HTML report files for ${IE_COVERAGE_REPOSITORY}"
|
||||
DEPENDS "${IE_COVERAGE_SCRIPT_DIR}/coverage_clean.cmake"
|
||||
VERBATIM)
|
||||
|
||||
set_target_properties(ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
|
||||
ie_coverage_clean_${IE_COVERAGE_REPOSITORY}
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_clean ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
|
||||
ie_coverage_clean_${IE_COVERAGE_REPOSITORY})
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_capture(INFO_FILE <info_file>
|
||||
# BASE_DIRECTORY <base dir>
|
||||
# DIRECTORY <gcda dir>)
|
||||
#
|
||||
function(ie_coverage_capture)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INFO_FILE;BASE_DIRECTORY;DIRECTORY" "" ${ARGN})
|
||||
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}.info")
|
||||
set(output_base_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}_base.info")
|
||||
set(output_tests_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}_tests.info")
|
||||
|
||||
add_custom_command(OUTPUT ${output_base_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${IE_COVERAGE_REPORTS}"
|
||||
COMMAND lcov --no-external --capture --initial --quiet
|
||||
--directory "${IE_COVERAGE_DIRECTORY}"
|
||||
--base-directory "${IE_COVERAGE_BASE_DIRECTORY}"
|
||||
--output-file ${output_base_file}
|
||||
COMMENT "Capture initial coverage data ${IE_COVERAGE_INFO_FILE}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT ${output_tests_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${IE_COVERAGE_REPORTS}"
|
||||
COMMAND lcov --no-external --capture --quiet
|
||||
--directory "${IE_COVERAGE_DIRECTORY}"
|
||||
--base-directory "${IE_COVERAGE_BASE_DIRECTORY}"
|
||||
--output-file ${output_tests_file}
|
||||
COMMENT "Capture test coverage data ${IE_COVERAGE_INFO_FILE}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "IE_COVERAGE_OUTPUT_FILE=${output_file}"
|
||||
-D "IE_COVERAGE_INPUT_FILES=${output_base_file};${output_tests_file}"
|
||||
-P "${IE_COVERAGE_SCRIPT_DIR}/coverage_merge.cmake"
|
||||
COMMENT "Generate total coverage data ${IE_COVERAGE_INFO_FILE}"
|
||||
DEPENDS ${output_base_file} ${output_tests_file}
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_INFO_FILE}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_INFO_FILE}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_extract(INPUT <info_file> OUTPUT <output_file> PATTERNS <patterns ...>)
|
||||
#
|
||||
function(ie_coverage_extract)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INPUT;OUTPUT" "PATTERNS" ${ARGN})
|
||||
|
||||
set(input_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INPUT}.info")
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_OUTPUT}.info")
|
||||
|
||||
set(commands lcov --quiet)
|
||||
foreach(pattern IN LISTS IE_COVERAGE_PATTERNS)
|
||||
list(APPEND commands --extract ${input_file} ${pattern})
|
||||
endforeach()
|
||||
list(APPEND commands --output-file ${output_file})
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${commands}
|
||||
COMMENT "Generate coverage data ${IE_COVERAGE_OUTPUT}"
|
||||
DEPENDS ${input_file}
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ie_coverage_${IE_COVERAGE_INPUT}_info)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_remove(INPUT <info_file> OUTPUT <output_file> PATTERNS <patterns ...>)
|
||||
#
|
||||
function(ie_coverage_remove)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INPUT;OUTPUT" "PATTERNS" ${ARGN})
|
||||
|
||||
set(input_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INPUT}.info")
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_OUTPUT}.info")
|
||||
|
||||
set(commands lcov --quiet)
|
||||
foreach(pattern IN LISTS IE_COVERAGE_PATTERNS)
|
||||
list(APPEND commands --remove ${input_file} ${pattern})
|
||||
endforeach()
|
||||
list(APPEND commands --output-file ${output_file})
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${commands}
|
||||
COMMENT "Generate coverage data ${IE_COVERAGE_OUTPUT}"
|
||||
DEPENDS ${input_file}
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ie_coverage_${IE_COVERAGE_INPUT}_info)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_merge(OUTPUT <output file> INPUTS <input files ...>)
|
||||
#
|
||||
function(ie_coverage_merge)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "OUTPUT" "INPUTS" ${ARGN})
|
||||
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_OUTPUT}.info")
|
||||
foreach(input_info_file IN LISTS IE_COVERAGE_INPUTS)
|
||||
set(input_file ${IE_COVERAGE_REPORTS}/${input_info_file}.info)
|
||||
list(APPEND dependencies ie_coverage_${input_info_file}_info)
|
||||
list(APPEND input_files ${input_file})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "IE_COVERAGE_OUTPUT_FILE=${output_file}"
|
||||
-D "IE_COVERAGE_INPUT_FILES=${input_files}"
|
||||
-P "${IE_COVERAGE_SCRIPT_DIR}/coverage_merge.cmake"
|
||||
COMMENT "Generate coverage data ${IE_COVERAGE_OUTPUT}"
|
||||
DEPENDS ${input_files}
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ${dependencies})
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_genhtml(INFO_FILE <info_file> PREFIX <prefix>)
|
||||
#
|
||||
function(ie_coverage_genhtml)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INFO_FILE;PREFIX" "" ${ARGN})
|
||||
|
||||
set(input_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}.info")
|
||||
set(output_directory "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}")
|
||||
|
||||
add_custom_command(OUTPUT "${output_directory}/index.html"
|
||||
COMMAND genhtml ${input_file} --title "${IE_COVERAGE_INFO_FILE}" --legend
|
||||
--no-branch-coverage --demangle-cpp
|
||||
--output-directory "${output_directory}"
|
||||
--num-spaces 4 --quiet
|
||||
--prefix "${IE_COVERAGE_PREFIX}"
|
||||
DEPENDS ${input_file}
|
||||
COMMENT "Generate HTML report for ${IE_COVERAGE_INFO_FILE}"
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml
|
||||
DEPENDS "${output_directory}/index.html")
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml ie_coverage_${IE_COVERAGE_INFO_FILE}_info)
|
||||
add_dependencies(ie_coverage ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml)
|
||||
endfunction()
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# XARCH_FUNC_NAME -- name of function to dispatch
|
||||
# XARCH_NAMESPACES -- full namespace used to keep ODR
|
||||
# XARCH_DISP_FILE -- dispatcher file name to generate
|
||||
# XARCH_SET -- set of ARCH supported by dispatcher. semicolon-delimited
|
||||
# XARCH_SET -- set of ARCH supported by dispatcher. space delimited
|
||||
#
|
||||
# =================================================================
|
||||
|
||||
@@ -24,6 +24,7 @@ function(_generate_dispatcher)
|
||||
_find_signature_in_file(${XARCH_API_HEADER} ${XARCH_FUNC_NAME} SIGNATURE)
|
||||
_generate_call_line_from_signature("${SIGNATURE}" CALL_LINE)
|
||||
|
||||
string(REPLACE " " ";" XARCH_SET "${XARCH_SET}")
|
||||
string(REPLACE "::" ";" XARCH_NAMESPACES "${XARCH_NAMESPACES}")
|
||||
|
||||
list(GET XARCH_NAMESPACES -1 XARCH_CURRENT_NAMESPACE)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
@@ -13,10 +13,10 @@ set(_ACCEPTED_ARCHS_AVX512F "^(ANY|SSE42|AVX|AVX2|AVX512F)$")
|
||||
|
||||
## Arch specific definitions
|
||||
set(_DEFINE_ANY "")
|
||||
set(_DEFINE_SSE42 "HAVE_SSE42" ${_DEFINE_ANY})
|
||||
set(_DEFINE_AVX "HAVE_AVX" ${_DEFINE_SSE42})
|
||||
set(_DEFINE_AVX2 "HAVE_AVX2" ${_DEFINE_AVX})
|
||||
set(_DEFINE_AVX512F "HAVE_AVX512F" ${_DEFINE_AVX2})
|
||||
set(_DEFINE_SSE42 "-DHAVE_SSE42" ${_DEFINE_ANY})
|
||||
set(_DEFINE_AVX "-DHAVE_AVX" ${_DEFINE_SSE42})
|
||||
set(_DEFINE_AVX2 "-DHAVE_AVX2" ${_DEFINE_AVX})
|
||||
set(_DEFINE_AVX512F "-DHAVE_AVX512F" ${_DEFINE_AVX2})
|
||||
|
||||
## Arch specific compile options
|
||||
ie_avx512_optimization_flags(_FLAGS_AVX512F)
|
||||
@@ -117,25 +117,21 @@ function(_clone_source_to_target TARGET SOURCE ARCH_SET)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${ARCH_SOURCE}
|
||||
DEPENDS ${SOURCE}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
set_property(SOURCE ${ARCH_SOURCE} APPEND_STRING PROPERTY COMPILE_OPTIONS
|
||||
"${_FLAGS_${_arch}}")
|
||||
|
||||
set_property(SOURCE ${ARCH_SOURCE} APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
set(_ARCH_SPECIFIC_FLAGS
|
||||
${_DEFINE_${_arch}}
|
||||
"XARCH=${_arch}" ## to replace XARCH with direct ARCH name
|
||||
${_FLAGS_${_arch}}
|
||||
"-DXARCH=${_arch}" ## to replace XARCH with direct ARCH name
|
||||
"-I${CMAKE_CURRENT_SOURCE_DIR}/${ARCH_INCLUDE_DIR}" ## To make valid #include "some.hpp"
|
||||
)
|
||||
|
||||
## To make `#include "some.hpp"` valid
|
||||
set_property(SOURCE ${ARCH_SOURCE} APPEND PROPERTY INCLUDE_DIRECTORIES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${ARCH_INCLUDE_DIR}")
|
||||
_add_source_compile_flags(${ARCH_SOURCE} ${_ARCH_SPECIFIC_FLAGS})
|
||||
|
||||
list(APPEND _ARCH_SOURCES ${ARCH_SOURCE})
|
||||
endforeach()
|
||||
|
||||
target_sources(${TARGET} PRIVATE ${_ARCH_SOURCES})
|
||||
_add_source_to_target(${TARGET} ${_ARCH_SOURCES})
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -150,27 +146,26 @@ function(_add_dispatcher_to_target TARGET HEADER FUNC_NAME NAMESPACE ARCH_SET)
|
||||
set(DISPATCHER_SOURCE "cross-compiled/${DISPATCHER_NAME}_disp.cpp")
|
||||
set(DISPATCHER_OPT_HOLDER "cross-compiled/${DISPATCHER_NAME}_holder.txt")
|
||||
|
||||
set(_GEN_ARGS_LIST
|
||||
-DXARCH_FUNC_NAME="${X_NAME}"
|
||||
-DXARCH_NAMESPACES="${NAMESPACE}"
|
||||
-DXARCH_API_HEADER="${CMAKE_CURRENT_SOURCE_DIR}/${HEADER}"
|
||||
-DXARCH_DISP_FILE="${CMAKE_CURRENT_BINARY_DIR}/${DISPATCHER_SOURCE}"
|
||||
-DXARCH_SET="${ARCH_SET}"
|
||||
)
|
||||
configure_file(${DISPATCHER_GEN_OPTIONS_HOLDER} ${DISPATCHER_OPT_HOLDER})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${DISPATCHER_SOURCE}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "XARCH_FUNC_NAME=${X_NAME}"
|
||||
-D "XARCH_NAMESPACES=${NAMESPACE}"
|
||||
-D "XARCH_API_HEADER=${CMAKE_CURRENT_SOURCE_DIR}/${HEADER}"
|
||||
-D "XARCH_DISP_FILE=${CMAKE_CURRENT_BINARY_DIR}/${DISPATCHER_SOURCE}"
|
||||
-D "XARCH_SET=${ARCH_SET}"
|
||||
COMMAND ${CMAKE_COMMAND} ${_GEN_ARGS_LIST}
|
||||
-P ${DISPATCHER_GEN_SCRIPT}
|
||||
DEPENDS ${HEADER}
|
||||
${DISPATCHER_GEN_SCRIPT}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${DISPATCHER_OPT_HOLDER} ## Just to make run dependency on args value
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
set_property(SOURCE ${DISPATCHER_SOURCE} APPEND PROPERTY INCLUDE_DIRECTORIES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${DISPATCHER_INCLUDE_DIR}")
|
||||
|
||||
target_sources(${TARGET} PRIVATE ${DISPATCHER_SOURCE})
|
||||
_add_source_compile_flags(${DISPATCHER_SOURCE} "-I${DISPATCHER_INCLUDE_DIR}")
|
||||
_add_source_to_target(${TARGET} ${DISPATCHER_SOURCE})
|
||||
endfunction()
|
||||
|
||||
#######################################
|
||||
@@ -204,3 +199,29 @@ function(_remove_source_from_target TARGET SOURCE_FILE)
|
||||
PROPERTIES
|
||||
SOURCES "${ORIGINAL_SOURCES}")
|
||||
endfunction()
|
||||
|
||||
function(_add_source_to_target TARGET)
|
||||
get_target_property(ORIGINAL_SOURCES ${TARGET} SOURCES)
|
||||
|
||||
list(APPEND ORIGINAL_SOURCES ${ARGN})
|
||||
|
||||
set_target_properties(${TARGET}
|
||||
PROPERTIES
|
||||
SOURCES "${ORIGINAL_SOURCES}")
|
||||
endfunction()
|
||||
|
||||
function(_add_source_compile_flags SOURCE)
|
||||
get_source_file_property(ORIGINAL_FLAGS ${SOURCE} COMPILE_FLAGS)
|
||||
|
||||
## Empty list of COMPILE_FLAGS represented as NOTFOUND
|
||||
if(NOT ORIGINAL_FLAGS)
|
||||
set(ORIGINAL_FLAGS "")
|
||||
endif()
|
||||
|
||||
string(REPLACE ";" " " NEW_FLAGS "${ARGN}")
|
||||
string(APPEND ORIGINAL_FLAGS " " ${NEW_FLAGS})
|
||||
|
||||
set_source_files_properties(${SOURCE}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "${ORIGINAL_FLAGS}")
|
||||
endfunction()
|
||||
73
cmake/debug.cmake
Normal file
73
cmake/debug.cmake
Normal file
@@ -0,0 +1,73 @@
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (debug_message)
|
||||
if (VERBOSE_BUILD)
|
||||
message(${ARGV})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(clean_message type)
|
||||
string (REPLACE ";" "" output_string "${ARGN}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${output_string}")
|
||||
if(${ARGV0} STREQUAL "FATAL_ERROR")
|
||||
message (FATAL_ERROR)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
file(REMOVE ${CMAKE_BINARY_DIR}/ld_library_rpath_64.txt)
|
||||
|
||||
# log relative path to shared library that has to be used in LD_LIBRARY_PATH
|
||||
function (log_rpath_remove_top component component_remove_top lib lib_remove_top)
|
||||
|
||||
set(top_lib_dir ${${component}})
|
||||
set(lib_dir ${lib})
|
||||
|
||||
# debug_message(STATUS "LIB-IN=${lib} ")
|
||||
# debug_message(STATUS "TOPLIB-IN=${top_lib_dir} ")
|
||||
get_filename_component(top_lib_dir "${${component}}" DIRECTORY)
|
||||
|
||||
if (${component_remove_top} AND ${component})
|
||||
else()
|
||||
get_filename_component(add_name "${${component}}" NAME)
|
||||
set(top_lib_dir "${top_lib_dir}/${add_name}")
|
||||
endif()
|
||||
if (${lib_remove_top} AND lib)
|
||||
get_filename_component(lib_dir ${lib} DIRECTORY)
|
||||
endif()
|
||||
|
||||
string (REPLACE "//" "/" top_lib_dir "${top_lib_dir}")
|
||||
string (REPLACE "//" "/" lib_dir "${lib_dir}")
|
||||
|
||||
string (REPLACE "\\\\" "/" top_lib_dir "${top_lib_dir}")
|
||||
string (REPLACE "\\\\" "/" lib_dir "${lib_dir}")
|
||||
|
||||
# debug_message(STATUS "LIB-OUT=${lib_dir}")
|
||||
# debug_message(STATUS "TOPLIB-OUT=${top_lib_dir}")
|
||||
|
||||
if (WIN32)
|
||||
string (TOLOWER "${top_lib_dir}" top_lib_dir)
|
||||
string (TOLOWER "${lib_dir}" lib_dir)
|
||||
endif()
|
||||
|
||||
string (REPLACE "${top_lib_dir}" "" component_dir "${lib_dir}")
|
||||
|
||||
set(RPATH_INFO "${component}=${component_dir}")
|
||||
debug_message(STATUS "LD_LIBRARY_RPATH: ${RPATH_INFO}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/ld_library_rpath_64.txt "${RPATH_INFO}\n")
|
||||
endfunction()
|
||||
|
||||
function (log_rpath_from_dir component lib_dir)
|
||||
log_rpath_remove_top("${component}" TRUE "${lib_dir}" FALSE)
|
||||
endfunction()
|
||||
|
||||
function (log_rpath component lib_path)
|
||||
log_rpath_remove_top(${component} TRUE ${lib_path} TRUE)
|
||||
endfunction()
|
||||
|
||||
# Just wrapping of the original message() function to make this macro known during IE build.
|
||||
# This macro is redefined (with additional checks) within the InferenceEngineConfig.cmake file.
|
||||
macro(ext_message TRACE_LEVEL)
|
||||
message(${TRACE_LEVEL} "${ARGN}")
|
||||
endmacro()
|
||||
@@ -1,45 +1,30 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
# TODO: fix it
|
||||
set_temp_directory(TEMP "${IE_MAIN_SOURCE_DIR}")
|
||||
|
||||
if(ENABLE_SAME_BRANCH_FOR_MODELS)
|
||||
branchName(MODELS_BRANCH)
|
||||
else()
|
||||
set(MODELS_BRANCH "master")
|
||||
endif()
|
||||
include(dependency_solver)
|
||||
|
||||
if(ENABLE_DATA)
|
||||
add_models_repo(${ENABLE_DATA} "data:https://github.com/openvinotoolkit/testdata.git")
|
||||
set(MODELS_PATH "${TEMP}/models/src/data")
|
||||
set(DATA_PATH "${MODELS_PATH}")
|
||||
endif()
|
||||
if(CMAKE_CROSSCOMPILING AND NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
set(HOST_X86_64 ON)
|
||||
endif()
|
||||
|
||||
message(STATUS "MODELS_PATH=" ${MODELS_PATH})
|
||||
|
||||
fetch_models_and_validation_set()
|
||||
|
||||
if(COMMAND get_linux_name)
|
||||
get_linux_name(LINUX_OS_NAME)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
set(protoc_version "3.9.2")
|
||||
|
||||
RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
|
||||
ARCHIVE_LIN "protoc-${protoc_version}-linux-x86_64.tar.gz"
|
||||
TARGET_PATH "${TEMP}/protoc-${protoc_version}-linux-x86_64"
|
||||
SHA256 "1d6da1d97d0cbfcd333558afe24533eb3cb48dc1e0ab5e971aa1e50ede8bcf45"
|
||||
)
|
||||
debug_message(STATUS "host protoc-${protoc_version} root path = " ${SYSTEM_PROTOC_ROOT})
|
||||
set(protoc_version "3.7.1")
|
||||
if(CMAKE_HOST_SYSTEM_NAME MATCHES Linux)
|
||||
RESOLVE_DEPENDENCY(SYSTEM_PROTOC_ROOT
|
||||
ARCHIVE_LIN "protoc-${protoc_version}-linux-x86_64.tar.gz"
|
||||
TARGET_PATH "${TEMP}/protoc-${protoc_version}-linux-x86_64")
|
||||
debug_message(STATUS "host protoc-${protoc_version} root path = " ${SYSTEM_PROTOC_ROOT})
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported host system (${CMAKE_HOST_SYSTEM_NAME}) and arch (${CMAKE_HOST_SYSTEM_PROCESSOR}) for cross-compilation")
|
||||
endif()
|
||||
|
||||
reset_deps_cache(SYSTEM_PROTOC)
|
||||
|
||||
find_host_program(
|
||||
message("${SYSTEM_PROTOC_ROOT}/bin")
|
||||
find_program(
|
||||
SYSTEM_PROTOC
|
||||
NAMES protoc
|
||||
PATHS "${SYSTEM_PROTOC_ROOT}/bin"
|
||||
@@ -50,251 +35,3 @@ if(CMAKE_CROSSCOMPILING AND CMAKE_HOST_SYSTEM_NAME MATCHES Linux AND CMAKE_HOST_
|
||||
|
||||
update_deps_cache(SYSTEM_PROTOC "${SYSTEM_PROTOC}" "Path to host protoc for ONNX Importer")
|
||||
endif()
|
||||
|
||||
if(ENABLE_MYRIAD)
|
||||
include(${IE_MAIN_SOURCE_DIR}/cmake/vpu_dependencies.cmake)
|
||||
endif()
|
||||
|
||||
## Intel OMP package
|
||||
if(THREADING STREQUAL "OMP")
|
||||
reset_deps_cache(OMP)
|
||||
if(WIN32 AND X86_64)
|
||||
RESOLVE_DEPENDENCY(OMP
|
||||
ARCHIVE_WIN "iomp.zip"
|
||||
TARGET_PATH "${TEMP}/omp"
|
||||
ENVIRONMENT "OMP"
|
||||
VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*"
|
||||
SHA256 "62c68646747fb10f19b53217cb04a1e10ff93606f992e6b35eb8c31187c68fbf")
|
||||
elseif(LINUX AND X86_64)
|
||||
RESOLVE_DEPENDENCY(OMP
|
||||
ARCHIVE_LIN "iomp.tgz"
|
||||
TARGET_PATH "${TEMP}/omp"
|
||||
ENVIRONMENT "OMP"
|
||||
VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*"
|
||||
SHA256 "7832b16d82513ee880d97c27c7626f9525ebd678decf6a8fe6c38550f73227d9")
|
||||
elseif(APPLE AND X86_64)
|
||||
RESOLVE_DEPENDENCY(OMP
|
||||
ARCHIVE_MAC "iomp_20190130_mac.tgz"
|
||||
TARGET_PATH "${TEMP}/omp"
|
||||
ENVIRONMENT "OMP"
|
||||
VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*"
|
||||
SHA256 "591ea4a7e08bbe0062648916f42bded71d24c27f00af30a8f31a29b5878ea0cc")
|
||||
else()
|
||||
message(FATAL_ERROR "Intel OMP is not available on current platform")
|
||||
endif()
|
||||
update_deps_cache(OMP "${OMP}" "Path to OMP root folder")
|
||||
debug_message(STATUS "intel_omp=" ${OMP})
|
||||
|
||||
ie_cpack_add_component(omp REQUIRED)
|
||||
file(GLOB_RECURSE source_list "${OMP}/*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
|
||||
install(FILES ${source_list}
|
||||
DESTINATION "runtime/3rdparty/omp/lib"
|
||||
COMPONENT omp)
|
||||
endif()
|
||||
|
||||
## TBB package
|
||||
if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
||||
reset_deps_cache(TBBROOT TBB_DIR)
|
||||
|
||||
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||
set(IE_PATH_TO_DEPS "$ENV{THIRDPARTY_SERVER_PATH}")
|
||||
elseif(DEFINED THIRDPARTY_SERVER_PATH)
|
||||
set(IE_PATH_TO_DEPS "${THIRDPARTY_SERVER_PATH}")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND X86_64)
|
||||
#TODO: add target_path to be platform specific as well, to avoid following if
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_WIN "tbb2020_20200415_win.zip"
|
||||
TARGET_PATH "${TEMP}/tbb"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "f1c9b9e2861efdaa01552bd25312ccbc5feeb45551e5f91ae61e29221c5c1479")
|
||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||
ARCHIVE_WIN "tbbbind_2_5_static_win_v1.zip"
|
||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||
SHA256 "a67afeea8cf194f97968c800dab5b5459972908295242e282045d6b8953573c1")
|
||||
elseif(ANDROID) # Should be before LINUX due LINUX is detected as well
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_ANDROID "tbb2020_20200404_android.tgz"
|
||||
TARGET_PATH "${TEMP}/tbb"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "f42d084224cc2d643314bd483ad180b081774608844000f132859fca3e9bf0ce")
|
||||
elseif(LINUX AND X86_64)
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_LIN "tbb2020_20200415_lin_strip.tgz"
|
||||
TARGET_PATH "${TEMP}/tbb"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "95b2f3b0b70c7376a0c7de351a355c2c514b42c4966e77e3e34271a599501008")
|
||||
RESOLVE_DEPENDENCY(TBBBIND_2_5
|
||||
ARCHIVE_LIN "tbbbind_2_5_static_lin_v2.tgz"
|
||||
TARGET_PATH "${TEMP}/tbbbind_2_5"
|
||||
ENVIRONMENT "TBBBIND_2_5_ROOT"
|
||||
SHA256 "865e7894c58402233caf0d1b288056e0e6ab2bf7c9d00c9dc60561c484bc90f4")
|
||||
elseif(LINUX AND AARCH64)
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_LIN "keembay/tbb2020_38404_kmb_lic.tgz"
|
||||
TARGET_PATH "${TEMP}/tbb_yocto"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "321261ff2eda6d4568a473cb883262bce77a93dac599f7bd65d2918bdee4d75b")
|
||||
elseif(APPLE AND X86_64)
|
||||
RESOLVE_DEPENDENCY(TBB
|
||||
ARCHIVE_MAC "tbb2020_20200404_mac.tgz"
|
||||
TARGET_PATH "${TEMP}/tbb"
|
||||
ENVIRONMENT "TBBROOT"
|
||||
SHA256 "ad9cf52e657660058aa6c6844914bc0fc66241fec89a392d8b79a7ff69c3c7f6")
|
||||
else()
|
||||
message(FATAL_ERROR "TBB is not available on current platform")
|
||||
endif()
|
||||
|
||||
update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
|
||||
if(EXISTS "${TBBROOT}/lib/cmake/TBB/TBBConfig.cmake")
|
||||
# oneTBB case
|
||||
update_deps_cache(TBB_DIR "${TBB}/lib/cmake/TBB" "Path to TBB cmake folder")
|
||||
else()
|
||||
update_deps_cache(TBB_DIR "${TBB}/cmake" "Path to TBB cmake folder")
|
||||
endif()
|
||||
|
||||
update_deps_cache(TBBBIND_2_5_DIR "${TBBBIND_2_5}/cmake" "Path to TBBBIND_2_5 cmake folder")
|
||||
debug_message(STATUS "tbb=" ${TBB})
|
||||
|
||||
if(DEFINED IE_PATH_TO_DEPS)
|
||||
unset(IE_PATH_TO_DEPS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## OpenCV
|
||||
if(ENABLE_OPENCV)
|
||||
reset_deps_cache(OpenCV_DIR)
|
||||
|
||||
set(OPENCV_VERSION "4.5.2")
|
||||
set(OPENCV_BUILD "076")
|
||||
set(OPENCV_BUILD_YOCTO "772")
|
||||
|
||||
if(AARCH64)
|
||||
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||
set(IE_PATH_TO_DEPS "$ENV{THIRDPARTY_SERVER_PATH}")
|
||||
elseif(DEFINED THIRDPARTY_SERVER_PATH)
|
||||
set(IE_PATH_TO_DEPS "${THIRDPARTY_SERVER_PATH}")
|
||||
else()
|
||||
message(WARNING "OpenCV is not found!")
|
||||
endif()
|
||||
|
||||
if(DEFINED IE_PATH_TO_DEPS)
|
||||
set(OPENCV_SUFFIX "yocto_kmb")
|
||||
set(OPENCV_BUILD "${OPENCV_BUILD_YOCTO}")
|
||||
|
||||
RESOLVE_DEPENDENCY(OPENCV
|
||||
ARCHIVE_LIN "opencv/opencv_${OPENCV_VERSION}-${OPENCV_BUILD}_${OPENCV_SUFFIX}.txz"
|
||||
TARGET_PATH "${TEMP}/opencv_${OPENCV_VERSION}_${OPENCV_SUFFIX}/opencv"
|
||||
ENVIRONMENT "OpenCV_DIR"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*"
|
||||
SHA256 "23c250796ad5fc9db810e1680ccdb32c45dc0e50cace5e0f02b30faf652fe343")
|
||||
|
||||
unset(IE_PATH_TO_DEPS)
|
||||
endif()
|
||||
else()
|
||||
if(WIN32 AND X86_64)
|
||||
RESOLVE_DEPENDENCY(OPENCV
|
||||
ARCHIVE_WIN "opencv/opencv_${OPENCV_VERSION}-${OPENCV_BUILD}.txz"
|
||||
TARGET_PATH "${TEMP}/opencv_${OPENCV_VERSION}/opencv"
|
||||
ENVIRONMENT "OpenCV_DIR"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*"
|
||||
SHA256 "a14f872e6b63b6ac12c7ff47fa49e578d14c14433b57f5d85ab5dd48a079938c")
|
||||
elseif(APPLE AND X86_64)
|
||||
RESOLVE_DEPENDENCY(OPENCV
|
||||
ARCHIVE_MAC "opencv/opencv_${OPENCV_VERSION}-${OPENCV_BUILD}_osx.txz"
|
||||
TARGET_PATH "${TEMP}/opencv_${OPENCV_VERSION}_osx/opencv"
|
||||
ENVIRONMENT "OpenCV_DIR"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*"
|
||||
SHA256 "3e162f96e86cba8836618134831d9cf76df0438778b3e27e261dedad9254c514")
|
||||
elseif(LINUX)
|
||||
if(AARCH64)
|
||||
set(OPENCV_SUFFIX "yocto_kmb")
|
||||
set(OPENCV_BUILD "${OPENCV_BUILD_YOCTO}")
|
||||
elseif(ARM)
|
||||
set(OPENCV_SUFFIX "debian9arm")
|
||||
set(OPENCV_HASH "4274f8c40b17215f4049096b524e4a330519f3e76813c5a3639b69c48633d34e")
|
||||
elseif((LINUX_OS_NAME STREQUAL "CentOS 7" OR
|
||||
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" AND X86_64)
|
||||
set(OPENCV_SUFFIX "centos8")
|
||||
set(OPENCV_HASH "db087dfd412eedb8161636ec083ada85ff278109948d1d62a06b0f52e1f04202")
|
||||
elseif(LINUX_OS_NAME STREQUAL "Ubuntu 16.04" AND X86_64)
|
||||
set(OPENCV_SUFFIX "ubuntu16")
|
||||
set(OPENCV_HASH "cd46831b4d8d1c0891d8d22ff5b2670d0a465a8a8285243059659a50ceeae2c3")
|
||||
elseif(LINUX_OS_NAME STREQUAL "Ubuntu 18.04" AND X86_64)
|
||||
set(OPENCV_SUFFIX "ubuntu18")
|
||||
set(OPENCV_HASH "db087dfd412eedb8161636ec083ada85ff278109948d1d62a06b0f52e1f04202")
|
||||
elseif((LINUX_OS_NAME STREQUAL "Ubuntu 20.04" OR LINUX_OS_NAME STREQUAL "LinuxMint 20.1") AND X86_64)
|
||||
set(OPENCV_SUFFIX "ubuntu20")
|
||||
set(OPENCV_HASH "2fe7bbc40e1186eb8d099822038cae2821abf617ac7a16fadf98f377c723e268")
|
||||
elseif(NOT DEFINED OpenCV_DIR AND NOT DEFINED ENV{OpenCV_DIR})
|
||||
message(FATAL_ERROR "OpenCV is not available on current platform (${LINUX_OS_NAME})")
|
||||
endif()
|
||||
RESOLVE_DEPENDENCY(OPENCV
|
||||
ARCHIVE_LIN "opencv/opencv_${OPENCV_VERSION}-${OPENCV_BUILD}_${OPENCV_SUFFIX}.txz"
|
||||
TARGET_PATH "${TEMP}/opencv_${OPENCV_VERSION}_${OPENCV_SUFFIX}/opencv"
|
||||
ENVIRONMENT "OpenCV_DIR"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*"
|
||||
SHA256 ${OPENCV_HASH})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(ocv_cmake_path "${OPENCV}/sdk/native/jni/")
|
||||
else()
|
||||
set(ocv_cmake_path "${OPENCV}/cmake")
|
||||
endif()
|
||||
|
||||
update_deps_cache(OpenCV_DIR "${ocv_cmake_path}" "Path to OpenCV package folder")
|
||||
debug_message(STATUS "opencv=" ${OPENCV})
|
||||
else()
|
||||
reset_deps_cache(OpenCV_DIR)
|
||||
endif()
|
||||
|
||||
include(${IE_MAIN_SOURCE_DIR}/cmake/ie_parallel.cmake)
|
||||
|
||||
if(ENABLE_GNA)
|
||||
reset_deps_cache(
|
||||
GNA
|
||||
GNA_PLATFORM_DIR
|
||||
GNA_KERNEL_LIB_NAME
|
||||
GNA_LIBS_LIST
|
||||
GNA_LIB_DIR
|
||||
libGNA_INCLUDE_DIRS
|
||||
libGNA_LIBRARIES_BASE_PATH)
|
||||
if(GNA_LIBRARY_VERSION STREQUAL "GNA1")
|
||||
RESOLVE_DEPENDENCY(GNA
|
||||
ARCHIVE_UNIFIED "GNA/gna_20181120.zip"
|
||||
TARGET_PATH "${TEMP}/gna"
|
||||
SHA256 "b631d6cc5f6cca4a89a3f5dfa383066f3282fee25d633d9085c605bdd8090210")
|
||||
else()
|
||||
if(GNA_LIBRARY_VERSION STREQUAL "GNA1_1401")
|
||||
set(GNA_VERSION "01.00.00.1401")
|
||||
set(GNA_HASH "cc954e67525006bf8bd353a6682e38bf208f6d74e973e0fc292850e721f17452")
|
||||
endif()
|
||||
if(GNA_LIBRARY_VERSION STREQUAL "GNA2")
|
||||
set(GNA_VERSION "03.00.00.1377")
|
||||
set(GNA_HASH "d45fb48994d8c2803a16e88e29ae48851066325b97c1c6c4a5bf4f4573d55c65")
|
||||
endif()
|
||||
|
||||
set(FILES_TO_EXTRACT_LIST gna_${GNA_VERSION}/include)
|
||||
if(WIN32)
|
||||
LIST(APPEND FILES_TO_EXTRACT_LIST gna_${GNA_VERSION}/win64)
|
||||
else()
|
||||
LIST(APPEND FILES_TO_EXTRACT_LIST gna_${GNA_VERSION}/linux)
|
||||
endif()
|
||||
|
||||
RESOLVE_DEPENDENCY(GNA
|
||||
ARCHIVE_UNIFIED "GNA/GNA_${GNA_VERSION}.zip"
|
||||
TARGET_PATH "${TEMP}/gna_${GNA_VERSION}"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*"
|
||||
FILES_TO_EXTRACT FILES_TO_EXTRACT_LIST
|
||||
SHA256 ${GNA_HASH})
|
||||
endif()
|
||||
update_deps_cache(GNA "${GNA}" "Path to GNA root folder")
|
||||
debug_message(STATUS "gna=" ${GNA})
|
||||
endif()
|
||||
|
||||
251
cmake/developer_package.cmake
Normal file
251
cmake/developer_package.cmake
Normal file
@@ -0,0 +1,251 @@
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Detect target
|
||||
include(target_flags)
|
||||
|
||||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH_FOLDER)
|
||||
if(X86_64)
|
||||
set(ARCH_FOLDER intel64)
|
||||
elseif(X86)
|
||||
set(ARCH_FOLDER ia32)
|
||||
elseif(MSVC AND ARM)
|
||||
set(ARCH_FOLDER arm)
|
||||
elseif(MSVC AND AARCH64)
|
||||
set(ARCH_FOLDER arm64)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/cmake/download"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/cmake/cross_compile")
|
||||
|
||||
#
|
||||
# CPack
|
||||
#
|
||||
|
||||
include(CPackComponent)
|
||||
unset(IE_CPACK_COMPONENTS_ALL CACHE)
|
||||
|
||||
set(IE_CPACK_IE_DIR deployment_tools/inference_engine)
|
||||
|
||||
# Search packages for the host system instead of packages for the target system
|
||||
# in case of cross compilation these macros should be defined by the toolchain file
|
||||
if(NOT COMMAND find_host_package)
|
||||
macro(find_host_package)
|
||||
find_package(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
if(NOT COMMAND find_host_program)
|
||||
macro(find_host_program)
|
||||
find_program(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
#
|
||||
# ie_cpack_set_library_dir()
|
||||
#
|
||||
# Set library directory for cpack
|
||||
#
|
||||
function(ie_cpack_set_library_dir)
|
||||
if(WIN32)
|
||||
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/bin/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
|
||||
set(IE_CPACK_ARCHIVE_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE)
|
||||
else()
|
||||
set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
set(IE_CPACK_ARCHIVE_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
ie_cpack_set_library_dir()
|
||||
|
||||
#
|
||||
# ie_cpack_add_component(NAME ...)
|
||||
#
|
||||
# Wraps original `cpack_add_component` and adds component to internal IE list
|
||||
#
|
||||
macro(ie_cpack_add_component NAME)
|
||||
list(APPEND IE_CPACK_COMPONENTS_ALL ${NAME})
|
||||
set(IE_CPACK_COMPONENTS_ALL "${IE_CPACK_COMPONENTS_ALL}" CACHE STRING "" FORCE)
|
||||
cpack_add_component(${NAME} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(ie_cpack)
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
string(REPLACE "/" "_" CPACK_PACKAGE_VERSION "${CI_BUILD_NUMBER}")
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_NAME inference-engine_${CMAKE_BUILD_TYPE})
|
||||
else()
|
||||
set(CPACK_PACKAGE_NAME inference-engine)
|
||||
endif()
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
|
||||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||
set(CPACK_PACKAGE_VENDOR "Intel")
|
||||
set(CPACK_COMPONENTS_ALL ${ARGN})
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
|
||||
if(OS_FOLDER)
|
||||
set(CPACK_SYSTEM_NAME "${OS_FOLDER}")
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
endmacro()
|
||||
|
||||
# prepare temporary folder
|
||||
function(set_temp_directory temp_variable source_tree_dir)
|
||||
if (DEFINED ENV{DL_SDK_TEMP} AND NOT $ENV{DL_SDK_TEMP} STREQUAL "")
|
||||
message(STATUS "DL_SDK_TEMP environment is set : $ENV{DL_SDK_TEMP}")
|
||||
|
||||
if (WIN32)
|
||||
string(REPLACE "\\" "\\\\" temp $ENV{DL_SDK_TEMP})
|
||||
else()
|
||||
set(temp $ENV{DL_SDK_TEMP})
|
||||
endif()
|
||||
|
||||
if (ENABLE_ALTERNATIVE_TEMP)
|
||||
set(ALTERNATIVE_PATH ${source_tree_dir}/temp)
|
||||
endif()
|
||||
else ()
|
||||
set(temp ${source_tree_dir}/temp)
|
||||
endif()
|
||||
|
||||
set("${temp_variable}" "${temp}" CACHE PATH "Path to temp directory")
|
||||
if(ALTERNATIVE_PATH)
|
||||
set(ALTERNATIVE_PATH "${ALTERNATIVE_PATH}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Common scripts
|
||||
#
|
||||
|
||||
include(coverage/coverage)
|
||||
include(shellcheck/shellcheck)
|
||||
|
||||
# External dependencies
|
||||
find_package(Threads)
|
||||
|
||||
# printing debug messages
|
||||
include(debug)
|
||||
|
||||
if(OS_FOLDER)
|
||||
message ("**** OS FOLDER IS: [${OS_FOLDER}]")
|
||||
if("${OS_FOLDER}" STREQUAL "ON")
|
||||
message ("**** USING OS FOLDER: [${CMAKE_SYSTEM_NAME}]")
|
||||
set(BIN_FOLDER "bin/${CMAKE_SYSTEM_NAME}/${ARCH_FOLDER}")
|
||||
else()
|
||||
set(BIN_FOLDER "bin/${OS_FOLDER}/${ARCH_FOLDER}")
|
||||
endif()
|
||||
else()
|
||||
set(BIN_FOLDER "bin/${ARCH_FOLDER}")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
debug_message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used")
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
# allow to override default OUTPUT_ROOT root
|
||||
if(NOT DEFINED OUTPUT_ROOT)
|
||||
set(OUTPUT_ROOT ${OpenVINO_MAIN_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Enable postfixes for Debug/Release builds
|
||||
set(IE_DEBUG_POSTFIX_WIN "d")
|
||||
set(IE_RELEASE_POSTFIX_WIN "")
|
||||
set(IE_DEBUG_POSTFIX_LIN "")
|
||||
set(IE_RELEASE_POSTFIX_LIN "")
|
||||
set(IE_DEBUG_POSTFIX_MAC "d")
|
||||
set(IE_RELEASE_POSTFIX_MAC "")
|
||||
|
||||
if(WIN32)
|
||||
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_WIN})
|
||||
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_WIN})
|
||||
elseif(APPLE)
|
||||
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_MAC})
|
||||
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_MAC})
|
||||
else()
|
||||
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_LIN})
|
||||
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_LIN})
|
||||
endif()
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX})
|
||||
set(CMAKE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX})
|
||||
|
||||
if (WIN32 OR CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
# Support CMake multiconfiguration for Visual Studio or Xcode build
|
||||
set(IE_BUILD_POSTFIX $<$<CONFIG:Debug>:${IE_DEBUG_POSTFIX}>$<$<CONFIG:Release>:${IE_RELEASE_POSTFIX}>)
|
||||
else ()
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
|
||||
set(IE_BUILD_POSTFIX ${IE_DEBUG_POSTFIX})
|
||||
else()
|
||||
set(IE_BUILD_POSTFIX ${IE_RELEASE_POSTFIX})
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
add_definitions(-DIE_BUILD_POSTFIX=\"${IE_BUILD_POSTFIX}\")
|
||||
|
||||
if(NOT UNIX)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
else()
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
|
||||
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# WA for Xcode generator + object libraries issue:
|
||||
# https://gitlab.kitware.com/cmake/cmake/issues/20260
|
||||
# http://cmake.3232098.n2.nabble.com/XCODE-DEPEND-HELPER-make-Deletes-Targets-Before-and-While-They-re-Built-td7598277.html
|
||||
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY ON)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
endif()
|
||||
|
||||
# Use solution folders
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0054 NEW)
|
||||
|
||||
# LTO
|
||||
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
||||
include(CheckIPOSupported)
|
||||
|
||||
check_ipo_supported(RESULT IPO_SUPPORTED
|
||||
OUTPUT OUTPUT_MESSAGE
|
||||
LANGUAGES C CXX)
|
||||
|
||||
if(NOT IPO_SUPPORTED)
|
||||
set(ENABLE_LTO "OFF" CACHE STRING "Enable Link Time Optmization" FORCE)
|
||||
message(WARNING "IPO / LTO is not supported: ${OUTPUT_MESSAGE}")
|
||||
endif()
|
||||
|
||||
# General flags
|
||||
|
||||
include(sdl)
|
||||
include(os_flags)
|
||||
include(sanitizer)
|
||||
include(cross_compiled_func)
|
||||
include(faster_build)
|
||||
include(whole_archive)
|
||||
include(api_validator/api_validator)
|
||||
|
||||
function(set_ci_build_number)
|
||||
set(OpenVINO_MAIN_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
|
||||
include(version)
|
||||
set(CI_BUILD_NUMBER "${CI_BUILD_NUMBER}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
set_ci_build_number()
|
||||
|
||||
include(vs_version/vs_version)
|
||||
@@ -1,309 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
if(NOT DEFINED IEDevScripts_DIR)
|
||||
message(FATAL_ERROR "IEDevScripts_DIR is not defined")
|
||||
endif()
|
||||
|
||||
set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
set(CMAKE_MODULE_PATH "${IEDevScripts_DIR}")
|
||||
|
||||
function(set_ci_build_number)
|
||||
set(repo_root "${CMAKE_SOURCE_DIR}")
|
||||
include(version)
|
||||
foreach(var CI_BUILD_NUMBER IE_VERSION IE_VERSION_BUILD
|
||||
IE_VERSION_MAJOR IE_VERSION_MINOR IE_VERSION_PATCH)
|
||||
if(NOT DEFINED ${var})
|
||||
message(FATAL_ERROR "${var} version component is not defined")
|
||||
endif()
|
||||
set(${var} "${${var}}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
set_ci_build_number()
|
||||
|
||||
include(features)
|
||||
include(message)
|
||||
|
||||
#
|
||||
# Detect target
|
||||
#
|
||||
|
||||
include(target_flags)
|
||||
|
||||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH_FOLDER)
|
||||
if(X86_64)
|
||||
set(ARCH_FOLDER intel64)
|
||||
elseif(X86)
|
||||
set(ARCH_FOLDER ia32)
|
||||
elseif(MSVC AND ARM)
|
||||
set(ARCH_FOLDER arm)
|
||||
elseif(MSVC AND AARCH64)
|
||||
set(ARCH_FOLDER arm64)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Prepare temporary folder
|
||||
#
|
||||
|
||||
function(set_temp_directory temp_variable source_tree_dir)
|
||||
if (DEFINED ENV{DL_SDK_TEMP} AND NOT $ENV{DL_SDK_TEMP} STREQUAL "")
|
||||
message(STATUS "DL_SDK_TEMP environment is set : $ENV{DL_SDK_TEMP}")
|
||||
file(TO_CMAKE_PATH $ENV{DL_SDK_TEMP} temp)
|
||||
else ()
|
||||
set(temp ${source_tree_dir}/temp)
|
||||
endif()
|
||||
|
||||
set("${temp_variable}" "${temp}" CACHE PATH "Path to temp directory")
|
||||
if(ALTERNATIVE_PATH)
|
||||
set(ALTERNATIVE_PATH "${ALTERNATIVE_PATH}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# For cross-compilation
|
||||
#
|
||||
|
||||
# Search packages for the host system instead of packages for the target system
|
||||
# in case of cross compilation these macros should be defined by the toolchain file
|
||||
if(NOT COMMAND find_host_package)
|
||||
macro(find_host_package)
|
||||
find_package(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
if(NOT COMMAND find_host_program)
|
||||
macro(find_host_program)
|
||||
find_program(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Common scripts
|
||||
#
|
||||
|
||||
include(packaging)
|
||||
include(coverage/coverage)
|
||||
include(shellcheck/shellcheck)
|
||||
|
||||
# printing debug messages
|
||||
include(debug)
|
||||
|
||||
if(OS_FOLDER)
|
||||
message ("**** OS FOLDER IS: [${OS_FOLDER}]")
|
||||
if(OS_FOLDER STREQUAL "ON")
|
||||
message ("**** USING OS FOLDER: [${CMAKE_SYSTEM_NAME}]")
|
||||
set(BIN_FOLDER "bin/${CMAKE_SYSTEM_NAME}/${ARCH_FOLDER}")
|
||||
else()
|
||||
set(BIN_FOLDER "bin/${OS_FOLDER}/${ARCH_FOLDER}")
|
||||
endif()
|
||||
else()
|
||||
set(BIN_FOLDER "bin/${ARCH_FOLDER}")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
|
||||
message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used")
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
else()
|
||||
set(RELEASE_TYPES "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
|
||||
list(FIND RELEASE_TYPES ${CMAKE_BUILD_TYPE} INDEX_FOUND)
|
||||
if (INDEX_FOUND EQUAL -1)
|
||||
message(FATAL_ERROR "CMAKE_BUILD_TYPE must be one of Debug, Release, RelWithDebInfo, or MinSizeRel")
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
if(USE_BUILD_TYPE_SUBFOLDER)
|
||||
set(BIN_FOLDER "${BIN_FOLDER}/${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
# allow to override default OUTPUT_ROOT root
|
||||
if(NOT DEFINED OUTPUT_ROOT)
|
||||
if(NOT DEFINED OpenVINO_SOURCE_DIR)
|
||||
message(FATAL_ERROR "OpenVINO_SOURCE_DIR is not defined")
|
||||
endif()
|
||||
set(OUTPUT_ROOT ${OpenVINO_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Enable postfixes for Debug/Release builds
|
||||
set(IE_DEBUG_POSTFIX_WIN "d")
|
||||
set(IE_RELEASE_POSTFIX_WIN "")
|
||||
set(IE_DEBUG_POSTFIX_LIN "")
|
||||
set(IE_RELEASE_POSTFIX_LIN "")
|
||||
set(IE_DEBUG_POSTFIX_MAC "")
|
||||
set(IE_RELEASE_POSTFIX_MAC "")
|
||||
|
||||
if(WIN32)
|
||||
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_WIN})
|
||||
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_WIN})
|
||||
elseif(APPLE)
|
||||
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_MAC})
|
||||
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_MAC})
|
||||
else()
|
||||
set(IE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX_LIN})
|
||||
set(IE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX_LIN})
|
||||
endif()
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX})
|
||||
set(CMAKE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX})
|
||||
|
||||
if (MSVC OR CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
# Support CMake multiconfiguration for Visual Studio or Xcode build
|
||||
set(IE_BUILD_POSTFIX $<$<CONFIG:Debug>:${IE_DEBUG_POSTFIX}>$<$<CONFIG:Release>:${IE_RELEASE_POSTFIX}>)
|
||||
else ()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(IE_BUILD_POSTFIX ${IE_DEBUG_POSTFIX})
|
||||
else()
|
||||
set(IE_BUILD_POSTFIX ${IE_RELEASE_POSTFIX})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(-DIE_BUILD_POSTFIX=\"${IE_BUILD_POSTFIX}\")
|
||||
|
||||
if(NOT UNIX)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
else()
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
|
||||
endif()
|
||||
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
# WA for Xcode generator + object libraries issue:
|
||||
# https://gitlab.kitware.com/cmake/cmake/issues/20260
|
||||
# http://cmake.3232098.n2.nabble.com/XCODE-DEPEND-HELPER-make-Deletes-Targets-Before-and-While-They-re-Built-td7598277.html
|
||||
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY ON)
|
||||
endif()
|
||||
|
||||
# Use solution folders
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# Enable CMAKE_<LANG>_COMPILER_ID AppleClang
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
|
||||
|
||||
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Don't warn about obsolete cmake versions in 3rdparty")
|
||||
set(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION ON CACHE BOOL "Warn about absolute paths in destination")
|
||||
|
||||
# LTO
|
||||
|
||||
if(ENABLE_LTO)
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
||||
include(CheckIPOSupported)
|
||||
|
||||
check_ipo_supported(RESULT IPO_SUPPORTED
|
||||
OUTPUT OUTPUT_MESSAGE
|
||||
LANGUAGES C CXX)
|
||||
|
||||
if(NOT IPO_SUPPORTED)
|
||||
set(ENABLE_LTO "OFF" CACHE STRING "Enable Link Time Optmization" FORCE)
|
||||
message(WARNING "IPO / LTO is not supported: ${OUTPUT_MESSAGE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# General flags
|
||||
|
||||
macro(ov_install_static_lib target comp)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${target} EXPORT OpenVINOTargets
|
||||
RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT ${comp}
|
||||
ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT ${comp}
|
||||
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT ${comp})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
include(compile_flags/sdl)
|
||||
include(compile_flags/os_flags)
|
||||
include(compile_flags/sanitizer)
|
||||
include(compile_flags/fuzzing)
|
||||
include(download/dependency_solver)
|
||||
include(cross_compile/cross_compiled_func)
|
||||
include(faster_build)
|
||||
include(whole_archive)
|
||||
include(linux_name)
|
||||
include(models)
|
||||
include(api_validator/api_validator)
|
||||
|
||||
include(vs_version/vs_version)
|
||||
include(plugins/plugins)
|
||||
include(add_ie_target)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(ENABLE_FUZZING)
|
||||
enable_fuzzing()
|
||||
endif()
|
||||
|
||||
# macro to mark target as conditionally compiled
|
||||
|
||||
function(ie_mark_target_as_cc TARGET_NAME)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE openvino::conditional_compilation)
|
||||
|
||||
if(NOT (SELECTIVE_BUILD STREQUAL "ON"))
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ${TARGET_NAME})
|
||||
message(FATAL_ERROR "${TARGET_NAME} does not represent target")
|
||||
endif()
|
||||
|
||||
get_target_property(sources ${TARGET_NAME} SOURCES)
|
||||
set_source_files_properties(${sources} PROPERTIES OBJECT_DEPENDS ${GENERATED_HEADER})
|
||||
endfunction()
|
||||
|
||||
# check python package
|
||||
|
||||
function(ie_check_pip_package full_name message_type)
|
||||
find_package(PythonInterp 3 REQUIRED)
|
||||
|
||||
get_filename_component(PYTHON_EXEC_DIR ${PYTHON_EXECUTABLE} DIRECTORY)
|
||||
|
||||
# extract version if any
|
||||
if(full_name MATCHES "^([a-z_]+)[~=<>!]*(.*)$")
|
||||
set(name ${CMAKE_MATCH_1})
|
||||
set(req_version ${CMAKE_MATCH_2})
|
||||
else()
|
||||
set(name ${full_name})
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -m pip show ${name}
|
||||
WORKING_DIRECTORY ${PYTHON_EXEC_DIR}
|
||||
RESULT_VARIABLE PIP_EXIT_CODE
|
||||
OUTPUT_VARIABLE output)
|
||||
|
||||
if(NOT PIP_EXIT_CODE EQUAL 0)
|
||||
set(${name}_FOUND OFF PARENT_SCOPE)
|
||||
message(${message_type} "${name} package is not installed. Please use \"${PYTHON_EXECUTABLE} -m pip install ${full_name}\".")
|
||||
else()
|
||||
if(req_version)
|
||||
string(REGEX MATCH "Version: ([0-9]+\.?[0-9]*\.?[0-9]*)\n" installed_version "${output}")
|
||||
if(installed_version)
|
||||
set(installed_version "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
|
||||
if(NOT req_version STREQUAL installed_version)
|
||||
message(${message_type} "${name} package is installed, but may have different version (${installed_version}). "
|
||||
"Please use \"${PYTHON_EXECUTABLE} -m pip install ${full_name}\".")
|
||||
endif()
|
||||
else()
|
||||
set(${name}_FOUND ON PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Code style utils
|
||||
|
||||
include(cpplint/cpplint)
|
||||
include(clang_format/clang_format)
|
||||
include(ncc_naming_style/ncc_naming_style)
|
||||
|
||||
# Restore state
|
||||
set(CMAKE_MODULE_PATH ${OLD_CMAKE_MODULE_PATH})
|
||||
@@ -1,35 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Perform search of TBB package corresponding with specified search order.
|
||||
#
|
||||
# TBBROOT var is set into external package path or has a default value
|
||||
# with IE own version of TBB. Search order is next:
|
||||
# 1) ${TBBROOT}/cmake
|
||||
# 2) ${TBBROOT} with IE own version of TBBConfig.cmake (actual for TBB < 2017.7)
|
||||
#
|
||||
|
||||
# Path to IE own version of TBBConfig.cmake old TBB version without cmake config.
|
||||
if(APPLE)
|
||||
set(IE_OWN_TBB_CONFIG tbb/mac)
|
||||
elseif(UNIX)
|
||||
set(IE_OWN_TBB_CONFIG tbb/lnx)
|
||||
elseif(WIN)
|
||||
set(IE_OWN_TBB_CONFIG tbb/win)
|
||||
else()
|
||||
unset(IE_OWN_TBB_CONFIG)
|
||||
endif()
|
||||
|
||||
find_package(TBB
|
||||
CONFIG
|
||||
PATHS ${TBBROOT}/cmake
|
||||
${TBBROOT}/lib/cmake/TBB # oneTBB case
|
||||
${IEDevScripts_DIR}/${IE_OWN_TBB_CONFIG}
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(TBB CONFIG_MODE)
|
||||
@@ -1,17 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
file(REMOVE "${OUTPUT_FILE}")
|
||||
|
||||
execute_process(COMMAND ${CLANG_FORMAT} -style=file -output-replacements-xml ${INPUT_FILE}
|
||||
OUTPUT_VARIABLE STYLE_CHECK_RESULT
|
||||
)
|
||||
|
||||
file(WRITE "${OUTPUT_FILE}" "${STYLE_CHECK_RESULT}")
|
||||
|
||||
if(NOT SKIP_RETURN_CODE)
|
||||
if("${STYLE_CHECK_RESULT}" MATCHES ".*<replacement .*")
|
||||
message(FATAL_ERROR "[clang-format] Code style check failed for: ${INPUT_FILE}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,25 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
macro(enable_fuzzing)
|
||||
# Enable (libFuzzer)[https://llvm.org/docs/LibFuzzer.html] if supported.
|
||||
set(FUZZING_COMPILER_FLAGS "-fsanitize=fuzzer-no-link -fprofile-instr-generate -fcoverage-mapping")
|
||||
set(FUZZING_LINKER_FLAGS "-fsanitize-coverage=trace-pc-guard -fprofile-instr-generate")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FUZZING_COMPILER_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FUZZING_COMPILER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FUZZING_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FUZZING_LINKER_FLAGS}")
|
||||
|
||||
unset(FUZZING_COMPILER_FLAGS)
|
||||
unset(FUZZING_LINKER_FLAGS)
|
||||
endmacro()
|
||||
|
||||
function(add_fuzzer FUZZER_EXE_NAME FUZZER_SOURCES)
|
||||
add_executable(${FUZZER_EXE_NAME} ${FUZZER_SOURCES})
|
||||
target_link_libraries(${FUZZER_EXE_NAME} PRIVATE fuzz-testhelper)
|
||||
if(ENABLE_FUZZING)
|
||||
set_target_properties(${FUZZER_EXE_NAME} PROPERTIES LINK_FLAGS "-fsanitize=fuzzer")
|
||||
endif()
|
||||
endfunction(add_fuzzer)
|
||||
@@ -1,365 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(ProcessorCount)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
#
|
||||
# Disables deprecated warnings generation
|
||||
# Defines ie_c_cxx_deprecated varaible which contains C / C++ compiler flags
|
||||
#
|
||||
macro(disable_deprecated_warnings)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(ie_c_cxx_deprecated "/Qdiag-disable:1478,1786")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(ie_c_cxx_deprecated "/wd4996")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(ie_c_cxx_deprecated "-diag-disable=1478,1786")
|
||||
else()
|
||||
set(ie_c_cxx_deprecated "-Wno-deprecated-declarations")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ie_c_cxx_deprecated)
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ie_c_cxx_deprecated}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ie_c_cxx_deprecated}")
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Don't threat deprecated warnings as errors
|
||||
# Defines ie_c_cxx_deprecated_no_errors varaible which contains C / C++ compiler flags
|
||||
#
|
||||
macro(ie_deprecated_no_errors)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(ie_c_cxx_deprecated_no_errors "/Qdiag-warning:1478,1786")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# show 4996 only for /w4
|
||||
set(ie_c_cxx_deprecated_no_errors "/w44996")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(ie_c_cxx_deprecated_no_errors "-diag-warning=1478,1786")
|
||||
else()
|
||||
set(ie_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations")
|
||||
endif()
|
||||
|
||||
if(NOT ie_c_cxx_deprecated_no_errors)
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ie_c_cxx_deprecated_no_errors}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ie_c_cxx_deprecated_no_errors}")
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Provides SSE4.2 compilation flags depending on an OS and a compiler
|
||||
#
|
||||
function(ie_sse42_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# No such option for MSVC 2019
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxSSE4.2 PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xSSE4.2 PARENT_SCOPE)
|
||||
else()
|
||||
set(${flags} -msse4.2 PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Provides AVX2 compilation flags depending on an OS and a compiler
|
||||
#
|
||||
function(ie_avx2_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxCORE-AVX2 PARENT_SCOPE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} /arch:AVX2 PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xCORE-AVX2 PARENT_SCOPE)
|
||||
else()
|
||||
set(${flags} -mavx2 -mfma PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Provides common AVX512 compilation flags for AVX512F instruction set support
|
||||
# depending on an OS and a compiler
|
||||
#
|
||||
function(ie_avx512_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxCOMMON-AVX512 PARENT_SCOPE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} /arch:AVX512 PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xCOMMON-AVX512 PARENT_SCOPE)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(${flags} -mavx512f -mfma PARENT_SCOPE)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$")
|
||||
set(${flags} -mavx512f -mfma PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(ie_arm_neon_optimization_flags flags)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# nothing
|
||||
elseif(ANDROID)
|
||||
if(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||
set(${flags} -mfpu=neon PARENT_SCOPE)
|
||||
elseif(ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON")
|
||||
set(${flags} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon PARENT_SCOPE)
|
||||
elseif((ANDROID_ABI STREQUAL "armeabi-v7a with NEON") OR
|
||||
(ANDROID_ABI STREQUAL "armeabi-v7a" AND
|
||||
DEFINED CMAKE_ANDROID_ARM_NEON AND CMAKE_ANDROID_ARM_NEON))
|
||||
set(${flags} -march=armv7-a -mfloat-abi=softfp -mfpu=neon PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
if(AARCH64)
|
||||
set(${flags} -O2 -ftree-vectorize PARENT_SCOPE)
|
||||
elseif(ARM)
|
||||
set(${flags} -mfpu=neon PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Disables all warnings for 3rd party targets
|
||||
#
|
||||
function(ov_disable_all_warnings)
|
||||
foreach(target IN LISTS ARGN)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_options(${target} PRIVATE /WX-)
|
||||
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
|
||||
target_compile_options(${target} PRIVATE -w)
|
||||
elseif(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
# 193: zero used for undefined preprocessing identifier "XXX"
|
||||
# 1011: missing return statement at end of non-void function "XXX"
|
||||
# 2415: variable "xxx" of static storage duration was declared but never referenced
|
||||
target_compile_options(${target} PRIVATE -diag-disable=warn,193,1011,2415)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Enables Link Time Optimization compilation
|
||||
#
|
||||
macro(ie_enable_lto)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Adds compiler flags to C / C++ sources
|
||||
#
|
||||
macro(ie_add_compiler_flags)
|
||||
foreach(flag ${ARGN})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Forced includes certain header file to all target source files
|
||||
#
|
||||
function(ov_force_include target scope header_file)
|
||||
if(MSVC)
|
||||
target_compile_options(${target} ${scope} /FI"${header_file}")
|
||||
else()
|
||||
target_compile_options(${target} ${scope} -include "${header_file}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Compilation and linker flags
|
||||
#
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# to allows to override CMAKE_CXX_STANDARD from command line
|
||||
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
if(ENABLE_COVERAGE)
|
||||
ie_add_compiler_flags(--coverage)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
ie_add_compiler_flags(-fsigned-char)
|
||||
endif()
|
||||
|
||||
# Honor visibility properties for all target types
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
|
||||
|
||||
function(ie_python_minimal_api target)
|
||||
# pybind11 uses a lot of API which is not a part of minimal python API subset
|
||||
# Ref 1: https://docs.python.org/3.11/c-api/stable.html
|
||||
# Ref 2: https://github.com/pybind/pybind11/issues/1755
|
||||
# target_compile_definitions(${target} PRIVATE Py_LIMITED_API=0x03090000)
|
||||
# if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# target_compile_options(${target} PRIVATE "-Wno-unused-variable")
|
||||
# endif()
|
||||
endfunction()
|
||||
|
||||
if(WIN32)
|
||||
ie_add_compiler_flags(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
|
||||
ie_add_compiler_flags(/EHsc) # no asynchronous structured exception handling
|
||||
ie_add_compiler_flags(/Gy) # remove unreferenced functions: function level linking
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
|
||||
if (TREAT_WARNING_AS_ERROR)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
ie_add_compiler_flags(/WX)
|
||||
ie_add_compiler_flags(/Qdiag-warning:47,1740,1786)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# ie_add_compiler_flags(/WX) # Too many warnings
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Compiler specific flags
|
||||
|
||||
ie_add_compiler_flags(/bigobj)
|
||||
ie_add_compiler_flags(/MP)
|
||||
|
||||
# Disable noisy warnings
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# C4251 needs to have dll-interface to be used by clients of class
|
||||
ie_add_compiler_flags(/wd4251)
|
||||
# C4275 non dll-interface class used as base for dll-interface class
|
||||
ie_add_compiler_flags(/wd4275)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
# 161: unrecognized pragma
|
||||
# 177: variable was declared but never referenced
|
||||
# 556: not matched type of assigned function pointer
|
||||
# 1744: field of class type without a DLL interface used in a class with a DLL interface
|
||||
# 1879: unimplemented pragma ignored
|
||||
# 2586: decorated name length exceeded, name was truncated
|
||||
# 2651: attribute does not apply to any entity
|
||||
# 3180: unrecognized OpenMP pragma
|
||||
# 11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
|
||||
# 15335: was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
|
||||
ie_add_compiler_flags(/Qdiag-disable:161,177,556,1744,1879,2586,2651,3180,11075,15335)
|
||||
endif()
|
||||
|
||||
# Debug information flags, by default CMake adds /Zi option
|
||||
# but provides no way to specify CMAKE_COMPILE_PDB_NAME on root level
|
||||
# In order to avoid issues with ninja we are replacing default flag instead of having two of them
|
||||
# and observing warning D9025 about flag override
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
else()
|
||||
# TODO: enable for C sources as well
|
||||
# ie_add_compiler_flags(-Werror)
|
||||
if(TREAT_WARNING_AS_ERROR)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
ie_add_compiler_flags(-ffunction-sections -fdata-sections)
|
||||
ie_add_compiler_flags(-fdiagnostics-show-option)
|
||||
ie_add_compiler_flags(-Wundef)
|
||||
ie_add_compiler_flags(-Wreturn-type)
|
||||
ie_add_compiler_flags(-Wunused-variable)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
ie_add_compiler_flags(-Wswitch)
|
||||
elseif(UNIX)
|
||||
ie_add_compiler_flags(-Wuninitialized -Winit-self)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
ie_add_compiler_flags(-Winconsistent-missing-override
|
||||
-Wstring-plus-int)
|
||||
else()
|
||||
ie_add_compiler_flags(-Wmaybe-uninitialized)
|
||||
check_cxx_compiler_flag("-Wsuggest-override" SUGGEST_OVERRIDE_SUPPORTED)
|
||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
set(CMAKE_CXX_FLAGS "-Wsuggest-override ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Disable noisy warnings
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
# 177: function "XXX" was declared but never referenced
|
||||
ie_add_compiler_flags(-diag-disable=remark,177,2196)
|
||||
endif()
|
||||
|
||||
# Linker flags
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
elseif(LINUX)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL")
|
||||
if(NOT ENABLE_FUZZING)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--exclude-libs,ALL")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Links provided libraries and include their INTERFACE_INCLUDE_DIRECTORIES as SYSTEM
|
||||
function(link_system_libraries TARGET_NAME)
|
||||
set(MODE PRIVATE)
|
||||
|
||||
foreach(arg IN LISTS ARGN)
|
||||
if(arg MATCHES "(PRIVATE|PUBLIC|INTERFACE)")
|
||||
set(MODE ${arg})
|
||||
else()
|
||||
if(TARGET "${arg}")
|
||||
target_include_directories(${TARGET_NAME}
|
||||
SYSTEM ${MODE}
|
||||
$<TARGET_PROPERTY:${arg},INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:${arg},INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TARGET_NAME} ${MODE} ${arg})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
@@ -1,57 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
if (ENABLE_SANITIZER)
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=address")
|
||||
check_cxx_compiler_flag("-fsanitize-recover=address" SANITIZE_RECOVER_ADDRESS_SUPPORTED)
|
||||
if (SANITIZE_RECOVER_ADDRESS_SUPPORTED)
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize-recover=address")
|
||||
endif()
|
||||
|
||||
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
if (ENABLE_UB_SANITIZER)
|
||||
# TODO: Remove -fno-sanitize=null as thirdparty/ocl/clhpp_headers UBSAN compatibility resolved:
|
||||
# https://github.com/KhronosGroup/OpenCL-CLHPP/issues/17
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=undefined -fno-sanitize=null")
|
||||
# TODO: Remove -Wno-maybe-uninitialized after CVS-61143 fix
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -Wno-maybe-uninitialized")
|
||||
check_cxx_compiler_flag("-fsanitize-recover=undefined" SANITIZE_RECOVER_UNDEFINED_SUPPORTED)
|
||||
if (SANITIZE_RECOVER_UNDEFINED_SUPPORTED)
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize-recover=undefined")
|
||||
endif()
|
||||
|
||||
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=undefined")
|
||||
endif()
|
||||
|
||||
if (ENABLE_THREAD_SANITIZER)
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=thread")
|
||||
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=thread")
|
||||
endif()
|
||||
|
||||
# common sanitizer options
|
||||
if (DEFINED SANITIZER_COMPILER_FLAGS)
|
||||
# ensure symbols are present
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -g -fno-omit-frame-pointer")
|
||||
if(NOT OV_COMPILER_IS_CLANG)
|
||||
# GPU plugin tests compilation is slow with -fvar-tracking-assignments on GCC.
|
||||
# Clang has no var-tracking-assignments.
|
||||
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fno-var-tracking-assignments")
|
||||
endif()
|
||||
# prevent unloading libraries at runtime, so sanitizer can resolve their symbols
|
||||
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -Wl,-z,nodelete")
|
||||
|
||||
if(OV_COMPILER_IS_CLANG AND NOT WIN32 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
|
||||
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=lld")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_COMPILER_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_COMPILER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SANITIZER_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${SANITIZER_LINKER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZER_LINKER_FLAGS}")
|
||||
endif()
|
||||
@@ -1,50 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
if(UNIX)
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -Wformat -Wformat-security")
|
||||
if (NOT ENABLE_SANITIZER)
|
||||
# ASan does not support fortification https://github.com/google/sanitizers/issues/247
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -D_FORTIFY_SOURCE=2")
|
||||
endif()
|
||||
if(NOT APPLE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pie")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(IE_LINKER_FLAGS "${IE_LINKER_FLAGS} -z noexecstack -z relro -z now")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -fstack-protector-all")
|
||||
else()
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -fstack-protector-strong")
|
||||
endif()
|
||||
if (NOT ENABLE_SANITIZER)
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -s")
|
||||
endif()
|
||||
elseif(OV_COMPILER_IS_CLANG)
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -fstack-protector-all")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if (NOT ENABLE_SANITIZER)
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -Wl,--strip-all")
|
||||
endif()
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} -fstack-protector-strong")
|
||||
set(IE_LINKER_FLAGS "${IE_LINKER_FLAGS} -z noexecstack -z relro -z now")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} /sdl")
|
||||
endif()
|
||||
set(IE_C_CXX_FLAGS "${IE_C_CXX_FLAGS} /guard:cf")
|
||||
if(ENABLE_INTEGRITYCHECK)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /INTEGRITYCHECK")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IE_C_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IE_C_CXX_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${IE_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${IE_LINKER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${IE_LINKER_FLAGS}")
|
||||
endif()
|
||||
@@ -1,213 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(OV_COVERAGE_GCDA_DATA_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
|
||||
if(NOT TARGET ie_coverage_clean)
|
||||
add_custom_target(ie_coverage_clean)
|
||||
set_target_properties(ie_coverage_clean PROPERTIES FOLDER coverage)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ie_coverage_init)
|
||||
add_custom_target(ie_coverage_init)
|
||||
set_target_properties(ie_coverage_init PROPERTIES FOLDER coverage)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ie_coverage)
|
||||
add_custom_target(ie_coverage)
|
||||
set_target_properties(ie_coverage PROPERTIES FOLDER coverage)
|
||||
endif()
|
||||
|
||||
set(IE_COVERAGE_REPORTS "${CMAKE_BINARY_DIR}/coverage")
|
||||
set(IE_COVERAGE_SCRIPT_DIR "${IEDevScripts_DIR}/coverage")
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
#
|
||||
# ie_coverage_clean(REPOSITORY <repo> DIRECTORY <dir>)
|
||||
#
|
||||
function(ie_coverage_clean)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "REPOSITORY;DIRECTORY" "" ${ARGN})
|
||||
|
||||
add_custom_target(ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
|
||||
COMMAND lcov --zerocounters --quiet
|
||||
--directory "${IE_COVERAGE_DIRECTORY}"
|
||||
COMMENT "Add zero counters for coverage for ${IE_COVERAGE_REPOSITORY}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(ie_coverage_clean_${IE_COVERAGE_REPOSITORY}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "IE_COVERAGE_REPORTS=${IE_COVERAGE_REPORTS}"
|
||||
-D "IE_COVERAGE_DIRECTORY=${IE_COVERAGE_DIRECTORY}"
|
||||
-D "CMAKE_BINARY_DIRECTORY=${CMAKE_BINARY_DIR}"
|
||||
-D "CMAKE_SOURCE_DIRECTORY=${CMAKE_SOURCE_DIR}"
|
||||
-P "${IE_COVERAGE_SCRIPT_DIR}/coverage_clean.cmake"
|
||||
COMMENT "Clean previously created HTML report files for ${IE_COVERAGE_REPOSITORY}"
|
||||
DEPENDS "${IE_COVERAGE_SCRIPT_DIR}/coverage_clean.cmake"
|
||||
VERBATIM)
|
||||
|
||||
set_target_properties(ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
|
||||
ie_coverage_clean_${IE_COVERAGE_REPOSITORY}
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_clean ie_coverage_zerocounters_${IE_COVERAGE_REPOSITORY}
|
||||
ie_coverage_clean_${IE_COVERAGE_REPOSITORY})
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_capture(INFO_FILE <info_file>
|
||||
# BASE_DIRECTORY <base dir>
|
||||
# DIRECTORY <gcda dir>)
|
||||
#
|
||||
function(ie_coverage_capture)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INFO_FILE;BASE_DIRECTORY;DIRECTORY" "" ${ARGN})
|
||||
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}.info")
|
||||
set(output_base_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}_base.info")
|
||||
set(output_tests_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}_tests.info")
|
||||
|
||||
add_custom_command(OUTPUT ${output_base_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${IE_COVERAGE_REPORTS}"
|
||||
COMMAND lcov --no-external --capture --initial --quiet
|
||||
--directory "${IE_COVERAGE_DIRECTORY}"
|
||||
--base-directory "${IE_COVERAGE_BASE_DIRECTORY}"
|
||||
--output-file ${output_base_file}
|
||||
COMMENT "Capture initial coverage data ${IE_COVERAGE_INFO_FILE}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT ${output_tests_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${IE_COVERAGE_REPORTS}"
|
||||
COMMAND lcov --no-external --capture --quiet
|
||||
--directory "${IE_COVERAGE_DIRECTORY}"
|
||||
--base-directory "${IE_COVERAGE_BASE_DIRECTORY}"
|
||||
--output-file ${output_tests_file}
|
||||
COMMENT "Capture test coverage data ${IE_COVERAGE_INFO_FILE}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "IE_COVERAGE_OUTPUT_FILE=${output_file}"
|
||||
-D "IE_COVERAGE_INPUT_FILES=${output_base_file};${output_tests_file}"
|
||||
-P "${IE_COVERAGE_SCRIPT_DIR}/coverage_merge.cmake"
|
||||
COMMENT "Generate total coverage data ${IE_COVERAGE_INFO_FILE}"
|
||||
DEPENDS ${output_base_file} ${output_tests_file}
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_INFO_FILE}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_INFO_FILE}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_extract(INPUT <info_file> OUTPUT <output_file> PATTERNS <patterns ...>)
|
||||
#
|
||||
function(ie_coverage_extract)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INPUT;OUTPUT" "PATTERNS" ${ARGN})
|
||||
|
||||
set(input_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INPUT}.info")
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_OUTPUT}.info")
|
||||
|
||||
set(commands lcov --quiet)
|
||||
foreach(pattern IN LISTS IE_COVERAGE_PATTERNS)
|
||||
list(APPEND commands --extract ${input_file} ${pattern})
|
||||
endforeach()
|
||||
list(APPEND commands --output-file ${output_file})
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${commands}
|
||||
COMMENT "Generate coverage data ${IE_COVERAGE_OUTPUT}"
|
||||
DEPENDS ${input_file}
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ie_coverage_${IE_COVERAGE_INPUT}_info)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_remove(INPUT <info_file> OUTPUT <output_file> PATTERNS <patterns ...>)
|
||||
#
|
||||
function(ie_coverage_remove)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INPUT;OUTPUT" "PATTERNS" ${ARGN})
|
||||
|
||||
set(input_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INPUT}.info")
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_OUTPUT}.info")
|
||||
|
||||
set(commands lcov --quiet)
|
||||
foreach(pattern IN LISTS IE_COVERAGE_PATTERNS)
|
||||
list(APPEND commands --remove ${input_file} ${pattern})
|
||||
endforeach()
|
||||
list(APPEND commands --output-file ${output_file})
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${commands}
|
||||
COMMENT "Generate coverage data ${IE_COVERAGE_OUTPUT}"
|
||||
DEPENDS ${input_file}
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ie_coverage_${IE_COVERAGE_INPUT}_info)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_merge(OUTPUT <output file> INPUTS <input files ...>)
|
||||
#
|
||||
function(ie_coverage_merge)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "OUTPUT" "INPUTS" ${ARGN})
|
||||
|
||||
set(output_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_OUTPUT}.info")
|
||||
foreach(input_info_file IN LISTS IE_COVERAGE_INPUTS)
|
||||
set(input_file ${IE_COVERAGE_REPORTS}/${input_info_file}.info)
|
||||
list(APPEND dependencies ie_coverage_${input_info_file}_info)
|
||||
list(APPEND input_files ${input_file})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(OUTPUT ${output_file}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "IE_COVERAGE_OUTPUT_FILE=${output_file}"
|
||||
-D "IE_COVERAGE_INPUT_FILES=${input_files}"
|
||||
-P "${IE_COVERAGE_SCRIPT_DIR}/coverage_merge.cmake"
|
||||
COMMENT "Generate coverage data ${IE_COVERAGE_OUTPUT}"
|
||||
DEPENDS ${input_files}
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
DEPENDS ${output_file})
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_OUTPUT}_info
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_OUTPUT}_info ${dependencies})
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_coverage_genhtml(INFO_FILE <info_file> PREFIX <prefix>)
|
||||
#
|
||||
function(ie_coverage_genhtml)
|
||||
cmake_parse_arguments(IE_COVERAGE "" "INFO_FILE;PREFIX" "" ${ARGN})
|
||||
|
||||
set(input_file "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}.info")
|
||||
set(output_directory "${IE_COVERAGE_REPORTS}/${IE_COVERAGE_INFO_FILE}")
|
||||
|
||||
add_custom_command(OUTPUT "${output_directory}/index.html"
|
||||
COMMAND genhtml ${input_file} --title "${IE_COVERAGE_INFO_FILE}" --legend
|
||||
--no-branch-coverage --demangle-cpp
|
||||
--output-directory "${output_directory}"
|
||||
--num-spaces 4 --quiet
|
||||
--prefix "${IE_COVERAGE_PREFIX}"
|
||||
DEPENDS ${input_file}
|
||||
COMMENT "Generate HTML report for ${IE_COVERAGE_INFO_FILE}"
|
||||
VERBATIM)
|
||||
add_custom_target(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml
|
||||
DEPENDS "${output_directory}/index.html")
|
||||
set_target_properties(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml
|
||||
PROPERTIES FOLDER coverage)
|
||||
|
||||
add_dependencies(ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml ie_coverage_${IE_COVERAGE_INFO_FILE}_info)
|
||||
add_dependencies(ie_coverage ie_coverage_${IE_COVERAGE_INFO_FILE}_genhtml)
|
||||
endfunction()
|
||||
@@ -1,107 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(ENABLE_CPPLINT)
|
||||
find_package(PythonInterp 3 QUIET)
|
||||
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(WARNING "Python3 interpreter was not found (required for cpplint check)")
|
||||
set(ENABLE_CPPLINT OFF)
|
||||
endif()
|
||||
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)
|
||||
if(NOT ENABLE_CPPLINT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(options "")
|
||||
set(oneValueArgs "")
|
||||
set(multiValueArgs FOR_TARGETS FOR_SOURCES EXCLUDE_PATTERNS CUSTOM_FILTERS)
|
||||
cmake_parse_arguments(CPPLINT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
foreach(target IN LISTS CPPLINT_FOR_TARGETS)
|
||||
get_target_property(target_sources "${target}" SOURCES)
|
||||
list(APPEND CPPLINT_FOR_SOURCES ${target_sources})
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES CPPLINT_FOR_SOURCES)
|
||||
|
||||
set(custom_filter "")
|
||||
foreach(filter IN LISTS CPPLINT_CUSTOM_FILTERS)
|
||||
string(CONCAT custom_filter "${custom_filter}" "," "${filter}")
|
||||
endforeach()
|
||||
|
||||
set(all_output_files "")
|
||||
foreach(source_file IN LISTS CPPLINT_FOR_SOURCES)
|
||||
set(exclude FALSE)
|
||||
foreach(pattern IN LISTS CPPLINT_EXCLUDE_PATTERNS)
|
||||
if(source_file MATCHES "${pattern}")
|
||||
set(exclude ON)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(exclude)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# ignore object libraries
|
||||
if(NOT EXISTS "${source_file}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
file(RELATIVE_PATH source_file_relative "${CMAKE_CURRENT_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)
|
||||
file(MAKE_DIRECTORY "${output_dir}")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
"${output_file}"
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}"
|
||||
-D "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
|
||||
-D "CPPLINT_SCRIPT=${IEDevScripts_DIR}/cpplint/cpplint.py"
|
||||
-D "INPUT_FILE=${source_file}"
|
||||
-D "OUTPUT_FILE=${output_file}"
|
||||
-D "WORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
-D "SKIP_RETURN_CODE=${ENABLE_CPPLINT_REPORT}"
|
||||
-D "CUSTOM_FILTER=${custom_filter}"
|
||||
-P "${IEDevScripts_DIR}/cpplint/cpplint_run.cmake"
|
||||
DEPENDS
|
||||
"${source_file}"
|
||||
"${IEDevScripts_DIR}/cpplint/cpplint.py"
|
||||
"${IEDevScripts_DIR}/cpplint/cpplint_run.cmake"
|
||||
COMMENT
|
||||
"[cpplint] ${source_file}"
|
||||
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}")
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER cpplint)
|
||||
|
||||
if(CPPLINT_FOR_TARGETS)
|
||||
foreach(target IN LISTS CPPLINT_FOR_TARGETS)
|
||||
add_dependencies(${target} ${TARGET_NAME})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
add_dependencies(cpplint_all ${TARGET_NAME})
|
||||
endfunction()
|
||||
@@ -1,17 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (debug_message)
|
||||
if (VERBOSE_BUILD)
|
||||
message(${ARGV})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(clean_message type)
|
||||
string (REPLACE ";" "" output_string "${ARGN}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${output_string}")
|
||||
if(${ARGV0} STREQUAL "FATAL_ERROR")
|
||||
message (FATAL_ERROR)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,25 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (Download from to fatal result output sha256)
|
||||
|
||||
if((NOT EXISTS "${to}"))
|
||||
message(STATUS "Downloading from ${from} to ${to} ...")
|
||||
file(DOWNLOAD ${from} ${to}
|
||||
TIMEOUT 3600
|
||||
LOG log
|
||||
STATUS status
|
||||
SHOW_PROGRESS
|
||||
EXPECTED_HASH SHA256=${sha256})
|
||||
|
||||
set (${output} ${status} PARENT_SCOPE)
|
||||
else()
|
||||
set (${output} 0 PARENT_SCOPE)
|
||||
endif()
|
||||
set(${result} "ON" PARENT_SCOPE)
|
||||
|
||||
endfunction(Download)
|
||||
|
||||
include(download/download_and_apply)
|
||||
include(download/download_and_extract)
|
||||
@@ -1,72 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
find_package(Wget QUIET)
|
||||
|
||||
function (DownloadAndCheck from to fatal result sha256)
|
||||
set(status_res "ON")
|
||||
set(output 1)
|
||||
|
||||
get_filename_component(download_dir ${to} DIRECTORY)
|
||||
if (NOT EXISTS ${download_dir})
|
||||
file(MAKE_DIRECTORY ${download_dir})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${to}")
|
||||
if (${from} MATCHES "(http:)|(https:)|(ftp:)")
|
||||
message(STATUS "Downloading from ${from} to ${to} ...")
|
||||
find_program(aria2c "aria2c")
|
||||
if (${aria2c} STREQUAL "aria2c-NOTFOUND")
|
||||
if (NOT WGET_FOUND)
|
||||
Download(${from} ${to} ${fatal} ${result} output ${sha256})
|
||||
list(GET output 0 status_code)
|
||||
else()
|
||||
foreach(index RANGE 5)
|
||||
message(STATUS "${WGET_EXECUTABLE} --no-cache --no-check-certificate
|
||||
--retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=5 ${from}")
|
||||
execute_process(COMMAND ${WGET_EXECUTABLE} "--no-cache" "--no-check-certificate"
|
||||
"--retry-connrefused" "--waitretry=1" "--read-timeout=20" "--timeout=15" "--tries=5"
|
||||
"${from}" "-O" "${to}"
|
||||
TIMEOUT 2000
|
||||
RESULT_VARIABLE status_code)
|
||||
file(SHA256 ${to} CHECKSUM)
|
||||
if (${CHECKSUM} STREQUAL ${sha256})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
if (NOT ${CHECKSUM} STREQUAL ${sha256})
|
||||
message(FATAL_ERROR "Hash mismatch:\n"
|
||||
"expected: ${sha256}\n"
|
||||
"got: ${CHECKSUM}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${aria2c} ,*.*.*.* -d ${download_dir} ${from}")
|
||||
execute_process(COMMAND "${aria2c}" "-s10" "-x10" "--dir=${download_dir}" "${from}"
|
||||
TIMEOUT 2000
|
||||
RESULT_VARIABLE status_code)
|
||||
endif()
|
||||
|
||||
if(NOT status_code EQUAL 0)
|
||||
if (fatal)
|
||||
message(FATAL_ERROR "fatal error: downloading '${from}' failed
|
||||
status_code: ${status_code}
|
||||
status_string: ${status_string}
|
||||
log: ${log}")
|
||||
else()
|
||||
set(status_res "ARCHIVE_DOWNLOAD_FAIL")
|
||||
message("error: downloading '${from}' failed
|
||||
status_code: ${status_code}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Copying from local folder ${from} to ${to} ... ")
|
||||
file(COPY ${from} DESTINATION ${download_dir})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(REMOVE ${to}.md5)
|
||||
set(${result} "${status_res}" PARENT_SCOPE)
|
||||
|
||||
endfunction(DownloadAndCheck)
|
||||
@@ -1,47 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (extract archive_path unpacked_path folder files_to_extract result)
|
||||
# Slurped from a generated extract-TARGET.cmake file.
|
||||
get_filename_component(unpacked_dir ${unpacked_path} DIRECTORY)
|
||||
|
||||
file(MAKE_DIRECTORY ${unpacked_path})
|
||||
|
||||
message(STATUS "extracting...
|
||||
src='${archive_path}'
|
||||
dst='${unpacked_path}'")
|
||||
|
||||
if(NOT EXISTS "${archive_path}")
|
||||
message(FATAL_ERROR "error: file to extract does not exist: '${archive_path}'")
|
||||
endif()
|
||||
|
||||
# Extract it:
|
||||
#
|
||||
# in case of archive dont have top level folder lets create it
|
||||
if (${folder})
|
||||
set (unpacked_dir ${unpacked_path})
|
||||
message("unpacked_dir= ${unpacked_dir}")
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE ";" " " list_files_to_extract "${${files_to_extract}}")
|
||||
message(STATUS "extracting... [tar xfz] ${list_files_to_extract}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz ${archive_path} ${${files_to_extract}}
|
||||
WORKING_DIRECTORY ${unpacked_dir}
|
||||
RESULT_VARIABLE rv
|
||||
ERROR_VARIABLE err)
|
||||
|
||||
if (NOT (rv EQUAL 0))
|
||||
message(STATUS "error: extract of '${archive_path}' failed: ${err}")
|
||||
#invalid archive
|
||||
file(REMOVE_RECURSE "${unpacked_path}")
|
||||
file(REMOVE_RECURSE "${archive_path}")
|
||||
set(${result} 0 PARENT_SCOPE)
|
||||
else()
|
||||
if (NOT (err STREQUAL ""))
|
||||
message(STATUS "${err}")
|
||||
endif()
|
||||
set(${result} 1 PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
endfunction (extract)
|
||||
@@ -1,84 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(options)
|
||||
include(target_flags)
|
||||
|
||||
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
|
||||
# this must be addressed in a proper way
|
||||
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF "LINUX;NOT CMAKE_CROSSCOMPILING; CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
|
||||
|
||||
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
|
||||
|
||||
if(UNIX)
|
||||
ie_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" ON)
|
||||
else()
|
||||
ie_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" OFF)
|
||||
endif()
|
||||
|
||||
# FIXME: ARM cross-compiler generates several "false positive" warnings regarding __builtin_memcpy buffer overflow
|
||||
ie_dependent_option (TREAT_WARNING_AS_ERROR "Treat build warnings as errors" ON "X86 OR X86_64" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_INTEGRITYCHECK "build DLLs with /INTEGRITYCHECK flag" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
|
||||
|
||||
ie_option (ENABLE_SANITIZER "enable checking memory errors via AddressSanitizer" OFF)
|
||||
|
||||
ie_option (ENABLE_UB_SANITIZER "enable UndefinedBahavior sanitizer" OFF)
|
||||
|
||||
ie_option (ENABLE_THREAD_SANITIZER "enable checking data races via ThreadSanitizer" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_COVERAGE "enable code coverage" OFF "CMAKE_CXX_COMPILER_ID STREQUAL GNU" OFF)
|
||||
|
||||
# Defines CPU capabilities
|
||||
|
||||
ie_dependent_option (ENABLE_SSE42 "Enable SSE4.2 optimizations" ON "X86_64 OR X86" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_AVX2 "Enable AVX2 optimizations" ON "X86_64 OR X86" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_AVX512F "Enable AVX512 optimizations" ON "X86_64 OR X86" OFF)
|
||||
|
||||
# Type of build, we add this as an explicit option to default it to ON
|
||||
# FIXME: Ah this moment setting this to OFF will only build ngraph a static library
|
||||
ie_option (BUILD_SHARED_LIBS "Build as a shared library" ON)
|
||||
|
||||
ie_dependent_option (ENABLE_FASTER_BUILD "Enable build features (PCH, UNITY) to speed up build time" OFF "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_CPPLINT "Enable cpplint checks during the build" ON "UNIX;NOT ANDROID" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" ON "UNIX;NOT ANDROID" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_NCC_STYLE "Enable ncc style check" ON "UNIX;NOT ANDROID" OFF)
|
||||
|
||||
ie_option (VERBOSE_BUILD "shows extra information about build" OFF)
|
||||
|
||||
ie_option (ENABLE_UNSAFE_LOCATIONS "skip check for MD5 for dependency" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_FUZZING "instrument build for fuzzing" OFF "OV_COMPILER_IS_CLANG; NOT WIN32" OFF)
|
||||
|
||||
#
|
||||
# Check features
|
||||
#
|
||||
|
||||
if(ENABLE_AVX512F)
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND (MSVC_VERSION VERSION_LESS 1920))
|
||||
# 1920 version of MSVC 2019. In MSVC 2017 AVX512F not work
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6))
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10))
|
||||
# TBD: clarify which AppleClang version supports avx512
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9))
|
||||
set(ENABLE_AVX512F OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (VERBOSE_BUILD)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
@@ -1,27 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(UNIX AND ENABLE_ERROR_HIGHLIGHT)
|
||||
function(message)
|
||||
string(ASCII 27 ESC)
|
||||
set(RESET "${ESC}[m")
|
||||
set(RED "${ESC}[31;1m")
|
||||
set(YELLOW "${ESC}[33;1m")
|
||||
|
||||
list(GET ARGV 0 MessageType)
|
||||
list(REMOVE_AT ARGV 0)
|
||||
|
||||
foreach(arg IN LISTS ARGV)
|
||||
set(_msg "${_msg}${arg}")
|
||||
endforeach()
|
||||
|
||||
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
|
||||
_message(${MessageType} "${RED}${_msg}${RESET}")
|
||||
elseif(MessageType STREQUAL WARNING)
|
||||
_message(${MessageType} "${YELLOW}${_msg}${RESET}")
|
||||
else()
|
||||
_message(${MessageType} "${_msg}")
|
||||
endif()
|
||||
endfunction()
|
||||
endif()
|
||||
Submodule cmake/developer_package/ncc_naming_style/ncc deleted from 63e59ed312
@@ -1,150 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(NOT COMMAND ie_check_pip_package)
|
||||
message(FATAL_ERROR "ncc_naming_style.cmake must be included after ie_check_pip_package")
|
||||
endif()
|
||||
|
||||
set(ncc_style_dir "${IEDevScripts_DIR}/ncc_naming_style")
|
||||
set(ncc_style_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/ncc_naming_style")
|
||||
|
||||
# try to find_package(Clang QUIET)
|
||||
# ClangConfig.cmake contains bug that if libclang-XX-dev is not
|
||||
# installed, then find_package fails with errors even in QUIET mode
|
||||
configure_file("${ncc_style_dir}/try_find_clang.cmake"
|
||||
"${ncc_style_bin_dir}/source/CMakeLists.txt" COPYONLY)
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -S "${ncc_style_bin_dir}/source"
|
||||
-B "${ncc_style_bin_dir}/build"
|
||||
RESULT_VARIABLE clang_find_result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE output)
|
||||
|
||||
if(NOT clang_find_result EQUAL "0")
|
||||
message(WARNING "Please, install libclang-[N]-dev package (required for ncc naming style check)")
|
||||
set(ENABLE_NCC_STYLE OFF)
|
||||
endif()
|
||||
|
||||
# Since we were able to find_package(Clang) in a separate process
|
||||
# let's try to find in current process
|
||||
if(ENABLE_NCC_STYLE)
|
||||
find_host_package(Clang QUIET)
|
||||
if(Clang_FOUND AND TARGET libclang)
|
||||
get_target_property(libclang_location libclang LOCATION)
|
||||
message(STATUS "Found libclang: ${libclang_location}")
|
||||
else()
|
||||
message(WARNING "libclang is not found (required for ncc naming style check)")
|
||||
set(ENABLE_NCC_STYLE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# find python3
|
||||
|
||||
find_package(PythonInterp 3 QUIET)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(WARNING "Python3 interpreter was not found (required for ncc naming style check)")
|
||||
set(ENABLE_NCC_STYLE OFF)
|
||||
endif()
|
||||
|
||||
# check python requirements_dev.txt
|
||||
|
||||
set(ncc_script_py "${ncc_style_dir}/ncc/ncc.py")
|
||||
|
||||
if(NOT EXISTS ${ncc_script_py})
|
||||
message(WARNING "ncc.py is not downloaded via submodule")
|
||||
set(ENABLE_NCC_STYLE OFF)
|
||||
endif()
|
||||
|
||||
if(ENABLE_NCC_STYLE)
|
||||
set(req_file "${ncc_style_dir}/requirements_dev.txt")
|
||||
file(STRINGS ${req_file} req_lines)
|
||||
|
||||
foreach(req IN LISTS req_lines)
|
||||
ie_check_pip_package(${req} STATUS)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# create high-level target
|
||||
|
||||
if(ENABLE_NCC_STYLE AND NOT TARGET ncc_all)
|
||||
add_custom_target(ncc_all ALL)
|
||||
set_target_properties(ncc_all PROPERTIES FOLDER ncc_naming_style)
|
||||
endif()
|
||||
|
||||
#
|
||||
# ov_ncc_naming_style(FOR_TARGET target_name
|
||||
# INCLUDE_DIRECTORY dir
|
||||
# [ADDITIONAL_INCLUDE_DIRECTORIES dir1 dir2 ..]
|
||||
# [DEFINITIONS def1 def2 ..])
|
||||
#
|
||||
# FOR_TARGET - name of the target
|
||||
# INCLUDE_DIRECTORY - directory to check headers from
|
||||
# ADDITIONAL_INCLUDE_DIRECTORIES - additional include directories used in checked headers
|
||||
# DEFINITIONS - additional definitions passed to preprocessor stage
|
||||
#
|
||||
function(ov_ncc_naming_style)
|
||||
if(NOT ENABLE_NCC_STYLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
cmake_parse_arguments(NCC_STYLE "FAIL"
|
||||
"FOR_TARGET;INCLUDE_DIRECTORY" "ADDITIONAL_INCLUDE_DIRECTORIES;DEFINITIONS" ${ARGN})
|
||||
|
||||
foreach(var FOR_TARGET INCLUDE_DIRECTORY)
|
||||
if(NOT DEFINED NCC_STYLE_${var})
|
||||
message(FATAL_ERROR "${var} is not defined in ov_ncc_naming_style function")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(GLOB_RECURSE headers
|
||||
RELATIVE "${NCC_STYLE_INCLUDE_DIRECTORY}"
|
||||
"${NCC_STYLE_INCLUDE_DIRECTORY}/*.hpp")
|
||||
|
||||
list(APPEND NCC_STYLE_ADDITIONAL_INCLUDE_DIRECTORIES "${NCC_STYLE_INCLUDE_DIRECTORY}")
|
||||
|
||||
foreach(header IN LISTS headers)
|
||||
set(output_file "${ncc_style_bin_dir}/${header}.ncc_style")
|
||||
set(full_header_path "${NCC_STYLE_INCLUDE_DIRECTORY}/${header}")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${output_file}
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}"
|
||||
-D "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
|
||||
-D "NCC_PY_SCRIPT=${ncc_script_py}"
|
||||
-D "INPUT_FILE=${full_header_path}"
|
||||
-D "OUTPUT_FILE=${output_file}"
|
||||
-D "DEFINITIONS=${NCC_STYLE_DEFINITIONS}"
|
||||
-D "CLANG_LIB_PATH=${libclang_location}"
|
||||
-D "STYLE_FILE=${ncc_style_dir}/openvino.style"
|
||||
-D "ADDITIONAL_INCLUDE_DIRECTORIES=${NCC_STYLE_ADDITIONAL_INCLUDE_DIRECTORIES}"
|
||||
-D "EXPECTED_FAIL=${NCC_STYLE_FAIL}"
|
||||
-P "${ncc_style_dir}/ncc_run.cmake"
|
||||
DEPENDS
|
||||
"${full_header_path}"
|
||||
"${ncc_style_dir}/openvino.style"
|
||||
"${ncc_script_py}"
|
||||
"${ncc_style_dir}/ncc_run.cmake"
|
||||
COMMENT
|
||||
"[ncc naming style] ${header}"
|
||||
VERBATIM)
|
||||
list(APPEND output_files ${output_file})
|
||||
endforeach()
|
||||
|
||||
set(ncc_target ${NCC_STYLE_FOR_TARGET}_ncc_check)
|
||||
add_custom_target(${ncc_target}
|
||||
DEPENDS ${output_files}
|
||||
COMMENT "[ncc naming style] ${NCC_STYLE_FOR_TARGET}")
|
||||
|
||||
add_dependencies(${NCC_STYLE_FOR_TARGET} ${ncc_target})
|
||||
add_dependencies(ncc_all ${ncc_target})
|
||||
endfunction()
|
||||
|
||||
if(TARGET ncc_all)
|
||||
ov_ncc_naming_style(FOR_TARGET ncc_all
|
||||
INCLUDE_DIRECTORY "${ncc_style_dir}/self_check"
|
||||
FAIL)
|
||||
endif()
|
||||
@@ -1,45 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
foreach(var NCC_PY_SCRIPT PYTHON_EXECUTABLE OUTPUT_FILE DEFINITIONS EXPECTED_FAIL
|
||||
INPUT_FILE ADDITIONAL_INCLUDE_DIRECTORIES STYLE_FILE CLANG_LIB_PATH)
|
||||
if(NOT DEFINED ${var})
|
||||
message(FATAL_ERROR "${var} is not defined for ncc_run.cmake")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(REMOVE "${OUTPUT_FILE}")
|
||||
|
||||
if(DEFINITIONS)
|
||||
set(defs --definition ${DEFINITIONS})
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${PYTHON_EXECUTABLE}"
|
||||
"${NCC_PY_SCRIPT}"
|
||||
--path ${INPUT_FILE}
|
||||
--style ${STYLE_FILE}
|
||||
--clang-lib ${CLANG_LIB_PATH}
|
||||
${defs}
|
||||
--include ${ADDITIONAL_INCLUDE_DIRECTORIES}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE output)
|
||||
|
||||
file(WRITE "${OUTPUT_FILE}" "${output}")
|
||||
|
||||
if(NOT result EQUAL "0")
|
||||
set(failed ON)
|
||||
endif()
|
||||
|
||||
if(EXPECTED_FAIL AND NOT failed)
|
||||
message(FATAL_ERROR "[ncc self check] Self check is not failed for ${INPUT_FILE}")
|
||||
endif()
|
||||
|
||||
if(failed AND NOT EXPECTED_FAIL)
|
||||
# Display the output to console (to parse it form IDE)
|
||||
message("${output}")
|
||||
message(FATAL_ERROR "[ncc naming style] Naming style check failed for ${INPUT_FILE}")
|
||||
endif()
|
||||
@@ -1,129 +0,0 @@
|
||||
# custom OpenVINO values
|
||||
CppMethod: '^(operator\W+|[a-z_\d]+|signaling_NaN|quiet_NaN)$'
|
||||
ClassName: '^([A-Z][\w]+|b?float16|numeric_limits|ngraph_error|stopwatch|unsupported_op)$'
|
||||
StructName: '^([A-Z][\w]+|element_type_traits|hash|oi_pair)$'
|
||||
FunctionName: '^(operator\W+|[a-z_\d]+)$'
|
||||
Namespace: '^([a-z\d_]+|InferenceEngine)$'
|
||||
NamespaceAlias: '^([a-z\d_]+|InferenceEngine)$'
|
||||
UnionName: '[A-Z][\w]+$'
|
||||
TemplateTemplateParameter: '[A-Z][\w]+'
|
||||
NamespaceReference: '^([a-z\d_]+|InferenceEngine)$'
|
||||
TemplateNonTypeParameter: '^\w*$'
|
||||
ClassTemplate: '^([A-Z][\w]+|element_type_traits)$'
|
||||
TemplateTypeParameter: '^\w*$'
|
||||
ParameterName: '^\w*$'
|
||||
FunctionTemplate: '^(operator.+|\w+)$'
|
||||
TypeAliasName: '^\w+$'
|
||||
VariableReference: '^\w+$'
|
||||
|
||||
EnumName: '^[A-Z][\w]+$'
|
||||
# excepts element_type
|
||||
EnumConstantName: '^([A-Z\d_]+|undefined|dynamic|boolean|bf16|f16|f32|f64|i4|i8|i16|i32|i64|u1|u4|u8|u16|u32|u64|asymmetric|align_corners|round_prefer_floor|round_prefer_ceil|floor|ceil|simple|nearest|linear|linear_onnx|cubic|area|scales|sizes|half_pixel|tf_half_pixel_for_nn|pytorch_half_pixel|asymetric)$'
|
||||
# TODO: align
|
||||
UsingDeclaration: '^.*$'
|
||||
TypedefName: '^.*$'
|
||||
CxxDynamicCastExpression: '^.*$'
|
||||
|
||||
# not needed values
|
||||
ClassTemplatePartialSpecialization: 'XXXX'
|
||||
ConversionFunction: '^.*$'
|
||||
UsingDirective: 'XXXX'
|
||||
ClassAccessSpecifier: '^.*$' # looks like can be fixed
|
||||
TypeReference: '^.*$' # looks like can be fixed
|
||||
CxxBaseSpecifier: '^.*$' # looks like can be fixed
|
||||
TemplateReference: '^.*$'
|
||||
MemberReference: '^.*$'
|
||||
LabelReference: 'XXXX'
|
||||
OverloadedDeclarationReference: '^.*$'
|
||||
InvalidFile: 'XXXX'
|
||||
NoDeclarationFound: 'XXXX'
|
||||
NotImplemented: 'XXXX'
|
||||
InvalidCode: 'XXXX'
|
||||
UnexposedExpression: '^.*$'
|
||||
DeclarationReferenceExpression: '^.*$'
|
||||
MemberReferenceExpression: '^.*$'
|
||||
CallExpression: '^.*$'
|
||||
BlockExpression: 'XXXX'
|
||||
IntegerLiteral: '^.*$'
|
||||
FloatingLiteral: '^.*$'
|
||||
ImaginaryLiteral: 'XXXX'
|
||||
StringLiteral: '^.*$'
|
||||
CharacterLiteral: '^.*$'
|
||||
ParenExpression: '^.*$'
|
||||
UnaryOperator: '^.*$'
|
||||
ArraySubscriptExpression: '^.*$'
|
||||
BinaryOperator: '^.*$'
|
||||
CompoundAssignmentOperator: '^.*$'
|
||||
ConditionalOperator: '^.*$'
|
||||
CstyleCastExpression: '^.*$'
|
||||
CompoundLiteralExpression: 'XXXX'
|
||||
InitListExpression: '^.*$'
|
||||
AddrLabelExpression: 'XXXX'
|
||||
StatementExpression: 'XXXX'
|
||||
GenericSelectionExpression: 'XXXX'
|
||||
GnuNullExpression: 'XXXX'
|
||||
CxxStaticCastExpression: '^.*$'
|
||||
CxxReinterpretCastExpression: '^.*$'
|
||||
CxxConstCastExpression: 'XXXX'
|
||||
CxxFunctionalCastExpression: '^.*$'
|
||||
CxxTypeidExpression: 'XXXX'
|
||||
CxxBoolLiteralExpression: '^.*$'
|
||||
CxxNullPointerLiteralExpression: '^.*$'
|
||||
CxxThisExpression: '^.*$'
|
||||
CxxThrowExpression: '^.*$'
|
||||
CxxNewExpression: '^.*$'
|
||||
CxxDeleteExpression: 'XXXX'
|
||||
CxxUnaryExpression: '^.*$'
|
||||
PackExpansionExpression: '^.*$'
|
||||
SizeOfPackExpression: '^.*$'
|
||||
LambdaExpression: '^.*$'
|
||||
ObjectBoolLiteralExpression: 'XXXX'
|
||||
ObjectSelfExpression: 'XXXX'
|
||||
UnexposedStatement: 'XXXX'
|
||||
LabelStatement: 'XXXX'
|
||||
CompoundStatement: '^.*$'
|
||||
CaseStatement: '^.*$'
|
||||
DefaultStatement: '^.*$'
|
||||
IfStatement: '^.*$'
|
||||
SwitchStatement: '^.*$'
|
||||
WhileStatement: '^.*$'
|
||||
DoStatement: '^.*$'
|
||||
ForStatement: '^.*$'
|
||||
GotoStatement: 'XXXX'
|
||||
IndirectGotoStatement: 'XXXX'
|
||||
ContinueStatement: '^.*$'
|
||||
BreakStatement: '^.*$'
|
||||
ReturnStatement: '^.*$'
|
||||
AsmStatement: 'XXXX'
|
||||
CxxCatchStatement: '^.*$'
|
||||
CxxTryStatement: '^.*$'
|
||||
CxxForRangeStatement: '^.*$'
|
||||
MsAsmStatement: 'XXXX'
|
||||
NullStatement: 'XXXX'
|
||||
DeclarationStatement: '^.*$'
|
||||
TranslationUnit: 'XXXX'
|
||||
UnexposedAttribute: '^.*$'
|
||||
CxxFinalAttribute: '^.*$'
|
||||
CxxOverrideAttribute: '^.*$'
|
||||
AnnotateAttribute: 'XXXX'
|
||||
AsmLabelAttribute: 'XXXX'
|
||||
PackedAttribute: 'XXXX'
|
||||
PureAttribute: 'XXXX'
|
||||
ConstAttribute: 'XXXX'
|
||||
NoduplicateAttribute: 'XXXX'
|
||||
PreprocessingDirective: 'XXXX'
|
||||
MacroDefinition: 'XXXX'
|
||||
MacroInstantiation: 'XXXX'
|
||||
InclusionDirective: 'XXXX'
|
||||
TypeAliasTeplateDeclaration: '^.*$'
|
||||
VariableName:
|
||||
ScopePrefix:
|
||||
Global: ''
|
||||
Static: ''
|
||||
ClassMember: ''
|
||||
DataTypePrefix:
|
||||
String: ''
|
||||
Integer: ''
|
||||
Bool: ''
|
||||
Pointer: ''
|
||||
Pattern: '^.*$'
|
||||
@@ -1,2 +0,0 @@
|
||||
clang==9.0
|
||||
pyyaml
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
class name {
|
||||
public:
|
||||
name() = default;
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
void Function();
|
||||
@@ -1,10 +0,0 @@
|
||||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
class name {
|
||||
public:
|
||||
name() = default;
|
||||
|
||||
void Method();
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(try_find_clang)
|
||||
|
||||
find_package(Clang QUIET)
|
||||
@@ -1,47 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# Usage: ie_option(<option_variable> "description" <initial value or boolean expression> [IF <condition>])
|
||||
|
||||
include (CMakeDependentOption)
|
||||
|
||||
macro (ie_option variable description value)
|
||||
option(${variable} "${description}" ${value})
|
||||
list(APPEND IE_OPTIONS ${variable})
|
||||
endmacro()
|
||||
|
||||
macro (ie_dependent_option variable description def_value condition fallback_value)
|
||||
cmake_dependent_option(${variable} "${description}" ${def_value} "${condition}" ${fallback_value})
|
||||
list(APPEND IE_OPTIONS ${variable})
|
||||
endmacro()
|
||||
|
||||
macro (ie_option_enum variable description value)
|
||||
set(OPTIONS)
|
||||
set(ONE_VALUE_ARGS)
|
||||
set(MULTI_VALUE_ARGS ALLOWED_VALUES)
|
||||
cmake_parse_arguments(IE_OPTION_ENUM "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})
|
||||
|
||||
if(NOT ${value} IN_LIST IE_OPTION_ENUM_ALLOWED_VALUES)
|
||||
message(FATAL_ERROR "variable must be one of ${IE_OPTION_ENUM_ALLOWED_VALUES}")
|
||||
endif()
|
||||
|
||||
list(APPEND IE_OPTIONS ${variable})
|
||||
|
||||
set(${variable} ${value} CACHE STRING "${description}")
|
||||
set_property(CACHE ${variable} PROPERTY STRINGS ${IE_OPTION_ENUM_ALLOWED_VALUES})
|
||||
endmacro()
|
||||
|
||||
function (print_enabled_features)
|
||||
if(NOT COMMAND set_ci_build_number)
|
||||
message(FATAL_ERROR "CI_BUILD_NUMBER is not set yet")
|
||||
endif()
|
||||
|
||||
message(STATUS "Inference Engine enabled features: ")
|
||||
message(STATUS "")
|
||||
message(STATUS " CI_BUILD_NUMBER: ${CI_BUILD_NUMBER}")
|
||||
foreach(_var ${IE_OPTIONS})
|
||||
message(STATUS " ${_var} = ${${_var}}")
|
||||
endforeach()
|
||||
message(STATUS "")
|
||||
endfunction()
|
||||
@@ -1,78 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(CMakeParseArguments)
|
||||
include(CPackComponent)
|
||||
|
||||
#
|
||||
# ie_cpack_set_library_dir()
|
||||
#
|
||||
# Set library directory for cpack
|
||||
#
|
||||
function(ie_cpack_set_library_dir)
|
||||
if(WIN32)
|
||||
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH runtime/bin/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
set(IE_CPACK_ARCHIVE_PATH runtime/lib/${ARCH_FOLDER}/$<CONFIG> PARENT_SCOPE)
|
||||
else()
|
||||
set(IE_CPACK_LIBRARY_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
set(IE_CPACK_RUNTIME_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
set(IE_CPACK_ARCHIVE_PATH runtime/lib/${ARCH_FOLDER} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
ie_cpack_set_library_dir()
|
||||
|
||||
#
|
||||
# ie_cpack_add_component(NAME ...)
|
||||
#
|
||||
# Wraps original `cpack_add_component` and adds component to internal IE list
|
||||
#
|
||||
unset(IE_CPACK_COMPONENTS_ALL CACHE)
|
||||
macro(ie_cpack_add_component NAME)
|
||||
list(APPEND IE_CPACK_COMPONENTS_ALL ${NAME})
|
||||
set(IE_CPACK_COMPONENTS_ALL "${IE_CPACK_COMPONENTS_ALL}" CACHE STRING "" FORCE)
|
||||
|
||||
cpack_add_component(${NAME} ${args})
|
||||
endmacro()
|
||||
|
||||
# create test component
|
||||
if(ENABLE_TESTS)
|
||||
cpack_add_component(tests DISABLED)
|
||||
endif()
|
||||
|
||||
macro(ie_cpack)
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
set(CPACK_SOURCE_GENERATOR "")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenVINO toolkit")
|
||||
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED OFF)
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
|
||||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) # multiple components
|
||||
set(CPACK_PACKAGE_VENDOR "Intel Corporation")
|
||||
set(CPACK_VERBATIM_VARIABLES ON)
|
||||
set(CPACK_COMPONENTS_ALL ${ARGN})
|
||||
if (NOT DEFINED CPACK_STRIP_FILES)
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
endif()
|
||||
set(CPACK_THREADS 8)
|
||||
|
||||
string(REPLACE "/" "_" CPACK_PACKAGE_VERSION "${CI_BUILD_NUMBER}")
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_NAME inference-engine_${CMAKE_BUILD_TYPE})
|
||||
else()
|
||||
set(CPACK_PACKAGE_NAME inference-engine)
|
||||
endif()
|
||||
|
||||
foreach(ver IN LISTS MAJOR MINOR PATCH)
|
||||
if(DEFINED IE_VERSION_${ver})
|
||||
set(CPACK_PACKAGE_VERSION_${ver} ${IE_VERSION_${ver}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(OS_FOLDER)
|
||||
set(CPACK_SYSTEM_NAME "${OS_FOLDER}")
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
endmacro()
|
||||
@@ -1,57 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
foreach(var IE_DEVICE_MAPPING IE_PLUGINS_HPP_HEADER IE_PLUGINS_HPP_HEADER_IN)
|
||||
if(NOT DEFINED ${var})
|
||||
message(FATAL_ERROR "${var} is required, but not defined")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# configure variables
|
||||
|
||||
set(IE_PLUGINS_DECLARATIONS "")
|
||||
set(IE_PLUGINS_MAP_DEFINITION
|
||||
" static const std::map<Key, Value> plugins_hpp = {")
|
||||
|
||||
foreach(dev_map IN LISTS IE_DEVICE_MAPPING)
|
||||
string(REPLACE ":" ";" dev_map "${dev_map}")
|
||||
list(GET dev_map 0 mapped_dev_name)
|
||||
list(GET dev_map 1 actual_dev_name)
|
||||
|
||||
# common
|
||||
set(_IE_CREATE_PLUGIN_FUNC "CreatePluginEngine${actual_dev_name}")
|
||||
set(_IE_CREATE_EXTENSION_FUNC "CreateExtensionShared${actual_dev_name}")
|
||||
|
||||
# declarations
|
||||
set(IE_PLUGINS_DECLARATIONS "${IE_PLUGINS_DECLARATIONS}
|
||||
IE_DEFINE_PLUGIN_CREATE_FUNCTION_DECLARATION(${_IE_CREATE_PLUGIN_FUNC});")
|
||||
if(${actual_dev_name}_AS_EXTENSION)
|
||||
set(IE_PLUGINS_DECLARATIONS "${IE_PLUGINS_DECLARATIONS}
|
||||
IE_DEFINE_EXTENSION_CREATE_FUNCTION_DECLARATION(${_IE_CREATE_EXTENSION_FUNC});")
|
||||
else()
|
||||
set(_IE_CREATE_EXTENSION_FUNC "nullptr")
|
||||
endif()
|
||||
|
||||
# definitions
|
||||
set(dev_config "{")
|
||||
if(${mapped_dev_name}_CONFIG)
|
||||
foreach(props IN LISTS ${mapped_dev_name}_CONFIG)
|
||||
string(REPLACE ":" ";" props "${props}")
|
||||
|
||||
list(GET props 0 key)
|
||||
list(GET props 1 value)
|
||||
|
||||
set(dev_config "${dev_config} { \"${key}\", \"${value}\" }, ")
|
||||
endforeach()
|
||||
endif()
|
||||
set(dev_config "${dev_config}}")
|
||||
|
||||
set(IE_PLUGINS_MAP_DEFINITION "${IE_PLUGINS_MAP_DEFINITION}
|
||||
{ \"${mapped_dev_name}\", Value { ${_IE_CREATE_PLUGIN_FUNC}, ${_IE_CREATE_EXTENSION_FUNC}, ${dev_config} } },")
|
||||
endforeach()
|
||||
|
||||
set(IE_PLUGINS_MAP_DEFINITION "${IE_PLUGINS_MAP_DEFINITION}
|
||||
};\n")
|
||||
|
||||
configure_file("${IE_PLUGINS_HPP_HEADER_IN}" "${IE_PLUGINS_HPP_HEADER}" @ONLY)
|
||||
@@ -1,322 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
set(PLUGIN_FILES "" CACHE INTERNAL "")
|
||||
|
||||
function(ie_plugin_get_file_name target_name library_name)
|
||||
set(LIB_PREFIX "${CMAKE_SHARED_MODULE_PREFIX}")
|
||||
set(LIB_SUFFIX "${IE_BUILD_POSTFIX}${CMAKE_SHARED_MODULE_SUFFIX}")
|
||||
|
||||
set("${library_name}" "${LIB_PREFIX}${target_name}${LIB_SUFFIX}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(NOT TARGET ie_plugins)
|
||||
add_custom_target(ie_plugins)
|
||||
endif()
|
||||
|
||||
#
|
||||
# ie_add_plugin(NAME <targetName>
|
||||
# DEVICE_NAME <deviceName>
|
||||
# [PSEUDO_PLUGIN_FOR <actual_device>]
|
||||
# [AS_EXTENSION]
|
||||
# [DEFAULT_CONFIG <key:value;...>]
|
||||
# [SOURCES <sources>]
|
||||
# [OBJECT_LIBRARIES <object_libs>]
|
||||
# [VERSION_DEFINES_FOR <source>]
|
||||
# [SKIP_INSTALL]
|
||||
# [ADD_CLANG_FORMAT]
|
||||
# )
|
||||
#
|
||||
function(ie_add_plugin)
|
||||
set(options SKIP_INSTALL ADD_CLANG_FORMAT AS_EXTENSION)
|
||||
set(oneValueArgs NAME DEVICE_NAME VERSION_DEFINES_FOR PSEUDO_PLUGIN_FOR)
|
||||
set(multiValueArgs DEFAULT_CONFIG SOURCES OBJECT_LIBRARIES CPPLINT_FILTERS)
|
||||
cmake_parse_arguments(IE_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT IE_PLUGIN_NAME)
|
||||
message(FATAL_ERROR "Please, specify plugin target name")
|
||||
endif()
|
||||
|
||||
if(NOT IE_PLUGIN_DEVICE_NAME)
|
||||
message(FATAL_ERROR "Please, specify device name for ${IE_PLUGIN_NAME}")
|
||||
endif()
|
||||
|
||||
# create and configure target
|
||||
|
||||
if(NOT IE_PLUGIN_PSEUDO_PLUGIN_FOR)
|
||||
if(IE_PLUGIN_VERSION_DEFINES_FOR)
|
||||
addVersionDefines(${IE_PLUGIN_VERSION_DEFINES_FOR} CI_BUILD_NUMBER)
|
||||
endif()
|
||||
|
||||
set(input_files ${IE_PLUGIN_SOURCES})
|
||||
foreach(obj_lib IN LISTS IE_PLUGIN_OBJECT_LIBRARIES)
|
||||
list(APPEND input_files $<TARGET_OBJECTS:${obj_lib}>)
|
||||
add_cpplint_target(${obj_lib}_cpplint FOR_TARGETS ${obj_lib})
|
||||
endforeach()
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(library_type MODULE)
|
||||
else()
|
||||
set(library_type STATIC)
|
||||
endif()
|
||||
|
||||
add_library(${IE_PLUGIN_NAME} ${library_type} ${input_files})
|
||||
|
||||
target_compile_definitions(${IE_PLUGIN_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
# to distinguish functions creating plugin objects
|
||||
target_compile_definitions(${IE_PLUGIN_NAME} PRIVATE
|
||||
IE_CREATE_PLUGIN=CreatePluginEngine${IE_PLUGIN_DEVICE_NAME})
|
||||
if(IE_PLUGIN_AS_EXTENSION)
|
||||
# to distinguish functions creating extensions objects
|
||||
target_compile_definitions(${IE_PLUGIN_NAME} PRIVATE
|
||||
IE_CREATE_EXTENSION=CreateExtensionShared${IE_PLUGIN_DEVICE_NAME})
|
||||
endif()
|
||||
# install static plugins
|
||||
ov_install_static_lib(${IE_PLUGIN_NAME} core)
|
||||
endif()
|
||||
|
||||
ie_add_vs_version_file(NAME ${IE_PLUGIN_NAME}
|
||||
FILEDESCRIPTION "Inference Engine ${IE_PLUGIN_DEVICE_NAME} device plugin library")
|
||||
|
||||
if(TARGET IE::inference_engine_plugin_api)
|
||||
target_link_libraries(${IE_PLUGIN_NAME} PRIVATE IE::inference_engine_plugin_api)
|
||||
else()
|
||||
target_link_libraries(${IE_PLUGIN_NAME} PRIVATE inference_engine_plugin_api)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(${IE_PLUGIN_NAME} PROPERTIES COMPILE_PDB_NAME ${IE_PLUGIN_NAME})
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CROSSCOMPILING)
|
||||
target_link_options(${IE_PLUGIN_NAME} PRIVATE -Wl,--unresolved-symbols=ignore-in-shared-libs)
|
||||
endif()
|
||||
|
||||
set(custom_filter "")
|
||||
foreach(filter IN LISTS IE_PLUGIN_CPPLINT_FILTERS)
|
||||
string(CONCAT custom_filter "${custom_filter}" "," "${filter}")
|
||||
endforeach()
|
||||
|
||||
if (IE_PLUGIN_ADD_CLANG_FORMAT)
|
||||
add_clang_format_target(${IE_PLUGIN_NAME}_clang FOR_TARGETS ${IE_PLUGIN_NAME})
|
||||
else()
|
||||
add_cpplint_target(${IE_PLUGIN_NAME}_cpplint FOR_TARGETS ${IE_PLUGIN_NAME} CUSTOM_FILTERS ${custom_filter})
|
||||
endif()
|
||||
|
||||
add_dependencies(ie_plugins ${IE_PLUGIN_NAME})
|
||||
if(TARGET inference_engine_preproc AND BUILD_SHARED_LIBS)
|
||||
add_dependencies(${IE_PLUGIN_NAME} inference_engine_preproc)
|
||||
endif()
|
||||
|
||||
# fake dependencies to build in the following order:
|
||||
# IE -> IE readers -> IE inference plugins -> IE-based apps
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(TARGET ir_ngraph_frontend)
|
||||
add_dependencies(${IE_PLUGIN_NAME} ir_ngraph_frontend)
|
||||
endif()
|
||||
if(TARGET inference_engine_ir_v7_reader)
|
||||
add_dependencies(${IE_PLUGIN_NAME} inference_engine_ir_v7_reader)
|
||||
endif()
|
||||
if(TARGET onnx_ngraph_frontend)
|
||||
add_dependencies(${IE_PLUGIN_NAME} onnx_ngraph_frontend)
|
||||
endif()
|
||||
if(TARGET paddlepaddle_ngraph_frontend)
|
||||
add_dependencies(${IE_PLUGIN_NAME} paddlepaddle_ngraph_frontend)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install rules
|
||||
if(NOT IE_PLUGIN_SKIP_INSTALL)
|
||||
string(TOLOWER "${IE_PLUGIN_DEVICE_NAME}" install_component)
|
||||
ie_cpack_add_component(${install_component} REQUIRED DEPENDS core)
|
||||
|
||||
install(TARGETS ${IE_PLUGIN_NAME}
|
||||
LIBRARY DESTINATION ${IE_CPACK_RUNTIME_PATH}
|
||||
COMPONENT ${install_component})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check that plugin with such name is not registered
|
||||
|
||||
foreach(plugin_entry IN LISTS PLUGIN_FILES)
|
||||
string(REPLACE ":" ";" plugin_entry "${plugin_entry}")
|
||||
list(GET plugin_entry -1 library_name)
|
||||
list(GET plugin_entry 0 plugin_name)
|
||||
if(plugin_name STREQUAL "${IE_PLUGIN_DEVICE_NAME}" AND
|
||||
NOT library_name STREQUAL ${IE_PLUGIN_NAME})
|
||||
message(FATAL_ERROR "${IE_PLUGIN_NAME} and ${library_name} are both registered as ${plugin_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# append plugin to the list to register
|
||||
|
||||
list(APPEND PLUGIN_FILES "${IE_PLUGIN_DEVICE_NAME}:${IE_PLUGIN_NAME}")
|
||||
set(PLUGIN_FILES "${PLUGIN_FILES}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_CONFIG "${IE_PLUGIN_DEFAULT_CONFIG}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_PSEUDO_PLUGIN_FOR "${IE_PLUGIN_PSEUDO_PLUGIN_FOR}" CACHE INTERNAL "" FORCE)
|
||||
set(${IE_PLUGIN_DEVICE_NAME}_AS_EXTENSION "${IE_PLUGIN_AS_EXTENSION}" CACHE INTERNAL "" FORCE)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ie_register_plugins_dynamic(MAIN_TARGET <main target name>
|
||||
# POSSIBLE_PLUGINS <list of plugins which can be build by this repo>)
|
||||
#
|
||||
macro(ie_register_plugins_dynamic)
|
||||
set(options)
|
||||
set(oneValueArgs MAIN_TARGET)
|
||||
set(multiValueArgs POSSIBLE_PLUGINS)
|
||||
cmake_parse_arguments(IE_REGISTER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT IE_REGISTER_MAIN_TARGET)
|
||||
message(FATAL_ERROR "Please, define MAIN_TARGET")
|
||||
endif()
|
||||
|
||||
set(plugins_to_remove ${IE_REGISTER_POSSIBLE_PLUGINS})
|
||||
set(plugin_files_local)
|
||||
set(config_output_file "$<TARGET_FILE_DIR:${IE_REGISTER_MAIN_TARGET}>/plugins.xml")
|
||||
|
||||
foreach(plugin IN LISTS plugins_to_remove)
|
||||
add_custom_command(TARGET ${IE_REGISTER_MAIN_TARGET} POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}"
|
||||
-D "IE_CONFIG_OUTPUT_FILE=${config_output_file}"
|
||||
-D "IE_PLUGIN_NAME=${plugin}"
|
||||
-D "IE_CONFIGS_DIR=${CMAKE_BINARY_DIR}/plugins"
|
||||
-P "${IEDevScripts_DIR}/plugins/unregister_plugin_cmake.cmake"
|
||||
COMMENT
|
||||
"Remove ${plugin} from the plugins.xml file"
|
||||
VERBATIM)
|
||||
endforeach()
|
||||
|
||||
foreach(name IN LISTS PLUGIN_FILES)
|
||||
string(REPLACE ":" ";" name "${name}")
|
||||
list(LENGTH name length)
|
||||
if(NOT ${length} EQUAL 2)
|
||||
message(FATAL_ERROR "Unexpected error, please, contact developer of this script")
|
||||
endif()
|
||||
list(GET name 0 device_name)
|
||||
list(GET name 1 name)
|
||||
|
||||
# create plugin file
|
||||
set(config_file_name "${CMAKE_BINARY_DIR}/plugins/${device_name}.xml")
|
||||
ie_plugin_get_file_name(${name} library_name)
|
||||
|
||||
add_custom_command(TARGET ${IE_REGISTER_MAIN_TARGET} POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}"
|
||||
-D "IE_CONFIG_OUTPUT_FILE=${config_file_name}"
|
||||
-D "IE_DEVICE_NAME=${device_name}"
|
||||
-D "IE_PLUGIN_PROPERTIES=${${device_name}_CONFIG}"
|
||||
-D "IE_PLUGIN_LIBRARY_NAME=${library_name}"
|
||||
-P "${IEDevScripts_DIR}/plugins/create_plugin_file.cmake"
|
||||
COMMENT "Register ${device_name} device as ${library_name}"
|
||||
VERBATIM)
|
||||
|
||||
list(APPEND plugin_files_local "${config_file_name}")
|
||||
endforeach()
|
||||
|
||||
add_custom_command(TARGET ${IE_REGISTER_MAIN_TARGET} POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}"
|
||||
-D "CMAKE_SHARED_MODULE_PREFIX=${CMAKE_SHARED_MODULE_PREFIX}"
|
||||
-D "IE_CONFIG_OUTPUT_FILE=${config_output_file}"
|
||||
-D "IE_CONFIGS_DIR=${CMAKE_BINARY_DIR}/plugins"
|
||||
-P "${IEDevScripts_DIR}/plugins/register_plugin_cmake.cmake"
|
||||
COMMENT
|
||||
"Registering plugins to plugins.xml config file"
|
||||
VERBATIM)
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# ie_register_plugins_static(MAIN_TARGET <main target name>
|
||||
# POSSIBLE_PLUGINS <list of plugins which can be build by this repo>)
|
||||
#
|
||||
macro(ie_register_plugins_static)
|
||||
set(options)
|
||||
set(oneValueArgs MAIN_TARGET)
|
||||
set(multiValueArgs POSSIBLE_PLUGINS)
|
||||
cmake_parse_arguments(IE_REGISTER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
set(device_mapping)
|
||||
set(device_configs)
|
||||
set(as_extension)
|
||||
foreach(name IN LISTS PLUGIN_FILES)
|
||||
string(REPLACE ":" ";" name "${name}")
|
||||
list(LENGTH name length)
|
||||
if(NOT ${length} EQUAL 2)
|
||||
message(FATAL_ERROR "Unexpected error, please, contact developer of this script")
|
||||
endif()
|
||||
|
||||
# create device mapping: preudo device => actual device
|
||||
list(GET name 0 device_name)
|
||||
if(${device_name}_PSEUDO_PLUGIN_FOR)
|
||||
list(APPEND device_mapping "${device_name}:${${device_name}_PSEUDO_PLUGIN_FOR}")
|
||||
else()
|
||||
list(APPEND device_mapping "${device_name}:${device_name}")
|
||||
endif()
|
||||
|
||||
# register plugin as extension
|
||||
if(${device_name}_AS_EXTENSION)
|
||||
list(APPEND as_extension -D "${device_name}_AS_EXTENSION=ON")
|
||||
endif()
|
||||
|
||||
# add default plugin config options
|
||||
if(${device_name}_CONFIG)
|
||||
list(APPEND device_configs -D "${device_name}_CONFIG=${${device_name}_CONFIG}")
|
||||
endif()
|
||||
|
||||
# link plugin to inference_engine static version
|
||||
list(GET name 1 plugin_name)
|
||||
target_link_libraries(${IE_REGISTER_MAIN_TARGET} PRIVATE ${plugin_name})
|
||||
endforeach()
|
||||
|
||||
set(ie_plugins_hpp "${CMAKE_CURRENT_BINARY_DIR}/ie_plugins.hpp")
|
||||
set(plugins_hpp_in "${IEDevScripts_DIR}/plugins/plugins.hpp.in")
|
||||
|
||||
add_custom_command(OUTPUT "${ie_plugins_hpp}"
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}"
|
||||
-D "IE_DEVICE_MAPPING=${device_mapping}"
|
||||
-D "IE_PLUGINS_HPP_HEADER_IN=${plugins_hpp_in}"
|
||||
-D "IE_PLUGINS_HPP_HEADER=${ie_plugins_hpp}"
|
||||
${device_configs}
|
||||
${as_extension}
|
||||
-P "${IEDevScripts_DIR}/plugins/create_plugins_hpp.cmake"
|
||||
DEPENDS
|
||||
"${plugins_hpp_in}"
|
||||
"${IEDevScripts_DIR}/plugins/create_plugins_hpp.cmake"
|
||||
COMMENT
|
||||
"Generate ie_plugins.hpp for static build"
|
||||
VERBATIM)
|
||||
|
||||
# add dependency for object files
|
||||
get_target_property(sources ${IE_REGISTER_MAIN_TARGET} SOURCES)
|
||||
foreach(source IN LISTS sources)
|
||||
if("${source}" MATCHES "\\$\\<TARGET_OBJECTS\\:([A-Za-z0-9_]*)\\>")
|
||||
# object library
|
||||
set(obj_library ${CMAKE_MATCH_1})
|
||||
get_target_property(obj_sources ${obj_library} SOURCES)
|
||||
list(APPEND patched_sources ${obj_sources})
|
||||
else()
|
||||
# usual source
|
||||
list(APPEND patched_sources ${source})
|
||||
endif()
|
||||
endforeach()
|
||||
set_source_files_properties(${patched_sources} PROPERTIES OBJECT_DEPENDS ${ie_plugins_hpp})
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# ie_register_plugins(MAIN_TARGET <main target name>
|
||||
# POSSIBLE_PLUGINS <list of plugins which can be build by this repo>)
|
||||
#
|
||||
macro(ie_register_plugins)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
ie_register_plugins_dynamic(${ARGN})
|
||||
else()
|
||||
ie_register_plugins_static(${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
|
||||
|
||||
namespace {
|
||||
@IE_PLUGINS_DECLARATIONS@
|
||||
|
||||
struct Value {
|
||||
InferenceEngine::CreatePluginEngineFunc * m_create_plugin_func;
|
||||
InferenceEngine::CreateExtensionFunc * m_create_extension_func;
|
||||
std::map<std::string, std::string> m_default_config;
|
||||
};
|
||||
|
||||
using Key = std::string;
|
||||
using PluginsStaticRegistry = std::map<Key, Value>;
|
||||
|
||||
const std::map<Key, Value> getStaticPluginsRegistry() {
|
||||
@IE_PLUGINS_MAP_DEFINITION@
|
||||
return plugins_hpp;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -1,65 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(file_content
|
||||
"<ie>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</ie>")
|
||||
|
||||
if(NOT EXISTS "${IE_CONFIG_OUTPUT_FILE}")
|
||||
file(WRITE "${IE_CONFIG_OUTPUT_FILE}" "${file_content}")
|
||||
endif()
|
||||
|
||||
# get list of plugin files
|
||||
file(GLOB plugin_files "${IE_CONFIGS_DIR}/*.xml")
|
||||
|
||||
function(check_plugin_exists plugin_name outvar)
|
||||
set(${outvar} OFF PARENT_SCOPE)
|
||||
|
||||
# check if config file already has this plugin
|
||||
file(STRINGS "${IE_CONFIG_OUTPUT_FILE}" content REGEX "plugin .*=\"")
|
||||
|
||||
foreach(line IN LISTS content)
|
||||
string(REGEX MATCH "location=\"([^\"]*)\"" location "${line}")
|
||||
get_filename_component(location "${CMAKE_MATCH_1}" NAME_WE)
|
||||
|
||||
if("${CMAKE_SHARED_MODULE_PREFIX}${plugin_name}" MATCHES "${location}")
|
||||
# plugin has already registered
|
||||
set(${outvar} ON PARENT_SCOPE)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
set(plugin_files_to_add)
|
||||
foreach(plugin_file IN LISTS plugin_files)
|
||||
get_filename_component(plugin_name "${plugin_file}" NAME_WE)
|
||||
check_plugin_exists("${plugin_name}" exists)
|
||||
|
||||
if(NOT exists)
|
||||
list(APPEND plugin_files_to_add "${plugin_file}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# add plugin
|
||||
set(newContent "")
|
||||
file(STRINGS "${IE_CONFIG_OUTPUT_FILE}" content)
|
||||
|
||||
foreach(line IN LISTS content)
|
||||
if("${line}" MATCHES "</plugins>")
|
||||
foreach(plugin_file IN LISTS plugin_files_to_add)
|
||||
file(READ "${plugin_file}" content)
|
||||
set(newContent "${newContent}
|
||||
${content}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(newContent)
|
||||
set(newContent "${newContent}\n${line}")
|
||||
else()
|
||||
set(newContent "${line}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(WRITE "${IE_CONFIG_OUTPUT_FILE}" "${newContent}")
|
||||
@@ -1,35 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(NOT EXISTS "${IE_CONFIG_OUTPUT_FILE}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# remove plugin file
|
||||
file(REMOVE "${IE_CONFIGS_DIR}/${IE_PLUGIN_NAME}.xml")
|
||||
|
||||
# remove plugin
|
||||
set(newContent "")
|
||||
file(STRINGS "${IE_CONFIG_OUTPUT_FILE}" content)
|
||||
|
||||
set(skip_plugin OFF)
|
||||
foreach(line IN LISTS content)
|
||||
if("${line}" MATCHES "${IE_PLUGIN_NAME}")
|
||||
set(skip_plugin ON)
|
||||
endif()
|
||||
|
||||
if(NOT skip_plugin)
|
||||
if(newContent)
|
||||
set(newContent "${newContent}\n${line}")
|
||||
else()
|
||||
set(newContent "${line}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("${line}" MATCHES "</plugin>")
|
||||
set(skip_plugin OFF)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(WRITE "${IE_CONFIG_OUTPUT_FILE}" "${newContent}")
|
||||
@@ -1,183 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# TBB_FOUND should not be set explicitly. It is defined automatically by CMake.
|
||||
# Handling of TBB_VERSION is in TBBConfigVersion.cmake.
|
||||
|
||||
if (NOT TBB_FIND_COMPONENTS)
|
||||
set(TBB_FIND_COMPONENTS "tbb;tbbmalloc;tbbmalloc_proxy")
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
set(TBB_FIND_REQUIRED_${_tbb_component} 1)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Add components with internal dependencies: tbbmalloc_proxy -> tbbmalloc
|
||||
list(FIND TBB_FIND_COMPONENTS tbbmalloc_proxy _tbbmalloc_proxy_ix)
|
||||
if (NOT _tbbmalloc_proxy_ix EQUAL -1)
|
||||
list(FIND TBB_FIND_COMPONENTS tbbmalloc _tbbmalloc_ix)
|
||||
if (_tbbmalloc_ix EQUAL -1)
|
||||
list(APPEND TBB_FIND_COMPONENTS tbbmalloc)
|
||||
set(TBB_FIND_REQUIRED_tbbmalloc ${TBB_FIND_REQUIRED_tbbmalloc_proxy})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT TBBROOT)
|
||||
if(DEFINED ENV{TBBROOT})
|
||||
set (TBBROOT $ENV{TBBROOT})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(_tbb_root ${TBBROOT})
|
||||
|
||||
set(_tbb_x32_subdir ia32)
|
||||
set(_tbb_x64_subdir intel64)
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_tbb_arch_subdir ${_tbb_x64_subdir})
|
||||
else()
|
||||
set(_tbb_arch_subdir ${_tbb_x32_subdir})
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_LOADED)
|
||||
set(_tbb_compiler_id ${CMAKE_CXX_COMPILER_ID})
|
||||
set(_tbb_compiler_ver ${CMAKE_CXX_COMPILER_VERSION})
|
||||
elseif (CMAKE_C_COMPILER_LOADED)
|
||||
set(_tbb_compiler_id ${CMAKE_C_COMPILER_ID})
|
||||
set(_tbb_compiler_ver ${CMAKE_C_COMPILER_VERSION})
|
||||
endif()
|
||||
|
||||
# For non-GCC compilers try to find version of system GCC to choose right compiler subdirectory.
|
||||
if (NOT _tbb_compiler_id STREQUAL "GNU")
|
||||
execute_process(COMMAND gcc --version OUTPUT_VARIABLE _tbb_gcc_ver_output ERROR_QUIET)
|
||||
string(REGEX REPLACE ".*gcc.*([0-9]+\\.[0-9]+)\\.[0-9]+.*" "\\1" _tbb_compiler_ver "${_tbb_gcc_ver_output}")
|
||||
if (NOT _tbb_compiler_ver)
|
||||
message(FATAL_ERROR "This Intel TBB package is intended to be used only environment with available 'gcc'")
|
||||
endif()
|
||||
unset(_tbb_gcc_ver_output)
|
||||
endif()
|
||||
|
||||
if (EXISTS "${_tbb_root}/lib/${_tbb_arch_subdir}")
|
||||
set(_tbb_lib ${_tbb_root}/lib/${_tbb_arch_subdir})
|
||||
set(_tbb_inc ${_tbb_root}/include)
|
||||
|
||||
file(GLOB _tbb_gcc_versions_available RELATIVE ${_tbb_lib} ${_tbb_lib}/*)
|
||||
# shall we check _tbb_gcc_versions_available is not empty?
|
||||
foreach (_tbb_gcc_version ${_tbb_gcc_versions_available})
|
||||
string(SUBSTRING ${_tbb_gcc_version} 3 -1 _tbb_gcc_version_number)
|
||||
if (NOT _tbb_compiler_ver VERSION_LESS _tbb_gcc_version_number)
|
||||
set(_tbb_compiler_subdir ${_tbb_gcc_version})
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
if (TBBROOT)
|
||||
set(__tbb_hint_path "${TBBROOT}")
|
||||
else()
|
||||
set(__tbb_hint_path "/non/existing/path")
|
||||
endif()
|
||||
|
||||
# try to find TBB in the system
|
||||
find_library(_tbb_lib NAMES tbb
|
||||
HINTS "${__tbb_hint_path}"
|
||||
PATH_SUFFIXES lib lib64)
|
||||
find_path(_tbb_inc NAMES tbb.h
|
||||
HINTS "${__tbb_hint_path}"
|
||||
PATH_SUFFIXES include tbb include/tbb)
|
||||
unset(__tbb_hint_path)
|
||||
|
||||
if (NOT _tbb_lib OR NOT _tbb_inc)
|
||||
message("FATAL_ERROR" "Cannot find TBB")
|
||||
endif()
|
||||
|
||||
get_filename_component(_tbb_lib "${_tbb_lib}" PATH)
|
||||
get_filename_component(_tbb_inc "${_tbb_inc}" PATH)
|
||||
|
||||
set(_tbb_arch_subdir "")
|
||||
set(_tbb_compiler_subdir "")
|
||||
endif()
|
||||
|
||||
unset(_tbb_gcc_version_number)
|
||||
unset(_tbb_compiler_id)
|
||||
unset(_tbb_compiler_ver)
|
||||
|
||||
# Now we check that all the needed component are present
|
||||
get_filename_component(_tbb_lib_path "${_tbb_lib}/${_tbb_compiler_subdir}" ABSOLUTE)
|
||||
|
||||
if (TBB_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# detect version
|
||||
find_file(_tbb_def_header tbb_stddef.h HINTS "${_tbb_root}/include/tbb")
|
||||
|
||||
if (_tbb_def_header)
|
||||
file(READ "${_tbb_def_header}" _tbb_def_content)
|
||||
string(REGEX MATCH "TBB_VERSION_MAJOR[ ]*[0-9]*" _tbb_version_major ${_tbb_def_content})
|
||||
string(REGEX MATCH "[0-9][0-9]*" _tbb_version_major ${_tbb_version_major})
|
||||
|
||||
string(REGEX MATCH "TBB_VERSION_MINOR[ ]*[0-9]" _tbb_version_minor ${_tbb_def_content})
|
||||
string(REGEX MATCH "[0-9][0-9]*" _tbb_version_minor ${_tbb_version_minor})
|
||||
|
||||
set(TBB_VERSION "${_tbb_version_major}.${_tbb_version_minor}")
|
||||
else()
|
||||
set(TBB_VERSION "")
|
||||
endif()
|
||||
|
||||
foreach (_tbb_soversion 2 12)
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
set(_tbb_release_lib
|
||||
"${_tbb_lib_path}/lib${_tbb_component}.so.${_tbb_soversion}")
|
||||
set(_tbb_debug_lib
|
||||
"${_tbb_lib_path}/lib${_tbb_component}_debug.so.${_tbb_soversion}")
|
||||
|
||||
# oneDNN change: check library existence (BUILD_MODE related only, not both)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_CMAKE_BUILD_TYPE)
|
||||
if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
||||
if (EXISTS "${_tbb_debug_lib}")
|
||||
set(_lib_exists TRUE)
|
||||
elseif (EXISTS "${_tbb_release_lib}")
|
||||
message(FATAL_ERROR
|
||||
"Intel TBB release library is found here: ${_tbb_release_lib}. "
|
||||
"But the debug library
|
||||
(lib${_tbb_component}_debug.so.${_tbb_soversion}) is missing.")
|
||||
endif()
|
||||
else()
|
||||
if (EXISTS "${_tbb_release_lib}")
|
||||
set(_lib_exists TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (_lib_exists)
|
||||
if (NOT TARGET TBB::${_tbb_component})
|
||||
add_library(TBB::${_tbb_component} SHARED IMPORTED)
|
||||
set_target_properties(TBB::${_tbb_component} PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG"
|
||||
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"
|
||||
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_inc}")
|
||||
|
||||
# Add internal dependencies for imported targets: TBB::tbbmalloc_proxy -> TBB::tbbmalloc
|
||||
if (_tbb_component STREQUAL tbbmalloc_proxy)
|
||||
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
|
||||
endif()
|
||||
|
||||
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
|
||||
set(TBB_${_tbb_component}_FOUND 1)
|
||||
endif()
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
if (NOT _lib_exists AND TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
|
||||
message(FATAL_ERROR "Missed required Intel TBB component: ${_tbb_component}")
|
||||
endif()
|
||||
|
||||
unset(_tbb_x32_subdir)
|
||||
unset(_tbb_x64_subdir)
|
||||
unset(_tbb_arch_subdir)
|
||||
unset(_tbb_compiler_subdir)
|
||||
unset(_tbbmalloc_proxy_ix)
|
||||
unset(_tbbmalloc_ix)
|
||||
unset(_tbb_lib_path)
|
||||
unset(_tbb_release_lib)
|
||||
unset(_tbb_debug_lib)
|
||||
@@ -1,102 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# TBB_FOUND should not be set explicitly. It is defined automatically by CMake.
|
||||
# Handling of TBB_VERSION is in TBBConfigVersion.cmake.
|
||||
|
||||
if (NOT TBB_FIND_COMPONENTS)
|
||||
set(TBB_FIND_COMPONENTS "tbb;tbbmalloc;tbbmalloc_proxy")
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
set(TBB_FIND_REQUIRED_${_tbb_component} 1)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Add components with internal dependencies: tbbmalloc_proxy -> tbbmalloc
|
||||
list(FIND TBB_FIND_COMPONENTS tbbmalloc_proxy _tbbmalloc_proxy_ix)
|
||||
if (NOT _tbbmalloc_proxy_ix EQUAL -1)
|
||||
list(FIND TBB_FIND_COMPONENTS tbbmalloc _tbbmalloc_ix)
|
||||
if (_tbbmalloc_ix EQUAL -1)
|
||||
list(APPEND TBB_FIND_COMPONENTS tbbmalloc)
|
||||
set(TBB_FIND_REQUIRED_tbbmalloc ${TBB_FIND_REQUIRED_tbbmalloc_proxy})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT TBBROOT)
|
||||
if(DEFINED ENV{TBBROOT})
|
||||
set (TBBROOT $ENV{TBBROOT})
|
||||
else()
|
||||
message("FATAL_ERROR" "TBBROOT is unset")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(_tbb_root ${TBBROOT})
|
||||
|
||||
set(_tbb_x32_subdir .)
|
||||
set(_tbb_x64_subdir .)
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_tbb_arch_subdir ${_tbb_x64_subdir})
|
||||
else()
|
||||
set(_tbb_arch_subdir ${_tbb_x32_subdir})
|
||||
endif()
|
||||
|
||||
set(_tbb_compiler_subdir .)
|
||||
|
||||
get_filename_component(_tbb_lib_path "${_tbb_root}/lib/${_tbb_arch_subdir}/${_tbb_compiler_subdir}" ABSOLUTE)
|
||||
|
||||
if (TBB_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# detect version
|
||||
find_file(_tbb_def_header tbb_stddef.h HINTS "${_tbb_root}/include/tbb")
|
||||
|
||||
if (_tbb_def_header)
|
||||
file(READ "${_tbb_def_header}" _tbb_def_content)
|
||||
string(REGEX MATCH "TBB_VERSION_MAJOR[ ]*[0-9]*" _tbb_version_major ${_tbb_def_content})
|
||||
string(REGEX MATCH "[0-9][0-9]*" _tbb_version_major ${_tbb_version_major})
|
||||
|
||||
string(REGEX MATCH "TBB_VERSION_MINOR[ ]*[0-9]" _tbb_version_minor ${_tbb_def_content})
|
||||
string(REGEX MATCH "[0-9][0-9]*" _tbb_version_minor ${_tbb_version_minor})
|
||||
|
||||
set(TBB_VERSION "${_tbb_version_major}.${_tbb_version_minor}")
|
||||
else()
|
||||
set(TBB_VERSION "")
|
||||
endif()
|
||||
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
set(_tbb_release_lib "${_tbb_lib_path}/lib${_tbb_component}.dylib")
|
||||
set(_tbb_debug_lib "${_tbb_lib_path}/lib${_tbb_component}_debug.dylib")
|
||||
|
||||
if (EXISTS "${_tbb_release_lib}" AND EXISTS "${_tbb_debug_lib}")
|
||||
if (NOT TARGET TBB::${_tbb_component})
|
||||
add_library(TBB::${_tbb_component} SHARED IMPORTED)
|
||||
set_target_properties(TBB::${_tbb_component} PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG"
|
||||
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"
|
||||
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_root}/include")
|
||||
|
||||
# Add internal dependencies for imported targets: TBB::tbbmalloc_proxy -> TBB::tbbmalloc
|
||||
if (_tbb_component STREQUAL tbbmalloc_proxy)
|
||||
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
|
||||
endif()
|
||||
|
||||
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
|
||||
set(TBB_${_tbb_component}_FOUND 1)
|
||||
endif()
|
||||
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
|
||||
message(FATAL_ERROR "Missed required Intel TBB component: ${_tbb_component}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
unset(_tbb_x32_subdir)
|
||||
unset(_tbb_x64_subdir)
|
||||
unset(_tbb_arch_subdir)
|
||||
unset(_tbb_compiler_subdir)
|
||||
unset(_tbbmalloc_proxy_ix)
|
||||
unset(_tbbmalloc_ix)
|
||||
unset(_tbb_lib_path)
|
||||
unset(_tbb_release_lib)
|
||||
unset(_tbb_debug_lib)
|
||||
@@ -1,128 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# TBB_FOUND should not be set explicitly. It is defined automatically by CMake.
|
||||
# Handling of TBB_VERSION is in TBBConfigVersion.cmake.
|
||||
|
||||
if (NOT TBB_FIND_COMPONENTS)
|
||||
set(TBB_FIND_COMPONENTS "tbb;tbbmalloc;tbbmalloc_proxy")
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
set(TBB_FIND_REQUIRED_${_tbb_component} 1)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Add components with internal dependencies: tbbmalloc_proxy -> tbbmalloc
|
||||
list(FIND TBB_FIND_COMPONENTS tbbmalloc_proxy _tbbmalloc_proxy_ix)
|
||||
if (NOT _tbbmalloc_proxy_ix EQUAL -1)
|
||||
list(FIND TBB_FIND_COMPONENTS tbbmalloc _tbbmalloc_ix)
|
||||
if (_tbbmalloc_ix EQUAL -1)
|
||||
list(APPEND TBB_FIND_COMPONENTS tbbmalloc)
|
||||
set(TBB_FIND_REQUIRED_tbbmalloc ${TBB_FIND_REQUIRED_tbbmalloc_proxy})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT TBBROOT)
|
||||
if(DEFINED ENV{TBBROOT})
|
||||
set (TBBROOT $ENV{TBBROOT})
|
||||
else()
|
||||
message("FATAL_ERROR" "TBBROOT is unset")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(_tbb_root ${TBBROOT})
|
||||
|
||||
set(_tbb_x32_subdir ia32)
|
||||
set(_tbb_x64_subdir intel64)
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_tbb_arch_subdir ${_tbb_x64_subdir})
|
||||
else()
|
||||
set(_tbb_arch_subdir ${_tbb_x32_subdir})
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
message(FATAL_ERROR "This Intel TBB package is intended to be used only in the project with MSVC")
|
||||
endif()
|
||||
|
||||
# Detect the most relevant MSVC subdirectory
|
||||
set(_tbb_msvc_1700_subdir vc11)
|
||||
set(_tbb_msvc_1800_subdir vc12)
|
||||
set(_tbb_msvc_1900_subdir vc14)
|
||||
set(_tbb_msvc_ver ${MSVC_VERSION})
|
||||
if (MSVC_VERSION VERSION_LESS 1700)
|
||||
message(FATAL_ERROR "This Intel TBB package is intended to be used only in the project with MSVC version 1700 (vc11) or higher")
|
||||
elseif (MSVC_VERSION VERSION_GREATER 1900)
|
||||
set(_tbb_msvc_ver 1900)
|
||||
endif()
|
||||
set(_tbb_compiler_subdir ${_tbb_msvc_${_tbb_msvc_ver}_subdir})
|
||||
unset(_tbb_msvc_1700_subdir)
|
||||
unset(_tbb_msvc_1800_subdir)
|
||||
unset(_tbb_msvc_1900_subdir)
|
||||
|
||||
if (WINDOWS_STORE)
|
||||
set(_tbb_compiler_subdir ${_tbb_compiler_subdir}_ui)
|
||||
endif()
|
||||
|
||||
#set conveniance variable to locate TBB files (these are used for a PSXE install)
|
||||
get_filename_component(_tbb_lib_path "${_tbb_root}/lib/${_tbb_arch_subdir}/${_tbb_compiler_subdir}" ABSOLUTE)
|
||||
get_filename_component(_tbb_inc_path "${_tbb_root}/include/" ABSOLUTE)
|
||||
|
||||
if (TBB_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# detect version
|
||||
find_file(_tbb_def_header tbb_stddef.h HINTS "${_tbb_root}/include/tbb")
|
||||
|
||||
if (_tbb_def_header)
|
||||
file(READ "${_tbb_def_header}" _tbb_def_content)
|
||||
string(REGEX MATCH "TBB_VERSION_MAJOR[ ]*[0-9]*" _tbb_version_major ${_tbb_def_content})
|
||||
string(REGEX MATCH "[0-9][0-9]*" _tbb_version_major ${_tbb_version_major})
|
||||
|
||||
string(REGEX MATCH "TBB_VERSION_MINOR[ ]*[0-9]" _tbb_version_minor ${_tbb_def_content})
|
||||
string(REGEX MATCH "[0-9][0-9]*" _tbb_version_minor ${_tbb_version_minor})
|
||||
|
||||
set(TBB_VERSION "${_tbb_version_major}.${_tbb_version_minor}")
|
||||
else()
|
||||
set(TBB_VERSION "")
|
||||
endif()
|
||||
|
||||
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
|
||||
set(_tbb_release_lib "${_tbb_lib_path}/${_tbb_component}.lib")
|
||||
set(_tbb_debug_lib "${_tbb_lib_path}/${_tbb_component}_debug.lib")
|
||||
|
||||
if (EXISTS "${_tbb_release_lib}" AND EXISTS "${_tbb_debug_lib}")
|
||||
if (NOT TARGET TBB::${_tbb_component})
|
||||
add_library(TBB::${_tbb_component} SHARED IMPORTED)
|
||||
set_target_properties(TBB::${_tbb_component} PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG"
|
||||
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"
|
||||
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_inc_path}"
|
||||
IMPORTED_IMPLIB_RELEASE "${_tbb_release_lib}"
|
||||
IMPORTED_IMPLIB_DEBUG "${_tbb_debug_lib}"
|
||||
INTERFACE_COMPILE_DEFINITIONS "__TBB_NO_IMPLICIT_LINKAGE=1")
|
||||
|
||||
# Add internal dependencies for imported targets: TBB::tbbmalloc_proxy -> TBB::tbbmalloc
|
||||
if (_tbb_component STREQUAL tbbmalloc_proxy)
|
||||
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
|
||||
endif()
|
||||
|
||||
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
|
||||
set(TBB_${_tbb_component}_FOUND 1)
|
||||
endif()
|
||||
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
|
||||
message(FATAL_ERROR "Missed required Intel TBB component: ${_tbb_component}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
unset(_tbb_x32_subdir)
|
||||
unset(_tbb_x64_subdir)
|
||||
unset(_tbb_arch_subdir)
|
||||
unset(_tbb_compiler_subdir)
|
||||
unset(_tbbmalloc_proxy_ix)
|
||||
unset(_tbbmalloc_ix)
|
||||
unset(_tbb_lib_path)
|
||||
unset(_tbb_release_lib)
|
||||
unset(_tbb_debug_lib)
|
||||
@@ -1,130 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (branchName VAR)
|
||||
if(NOT DEFINED repo_root)
|
||||
message(FATAL_ERROR "repo_root is not defined")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${repo_root}
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set (${VAR} ${GIT_BRANCH} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function (commitHash VAR)
|
||||
if(NOT DEFINED repo_root)
|
||||
message(FATAL_ERROR "repo_root is not defined")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND git rev-parse HEAD
|
||||
WORKING_DIRECTORY ${repo_root}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set (${VAR} ${GIT_COMMIT_HASH} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(ie_parse_ci_build_number)
|
||||
set(IE_VERSION_BUILD 000)
|
||||
if(CI_BUILD_NUMBER MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)\-([0-9]+)\-.*")
|
||||
set(IE_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(IE_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(IE_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
set(IE_VERSION_BUILD ${CMAKE_MATCH_4})
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED repo_root)
|
||||
message(FATAL_ERROR "repo_root is not defined")
|
||||
endif()
|
||||
|
||||
macro(ie_get_hpp_version)
|
||||
if(NOT DEFINED OpenVINO_SOURCE_DIR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(ie_version_hpp "${OpenVINO_SOURCE_DIR}/inference-engine/src/inference_engine/include/ie/ie_version.hpp")
|
||||
if(NOT EXISTS ${ie_version_hpp})
|
||||
message(FATAL_ERROR "File ie_version.hpp with IE_VERSION definitions is not found")
|
||||
endif()
|
||||
|
||||
set(ov_version_hpp "${OpenVINO_SOURCE_DIR}/ngraph/core/include/openvino/core/version.hpp")
|
||||
if(NOT EXISTS ${ov_version_hpp})
|
||||
message(FATAL_ERROR "File openvino/core/version.hpp with OPENVINO_VERSION definitions is not found")
|
||||
endif()
|
||||
|
||||
file(STRINGS "${ie_version_hpp}" IE_VERSION_PARTS REGEX "#define IE_VERSION_[A-Z]+[ ]+" )
|
||||
file(STRINGS "${ov_version_hpp}" OV_VERSION_PARTS REGEX "#define OPENVINO_VERSION_[A-Z]+[ ]+" )
|
||||
|
||||
foreach(suffix MAJOR MINOR PATCH)
|
||||
set(ie_version_name "IE_VERSION_${suffix}")
|
||||
set(ov_version_name "OPENVINO_VERSION_${suffix}")
|
||||
|
||||
string(REGEX REPLACE ".+${ie_version_name}[ ]+([0-9]+).*" "\\1"
|
||||
${ie_version_name}_HPP "${IE_VERSION_PARTS}")
|
||||
string(REGEX REPLACE ".+${ov_version_name}[ ]+([0-9]+).*" "\\1"
|
||||
${ov_version_name}_HPP "${OV_VERSION_PARTS}")
|
||||
|
||||
if(NOT ${ie_version_name}_HPP EQUAL ${ov_version_name}_HPP)
|
||||
message(FATAL_ERROR "${ov_version_name} (${${ov_version_name}_HPP})"
|
||||
" and ${ie_version_name} (${${ie_version_name}_HPP}) are not equal")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(ie_hpp_version_is_found ON)
|
||||
endmacro()
|
||||
|
||||
# detect OpenVINO version via ie_version.hpp
|
||||
ie_get_hpp_version()
|
||||
|
||||
if(ie_hpp_version_is_found)
|
||||
foreach(var IE_VERSION_MAJOR IE_VERSION_MINOR IE_VERSION_PATCH)
|
||||
if(DEFINED ${var} AND NOT ${var} EQUAL ${var}_HPP)
|
||||
message(FATAL_ERROR "${var} parsed from CI_BUILD_NUMBER (${${var}}) \
|
||||
and from ie_version.hpp (${${var}_HPP}) are different")
|
||||
else()
|
||||
# CI_BUILD_NUMBER is not defined well, take info from ie_verison.hpp as a baseline
|
||||
set(${var} ${${var}_HPP})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(IE_VERSION "${IE_VERSION_MAJOR}.${IE_VERSION_MINOR}.${IE_VERSION_PATCH}")
|
||||
message(STATUS "OpenVINO version is ${IE_VERSION}")
|
||||
endmacro()
|
||||
|
||||
if (DEFINED ENV{CI_BUILD_NUMBER})
|
||||
set(CI_BUILD_NUMBER $ENV{CI_BUILD_NUMBER})
|
||||
else()
|
||||
branchName(GIT_BRANCH)
|
||||
commitHash(GIT_COMMIT_HASH)
|
||||
|
||||
set(custom_build "custom_${GIT_BRANCH}_${GIT_COMMIT_HASH}")
|
||||
set(CI_BUILD_NUMBER "${custom_build}")
|
||||
endif()
|
||||
|
||||
# provides Inference Engine version
|
||||
# 1. If CI_BUILD_NUMBER is defined, parses this information
|
||||
# 2. Otherwise, parses ie_version.hpp
|
||||
ie_parse_ci_build_number()
|
||||
|
||||
macro (addVersionDefines FILE)
|
||||
set(__version_file ${FILE})
|
||||
if(NOT IS_ABSOLUTE ${__version_file})
|
||||
set(__version_file "${CMAKE_CURRENT_SOURCE_DIR}/${__version_file}")
|
||||
endif()
|
||||
if(NOT EXISTS ${__version_file})
|
||||
message(FATAL_ERROR "${FILE} does not exists in current source directory")
|
||||
endif()
|
||||
foreach (VAR ${ARGN})
|
||||
if (DEFINED ${VAR} AND NOT "${${VAR}}" STREQUAL "")
|
||||
set_property(
|
||||
SOURCE ${__version_file}
|
||||
APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS
|
||||
${VAR}="${${VAR}}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(__version_file)
|
||||
endmacro()
|
||||
@@ -1,80 +0,0 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(IE_VS_VER_FILEVERSION_QUAD "${IE_VERSION_MAJOR},${IE_VERSION_MINOR},${IE_VERSION_PATCH},0")
|
||||
set(IE_VS_VER_PRODUCTVERSION_QUAD "${IE_VERSION_MAJOR},${IE_VERSION_MINOR},${IE_VERSION_PATCH},0")
|
||||
set(IE_VS_VER_FILEVERSION_STR "${IE_VERSION_MAJOR}.${IE_VERSION_MINOR}.${IE_VERSION_PATCH}.0")
|
||||
|
||||
set(IE_VS_VER_COMPANY_NAME_STR "Intel Corporation")
|
||||
set(IE_VS_VER_PRODUCTVERSION_STR "${CI_BUILD_NUMBER}")
|
||||
set(IE_VS_VER_PRODUCTNAME_STR "OpenVINO toolkit")
|
||||
set(IE_VS_VER_COPYRIGHT_STR "Copyright (C) 2018-2021, Intel Corporation")
|
||||
set(IE_VS_VER_COMMENTS_STR "https://docs.openvinotoolkit.org/")
|
||||
|
||||
#
|
||||
# ie_add_vs_version_file(NAME <name>
|
||||
# FILEDESCRIPTION <file description>
|
||||
# [COMPANY_NAME <company name>]
|
||||
# [FILEVERSION <file version>]
|
||||
# [INTERNALNAME <internal name>]
|
||||
# [COPYRIGHT <name>]
|
||||
# [PRODUCTNAME <name>]
|
||||
# [PRODUCTVERSION <name>]
|
||||
# [COMMENTS <name>]
|
||||
# [FILEVERSION_QUAD <name>]
|
||||
# [PRODUCTVERSION_QUAD <name>])
|
||||
#
|
||||
function(ie_add_vs_version_file)
|
||||
if(NOT WIN32 OR NOT BUILD_SHARED_LIBS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
cmake_parse_arguments(VS_VER "" "COMPANY_NAME;NAME;FILEDESCRIPTION;FILEVERSION;INTERNALNAME;COPYRIGHT;PRODUCTNAME;PRODUCTVERSION;COMMENTS;FILEVERSION_QUAD;PRODUCTVERSION_QUAD" "" ${ARGN})
|
||||
|
||||
if(NOT TARGET ${VS_VER_NAME})
|
||||
message(FATAL_ERROR "${VS_VER_NAME} must define a target")
|
||||
endif()
|
||||
|
||||
get_target_property(target_type ${VS_VER_NAME} TYPE)
|
||||
if(NOT target_type MATCHES "^(SHARED|MODULE)_LIBRARY$")
|
||||
message(FATAL_ERROR "ie_add_vs_version_file can work only with dynamic libraries")
|
||||
endif()
|
||||
|
||||
macro(_vs_ver_update_variable name)
|
||||
if(VS_VER_NAME AND DEFINED IE_${VS_VER_NAME}_VS_VER_${name})
|
||||
set(IE_VS_VER_${name} "${IE_${VS_VER_NAME}_VS_VER_${name}}")
|
||||
elseif(VS_VER_${name})
|
||||
set(IE_VS_VER_${name} "${VS_VER_${name}}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
_vs_ver_update_variable(FILEVERSION_QUAD)
|
||||
_vs_ver_update_variable(PRODUCTVERSION_QUAD)
|
||||
|
||||
macro(_vs_ver_update_str_variable name)
|
||||
if(VS_VER_NAME AND DEFINED IE_${VS_VER_NAME}_VS_VER_${name})
|
||||
set(IE_VS_VER_${name}_STR "${IE_${VS_VER_NAME}_VS_VER_${name}}")
|
||||
elseif(VS_VER_${name})
|
||||
set(IE_VS_VER_${name}_STR "${VS_VER_${name}}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
_vs_ver_update_str_variable(COMPANY_NAME)
|
||||
_vs_ver_update_str_variable(FILEDESCRIPTION)
|
||||
_vs_ver_update_str_variable(FILEVERSION)
|
||||
_vs_ver_update_str_variable(INTERNALNAME)
|
||||
_vs_ver_update_str_variable(COPYRIGHT)
|
||||
_vs_ver_update_str_variable(PRODUCTNAME)
|
||||
_vs_ver_update_str_variable(PRODUCTVERSION)
|
||||
_vs_ver_update_str_variable(COMMENTS)
|
||||
|
||||
set(IE_VS_VER_ORIGINALFILENAME_STR "${CMAKE_SHARED_LIBRARY_PREFIX}${VS_VER_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set(IE_VS_VER_INTERNALNAME_STR ${VS_VER_NAME})
|
||||
|
||||
set(vs_version_output "${CMAKE_CURRENT_BINARY_DIR}/vs_version.rc")
|
||||
configure_file("${IEDevScripts_DIR}/vs_version/vs_version.rc.in" "${vs_version_output}" @ONLY)
|
||||
|
||||
source_group("src" FILES ${vs_version_output})
|
||||
target_sources(${VS_VER_NAME} PRIVATE ${vs_version_output})
|
||||
endfunction()
|
||||
@@ -1,10 +1,11 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include (download/download)
|
||||
include ("download")
|
||||
|
||||
function (resolve_archive_dependency VAR COMPONENT ARCHIVE ARCHIVE_UNIFIED ARCHIVE_WIN ARCHIVE_LIN ARCHIVE_MAC ARCHIVE_ANDROID TARGET_PATH FOLDER ENVIRONMENT)
|
||||
|
||||
function (resolve_archive_dependency VAR COMPONENT ARCHIVE ARCHIVE_UNIFIED ARCHIVE_WIN ARCHIVE_LIN ARCHIVE_MAC ARCHIVE_ANDROID TARGET_PATH FOLDER ENVIRONMENT SHA256 FILES_TO_EXTRACT)
|
||||
if (ENVIRONMENT AND (DEFINED ${ENVIRONMENT} OR DEFINED ENV{${ENVIRONMENT}}))
|
||||
set(HAS_ENV "TRUE")
|
||||
endif()
|
||||
@@ -12,9 +13,9 @@ function (resolve_archive_dependency VAR COMPONENT ARCHIVE ARCHIVE_UNIFIED ARCHI
|
||||
if (NOT DEFINED HAS_ENV)
|
||||
if (ARCHIVE)
|
||||
#TODO: check whether this is platform specific binary with same name per or it is in common folder
|
||||
DownloadAndExtract(${COMPONENT} ${ARCHIVE} ${TARGET_PATH} result_path ${FOLDER} ${SHA256} ${FILES_TO_EXTRACT})
|
||||
DownloadAndExtract(${COMPONENT} ${ARCHIVE} ${TARGET_PATH} result_path ${FOLDER})
|
||||
else()
|
||||
DownloadAndExtractPlatformSpecific(${COMPONENT} ${ARCHIVE_UNIFIED} ${ARCHIVE_WIN} ${ARCHIVE_LIN} ${ARCHIVE_MAC} ${ARCHIVE_ANDROID} ${TARGET_PATH} result_path ${FOLDER} ${SHA256} ${FILES_TO_EXTRACT})
|
||||
DownloadAndExtractPlatformSpecific(${COMPONENT} ${ARCHIVE_UNIFIED} ${ARCHIVE_WIN} ${ARCHIVE_LIN} ${ARCHIVE_MAC} ${ARCHIVE_ANDROID} ${TARGET_PATH} result_path ${FOLDER})
|
||||
endif()
|
||||
|
||||
set (${VAR} ${result_path} PARENT_SCOPE)
|
||||
@@ -25,8 +26,15 @@ function (resolve_archive_dependency VAR COMPONENT ARCHIVE ARCHIVE_UNIFIED ARCHI
|
||||
set (${VAR} $ENV{${ENVIRONMENT}} PARENT_SCOPE)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
endfunction(resolve_archive_dependency)
|
||||
|
||||
function(resolve_pull_request GITHUB_PULL_REQUEST TARGET_PATH)
|
||||
get_filename_component(FILE_NAME ${GITHUB_PULL_REQUEST} NAME)
|
||||
set (PATCH_URL "")
|
||||
DownloadAndApply("${PATCH_URL}/${GITHUB_PULL_REQUEST}" "${IE_MAIN_SOURCE_DIR}/${TARGET_PATH}/${FILE_NAME}")
|
||||
endfunction(resolve_pull_request)
|
||||
|
||||
function(extract_version_from_filename filename regex version)
|
||||
string(REGEX MATCH ${regex} match ${filename})
|
||||
|
||||
@@ -44,8 +52,10 @@ function(read_version archive regex version_var)
|
||||
endfunction(read_version)
|
||||
|
||||
function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)
|
||||
|
||||
list(REMOVE_AT ARGV 0)
|
||||
set(SUPPORTED_ARGS FOLDER ARCHIVE ARCHIVE_UNIFIED ARCHIVE_WIN ARCHIVE_LIN ARCHIVE_MAC ARCHIVE_ANDROID TARGET_PATH ENVIRONMENT VERSION_REGEX SHA256 FILES_TO_EXTRACT)
|
||||
set(SUPPORTED_ARGS FOLDER ARCHIVE ARCHIVE_UNIFIED ARCHIVE_WIN ARCHIVE_LIN ARCHIVE_MAC ARCHIVE_ANDROID TARGET_PATH ENVIRONMENT GITHUB_PULL_REQUEST VERSION_REGEX)
|
||||
|
||||
|
||||
#unnecessary vars
|
||||
foreach(arg ${ARGV})
|
||||
@@ -103,13 +113,7 @@ function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)
|
||||
set (FOLDER FALSE)
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED SHA256)
|
||||
message(FATAL_ERROR "SHA is not specified for: " ${NAME_OF_CMAKE_VAR})
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED FILES_TO_EXTRACT)
|
||||
set (FILES_TO_EXTRACT FALSE)
|
||||
endif()
|
||||
|
||||
#for each dependency type have to do separate things
|
||||
if (ARCHIVE_WIN OR ARCHIVE_LIN OR ARCHIVE_MAC OR ARCHIVE_ANDROID OR ARCHIVE OR ARCHIVE_UNIFIED)
|
||||
@@ -117,7 +121,7 @@ function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)
|
||||
message(FATAL_ERROR "TARGET_PATH should be defined for every dependency")
|
||||
endif()
|
||||
|
||||
resolve_archive_dependency(RESULT ${NAME_OF_CMAKE_VAR} ${ARCHIVE} ${ARCHIVE_UNIFIED} ${ARCHIVE_WIN} ${ARCHIVE_LIN} ${ARCHIVE_MAC} ${ARCHIVE_ANDROID} ${TARGET_PATH} ${FOLDER} ${ENVIRONMENT} ${SHA256} ${FILES_TO_EXTRACT})
|
||||
resolve_archive_dependency(RESULT ${NAME_OF_CMAKE_VAR} ${ARCHIVE} ${ARCHIVE_UNIFIED} ${ARCHIVE_WIN} ${ARCHIVE_LIN} ${ARCHIVE_MAC} ${ARCHIVE_ANDROID} ${TARGET_PATH} ${FOLDER} ${ENVIRONMENT})
|
||||
set(${NAME_OF_CMAKE_VAR} ${RESULT} PARENT_SCOPE)
|
||||
if (VERSION_REGEX)
|
||||
GetNameAndUrlToDownload(archive RELATIVE_URL ${ARCHIVE_UNIFIED} ${ARCHIVE_WIN} ${ARCHIVE_LIN} ${ARCHIVE_MAC} ${ARCHIVE_ANDROID})
|
||||
@@ -125,8 +129,11 @@ function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)
|
||||
read_version(${archive} ${VERSION_REGEX} "${NAME_OF_CMAKE_VAR}_VERSION")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif (DEFINED GITHUB_PULL_REQUEST)
|
||||
resolve_pull_request(${GITHUB_PULL_REQUEST} ${TARGET_PATH})
|
||||
else()
|
||||
message(FATAL_ERROR "Dependency of unknowntype, SHOULD set one of ARCHIVE_WIN, ARCHIVE, ARCHIVE_LIN, ARCHIVE_MAC, ARCHIVE_ANDROID")
|
||||
message(FATAL_ERROR "Dependency of unknowntype, SHOULD set one of ARCHIVE_WIN, ARCHIVE, ARCHIVE_LIN, ARCHIVE_MAC, ARCHIVE_ANDROID, GITHUB_PULL_REQUEST")
|
||||
endif()
|
||||
|
||||
endfunction(RESOLVE_DEPENDENCY)
|
||||
24
cmake/download/download.cmake
Normal file
24
cmake/download/download.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (Download from to fatal result output)
|
||||
|
||||
if((NOT EXISTS "${to}"))
|
||||
message(STATUS "Downloading from ${from} to ${to} ...")
|
||||
file(DOWNLOAD ${from} ${to}
|
||||
TIMEOUT 3600
|
||||
LOG log
|
||||
STATUS status
|
||||
SHOW_PROGRESS)
|
||||
|
||||
set (${output} ${status} PARENT_SCOPE)
|
||||
else()
|
||||
set (${output} 0 PARENT_SCOPE)
|
||||
endif()
|
||||
set(${result} "ON" PARENT_SCOPE)
|
||||
|
||||
endfunction(Download)
|
||||
|
||||
include ("download_and_apply")
|
||||
include ("download_and_extract")
|
||||
@@ -1,8 +1,8 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function (DownloadAndApply URL apply_to sha256)
|
||||
function (DownloadAndApply URL apply_to)
|
||||
|
||||
if (EXISTS ${apply_to})
|
||||
file(READ ${apply_to} patchFile4Bytes LIMIT 4)
|
||||
@@ -16,7 +16,7 @@ function (DownloadAndApply URL apply_to sha256)
|
||||
file(REMOVE ${apply_to})
|
||||
endif()
|
||||
|
||||
DownloadAndCheck(${URL} ${apply_to} TRUE result ${sha256})
|
||||
DownloadAndCheck(${URL} ${apply_to} TRUE result)
|
||||
else ()
|
||||
set (MIGHT_BE_APPLIED 1)
|
||||
endif()
|
||||
61
cmake/download/download_and_check.cmake
Normal file
61
cmake/download/download_and_check.cmake
Normal file
@@ -0,0 +1,61 @@
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include (FindWget)
|
||||
|
||||
function (DownloadAndCheck from to fatal result)
|
||||
set(status_res "ON")
|
||||
set(output 1)
|
||||
|
||||
get_filename_component(download_dir ${to} DIRECTORY)
|
||||
if (NOT EXISTS ${download_dir})
|
||||
file(MAKE_DIRECTORY ${download_dir})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${to}")
|
||||
if (${from} MATCHES "(http:)|(https:)|(ftp:)")
|
||||
message(STATUS "Downloading from ${from} to ${to} ...")
|
||||
find_program(aria2c "aria2c")
|
||||
if (${aria2c} STREQUAL "aria2c-NOTFOUND")
|
||||
if (NOT ${WGET_FOUND})
|
||||
Download(${from} ${to} ${fatal} ${result} output)
|
||||
list(GET output 0 status_code)
|
||||
else()
|
||||
message(STATUS "${WGET_EXECUTABLE} --no-cache --no-check-certificate
|
||||
--retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=5 ${from}")
|
||||
execute_process(COMMAND ${WGET_EXECUTABLE} "--no-cache" "--no-check-certificate"
|
||||
"--retry-connrefused" "--waitretry=1" "--read-timeout=20" "--timeout=15" "--tries=5"
|
||||
"${from}" "-O" "${to}"
|
||||
TIMEOUT 2000
|
||||
RESULT_VARIABLE status_code)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${aria2c} ,*.*.*.* -d ${download_dir} ${from}")
|
||||
execute_process(COMMAND "${aria2c}" "-s10" "-x10" "--dir=${download_dir}" "${from}"
|
||||
TIMEOUT 2000
|
||||
RESULT_VARIABLE status_code)
|
||||
endif()
|
||||
|
||||
if(NOT status_code EQUAL 0)
|
||||
if (fatal)
|
||||
message(FATAL_ERROR "fatal error: downloading '${from}' failed
|
||||
status_code: ${status_code}
|
||||
status_string: ${status_string}
|
||||
log: ${log}")
|
||||
else()
|
||||
set(status_res "ARCHIVE_DOWNLOAD_FAIL")
|
||||
message("error: downloading '${from}' failed
|
||||
status_code: ${status_code}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Copying from local folder ${from} to ${to} ... ")
|
||||
file(COPY ${from} DESTINATION ${download_dir})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(REMOVE ${to}.md5)
|
||||
set(${result} "${status_res}" PARENT_SCOPE)
|
||||
|
||||
endfunction(DownloadAndCheck)
|
||||
@@ -1,9 +1,9 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(download/extract)
|
||||
include(download/download_and_check)
|
||||
include ("extract")
|
||||
include ("download_and_check")
|
||||
|
||||
function (GetNameAndUrlToDownload name url archive_name_unified archive_name_win archive_name_lin archive_name_mac archive_name_android)
|
||||
if (archive_name_unified)
|
||||
@@ -41,27 +41,25 @@ function (DownloadAndExtractPlatformSpecific
|
||||
archive_name_android
|
||||
unpacked_path
|
||||
result_path
|
||||
folder
|
||||
sha256
|
||||
files_to_extract)
|
||||
folder)
|
||||
|
||||
GetNameAndUrlToDownload(archive_name RELATIVE_URL ${archive_name_unified} ${archive_name_win} ${archive_name_lin} ${archive_name_mac} ${archive_name_android} )
|
||||
if (NOT archive_name OR NOT RELATIVE_URL)
|
||||
return()
|
||||
endif()
|
||||
CheckOrDownloadAndExtract(${component} ${RELATIVE_URL} ${archive_name} ${unpacked_path} result_path2 ${folder} TRUE FALSE TRUE ${sha256} ${files_to_extract})
|
||||
CheckOrDownloadAndExtract(${component} ${RELATIVE_URL} ${archive_name} ${unpacked_path} result_path2 ${folder} TRUE FALSE TRUE)
|
||||
set (${result_path} ${result_path2} PARENT_SCOPE)
|
||||
|
||||
endfunction(DownloadAndExtractPlatformSpecific)
|
||||
|
||||
#download from common folder
|
||||
function (DownloadAndExtract component archive_name unpacked_path result_path folder sha256 files_to_extract)
|
||||
function (DownloadAndExtract component archive_name unpacked_path result_path folder)
|
||||
set (RELATIVE_URL "${archive_name}")
|
||||
set(fattal TRUE)
|
||||
CheckOrDownloadAndExtract(${component} ${RELATIVE_URL} ${archive_name} ${unpacked_path} result_path2 ${folder} ${fattal} result TRUE ${sha256} ${files_to_extract})
|
||||
CheckOrDownloadAndExtract(${component} ${RELATIVE_URL} ${archive_name} ${unpacked_path} result_path2 ${folder} ${fattal} result TRUE)
|
||||
|
||||
if (NOT ${result})
|
||||
DownloadAndExtractPlatformSpecific(${component} ${archive_name} ${archive_name} ${archive_name} ${unpacked_path} ${result_path2} ${folder} ${sha256} ${files_to_extract})
|
||||
DownloadAndExtractPlatformSpecific(${component} ${archive_name} ${archive_name} ${archive_name} ${unpacked_path} ${result_path2} ${folder})
|
||||
endif()
|
||||
|
||||
set (${result_path} ${result_path2} PARENT_SCOPE)
|
||||
@@ -69,9 +67,9 @@ function (DownloadAndExtract component archive_name unpacked_path result_path fo
|
||||
endfunction(DownloadAndExtract)
|
||||
|
||||
|
||||
function (DownloadAndExtractInternal URL archive_path unpacked_path folder fattal resultExt sha256 files_to_extract)
|
||||
function (DownloadAndExtractInternal URL archive_path unpacked_path folder fattal resultExt)
|
||||
set (status "ON")
|
||||
DownloadAndCheck(${URL} ${archive_path} ${fattal} result1 ${sha256})
|
||||
DownloadAndCheck(${URL} ${archive_path} ${fattal} result1)
|
||||
if ("${result1}" STREQUAL "ARCHIVE_DOWNLOAD_FAIL")
|
||||
#check alternative url as well
|
||||
set (status "OFF")
|
||||
@@ -84,17 +82,17 @@ function (DownloadAndExtractInternal URL archive_path unpacked_path folder fatt
|
||||
endif()
|
||||
|
||||
if("${status}" STREQUAL "ON")
|
||||
ExtractWithVersion(${URL} ${archive_path} ${unpacked_path} ${folder} result ${files_to_extract})
|
||||
ExtractWithVersion(${URL} ${archive_path} ${unpacked_path} ${folder} result)
|
||||
endif()
|
||||
|
||||
set (${resultExt} ${status} PARENT_SCOPE)
|
||||
|
||||
endfunction(DownloadAndExtractInternal)
|
||||
|
||||
function (ExtractWithVersion URL archive_path unpacked_path folder result files_to_extract)
|
||||
function (ExtractWithVersion URL archive_path unpacked_path folder result)
|
||||
|
||||
debug_message("ExtractWithVersion : ${archive_path} : ${unpacked_path} : ${folder} : ${files_to_extract}")
|
||||
extract(${archive_path} ${unpacked_path} ${folder} ${files_to_extract} status)
|
||||
debug_message("ExtractWithVersion : ${archive_path} : ${unpacked_path}")
|
||||
extract(${archive_path} ${unpacked_path} ${folder} status)
|
||||
#dont need archive actually after unpacking
|
||||
file(REMOVE_RECURSE "${archive_path}")
|
||||
if (${status})
|
||||
@@ -107,20 +105,20 @@ function (ExtractWithVersion URL archive_path unpacked_path folder result files_
|
||||
set (${result} ${status} PARENT_SCOPE)
|
||||
endfunction (ExtractWithVersion)
|
||||
|
||||
function (DownloadOrExtractInternal URL archive_path unpacked_path folder fattal resultExt sha256 files_to_extract)
|
||||
function (DownloadOrExtractInternal URL archive_path unpacked_path folder fattal resultExt)
|
||||
debug_message("checking wether archive downloaded : ${archive_path}")
|
||||
set (downloadStatus "NOTOK")
|
||||
if (NOT EXISTS ${archive_path})
|
||||
DownloadAndExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} result ${sha256} ${files_to_extract})
|
||||
DownloadAndExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} result)
|
||||
if (${result})
|
||||
set (downloadStatus "OK")
|
||||
endif()
|
||||
else()
|
||||
|
||||
if (ENABLE_UNSAFE_LOCATIONS)
|
||||
ExtractWithVersion(${URL} ${archive_path} ${unpacked_path} ${folder} result ${files_to_extract})
|
||||
ExtractWithVersion(${URL} ${archive_path} ${unpacked_path} ${folder} result)
|
||||
if(NOT ${result})
|
||||
DownloadAndExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} result ${sha256} ${files_to_extract})
|
||||
DownloadAndExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} result)
|
||||
if (${result})
|
||||
set (downloadStatus "OK")
|
||||
endif()
|
||||
@@ -128,7 +126,7 @@ function (DownloadOrExtractInternal URL archive_path unpacked_path folder fattal
|
||||
else()
|
||||
debug_message("archive found on FS : ${archive_path}, however we cannot check it's checksum and think that it is invalid")
|
||||
file(REMOVE_RECURSE "${archive_path}")
|
||||
DownloadAndExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} result ${sha256} ${files_to_extract})
|
||||
DownloadAndExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} result)
|
||||
if (${result})
|
||||
set (downloadStatus "OK")
|
||||
endif()
|
||||
@@ -148,9 +146,10 @@ endfunction(DownloadOrExtractInternal)
|
||||
|
||||
file(REMOVE ${CMAKE_BINARY_DIR}/dependencies_64.txt)
|
||||
|
||||
function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked_path result_path folder fattal resultExt use_alternatives sha256 files_to_extract)
|
||||
function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked_path result_path folder fattal resultExt use_alternatives)
|
||||
set (archive_path ${TEMP}/download/${archive_name})
|
||||
set (status "ON")
|
||||
set (on_master FALSE)
|
||||
|
||||
if(DEFINED IE_PATH_TO_DEPS)
|
||||
set(URL "${IE_PATH_TO_DEPS}/${RELATIVE_URL}")
|
||||
@@ -170,12 +169,19 @@ function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked
|
||||
debug_message ("checking that unpacked directory exist: ${unpacked_path}")
|
||||
|
||||
if (NOT EXISTS ${unpacked_path})
|
||||
DownloadOrExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} status ${sha256} ${files_to_extract})
|
||||
DownloadOrExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} status)
|
||||
else(NOT EXISTS ${unpacked_path})
|
||||
#path exists, so we would like to check what was unpacked version
|
||||
set (version_file ${unpacked_path}/ie_dependency.info)
|
||||
|
||||
if (NOT EXISTS ${version_file})
|
||||
if (DEFINED TEAMCITY_GIT_BRANCH)
|
||||
if(${TEAMCITY_GIT_BRANCH} STREQUAL "master")
|
||||
set(on_master TRUE)
|
||||
debug_message ("On master branch, update data in DL_SDK_TEMP if necessary")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${version_file} AND NOT ${ENABLE_ALTERNATIVE_TEMP})
|
||||
clean_message(FATAL_ERROR "error: Dependency doesn't contain version file. Please select actions: \n"
|
||||
"if you are not sure about your FS dependency - remove it : \n"
|
||||
"\trm -rf ${unpacked_path}\n"
|
||||
@@ -195,24 +201,24 @@ function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${version_file} OR NOT ${dependency_url} STREQUAL ${URL})
|
||||
if (${use_alternatives} AND ALTERNATIVE_PATH)
|
||||
if (${use_alternatives} AND ALTERNATIVE_PATH AND NOT ${on_master})
|
||||
#creating alternative_path
|
||||
string(REPLACE ${TEMP} ${ALTERNATIVE_PATH} unpacked_path ${unpacked_path})
|
||||
string(REPLACE ${TEMP} ${ALTERNATIVE_PATH} archive_path ${archive_path})
|
||||
|
||||
debug_message("dependency different: use local path for fetching updated version: ${alternative_path}")
|
||||
CheckOrDownloadAndExtract(${component} ${RELATIVE_URL} ${archive_name} ${unpacked_path} ${result_path} ${folder} ${fattal} ${resultExt} FALSE ${sha256} ${files_to_extract})
|
||||
CheckOrDownloadAndExtract(${component} ${RELATIVE_URL} ${archive_name} ${unpacked_path} ${result_path} ${folder} ${fattal} ${resultExt} FALSE)
|
||||
|
||||
else()
|
||||
debug_message("dependency updated: download it again")
|
||||
file(REMOVE_RECURSE "${unpacked_path}")
|
||||
DownloadOrExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} status ${sha256} ${files_to_extract})
|
||||
DownloadOrExtractInternal(${URL} ${archive_path} ${unpacked_path} ${folder} ${fattal} status)
|
||||
endif()
|
||||
endif ()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (${use_alternatives})
|
||||
if (${use_alternatives} OR ${on_master})
|
||||
set (${resultExt} "${status}" PARENT_SCOPE)
|
||||
set (${result_path} ${unpacked_path} PARENT_SCOPE)
|
||||
endif()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user