Skip to content

Commit 19cfaa2

Browse files
committed
Merge pull request opencv#21254 from alalek:build_opencv_winpack_dldt_2021.4.2
2 parents 35f27d0 + 52c423a commit 19cfaa2

9 files changed

+330
-3
lines changed

cmake/OpenCVDetectInferenceEngine.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ if(DEFINED InferenceEngine_VERSION)
112112
endif()
113113
endif()
114114
if(NOT INF_ENGINE_RELEASE AND NOT INF_ENGINE_RELEASE_INIT)
115-
message(STATUS "WARNING: InferenceEngine version has not been set, 2021.4.1 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
116-
set(INF_ENGINE_RELEASE_INIT "2021040100")
115+
message(STATUS "WARNING: InferenceEngine version has not been set, 2021.4.2 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
116+
set(INF_ENGINE_RELEASE_INIT "2021040200")
117117
elseif(DEFINED INF_ENGINE_RELEASE)
118118
set(INF_ENGINE_RELEASE_INIT "${INF_ENGINE_RELEASE}")
119119
endif()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/inference-engine/src/CMakeLists.txt b/inference-engine/src/CMakeLists.txt
2+
index 0ba0dd78..7d34e7cb 100644
3+
--- a/inference-engine/src/CMakeLists.txt
4+
+++ b/inference-engine/src/CMakeLists.txt
5+
@@ -26,9 +26,9 @@ endif()
6+
7+
add_subdirectory(hetero_plugin)
8+
9+
-add_subdirectory(auto_plugin)
10+
+#add_subdirectory(auto_plugin)
11+
12+
-add_subdirectory(multi_device)
13+
+#add_subdirectory(multi_device)
14+
15+
add_subdirectory(transformations)
16+
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
diff --git a/cmake/developer_package/add_ie_target.cmake b/cmake/developer_package/add_ie_target.cmake
2+
index d49f16a4d..2726ca787 100644
3+
--- a/cmake/developer_package/add_ie_target.cmake
4+
+++ b/cmake/developer_package/add_ie_target.cmake
5+
@@ -92,7 +92,7 @@ function(addIeTarget)
6+
if (ARG_TYPE STREQUAL EXECUTABLE)
7+
add_executable(${ARG_NAME} ${all_sources})
8+
elseif(ARG_TYPE STREQUAL STATIC OR ARG_TYPE STREQUAL SHARED)
9+
- add_library(${ARG_NAME} ${ARG_TYPE} ${all_sources})
10+
+ add_library(${ARG_NAME} ${ARG_TYPE} EXCLUDE_FROM_ALL ${all_sources})
11+
else()
12+
message(SEND_ERROR "Invalid target type ${ARG_TYPE} specified for target name ${ARG_NAME}")
13+
endif()
14+
diff --git a/inference-engine/CMakeLists.txt b/inference-engine/CMakeLists.txt
15+
index 1ac7fd8bf..df7091e51 100644
16+
--- a/inference-engine/CMakeLists.txt
17+
+++ b/inference-engine/CMakeLists.txt
18+
@@ -39,7 +39,7 @@ if(ENABLE_TESTS)
19+
add_subdirectory(tests)
20+
endif()
21+
22+
-add_subdirectory(tools)
23+
+#add_subdirectory(tools)
24+
25+
function(ie_build_samples)
26+
# samples should be build with the same flags as from OpenVINO package,
27+
@@ -58,7 +58,7 @@ endfunction()
28+
29+
# gflags and format_reader targets are kept inside of samples directory and
30+
# they must be built even if samples build is disabled (required for tests and tools).
31+
-ie_build_samples()
32+
+#ie_build_samples()
33+
34+
if(ENABLE_PYTHON)
35+
add_subdirectory(ie_bridges/python)
36+
@@ -142,7 +142,7 @@ endif()
37+
# Developer package
38+
#
39+
40+
-openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader gflags ie_samples_utils)
41+
+#openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader gflags ie_samples_utils)
42+
43+
# for Template plugin
44+
if(NGRAPH_INTERPRETER_ENABLE)
45+
@@ -166,7 +166,7 @@ function(ie_generate_dev_package_config)
46+
@ONLY)
47+
endfunction()
48+
49+
-ie_generate_dev_package_config()
50+
+#ie_generate_dev_package_config()
51+
52+
#
53+
# Coverage
54+
diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
55+
index e8ed1a5c4..1fc9fc3ff 100644
56+
--- a/inference-engine/src/inference_engine/CMakeLists.txt
57+
+++ b/inference-engine/src/inference_engine/CMakeLists.txt
58+
@@ -110,7 +110,7 @@ add_cpplint_target(${TARGET_NAME}_plugin_api_cpplint FOR_SOURCES ${plugin_api_sr
59+
60+
# Create object library
61+
62+
-add_library(${TARGET_NAME}_obj OBJECT
63+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
64+
${LIBRARY_SRC}
65+
${LIBRARY_HEADERS}
66+
${PUBLIC_HEADERS})
67+
@@ -181,7 +181,7 @@ ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
68+
69+
# Static library used for unit tests which are always built
70+
71+
-add_library(${TARGET_NAME}_s STATIC
72+
+add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL
73+
$<TARGET_OBJECTS:${TARGET_NAME}_legacy_obj>
74+
$<TARGET_OBJECTS:${TARGET_NAME}_obj>
75+
${IE_STATIC_DEPENDENT_FILES})
76+
diff --git a/inference-engine/src/legacy_api/CMakeLists.txt b/inference-engine/src/legacy_api/CMakeLists.txt
77+
index 8eae82bd2..e0e6745b1 100644
78+
--- a/inference-engine/src/legacy_api/CMakeLists.txt
79+
+++ b/inference-engine/src/legacy_api/CMakeLists.txt
80+
@@ -26,7 +26,7 @@ endif()
81+
82+
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
83+
84+
-add_library(${TARGET_NAME}_obj OBJECT
85+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
86+
${LIBRARY_SRC}
87+
${PUBLIC_HEADERS})
88+
89+
diff --git a/inference-engine/src/mkldnn_plugin/CMakeLists.txt b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
90+
index fe57b29dd..07831e2fb 100644
91+
--- a/inference-engine/src/mkldnn_plugin/CMakeLists.txt
92+
+++ b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
93+
@@ -67,7 +67,7 @@ ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
94+
95+
# add test object library
96+
97+
-add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
98+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL ${SOURCES} ${HEADERS})
99+
target_link_libraries(${TARGET_NAME}_obj PUBLIC mkldnn)
100+
101+
target_include_directories(${TARGET_NAME}_obj PRIVATE $<TARGET_PROPERTY:inference_engine_preproc_s,INTERFACE_INCLUDE_DIRECTORIES>
102+
diff --git a/inference-engine/src/preprocessing/CMakeLists.txt b/inference-engine/src/preprocessing/CMakeLists.txt
103+
index f9548339d..ef962145a 100644
104+
--- a/inference-engine/src/preprocessing/CMakeLists.txt
105+
+++ b/inference-engine/src/preprocessing/CMakeLists.txt
106+
@@ -101,7 +101,7 @@ endif()
107+
108+
# Create object library
109+
110+
-add_library(${TARGET_NAME}_obj OBJECT
111+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
112+
${LIBRARY_SRC}
113+
${LIBRARY_HEADERS})
114+
115+
@@ -153,7 +153,7 @@ ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
116+
117+
# Static library used for unit tests which are always built
118+
119+
-add_library(${TARGET_NAME}_s STATIC
120+
+add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL
121+
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
122+
123+
set_ie_threading_interface_for(${TARGET_NAME}_s)
124+
diff --git a/inference-engine/src/vpu/common/CMakeLists.txt b/inference-engine/src/vpu/common/CMakeLists.txt
125+
index 249e47c28..4ddf63049 100644
126+
--- a/inference-engine/src/vpu/common/CMakeLists.txt
127+
+++ b/inference-engine/src/vpu/common/CMakeLists.txt
128+
@@ -5,7 +5,7 @@
129+
file(GLOB_RECURSE SOURCES *.cpp *.hpp *.h)
130+
131+
function(add_common_target TARGET_NAME STATIC_IE)
132+
- add_library(${TARGET_NAME} STATIC ${SOURCES})
133+
+ add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${SOURCES})
134+
135+
ie_faster_build(${TARGET_NAME}
136+
UNITY
137+
@@ -60,7 +60,7 @@ add_common_target("vpu_common_lib" FALSE)
138+
139+
# Unit tests support for graph transformer
140+
if(WIN32)
141+
- add_common_target("vpu_common_lib_test_static" TRUE)
142+
+ #add_common_target("vpu_common_lib_test_static" TRUE)
143+
else()
144+
add_library("vpu_common_lib_test_static" ALIAS "vpu_common_lib")
145+
endif()
146+
diff --git a/inference-engine/src/vpu/graph_transformer/CMakeLists.txt b/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
147+
index bc73ab5b1..b4c1547fc 100644
148+
--- a/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
149+
+++ b/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
150+
@@ -5,7 +5,7 @@
151+
file(GLOB_RECURSE SOURCES *.cpp *.hpp *.h *.inc)
152+
153+
function(add_graph_transformer_target TARGET_NAME STATIC_IE)
154+
- add_library(${TARGET_NAME} STATIC ${SOURCES})
155+
+ add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${SOURCES})
156+
157+
set_ie_threading_interface_for(${TARGET_NAME})
158+
159+
@@ -70,7 +70,7 @@ add_graph_transformer_target("vpu_graph_transformer" FALSE)
160+
161+
# Unit tests support for graph transformer
162+
if(WIN32)
163+
- add_graph_transformer_target("vpu_graph_transformer_test_static" TRUE)
164+
+ #add_graph_transformer_target("vpu_graph_transformer_test_static" TRUE)
165+
else()
166+
add_library("vpu_graph_transformer_test_static" ALIAS "vpu_graph_transformer")
167+
endif()
168+
diff --git a/inference-engine/thirdparty/pugixml/CMakeLists.txt b/inference-engine/thirdparty/pugixml/CMakeLists.txt
169+
index 8bcb2801a..f7e031c01 100644
170+
--- a/inference-engine/thirdparty/pugixml/CMakeLists.txt
171+
+++ b/inference-engine/thirdparty/pugixml/CMakeLists.txt
172+
@@ -41,7 +41,7 @@ if(BUILD_SHARED_LIBS)
173+
else()
174+
add_library(pugixml STATIC ${SOURCES})
175+
if (MSVC)
176+
- add_library(pugixml_mt STATIC ${SOURCES})
177+
+ #add_library(pugixml_mt STATIC ${SOURCES})
178+
#if (WIN32)
179+
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
180+
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
181+
diff --git a/ngraph/core/builder/CMakeLists.txt b/ngraph/core/builder/CMakeLists.txt
182+
index ff5c381e7..2797ec9ab 100644
183+
--- a/ngraph/core/builder/CMakeLists.txt
184+
+++ b/ngraph/core/builder/CMakeLists.txt
185+
@@ -16,7 +16,7 @@ source_group("src" FILES ${LIBRARY_SRC})
186+
source_group("include" FILES ${PUBLIC_HEADERS})
187+
188+
# Create shared library
189+
-add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
190+
+add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${LIBRARY_SRC} ${PUBLIC_HEADERS})
191+
192+
if(COMMAND ie_faster_build)
193+
ie_faster_build(${TARGET_NAME}
194+
diff --git a/ngraph/core/reference/CMakeLists.txt b/ngraph/core/reference/CMakeLists.txt
195+
index ef4a764ab..f6d3172e2 100644
196+
--- a/ngraph/core/reference/CMakeLists.txt
197+
+++ b/ngraph/core/reference/CMakeLists.txt
198+
@@ -16,7 +16,7 @@ source_group("src" FILES ${LIBRARY_SRC})
199+
source_group("include" FILES ${PUBLIC_HEADERS})
200+
201+
# Create shared library
202+
-add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
203+
+add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${LIBRARY_SRC} ${PUBLIC_HEADERS})
204+
205+
if(COMMAND ie_faster_build)
206+
ie_faster_build(${TARGET_NAME}
207+
diff --git a/openvino/itt/CMakeLists.txt b/openvino/itt/CMakeLists.txt
208+
index e9f880b8c..c63f4df63 100644
209+
--- a/openvino/itt/CMakeLists.txt
210+
+++ b/openvino/itt/CMakeLists.txt
211+
@@ -6,7 +6,7 @@ set(TARGET_NAME itt)
212+
213+
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp")
214+
215+
-add_library(${TARGET_NAME} STATIC ${SOURCES})
216+
+add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${SOURCES})
217+
218+
add_library(openvino::itt ALIAS ${TARGET_NAME})
219+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
iff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index e0706a72e..9a053b1e4 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -6,6 +6,10 @@ cmake_minimum_required(VERSION 3.13)
6+
7+
project(OpenVINO)
8+
9+
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /FS")
10+
+set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
11+
+set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
12+
+
13+
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
14+
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
15+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/cmake/developer_package/vs_version/vs_version.cmake b/cmake/developer_package/vs_version/vs_version.cmake
2+
index 14d4c0e1e..6a44f73b9 100644
3+
--- a/cmake/developer_package/vs_version/vs_version.cmake
4+
+++ b/cmake/developer_package/vs_version/vs_version.cmake
5+
@@ -8,9 +8,9 @@ set(IE_VS_VER_FILEVERSION_STR "${IE_VERSION_MAJOR}.${IE_VERSION_MINOR}.${IE_VERS
6+
7+
set(IE_VS_VER_COMPANY_NAME_STR "Intel Corporation")
8+
set(IE_VS_VER_PRODUCTVERSION_STR "${CI_BUILD_NUMBER}")
9+
-set(IE_VS_VER_PRODUCTNAME_STR "OpenVINO toolkit")
10+
+set(IE_VS_VER_PRODUCTNAME_STR "OpenVINO toolkit (for OpenCV Windows package)")
11+
set(IE_VS_VER_COPYRIGHT_STR "Copyright (C) 2018-2021, Intel Corporation")
12+
-set(IE_VS_VER_COMMENTS_STR "https://docs.openvinotoolkit.org/")
13+
+set(IE_VS_VER_COMMENTS_STR "https://github.com/opencv/opencv/wiki/Intel%27s-Deep-Learning-Inference-Engine-backend")
14+
15+
#
16+
# ie_add_vs_version_file(NAME <name>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
os.environ['CI_BUILD_NUMBER'] = '2021.4.2-opencv_winpack_dldt'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
applyPatch('20210630-dldt-disable-unused-targets.patch')
2+
applyPatch('20210630-dldt-pdb.patch')
3+
applyPatch('20210630-dldt-disable-multidevice-autoplugin.patch')
4+
applyPatch('20210630-dldt-vs-version.patch')
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
sysroot_bin_dir = prepare_dir(self.sysrootdir / 'bin')
2+
copytree(self.build_dir / 'install', self.sysrootdir / 'ngraph')
3+
#rm_one(self.sysrootdir / 'ngraph' / 'lib' / 'ngraph.dll')
4+
5+
build_config = 'Release' if not self.config.build_debug else 'Debug'
6+
build_bin_dir = self.build_dir / 'bin' / 'intel64' / build_config
7+
8+
def copy_bin(name):
9+
global build_bin_dir, sysroot_bin_dir
10+
copytree(build_bin_dir / name, sysroot_bin_dir / name)
11+
12+
dll_suffix = 'd' if self.config.build_debug else ''
13+
def copy_dll(name):
14+
global copy_bin, dll_suffix
15+
copy_bin(name + dll_suffix + '.dll')
16+
copy_bin(name + dll_suffix + '.pdb')
17+
18+
copy_bin('cache.json')
19+
copy_dll('clDNNPlugin')
20+
copy_dll('HeteroPlugin')
21+
copy_dll('inference_engine')
22+
copy_dll('inference_engine_ir_reader')
23+
#copy_dll('inference_engine_ir_v7_reader')
24+
copy_dll('inference_engine_legacy')
25+
copy_dll('inference_engine_transformations') # runtime
26+
copy_dll('inference_engine_lp_transformations') # runtime
27+
#copy_dll('inference_engine_preproc') # runtime
28+
copy_dll('MKLDNNPlugin') # runtime
29+
copy_dll('myriadPlugin') # runtime
30+
#copy_dll('MultiDevicePlugin') # runtime, not used
31+
copy_dll('ngraph')
32+
copy_bin('plugins.xml')
33+
copy_bin('pcie-ma2x8x.elf')
34+
copy_bin('usb-ma2x8x.mvcmd')
35+
36+
copytree(self.srcdir / 'inference-engine' / 'temp' / 'tbb' / 'bin', sysroot_bin_dir)
37+
copytree(self.srcdir / 'inference-engine' / 'temp' / 'tbb', self.sysrootdir / 'tbb')
38+
39+
sysroot_ie_dir = prepare_dir(self.sysrootdir / 'deployment_tools' / 'inference_engine')
40+
sysroot_ie_lib_dir = prepare_dir(sysroot_ie_dir / 'lib' / 'intel64')
41+
42+
copytree(self.srcdir / 'inference-engine' / 'include', sysroot_ie_dir / 'include')
43+
if not self.config.build_debug:
44+
copytree(build_bin_dir / 'ngraph.lib', sysroot_ie_lib_dir / 'ngraph.lib')
45+
copytree(build_bin_dir / 'inference_engine.lib', sysroot_ie_lib_dir / 'inference_engine.lib')
46+
copytree(build_bin_dir / 'inference_engine_ir_reader.lib', sysroot_ie_lib_dir / 'inference_engine_ir_reader.lib')
47+
copytree(build_bin_dir / 'inference_engine_legacy.lib', sysroot_ie_lib_dir / 'inference_engine_legacy.lib')
48+
else:
49+
copytree(build_bin_dir / 'ngraphd.lib', sysroot_ie_lib_dir / 'ngraphd.lib')
50+
copytree(build_bin_dir / 'inference_engined.lib', sysroot_ie_lib_dir / 'inference_engined.lib')
51+
copytree(build_bin_dir / 'inference_engine_ir_readerd.lib', sysroot_ie_lib_dir / 'inference_engine_ir_readerd.lib')
52+
copytree(build_bin_dir / 'inference_engine_legacyd.lib', sysroot_ie_lib_dir / 'inference_engine_legacyd.lib')
53+
54+
sysroot_license_dir = prepare_dir(self.sysrootdir / 'etc' / 'licenses')
55+
copytree(self.srcdir / 'LICENSE', sysroot_license_dir / 'dldt-LICENSE')
56+
copytree(self.sysrootdir / 'tbb/LICENSE', sysroot_license_dir / 'tbb-LICENSE')

platforms/winpack_dldt/build_package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def package_sources(self):
469469
def main():
470470

471471
dldt_src_url = 'https://github.com/openvinotoolkit/openvino'
472-
dldt_src_commit = '2021.4.1'
472+
dldt_src_commit = '2021.4.2'
473473
dldt_config = None
474474
dldt_release = None
475475

0 commit comments

Comments
 (0)