Skip to content

Commit 95a5779

Browse files
author
Alexey Suhov
committed
Publishing 2020.2 content
1 parent a347375 commit 95a5779

File tree

3,056 files changed

+343131
-199042
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,056 files changed

+343131
-199042
lines changed

CMakeLists.txt

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,41 @@
33
#
44

55
cmake_policy(SET CMP0054 NEW)
6+
7+
# TODO: for make instal / package we need to use 3.13.3 version because
8+
# it allows to install targets created outside of current projects
9+
# See https://blog.kitware.com/cmake-3-13-0-available-for-download/
10+
611
if (APPLE)
712
# due to https://cmake.org/cmake/help/v3.12/policy/CMP0068.html
813
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
914
else()
10-
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
15+
cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR)
1116
endif()
1217

18+
1319
project(OpenVINO)
1420

1521
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
22+
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
1623
set(CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
1724

1825
include(CTest)
1926
include(features)
2027

2128
# include developer package
22-
include(developer_package)
29+
include(developer_package NO_POLICY_SCOPE)
2330

2431
# These options are shared with 3rdparty plugins
2532
# by means of developer package
2633
include(check_features)
34+
include(dependencies)
2735

2836
# resolving dependencies for the project
2937
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
3038
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
3139
message (STATUS "OpenVINO_MAIN_SOURCE_DIR .............. " ${OpenVINO_MAIN_SOURCE_DIR})
32-
if (ENABLE_INFERENCE_ENGINE)
33-
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
34-
message (STATUS "IE_MAIN_SOURCE_DIR .............. " ${IE_MAIN_SOURCE_DIR})
35-
endif()
40+
message (STATUS "IE_MAIN_SOURCE_DIR .............. " ${IE_MAIN_SOURCE_DIR})
3641
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
3742
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
3843
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
@@ -42,57 +47,44 @@ file(REMOVE "${CMAKE_BINARY_DIR}/targets_developer.cmake")
4247
file(REMOVE "${CMAKE_BINARY_DIR}/targets.cmake")
4348

4449
function(build_ngraph)
45-
if(NOT ENABLE_NGRAPH)
46-
return()
47-
endif()
48-
4950
function(ngraph_set option value)
5051
if(NOT DEFINED ${option})
5152
set(${option} ${value} CACHE BOOL "" FORCE)
5253
endif()
5354
endfunction()
5455

55-
add_definitions(-DENABLE_NGRAPH)
5656
set(NGRAPH_BUILD_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CACHE STRING "" FORCE)
5757
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OpenVINO_MAIN_SOURCE_DIR}/ngraph/cmake/Modules/")
5858

59-
ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
59+
if (ENABLE_SANITIZER)
60+
ngraph_set(NGRAPH_ADDRESS_SANITIZER TRUE)
61+
else ()
62+
ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
63+
endif ()
6064
ngraph_set(NGRAPH_TOOLS_ENABLE FALSE)
6165
ngraph_set(NGRAPH_CPU_ENABLE FALSE)
62-
ngraph_set(NGRAPH_MLIR_ENABLE FALSE)
63-
ngraph_set(NGRAPH_INTELGPU_ENABLE FALSE)
64-
ngraph_set(NGRAPH_GPU_ENABLE FALSE)
65-
ngraph_set(NGRAPH_INTERPRETER_ENABLE FALSE)
66+
ngraph_set(NGRAPH_INTERPRETER_ENABLE TRUE)
6667
ngraph_set(NGRAPH_NOP_ENABLE FALSE)
6768
ngraph_set(NGRAPH_GPUH_ENABLE FALSE)
6869
ngraph_set(NGRAPH_GENERIC_CPU_ENABLE FALSE)
69-
ngraph_set(NGRAPH_DEBUG_ENABLE FALSE)
70-
ngraph_set(NGRAPH_DEPRECATED_ENABLE FALSE)
71-
ngraph_set(NGRAPH_DEX_ONLY FALSE)
7270
ngraph_set(NGRAPH_ENABLE_CPU_CONV_AUTO FALSE)
73-
ngraph_set(NGRAPH_CODE_COVERAGE_ENABLE FALSE)
74-
ngraph_set(NGRAPH_LIB_VERSIONING_ENABLE FALSE)
75-
if (ENABLE_PYTHON AND NOT WIN32)
76-
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE TRUE)
77-
else()
78-
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
79-
endif()
71+
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
8072
ngraph_set(NGRAPH_PLAIDML_ENABLE FALSE)
81-
ngraph_set(NGRAPH_DISTRIBUTED_ENABLE FALSE)
8273
ngraph_set(NGRAPH_FAST_MATH_ENABLE FALSE)
8374
ngraph_set(NGRAPH_JSON_ENABLE FALSE)
84-
ngraph_set(NGRAPH_STATIC_LIB_ENABLE FALSE)
85-
ngraph_set(NGRAPH_INTERPRETER_STATIC_LIB_ENABLE FALSE)
86-
ngraph_set(NGRAPH_CPU_STATIC_LIB_ENABLE FALSE)
8775
ngraph_set(NGRAPH_DYNAMIC_COMPONENTS_ENABLE FALSE)
8876
ngraph_set(NGRAPH_NATIVE_ARCH_ENABLE FALSE)
8977

