[Dist/Tizen] bugfix: Adjust install directory according to target arch
[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 Patch0:         0001-CMake-Do-not-call-get_linux_name-when-LINUX_OS_NAME-.patch
59 Patch1:         0002-CMake-Add-a-variable-to-resolve-dependency-on-TBB-us.patch
60 BuildRequires:  cmake
61 BuildRequires:  pkgconfig(libtbb)
62 BuildRequires:  pkg-config
63
64 %description
65 OpenVINO™ toolkit, short for Open Visual Inference and Neural network Optimization toolkit,
66 provides developers with improved neural network performance on a variety of Intel® processors
67 and helps them further unlock cost-effective, real-time vision applications.
68 The toolkit enables deep learning inference and easy heterogeneous execution across multiple
69 Intel® platforms (CPU, Intel® Processor Graphics)—providing implementations across cloud
70 architectures to edge devices. This open source distribution provides flexibility and
71 availability to the developer community to innovate deep learning and AI solutions.
72
73 %package devel
74 Summary:        Development package for OpenVINO™ Toolkit
75 Requires:       %{name} = %{version}-%{release}
76
77 %description devel
78 Development package for Open Visual Inference and Neural network Optimization toolkit.
79 This contains corresponding header files and static archives.
80
81 %prep
82 %setup -q
83 %patch0 -p1
84 %patch1 -p1
85 cp %{SOURCE1} .
86 cp %{SOURCE1001} ./inference-engine/thirdparty
87 cp %{SOURCE1002} ./inference-engine/thirdparty
88 pushd inference-engine
89 pushd thirdparty
90 tar zxf %{external_ade_archive}.tar.gz
91 mv %{external_ade_archive}/* ade/
92 tar zxf %{external_ngraph_archive}.tar.gz
93 mv %{external_ngraph_archive}/* ngraph/
94 rm -rf *.tar.gz %{external_ade_archive} %{external_ngraph_archive}
95 popd
96 rm -rf build && mkdir -p build
97 pushd build
98 CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS=${CFLAGS/-Wall/};
99 CXXFLAGS="${CXXFLAGS:-%optflags}"; export CXXFLAGS=${CXXFLAGS/-Wall/};
100 FFLAGS="${FFLAGS:-%optflags}"; export FFLAGS=${FFLAGS/-Wall/};
101 cmake .. \
102         -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
103         -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
104         -DLIB_INSTALL_DIR:PATH=%{_libdir} -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
105         -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \
106         %{?_cmake_skip_rpath} \
107         -DBUILD_SHARED_LIBS:BOOL=ON \
108         -DUSE_TBB_SYSTEM_DEPS=ON -DBUILD_ADE_DOCUMENTATION=OFF -DBUILD_ADE_TUTORIAL=OFF \
109         -DBUILD_PKGCONFIG=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_TESTS=OFF \
110         -DCLDNN__INCLUDE_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCOVERAGE=OFF \
111         -DDEVELOPMENT_PLUGIN_MODE=OFF -DENABLE_VPU=OFF -DENABLE_ADE_TESTING=OFF \
112         -DENABLE_AFFINITY_GENERATOR=OFF -DENABLE_ALTERNATIVE_TEMP=OFF -DENABLE_CLDNN=OFF \
113         -DENABLE_CLDNN_BUILD=OFF -DENABLE_CLDNN_TESTS=OFF -DENABLE_CPPCHECK=OFF -DENABLE_CPPLINT=OFF \
114         -DENABLE_CPPLINT_REPORT=OFF -DENABLE_CPP_CCT=OFF -DENABLE_DEBUG_SYMBOLS=OFF \
115         -DENABLE_FUZZING=OFF -DENABLE_GAPI_TESTS=OFF -DENABLE_GNA=OFF -DENABLE_LTO=OFF \
116         -DENABLE_MKL_DNN=OFF -DENABLE_MYRIAD=OFF -DENABLE_MYRIAD_MVNC_TESTS=OFF -DENABLE_MYRIAD_NO_BOOT=OFF \
117         -DENABLE_OBJECT_DETECTION_TESTS=ON -DENABLE_OPENCV=OFF -DENABLE_PLUGIN_RPATH=OFF \
118         -DENABLE_PROFILING_ITT=OFF -DENABLE_PROFILING_RAW=OFF -DENABLE_PYTHON=OFF -DENABLE_ROCKHOPER=OFF \
119         -DENABLE_SAMPLES=OFF -DENABLE_SAMPLES_CORE=OFF -DENABLE_SEGMENTATION_TESTS=OFF -DENABLE_TESTS=ON \
120         -DTREAT_WARNING_AS_ERROR=OFF %{_extra_cmake_flags}
121 popd
122 popd
123
124 %build
125 pushd inference-engine
126 pushd build
127 %{__make} %{?_smp_mflags}
128 popd
129 popd
130
131 %install
132 mkdir -p %{buildroot}%{_libdir}
133 mkdir -p %{buildroot}%{_libdir}/tbb
134 pushd inference-engine/bin/%{install_arch}/Release
135 install -m 644 lib/*.so %{buildroot}%{_libdir}
136 install -m 644 lib/*.xml %{buildroot}%{_libdir}
137 install -m 644 lib/*.a %{buildroot}%{_libdir}/tbb
138 popd
139 mkdir -p %{buildroot}%{_includedir}
140 mkdir -p %{buildroot}%{_includedir}/builders
141 mkdir -p %{buildroot}%{_includedir}/cpp
142 mkdir -p %{buildroot}%{_includedir}/details
143 mkdir -p %{buildroot}%{_includedir}/hetero
144 mkdir -p %{buildroot}%{_includedir}/multi-device
145 pushd inference-engine
146 install -m 644 include/*.h* %{buildroot}%{_includedir}
147 install -m 644 include/builders/*.h* %{buildroot}%{_includedir}/builders/
148 install -m 644 include/cpp/*.h* %{buildroot}%{_includedir}/cpp/
149 install -m 644 include/details/*.h* %{buildroot}%{_includedir}/details/
150 install -m 644 include/hetero/*.h* %{buildroot}%{_includedir}/hetero/
151 install -m 644 include/multi-device/*.h* %{buildroot}%{_includedir}/multi-device/
152 popd
153
154 %check
155 pushd inference-engine/bin/%{install_arch}/Release
156 LD_LIBRARY_PATH=./lib ./InferenceEngineUnitTests
157 popd
158
159 %post
160 %{_sbindir}/ldconfig
161
162 %postun
163 %{_sbindir}/ldconfig
164
165 %files
166 %manifest %{name}.manifest
167 %license LICENSE
168 %{_libdir}/*.so
169 %{_libdir}/*.xml
170
171 %files devel
172 %manifest %{name}.manifest
173 %license LICENSE
174 %{_libdir}/tbb/*.a
175 %{_includedir}/*