Skip to content

Commit

Permalink
Publishing 2020.2 content
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Suhov committed Apr 13, 2020
1 parent a347375 commit 95a5779
Show file tree
Hide file tree
Showing 3,056 changed files with 343,131 additions and 199,042 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
66 changes: 26 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,41 @@
#

cmake_policy(SET CMP0054 NEW)

# TODO: for make instal / package we need to use 3.13.3 version because
# it allows to install targets created outside of current projects
# See https://blog.kitware.com/cmake-3-13-0-available-for-download/

if (APPLE)
# due to https://cmake.org/cmake/help/v3.12/policy/CMP0068.html
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
else()
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR)
endif()


project(OpenVINO)

set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
set(CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

include(CTest)
include(features)

# include developer package
include(developer_package)
include(developer_package NO_POLICY_SCOPE)

# These options are shared with 3rdparty plugins
# by means of developer package
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_MAIN_SOURCE_DIR .............. " ${OpenVINO_MAIN_SOURCE_DIR})
if (ENABLE_INFERENCE_ENGINE)
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
message (STATUS "IE_MAIN_SOURCE_DIR .............. " ${IE_MAIN_SOURCE_DIR})
endif()
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})
Expand All @@ -42,57 +47,44 @@ file(REMOVE "${CMAKE_BINARY_DIR}/targets_developer.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/targets.cmake")

function(build_ngraph)
if(NOT ENABLE_NGRAPH)
return()
endif()

function(ngraph_set option value)
if(NOT DEFINED ${option})
set(${option} ${value} CACHE BOOL "" FORCE)
endif()
endfunction()

add_definitions(-DENABLE_NGRAPH)
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/")

ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
if (ENABLE_SANITIZER)
ngraph_set(NGRAPH_ADDRESS_SANITIZER TRUE)
else ()
ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
endif ()
ngraph_set(NGRAPH_TOOLS_ENABLE FALSE)
ngraph_set(NGRAPH_CPU_ENABLE FALSE)
ngraph_set(NGRAPH_MLIR_ENABLE FALSE)
ngraph_set(NGRAPH_INTELGPU_ENABLE FALSE)
ngraph_set(NGRAPH_GPU_ENABLE FALSE)
ngraph_set(NGRAPH_INTERPRETER_ENABLE FALSE)
ngraph_set(NGRAPH_INTERPRETER_ENABLE TRUE)
ngraph_set(NGRAPH_NOP_ENABLE FALSE)
ngraph_set(NGRAPH_GPUH_ENABLE FALSE)
ngraph_set(NGRAPH_GENERIC_CPU_ENABLE FALSE)
ngraph_set(NGRAPH_DEBUG_ENABLE FALSE)
ngraph_set(NGRAPH_DEPRECATED_ENABLE FALSE)
ngraph_set(NGRAPH_DEX_ONLY FALSE)
ngraph_set(NGRAPH_ENABLE_CPU_CONV_AUTO FALSE)
ngraph_set(NGRAPH_CODE_COVERAGE_ENABLE FALSE)
ngraph_set(NGRAPH_LIB_VERSIONING_ENABLE FALSE)
if (ENABLE_PYTHON AND NOT WIN32)
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE TRUE)
else()
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
endif()
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
ngraph_set(NGRAPH_PLAIDML_ENABLE FALSE)
ngraph_set(NGRAPH_DISTRIBUTED_ENABLE FALSE)
ngraph_set(NGRAPH_FAST_MATH_ENABLE FALSE)
ngraph_set(NGRAPH_JSON_ENABLE FALSE)
ngraph_set(NGRAPH_STATIC_LIB_ENABLE FALSE)
ngraph_set(NGRAPH_INTERPRETER_STATIC_LIB_ENABLE FALSE)
ngraph_set(NGRAPH_CPU_STATIC_LIB_ENABLE FALSE)
ngraph_set(NGRAPH_DYNAMIC_COMPONENTS_ENABLE FALSE)
ngraph_set(NGRAPH_NATIVE_ARCH_ENABLE FALSE)

if (NOT ANDROID)
ngraph_set(NGRAPH_UNIT_TEST_ENABLE TRUE)
ngraph_set(NGRAPH_UNIT_TEST_OPENVINO_ENABLE TRUE)
# ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE TRUE)
set(NGRAPH_ONNX_IMPORT_ENABLE TRUE CACHE BOOL "" FORCE)
else()
ngraph_set(NGRAPH_UNIT_TEST_ENABLE FALSE)
ngraph_set(NGRAPH_TEST_UTIL_ENABLE FALSE)
ngraph_set(NGRAPH_UNIT_TEST_OPENVINO_ENABLE FALSE)
ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE FALSE)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand All @@ -108,11 +100,7 @@ function(build_ngraph)
if (UNIX)
ie_add_compiler_flags(-Wno-error=return-type -Wno-undef)
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146")
endif()

if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146 /wd4703 /wd4244")
endif()

if(ENABLE_LTO)
Expand All @@ -121,15 +109,13 @@ function(build_ngraph)

ie_cpack_add_component(ngraph)

set(SDL_cmake_included ON)
# set(NGRAPH_COMPONENT_PREFIX "deployment_tools/ngraph/")
add_subdirectory(ngraph)
endfunction()

build_ngraph()

if (ENABLE_INFERENCE_ENGINE)
add_subdirectory(inference-engine)
endif()

# cpack
add_subdirectory(inference-engine)