9078
if (NOT ANDROID)
9179
ngraph_set(NGRAPH_UNIT_TEST_ENABLE TRUE)
9280
ngraph_set(NGRAPH_UNIT_TEST_OPENVINO_ENABLE TRUE)
81+
# ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE TRUE)
82+
set(NGRAPH_ONNX_IMPORT_ENABLE TRUE CACHE BOOL "" FORCE)
9383
else()
9484
ngraph_set(NGRAPH_UNIT_TEST_ENABLE FALSE)
85+
ngraph_set(NGRAPH_TEST_UTIL_ENABLE FALSE)
9586
ngraph_set(NGRAPH_UNIT_TEST_OPENVINO_ENABLE FALSE)
87+
ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE FALSE)
9688
endif()
9789

9890
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -108,11 +100,7 @@ function(build_ngraph)
108100
if (UNIX)
109101
ie_add_compiler_flags(-Wno-error=return-type -Wno-undef)
110102
elseif(WIN32)
111-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146")
112-
endif()
113-
114-
if(UNIX)
115-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
103+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146 /wd4703 /wd4244")
116104
endif()
117105

118106
if(ENABLE_LTO)
@@ -121,15 +109,13 @@ function(build_ngraph)
121109

122110
ie_cpack_add_component(ngraph)
123111

112+
set(SDL_cmake_included ON)
113+
# set(NGRAPH_COMPONENT_PREFIX "deployment_tools/ngraph/")
124114
add_subdirectory(ngraph)
125115
endfunction()
126116

127117
build_ngraph()
128118

129-
if (ENABLE_INFERENCE_ENGINE)
130-
add_subdirectory(inference-engine)
131-
endif()
132-
133-
# cpack
119+
add_subdirectory(inference-engine)
134120

135121
ie_cpack(${IE_CPACK_COMPONENTS_ALL})

build-instruction.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The software was validated on:
5757
- CentOS\* 7.4 (64-bit) with default GCC\* 4.8.5
5858

