6 License: Apache-2.0 and MIT and BSD-2-Clause and MPL-2.0
8 Source0: %{name}-%{version}.tar.gz
9 Source1: %{name}.manifest
10 Source1001: nnapi_test_generated.tar.gz
11 Source1002: gtest.tar.gz
12 Source1003: eigen.tar.gz
13 Source1004: gemmlowp.tar.gz
14 Source1005: ruy.tar.gz
15 Source1006: cpuinfo.tar.gz
16 Source1007: XNNPACK.tar.gz
17 Source1008: FXDIV.tar.gz
18 Source1009: PTHREADPOOL.tar.gz
19 Source1010: PSIMD.tar.gz
20 Source1011: FP16.tar.gz
21 Source1012: OPENCL_HEADERS.tar.gz
22 Source1013: FARMHASH.tar.gz
23 Source1014: ABSEIL.tar.gz
24 Source1015: oourafft.tar.gz
25 Source2001: nnfw.pc.in
26 Source2002: nnfw-plugin.pc.in
28 %{!?build_type: %define build_type Release}
29 %{!?coverage_build: %define coverage_build 0}
30 %{!?test_build: %define test_build 0}
31 %{!?extra_option: %define extra_option %{nil}}
32 %if %{coverage_build} == 1
37 # Require flatbuffers-devel for onert frontend (model loading)
38 BuildRequires: flatbuffers-devel
40 %ifarch %{arm} aarch64
41 # Require python for acl-ex library build pre-process
43 BuildRequires: libarmcl-devel >= v21.02
46 Requires(post): /sbin/ldconfig
47 Requires(postun): /sbin/ldconfig
49 %if %{test_build} == 1
50 BuildRequires: boost-devel
51 BuildRequires: tensorflow-lite-devel
52 BuildRequires: hdf5-devel
53 BuildRequires: libaec-devel
54 BuildRequires: zlib-devel
55 BuildRequires: libjpeg-devel
59 nnfw is a high-performance, on-device neural network framework for Tizen
62 Summary: NNFW Devel Package
63 Requires: %{name} = %{version}-%{release}
66 NNFW development package for application developer using runtime
69 Summary: NNFW Devel Package
70 Requires: %{name}-devel = %{version}-%{release}
72 %description plugin-devel
73 NNFW development package for backend plugin developer
76 Summary: Minimal test binary for VD manual test
78 %description minimal-app
79 Minimal test binary for VD manual test
81 %if %{test_build} == 1
86 NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime.
90 %define target_arch armv7l
93 %define target_arch x86_64
96 %define target_arch aarch64
99 %define target_arch i686
102 %define install_dir %{_prefix}
103 %define install_path %{buildroot}%{install_dir}
104 %define build_env NNFW_WORKSPACE=build
105 %define build_options -DCMAKE_BUILD_TYPE=%{build_type} -DTARGET_ARCH=%{target_arch} -DTARGET_OS=tizen -DENABLE_TEST=off -DBUILD_MINIMAL_SAMPLE=on
107 # Set option for test build (and coverage test build)
108 %define test_install_home /opt/usr/nnfw-test
109 %define test_install_dir %{test_install_home}/Product/out
110 %define test_install_path %{buildroot}%{test_install_dir}
111 %define coverage_option %{nil}
112 %define test_suite_list infra/scripts tests/scripts
113 %define test_build_type %{build_type}
114 %if %{coverage_build} == 1
115 %define coverage_option -DENABLE_COVERAGE=ON
116 %define test_build_type Debug
118 %define test_build_env NNFW_INSTALL_PREFIX=%{test_install_path} NNFW_WORKSPACE=build_for_test
119 %define test_build_options %{coverage_option} -DCMAKE_BUILD_TYPE=%{test_build_type} -DTARGET_ARCH=%{target_arch} -DTARGET_OS=tizen -DENVVAR_ONERT_CONFIG=ON
125 tar -xf %{SOURCE1001} -C ./tests/nnapi/src/
126 tar -xf %{SOURCE1002} -C ./externals
127 tar -xf %{SOURCE1003} -C ./externals
128 tar -xf %{SOURCE1004} -C ./externals
129 tar -xf %{SOURCE1005} -C ./externals
130 tar -xf %{SOURCE1006} -C ./externals
131 tar -xf %{SOURCE1007} -C ./externals
132 tar -xf %{SOURCE1008} -C ./externals
133 tar -xf %{SOURCE1009} -C ./externals
134 tar -xf %{SOURCE1010} -C ./externals
135 tar -xf %{SOURCE1011} -C ./externals
136 tar -xf %{SOURCE1012} -C ./externals
137 tar -xf %{SOURCE1013} -C ./externals
138 tar -xf %{SOURCE1014} -C ./externals
139 tar -xf %{SOURCE1015} -C ./externals
142 %ifarch arm armv7l aarch64 x86_64 %ix86
144 %{build_env} ./nnfw configure %{build_options} %{extra_option}
145 %{build_env} ./nnfw build -j4
146 # install in workspace
147 # TODO Set install path
148 %{build_env} ./nnfw install
150 %if %{test_build} == 1
152 # TODO remove duplicated build process
153 %{test_build_env} ./nnfw configure %{test_build_options} %{extra_option}
154 %{test_build_env} ./nnfw build -j4
155 %if %{coverage_build} == 1
156 pwd > tests/scripts/build_path.txt
157 %endif # coverage_build
158 tar -zcf test-suite.tar.gz infra/scripts
160 %endif # arm armv7l aarch64
163 %ifarch arm armv7l aarch64 x86_64 %ix86
165 mkdir -p %{buildroot}%{_libdir}
166 mkdir -p %{buildroot}%{_bindir}
167 mkdir -p %{buildroot}%{_includedir}
168 install -m 644 build/out/lib/*.so %{buildroot}%{_libdir}
169 install -m 755 build/out/bin/onert-minimal-app %{buildroot}%{_bindir}
170 cp -r build/out/include/* %{buildroot}%{_includedir}/
175 sed -i 's:@libdir@:%{_libdir}:g
176 s:@includedir@:%{_includedir}:g
177 s:@version@:%{version}:g' ./nnfw.pc.in
178 sed -i 's:@libdir@:%{_libdir}:g
179 s:@includedir@:%{_includedir}:g
180 s:@version@:%{version}:g' ./nnfw-plugin.pc.in
181 mkdir -p %{buildroot}%{_libdir}/pkgconfig
182 install -m 0644 ./nnfw.pc.in %{buildroot}%{_libdir}/pkgconfig/nnfw.pc
183 install -m 0644 ./nnfw-plugin.pc.in %{buildroot}%{_libdir}/pkgconfig/nnfw-plugin.pc
185 %if %{test_build} == 1
186 %{test_build_env} ./nnfw install
187 # Share test script with ubuntu (ignore error if there is no list for target)
188 cp tests/nnapi/nnapi_gtest.skip.%{target_arch}-* %{buildroot}%{test_install_dir}/unittest/.
189 cp %{buildroot}%{test_install_dir}/unittest/nnapi_gtest.skip.%{target_arch}-linux.cpu %{buildroot}%{test_install_dir}/unittest/nnapi_gtest.skip
190 tar -zxf test-suite.tar.gz -C %{buildroot}%{test_install_home}
192 %if %{coverage_build} == 1
193 mkdir -p %{buildroot}%{test_install_home}/gcov
194 find . -name "*.gcno" -exec xargs cp {} %{buildroot}%{test_install_home}/gcov/. \;
195 install -m 0644 ./tests/scripts/build_path.txt %{buildroot}%{test_install_dir}/test/build_path.txt
196 %endif # coverage_build
201 %post -p /sbin/ldconfig
202 %postun -p /sbin/ldconfig
205 %manifest %{name}.manifest
206 %defattr(-,root,root,-)
207 %ifarch arm armv7l aarch64 x86_64 %ix86
209 %exclude %{_includedir}/CL/*
213 %manifest %{name}.manifest
214 %defattr(-,root,root,-)
215 %ifarch arm armv7l aarch64 x86_64 %ix86
216 %dir %{_includedir}/nnfw
217 %{_includedir}/nnfw/*
218 %{_libdir}/pkgconfig/nnfw.pc
222 %manifest %{name}.manifest
223 %defattr(-,root,root,-)
224 %ifarch arm armv7l aarch64 x86_64 %ix86
225 %dir %{_includedir}/onert
226 %{_includedir}/onert/*
227 %{_libdir}/pkgconfig/nnfw-plugin.pc
230 %ifarch arm armv7l aarch64 x86_64 %ix86
232 %manifest %{name}.manifest
233 %defattr(-,root,root,-)
234 %{_bindir}/onert-minimal-app
237 %if %{test_build} == 1
239 %manifest %{name}.manifest
240 %defattr(-,root,root,-)
241 %ifarch arm armv7l aarch64 x86_64
242 %dir %{test_install_home}
243 %{test_install_home}/*
244 %endif # arm armv7l aarch64
248 * Thu Mar 15 2018 Chunseok Lee <chunseok.lee@samsung.com>
249 - Initial spec file for nnfw