Skip to content

Commit b90a2a8

Browse files
committed
Merge pull request opencv#17759 from alalek:build_opencv_winpack_dldt_2020.4.0
2 parents 950a916 + ccf6dd0 commit b90a2a8

File tree

6 files changed

+298
-22
lines changed

6 files changed

+298
-22
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 1f981ed2..90eb500a 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -22,6 +22,9 @@ endif()
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+
+
12+
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
13+
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
14+
list(APPEND CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake")
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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,7 +26,7 @@ endif()
6+
7+
add_subdirectory(hetero_plugin)
8+
9+
-add_subdirectory(multi_device)
10+
+#add_subdirectory(multi_device)
11+
12+
add_subdirectory(transformations)
13+
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
diff --git a/inference-engine/CMakeLists.txt b/inference-engine/CMakeLists.txt
2+
index 39ff413b..df4e89c7 100644
3+
--- a/inference-engine/CMakeLists.txt
4+
+++ b/inference-engine/CMakeLists.txt
5+
@@ -66,7 +66,7 @@ if(ENABLE_TESTS)
6+
add_subdirectory(tests)
7+
endif()
8+
9+
-add_subdirectory(tools)
10+
+#add_subdirectory(tools)
11+
12+
function(ie_build_samples)
13+
# samples should be build with the same flags as from OpenVINO package,
14+
@@ -85,7 +85,7 @@ endfunction()
15+
16+
# gflags and format_reader targets are kept inside of samples directory and
17+
# they must be built even if samples build is disabled (required for tests and tools).
18+
-ie_build_samples()
19+
+#ie_build_samples()
20+
21+
file(GLOB_RECURSE SAMPLES_SOURCES samples/*.cpp samples/*.hpp samples/*.h)
22+
add_cpplint_target(sample_cpplint
23+
@@ -174,10 +174,10 @@ endif()
24+
# Developer package
25+
#
26+
27+
-ie_developer_export_targets(format_reader)
28+
+#ie_developer_export_targets(format_reader)
29+
ie_developer_export_targets(${NGRAPH_LIBRARIES})
30+
31+
-ie_developer_export()
32+
+#ie_developer_export()
33+
34+
configure_file(
35+
"${IE_MAIN_SOURCE_DIR}/cmake/developer_package_config.cmake.in"
36+
diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt
37+
index 4ae0d560..e37acbe0 100644
38+
--- a/inference-engine/src/inference_engine/CMakeLists.txt
39+
+++ b/inference-engine/src/inference_engine/CMakeLists.txt
40+
@@ -99,7 +99,7 @@ add_cpplint_target(${TARGET_NAME}_plugin_api_cpplint FOR_SOURCES ${plugin_api_sr
41+
42+
# Create common base object library
43+
44+
-add_library(${TARGET_NAME}_common_obj OBJECT
45+
+add_library(${TARGET_NAME}_common_obj OBJECT EXCLUDE_FROM_ALL
46+
${IE_BASE_SOURCE_FILES})
47+
48+
target_compile_definitions(${TARGET_NAME}_common_obj PRIVATE IMPLEMENT_INFERENCE_ENGINE_API)
49+
@@ -112,7 +112,7 @@ target_include_directories(${TARGET_NAME}_common_obj SYSTEM PRIVATE
50+
51+
# Create object library
52+
53+
-add_library(${TARGET_NAME}_obj OBJECT
54+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
55+
${LIBRARY_SRC}
56+
${LIBRARY_HEADERS}
57+
${PUBLIC_HEADERS})
58+
@@ -177,7 +177,7 @@ ie_register_plugins(MAIN_TARGET ${TARGET_NAME}
59+
60+
# Static library used for unit tests which are always built
61+
62+
-add_library(${TARGET_NAME}_s STATIC
63+
+add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL
64+
$<TARGET_OBJECTS:${TARGET_NAME}_obj>
65+
$<TARGET_OBJECTS:${TARGET_NAME}_common_obj>
66+
$<TARGET_OBJECTS:${TARGET_NAME}_legacy_obj>
67+
diff --git a/inference-engine/src/legacy_api/CMakeLists.txt b/inference-engine/src/legacy_api/CMakeLists.txt
68+
index 85524310..ed27e058 100644
69+
--- a/inference-engine/src/legacy_api/CMakeLists.txt
70+
+++ b/inference-engine/src/legacy_api/CMakeLists.txt
71+
@@ -21,7 +21,7 @@ source_group("include" FILES ${PUBLIC_HEADERS})
72+
73+
# Create object library
74+
75+
-add_library(${TARGET_NAME}_obj OBJECT
76+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
77+
${LIBRARY_SRC}
78+
${PUBLIC_HEADERS})
79+
80+
diff --git a/inference-engine/src/mkldnn_plugin/CMakeLists.txt b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
81+
index 297783da..06da35c3 100644
82+
--- a/inference-engine/src/mkldnn_plugin/CMakeLists.txt
83+
+++ b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
84+
@@ -192,7 +192,7 @@ cross_compiled_file(${TARGET_NAME}
85+
86+
# add test object library
87+
88+
-add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
89+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL ${SOURCES} ${HEADERS})
90+
91+
target_include_directories(${TARGET_NAME}_obj PRIVATE $<TARGET_PROPERTY:inference_engine_preproc_s,INTERFACE_INCLUDE_DIRECTORIES>
92+
$<TARGET_PROPERTY:inference_engine_lp_transformations,INTERFACE_INCLUDE_DIRECTORIES>
93+
diff --git a/inference-engine/src/preprocessing/CMakeLists.txt b/inference-engine/src/preprocessing/CMakeLists.txt
94+
index adc52f06..6b7d0ffe 100644
95+
--- a/inference-engine/src/preprocessing/CMakeLists.txt
96+
+++ b/inference-engine/src/preprocessing/CMakeLists.txt
97+
@@ -124,7 +124,7 @@ endif()
98+
99+
# Create object library
100+
101+
-add_library(${TARGET_NAME}_obj OBJECT
102+
+add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
103+
${LIBRARY_SRC}
104+
${LIBRARY_HEADERS})
105+
106+
@@ -183,7 +183,7 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}
107+
108+
# Static library used for unit tests which are always built
109+
110+
-add_library(${TARGET_NAME}_s STATIC
111+
+add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL
112+
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
113+
114+
set_ie_threading_interface_for(${TARGET_NAME}_s)
115+
diff --git a/inference-engine/src/vpu/common/CMakeLists.txt b/inference-engine/src/vpu/common/CMakeLists.txt
116+
index 43e9308f..2e40dd31 100644
117+
--- a/inference-engine/src/vpu/common/CMakeLists.txt
118+
+++ b/inference-engine/src/vpu/common/CMakeLists.txt
119+
@@ -55,7 +55,7 @@ add_common_target("vpu_common_lib" FALSE)
120+
121+
# Unit tests support for graph transformer
122+
if(WIN32)
123+
- add_common_target("vpu_common_lib_test_static" TRUE)
124+
+ #add_common_target("vpu_common_lib_test_static" TRUE)
125+
else()
126+
add_library("vpu_common_lib_test_static" ALIAS "vpu_common_lib")
127+
endif()
128+
diff --git a/inference-engine/src/vpu/graph_transformer/CMakeLists.txt b/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
129+
index 982d3c7f..15fcf3e8 100644
130+
--- a/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
131+
+++ b/inference-engine/src/vpu/graph_transformer/CMakeLists.txt
132+
@@ -64,7 +64,7 @@ add_graph_transformer_target("vpu_graph_transformer" FALSE)
133+
134+
# Unit tests support for graph transformer
135+
if(WIN32)
136+
- add_graph_transformer_target("vpu_graph_transformer_test_static" TRUE)
137+
+ #add_graph_transformer_target("vpu_graph_transformer_test_static" TRUE)
138+
else()
139+
add_library("vpu_graph_transformer_test_static" ALIAS "vpu_graph_transformer")
140+
endif()
141+
diff --git a/inference-engine/thirdparty/CMakeLists.txt b/inference-engine/thirdparty/CMakeLists.txt
142+
index f94453e0..c80e75c5 100644
143+
--- a/inference-engine/thirdparty/CMakeLists.txt
144+
+++ b/inference-engine/thirdparty/CMakeLists.txt
145+
@@ -43,13 +43,13 @@ function(build_with_lto)
146+
endfunction()
147+
148+
ie_build_pugixml()
149+
- add_subdirectory(stb_lib)
150+
+ #add_subdirectory(stb_lib)
151+
add_subdirectory(ade)
152+
add_subdirectory(fluid/modules/gapi)
153+
154+
target_include_directories(pugixml INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src>")
155+
156+
- set_target_properties(pugixml ade fluid stb_image
157+
+ set_target_properties(pugixml ade fluid
158+
PROPERTIES FOLDER thirdparty)
159+
160+
# developer package
161+
diff --git a/inference-engine/thirdparty/pugixml/CMakeLists.txt b/inference-engine/thirdparty/pugixml/CMakeLists.txt
162+
index 8bcb2801..380fb468 100644
163+
--- a/inference-engine/thirdparty/pugixml/CMakeLists.txt
164+
+++ b/inference-engine/thirdparty/pugixml/CMakeLists.txt
165+
@@ -41,7 +41,7 @@ if(BUILD_SHARED_LIBS)
166+
else()
167+
add_library(pugixml STATIC ${SOURCES})
168+
if (MSVC)
169+
- add_library(pugixml_mt STATIC ${SOURCES})
170+
+ #add_library(pugixml_mt STATIC ${SOURCES})
171+
#if (WIN32)
172+
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
173+
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
applyPatch('20200701-dldt-disable-unused-targets.patch')
2+
applyPatch('20200413-dldt-pdb.patch')
3+
applyPatch('20200604-dldt-disable-multidevice.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_legacy')
24+
copy_dll('inference_engine_transformations') # runtime
25+
copy_dll('inference_engine_lp_transformations') # runtime
26+
copy_dll('MKLDNNPlugin') # runtime
27+
copy_dll('myriadPlugin') # runtime
28+
#copy_dll('MultiDevicePlugin') # runtime, not used
29+
copy_dll('ngraph')
30+
copy_bin('plugins.xml')
31+
copytree(self.build_dir / 'bin' / 'intel64' / 'pcie-ma248x.elf', sysroot_bin_dir / 'pcie-ma248x.elf')
32+
copytree(self.build_dir / 'bin' / 'intel64' / 'usb-ma2x8x.mvcmd', sysroot_bin_dir / 'usb-ma2x8x.mvcmd')
33+
copytree(self.build_dir / 'bin' / 'intel64' / 'usb-ma2450.mvcmd', sysroot_bin_dir / 'usb-ma2450.mvcmd')
34+
35+
copytree(self.srcdir / 'inference-engine' / 'temp' / 'tbb' / 'bin', sysroot_bin_dir)
36+
copytree(self.srcdir / 'inference-engine' / 'temp' / 'tbb', self.sysrootdir / 'tbb')
37+
38+
sysroot_ie_dir = prepare_dir(self.sysrootdir / 'deployment_tools' / 'inference_engine')
39+
sysroot_ie_lib_dir = prepare_dir(sysroot_ie_dir / 'lib' / 'intel64')
40+
41+
copytree(self.srcdir / 'inference-engine' / 'include', sysroot_ie_dir / 'include')
42+
if not self.config.build_debug:
43+
copytree(self.build_dir / 'install' / 'lib' / 'ngraph.lib', sysroot_ie_lib_dir / 'ngraph.lib')
44+
copytree(build_bin_dir / 'inference_engine.lib', sysroot_ie_lib_dir / 'inference_engine.lib')
45+
copytree(build_bin_dir / 'inference_engine_ir_reader.lib', sysroot_ie_lib_dir / 'inference_engine_ir_reader.lib')
46+
copytree(build_bin_dir / 'inference_engine_legacy.lib', sysroot_ie_lib_dir / 'inference_engine_legacy.lib')
47+
else:
48+
copytree(self.build_dir / 'install' / 'lib' / 'ngraphd.lib', sysroot_ie_lib_dir / 'ngraphd.lib')
49+
copytree(build_bin_dir / 'inference_engined.lib', sysroot_ie_lib_dir / 'inference_engined.lib')
50+
copytree(build_bin_dir / 'inference_engine_ir_readerd.lib', sysroot_ie_lib_dir / 'inference_engine_ir_readerd.lib')
51+
copytree(build_bin_dir / 'inference_engine_legacyd.lib', sysroot_ie_lib_dir / 'inference_engine_legacyd.lib')
52+
53+
sysroot_license_dir = prepare_dir(self.sysrootdir / 'etc' / 'licenses')
54+
copytree(self.srcdir / 'LICENSE', sysroot_license_dir / 'dldt-LICENSE')
55+
copytree(self.srcdir / 'ngraph/LICENSE', sysroot_license_dir / 'ngraph-LICENSE')
56+
copytree(self.sysrootdir / 'tbb/LICENSE', sysroot_license_dir / 'tbb-LICENSE')

0 commit comments

Comments
 (0)