5959
### Software Requirements
60-
- [CMake]\* 3.5 or higher
60+
- [CMake]\* 3.11 or higher
6161
- GCC\* 4.8 or higher to build the Inference Engine
6262
- Python 2.7 or higher for Inference Engine Python API wrapper
6363
- (Optional) [Install Intel® Graphics Compute Runtime for OpenCL™ Driver package 19.41.14441].
@@ -234,7 +234,6 @@ with the following content:
234234
build-essential \
235235
crossbuild-essential-armhf \
236236
git \
237-
cmake \
238237
wget \
239238
libusb-1.0-0-dev:armhf \
240239
libgtk-3-dev:armhf \
@@ -245,6 +244,11 @@ with the following content:
245244
libgstreamer-plugins-base1.0-dev:armhf \
246245
libpython3-dev:armhf \
247246
python3-pip
247+
248+
RUN wget https://www.cmake.org/files/v3.14/cmake-3.14.3.tar.gz && \
249+
tar xf cmake-3.14.3.tar.gz && \
250+
(cd cmake-3.14.3 && ./bootstrap --parallel=$(nproc --all) && make --jobs=$(nproc --all) && make install) && \
251+
rm -rf cmake-3.14.3 cmake-3.14.3.tar.gz
248252
```
249253

250254
It uses the Debian\* Stretch (Debian 9) OS for compilation because it is a base of the Raspbian\* Stretch.
@@ -331,7 +335,7 @@ The software was validated on:
331335
Compiler 2018 Update 3
332336
333337
### Software Requirements
334-
- [CMake]\*3.5 or higher
338+
- [CMake]\*3.11 or higher
335339
- Microsoft\* Visual Studio 2017, 2019 or [Intel® C++ Compiler] 18.0
336340
- (Optional) Intel® Graphics Driver for Windows* (26.20) [driver package].
337341
- Python 3.4 or higher for Inference Engine Python API wrapper
@@ -377,8 +381,8 @@ cmake -G "Visual Studio 15 2017 Win64" -T "Intel C++ Compiler 18.0" ^
377381

378382
6. Before running the samples, add paths to the TBB and OpenCV binaries used for
379383
the build to the `%PATH%` environment variable. By default, TBB binaries are
380-
downloaded by the CMake-based script to the `<dldt_repo>/inference-engine/temp/tbb/lib`
381-
folder, OpenCV binaries to the `<dldt_repo>/inference-engine/temp/opencv_4.2.0/bin`
384+
downloaded by the CMake-based script to the `<dldt_repo>/inference-engine/temp/tbb/bin`
385+
folder, OpenCV binaries to the `<dldt_repo>/inference-engine/temp/opencv_4.3.0/opencv/bin`
382386
folder.
383387

384388
### Additional Build Options
@@ -449,7 +453,7 @@ The software was validated on:
449453
450454
### Software Requirements
451455
452-
- [CMake]\* 3.9 or higher
456+
- [CMake]\* 3.11 or higher
453457
- Clang\* compiler from Xcode\* 10.1 or higher
454458
- Python\* 3.4 or higher for the Inference Engine Python API wrapper
455459
@@ -525,9 +529,8 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
525529

526530
### Software Requirements
527531

528-
- [CMake]\* 3.5 or higher
532+
- [CMake]\* 3.11 or higher
529533
- Android NDK (this guide has been validated with r20 release)
530-
- OpenCV for Android
531534

532535
### Build Steps
533536

@@ -540,26 +543,18 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
540543
mv android-ndk-r20 android-ndk
541544
```
542545
543-
2. Download and unpack OpenCV
544-
```sh
545-
cd ~/Downloads
546-
wget https://github.com/opencv/opencv/releases/download/4.2.0/opencv-4.2.0-android-sdk.zip
547-
548-
unzip opencv-4.2.0-android-sdk.zip
549-
```
550-
551-
3. Clone submodules
546+
2. Clone submodules
552547
```sh
553548
cd dldt
554549
git submodule update --init --recursive
555550
```
556551
557-
4. Create a build folder:
552+
3. Create a build folder:
558553
```sh
559554
mkdir build
560555
```
561556
562-
5. Change working directory to `build` and run `cmake` to create makefiles. Then run `make`.
557+
4. Change working directory to `build` and run `cmake` to create makefiles. Then run `make`.
563558
```sh
564559
cd build
565560
@@ -568,7 +563,7 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
568563
-DANDROID_ABI=x86_64 \
569564
-DANDROID_PLATFORM=21 \
570565
-DANDROID_STL=c++_shared \
571-
-DOpenCV_DIR=~/Downloads/OpenCV-android-sdk/sdk/native/jni/
566+
-DENABLE_OPENCV=OFF
572567
573568
make --jobs=$(nproc --all)
574569
```
@@ -580,7 +575,7 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
580575
581576
## Use Custom OpenCV Builds for Inference Engine
582577
583-
> **NOTE**: The recommended and tested version of OpenCV is 4.2. The minimum
578+
> **NOTE**: The recommended and tested version of OpenCV is 4.3. The minimum
584579
supported version is 3.4.0.
585580
586581
Required versions of OpenCV packages are downloaded automatically during the