ie_cpack(${IE_CPACK_COMPONENTS_ALL})
37 changes: 16 additions & 21 deletions build-instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The software was validated on:
- CentOS\* 7.4 (64-bit) with default GCC\* 4.8.5

### Software Requirements
- [CMake]\* 3.5 or higher
- [CMake]\* 3.11 or higher
- GCC\* 4.8 or higher to build the Inference Engine
- Python 2.7 or higher for Inference Engine Python API wrapper
- (Optional) [Install Intel® Graphics Compute Runtime for OpenCL™ Driver package 19.41.14441].
Expand Down Expand Up @@ -234,7 +234,6 @@ with the following content:
build-essential \
crossbuild-essential-armhf \
git \
cmake \
wget \
libusb-1.0-0-dev:armhf \
libgtk-3-dev:armhf \
Expand All @@ -245,6 +244,11 @@ with the following content:
libgstreamer-plugins-base1.0-dev:armhf \
libpython3-dev:armhf \
python3-pip
RUN wget https://www.cmake.org/files/v3.14/cmake-3.14.3.tar.gz && \
tar xf cmake-3.14.3.tar.gz && \
(cd cmake-3.14.3 && ./bootstrap --parallel=$(nproc --all) && make --jobs=$(nproc --all) && make install) && \
rm -rf cmake-3.14.3 cmake-3.14.3.tar.gz
```

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

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

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

### Software Requirements

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

### Build Steps

Expand All @@ -540,26 +543,18 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
mv android-ndk-r20 android-ndk
```
2. Download and unpack OpenCV
```sh
cd ~/Downloads
wget https://github.com/opencv/opencv/releases/download/4.2.0/opencv-4.2.0-android-sdk.zip
unzip opencv-4.2.0-android-sdk.zip
```
3. Clone submodules
2. Clone submodules
```sh
cd dldt
git submodule update --init --recursive
```
4. Create a build folder:
3. Create a build folder:
```sh
mkdir build
```
5. Change working directory to `build` and run `cmake` to create makefiles. Then run `make`.
4. Change working directory to `build` and run `cmake` to create makefiles. Then run `make`.
```sh
cd build
Expand All @@ -568,7 +563,7 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
-DANDROID_ABI=x86_64 \
-DANDROID_PLATFORM=21 \
-DANDROID_STL=c++_shared \
-DOpenCV_DIR=~/Downloads/OpenCV-android-sdk/sdk/native/jni/
-DENABLE_OPENCV=OFF
make --jobs=$(nproc --all)
```
Expand All @@ -580,7 +575,7 @@ This section describes how to build Inference Engine for Android x86 (64-bit) op
## Use Custom OpenCV Builds for Inference Engine
> **NOTE**: The recommended and tested version of OpenCV is 4.2. The minimum
> **NOTE**: The recommended and tested version of OpenCV is 4.3. The minimum
supported version is 3.4.0.
Required versions of OpenCV packages are downloaded automatically during the
Expand Down
59 changes: 59 additions & 0 deletions cmake/arm.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,62 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

macro(__cmake_find_root_save_and_reset)
foreach(v
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
)
set(__save_${v} ${${v}})
set(${v} NEVER)
endforeach()
endmacro()

macro(__cmake_find_root_restore)
foreach(v
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
)
set(${v} ${__save_${v}})
unset(__save_${v})
endforeach()
endmacro()


# macro to find programs on the host OS
macro(find_host_program)
__cmake_find_root_save_and_reset()
if(CMAKE_HOST_WIN32)
SET(WIN32 1)
SET(UNIX)
elseif(CMAKE_HOST_APPLE)
SET(APPLE 1)
SET(UNIX)
endif()
find_program(${ARGN})
SET(WIN32)
SET(APPLE)
SET(UNIX 1)
__cmake_find_root_restore()
endmacro()

# macro to find packages on the host OS
macro(find_host_package)
__cmake_find_root_save_and_reset()
if(CMAKE_HOST_WIN32)
SET(WIN32 1)
SET(UNIX)
elseif(CMAKE_HOST_APPLE)
SET(APPLE 1)
SET(UNIX)
endif()
find_package(${ARGN})
SET(WIN32)
SET(APPLE)
SET(UNIX 1)
__cmake_find_root_restore()
endmacro()
59 changes: 59 additions & 0 deletions cmake/arm64.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,62 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

macro(__cmake_find_root_save_and_reset)
foreach(v
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
)
set(__save_${v} ${${v}})
set(${v} NEVER)
endforeach()
endmacro()

macro(__cmake_find_root_restore)
foreach(v
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
)
set(${v} ${__save_${v}})
unset(__save_${v})
endforeach()
endmacro()


# macro to find programs on the host OS
macro(find_host_program)
__cmake_find_root_save_and_reset()
if(CMAKE_HOST_WIN32)
SET(WIN32 1)
SET(UNIX)
elseif(CMAKE_HOST_APPLE)
SET(APPLE 1)
SET(UNIX)
endif()
find_program(${ARGN})
SET(WIN32)
SET(APPLE)
SET(UNIX 1)
__cmake_find_root_restore()
endmacro()

# macro to find packages on the host OS
macro(find_host_package)
__cmake_find_root_save_and_reset()
if(CMAKE_HOST_WIN32)
SET(WIN32 1)
SET(UNIX)
elseif(CMAKE_HOST_APPLE)
SET(APPLE 1)
SET(UNIX)
endif()
find_package(${ARGN})
SET(WIN32)
SET(APPLE)
SET(UNIX 1)
__cmake_find_root_restore()
endmacro()
Loading

0 comments on commit 95a5779

Please sign in to comment.