a3a340c55d92f38d11eb8cda745b515e135b1021
[platform/upstream/dldt.git] / packaging / openvino.spec
1 %bcond_with tizen
2 %if %{with tizen}
3 %global debug_package %{nil}
4 %global __debug_install_post %{nil}
5
6 %if "%{?_lib}" == "lib64"
7 %define _cmake_lib_suffix_flag %{?_cmake_lib_suffix64}
8 %else
9 %define _cmake_lib_suffix_flag %{nil}
10 %endif
11
12 %ifarch x86_64
13 %define _cmake_sse_support_flag -DENABLE_SSE42=1
14 %else
15 %define _cmake_sse_support_flag -DENABLE_SSE42=0
16 %endif
17
18 %define _extra_cmake_flags %{_cmake_lib_suffix_flag} %{_cmake_sse_support_flag} -DLINUX_OS_NAME="Tizen %{tizen_full_version}"
19
20 %ifarch x86_64 i686 armv7l aarch64
21
22 %ifarch x86_64
23 %define install_arch    intel64
24 %endif
25
26 %ifarch i686
27 %define install_arch    i686
28 %endif
29
30 %ifarch armv7l
31 %define install_arch    armv7l
32 %endif
33
34 %ifarch aarch64
35 %define install_arch    aarch64
36 %endif
37
38 %else
39 %define install_arch    %{_arch}
40 %endif
41
42 %endif
43
44 %define     external_ade_archive        ade-cbe2db61a659c2cc304c3837406f95c39dfa938e
45 %define     external_ngraph_archive     ngraph-0.22.0-rc.2
46
47 Name:           openvino
48 Summary:        OpenVINO™ Toolkit - Deep Learning Deployment Toolkit
49 Version:        2019R3
50 Release:        0
51 Group:          Development/Libraries
52 Packager:       Wook Song <wook16.song@samsung.com>
53 License:        Apache-2.0
54 Source0:        %{name}-%{version}.tar.gz
55 Source1:        %{name}.manifest
56 Source1001:     %{external_ade_archive}.tar.gz
57 Source1002:     %{external_ngraph_archive}.tar.gz
58 Source1003:     openvino.pc.in
59 Patch0:         0001-CMake-Do-not-call-get_linux_name-when-LINUX_OS_NAME-.patch
60 Patch1:         0002-CMake-Add-a-variable-to-resolve-dependency-on-TBB-us.patch
61 BuildRequires:  cmake
62 BuildRequires:  pkgconfig(libtbb)
63 BuildRequires:  pkg-config
64
65 %description
66 OpenVINO™ toolkit, short for Open Visual Inference and Neural network Optimization toolkit,
67 provides developers with improved neural network performance on a variety of Intel® processors
68 and helps them further unlock cost-effective, real-time vision applications.
69 The toolkit enables deep learning inference and easy heterogeneous execution across multiple
70 Intel® platforms (CPU, Intel® Processor Graphics)—providing implementations across cloud
71 architectures to edge devices. This open source distribution provides flexibility and
72 availability to the developer community to innovate deep learning and AI solutions.
73
74 %package devel
75 Summary:        Development package for OpenVINO™ Toolkit
76 Requires:       %{name} = %{version}-%{release}
77
78 %description devel
79 Development package for Open Visual Inference and Neural network Optimization toolkit.
80 This contains corresponding header files and static archives.
81
82 %prep
83 %setup -q
84 %patch0 -p1
85 %patch1 -p1
86 cp %{SOURCE1} .
87 cp %{SOURCE1001} ./inference-engine/thirdparty
88 cp %{SOURCE1002} ./inference-engine/thirdparty
89 cp %{SOURCE1003} .
90 pushd inference-engine
91 pushd thirdparty
92 tar zxf %{external_ade_archive}.tar.gz
93 mv %{external_ade_archive}/* ade/
94 tar zxf %{external_ngraph_archive}.tar.gz
95 mv %{external_ngraph_archive}/* ngraph/
96 rm -rf *.tar.gz %{external_ade_archive} %{external_ngraph_archive}
97 popd
98 rm -rf build && mkdir -p build
99 pushd build
100 CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS=${CFLAGS/-Wall/};
101 CXXFLAGS="${CXXFLAGS:-%optflags}"; export CXXFLAGS=${CXXFLAGS/-Wall/};
102 FFLAGS="${FFLAGS:-%optflags}"; export FFLAGS=${FFLAGS/-Wall/};
103 cmake .. \
104         -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
105         -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
106         -DLIB_INSTALL_DIR:PATH=%{_libdir} -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
107         -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \
108         %{?_cmake_skip_rpath} \
109         -DBUILD_SHARED_LIBS:BOOL=ON \
110         -DUSE_TBB_SYSTEM_DEPS=ON -DBUILD_ADE_DOCUMENTATION=OFF -DBUILD_ADE_TUTORIAL=OFF \
111         -DBUILD_PKGCONFIG=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_TESTS=OFF \
112         -DCLDNN__INCLUDE_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCOVERAGE=OFF \
113         -DDEVELOPMENT_PLUGIN_MODE=OFF -DENABLE_VPU=OFF -DENABLE_ADE_TESTING=OFF \
114         -DENABLE_AFFINITY_GENERATOR=OFF -DENABLE_ALTERNATIVE_TEMP=OFF -DENABLE_CLDNN=OFF \
115         -DENABLE_CLDNN_BUILD=OFF -DENABLE_CLDNN_TESTS=OFF -DENABLE_CPPCHECK=OFF -DENABLE_CPPLINT=OFF \
116         -DENABLE_CPPLINT_REPORT=OFF -DENABLE_CPP_CCT=OFF -DENABLE_DEBUG_SYMBOLS=OFF \
117         -DENABLE_FUZZING=OFF -DENABLE_GAPI_TESTS=OFF -DENABLE_GNA=OFF -DENABLE_LTO=OFF \
118         -DENABLE_MKL_DNN=OFF -DENABLE_MYRIAD=OFF -DENABLE_MYRIAD_MVNC_TESTS=OFF -DENABLE_MYRIAD_NO_BOOT=OFF \
119         -DENABLE_OBJECT_DETECTION_TESTS=ON -DENABLE_OPENCV=OFF -DENABLE_PLUGIN_RPATH=OFF \
120         -DENABLE_PROFILING_ITT=OFF -DENABLE_PROFILING_RAW=OFF -DENABLE_PYTHON=OFF -DENABLE_ROCKHOPER=OFF \
121         -DENABLE_SAMPLES=OFF -DENABLE_SAMPLES_CORE=OFF -DENABLE_SEGMENTATION_TESTS=OFF -DENABLE_TESTS=ON \
122         -DTREAT_WARNING_AS_ERROR=OFF %{_extra_cmake_flags}
123 popd
124 popd
125
126 %build
127 pushd inference-engine
128 pushd build
129 %{__make} %{?_smp_mflags}
130 popd
131 popd
132 sed -i 's|@VERSION@|%{version}|g' openvino.pc.in
133 sed -i 's|@PREFIX@|%{_prefix}|g' openvino.pc.in
134 sed -i 's|@LIB_INSTALL_DIR@|%{_libdir}|g' openvino.pc.in
135 sed -i 's|@INCLUDE_INSTALL_DIR@|%{_includedir}|g' openvino.pc.in
136
137 %install
138 mkdir -p %{buildroot}%{_libdir}
139 mkdir -p %{buildroot}%{_libdir}/pkgconfig
140 cp openvino.pc.in %{buildroot}%{_libdir}/pkgconfig/openvino.pc
141
142 pushd inference-engine/bin/%{install_arch}/Release
143 install -m 644 lib/*.so %{buildroot}%{_libdir}
144 install -m 644 lib/*.xml %{buildroot}%{_libdir}
145 install -m 644 lib/libngraph.a %{buildroot}%{_libdir}
146 install -m 644 lib/libinference_engine_s.a %{buildroot}%{_libdir}
147 install -m 644 lib/libhelpers.a %{buildroot}%{_libdir}
148 install -m 644 lib/libpugixml.a %{buildroot}%{_libdir}
149 install -m 644 lib/libfluid.a %{buildroot}%{_libdir}
150 popd
151
152 mkdir -p %{buildroot}%{_includedir}
153 mkdir -p %{buildroot}%{_includedir}/builders
154 mkdir -p %{buildroot}%{_includedir}/cpp
155 mkdir -p %{buildroot}%{_includedir}/details
156 mkdir -p %{buildroot}%{_includedir}/hetero
157 mkdir -p %{buildroot}%{_includedir}/multi-device
158 pushd inference-engine
159 install -m 644 include/*.h* %{buildroot}%{_includedir}
160 install -m 644 include/builders/*.h* %{buildroot}%{_includedir}/builders/
161 install -m 644 include/cpp/*.h* %{buildroot}%{_includedir}/cpp/
162 install -m 644 include/details/*.h* %{buildroot}%{_includedir}/details/
163 install -m 644 include/hetero/*.h* %{buildroot}%{_includedir}/hetero/
164 install -m 644 include/multi-device/*.h* %{buildroot}%{_includedir}/multi-device/
165 popd
166
167 # Block running tests until it is stabilized
168 #%check
169 #pushd inference-engine/bin/%{install_arch}/Release
170 #LD_LIBRARY_PATH=./lib ./InferenceEngineUnitTests
171 #popd
172
173 %post
174 %{_sbindir}/ldconfig
175
176 %postun
177 %{_sbindir}/ldconfig
178
179 %files
180 %manifest %{name}.manifest
181 %license LICENSE
182 %{_libdir}/*.so
183 %{_libdir}/*.xml
184
185 %files devel
186 %manifest %{name}.manifest
187 %license LICENSE
188 %{_libdir}/*.a
189 %{_libdir}/pkgconfig/openvino.pc
190 %{_includedir}/*