cmake/arm.toolchain.cmake

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,62 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
1212
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
1313
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
1414
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
15+
16+
macro(__cmake_find_root_save_and_reset)
17+
foreach(v
18+
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
19+
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
20+
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
21+
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
22+
)
23+
set(__save_${v} ${${v}})
24+
set(${v} NEVER)
25+
endforeach()
26+
endmacro()
27+
28+
macro(__cmake_find_root_restore)
29+
foreach(v
30+
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
31+
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
32+
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
33+
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
34+
)
35+
set(${v} ${__save_${v}})
36+
unset(__save_${v})
37+
endforeach()
38+
endmacro()
39+
40+
41+
# macro to find programs on the host OS
42+
macro(find_host_program)
43+
__cmake_find_root_save_and_reset()
44+
if(CMAKE_HOST_WIN32)
45+
SET(WIN32 1)
46+
SET(UNIX)
47+
elseif(CMAKE_HOST_APPLE)
48+
SET(APPLE 1)
49+
SET(UNIX)
50+
endif()
51+
find_program(${ARGN})
52+
SET(WIN32)
53+
SET(APPLE)
54+
SET(UNIX 1)
55+
__cmake_find_root_restore()
56+
endmacro()
57+
58+
# macro to find packages on the host OS
59+
macro(find_host_package)
60+
__cmake_find_root_save_and_reset()
61+
if(CMAKE_HOST_WIN32)
62+
SET(WIN32 1)
63+
SET(UNIX)
64+
elseif(CMAKE_HOST_APPLE)
65+
SET(APPLE 1)
66+
SET(UNIX)
67+
endif()
68+
find_package(${ARGN})
69+
SET(WIN32)
70+
SET(APPLE)
71+
SET(UNIX 1)
72+
__cmake_find_root_restore()
73+
endmacro()

cmake/arm64.toolchain.cmake

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,62 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
1212
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
1313
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
1414
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
15+
16+
macro(__cmake_find_root_save_and_reset)
17+
foreach(v
18+
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
19+
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
20+
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
21+
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
22+
)
23+
set(__save_${v} ${${v}})
24+
set(${v} NEVER)
25+
endforeach()
26+
endmacro()
27+
28+
macro(__cmake_find_root_restore)
29+
foreach(v
30+
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
31+
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
32+
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
33+
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
34+
)
35+
set(${v} ${__save_${v}})
36+
unset(__save_${v})
37+
endforeach()
38+
endmacro()
39+
40+
41+
# macro to find programs on the host OS
42+
macro(find_host_program)
43+
__cmake_find_root_save_and_reset()
44+
if(CMAKE_HOST_WIN32)
45+
SET(WIN32 1)
46+
SET(UNIX)
47+
elseif(CMAKE_HOST_APPLE)
48+
SET(APPLE 1)
49+
SET(UNIX)
50+
endif()
51+
find_program(${ARGN})
52+
SET(WIN32)
53+
SET(APPLE)
54+
SET(UNIX 1)
55+
__cmake_find_root_restore()
56+
endmacro()
57+
58+
# macro to find packages on the host OS
59+
macro(find_host_package)
60+
__cmake_find_root_save_and_reset()
61+
if(CMAKE_HOST_WIN32)
62+
SET(WIN32 1)
63+
SET(UNIX)
64+
elseif(CMAKE_HOST_APPLE)
65+
SET(APPLE 1)
66+
SET(UNIX)
67+
endif()
68+
find_package(${ARGN})
69+
SET(WIN32)
70+
SET(APPLE)
71+
SET(UNIX 1)
72+
__cmake_find_root_restore()
73+
endmacro()

0 commit comments

Comments
 (0)