Source1001: %{name}.manifest
ExclusiveArch: %arm aarch64
-%define OPEN_CL_SUPPORT 1
-%define CAFFE_SUPPORT 1
%define TF_LITE_SUPPORT 1
-
-%if 0%{?OPEN_CL_SUPPORT} != 1
- %define CAFFE_SUPPORT 0
-%endif
+%define TF_SUPPORT 0
+%define CAFFE_SUPPORT 0
+%define OPEN_CL_SUPPORT 1
BuildRequires: curl
BuildRequires: cmake
BuildRequires: libarmcl-devel
+%if 0%{?TF_SUPPORT} == 1
BuildRequires: protobuf-devel
+%endif
+%if 0%{?TF_LITE_SUPPORT} == 1
BuildRequires: flatbuffers
+%endif
BuildRequires: icu
BuildRequires: libicu-devel
-BuildRequires: libicu-tzdata
BuildRequires: boost-atomic
BuildRequires: boost-chrono
-BuildRequires: boost-container
-BuildRequires: boost-context
-BuildRequires: boost-coroutine
BuildRequires: boost-date-time
-BuildRequires: boost-fiber
BuildRequires: boost-filesystem
-BuildRequires: boost-graph
-BuildRequires: boost-iostreams
-BuildRequires: boost-jam
-BuildRequires: boost-locale
BuildRequires: boost-log
-BuildRequires: boost-math
-BuildRequires: boost-program-options
-BuildRequires: boost-random
BuildRequires: boost-regex
-BuildRequires: boost-serialization
-BuildRequires: boost-signals
-BuildRequires: boost-system
-BuildRequires: boost-test
BuildRequires: boost-devel
%if 0%{?TF_LITE_SUPPORT} == 1
BuildRequires: tensorflow-lite-devel
-%endif
-%if 0%{?CAFFE_SUPPORT} == 1
-BuildRequires: libcaffeonacl-devel
+BuildRequires: tensorflow-lite-flatbuf-schema
%endif
%description
Arm Neural Networks Library
%package devel
-Summary: Userspace interface to ARM Neural Network Library
-Provides: pkgconfig(rpm)
+Summary: Userspace interface to ARM Neural Network Library
Requires: %{name} = %{version}-%{release}
%description devel
-Summary: Userspace interface to ARM Neural Network Library
+Summary: Userspace interface to ARM Neural Network Library
%package tools
-Summary: Sample application and benchmark binaries to test ARM Neural Network Library
-Requires: %{name} = %{version}-%{release}
+Summary: Sample application and benchmark binaries to test ARM Neural Network Library
+Requires: %{name} = %{version}-%{release}
%description tools
-Summary: Sample application and benchmark binaries to test ARM Neural Network Library
+Summary: Sample application and benchmark binaries to test ARM Neural Network Library
%prep
%setup -q
cp %{SOURCE1001} .
-%if 0%{?CAFFE_SUPPORT} == 1
-sed -i 's/CAFFE_SUPPORT /-larmnnCaffeParser /g' armnn.pc
-%else # CAFFE_SUPPORT
-sed -i 's/CAFFE_SUPPORT //g' armnn.pc
-%endif # CAFFE_SUPPORT
-
-%if 0%{?TF_LITE_SUPPORT} == 1
-sed -i 's/TF_LITE_SUPPORT /-larmnnTfLiteParser /g' armnn.pc
-%else # TF_LITE_SUPPORT
-sed -i 's/TF_LITE_SUPPORT //g' armnn.pc
-%endif # TF_LITE_SUPPORT
-
%build
#compile proto files
#cd -
#build ArmNN
-cmake -DARMCOMPUTENEON=1 \
+cmake -DARMCOMPUTENEON=1 \
%if 0%{?OPEN_CL_SUPPORT} == 1
- -DARMCOMPUTECL=1 \
-%endif # TF_LITE_SUPPORT
- -DSHARED_BOOST=1 \
- -DCMAKE_SKIP_RPATH=1 \
+ -DARMCOMPUTECL=1 \
+ -DOPENCL_INCLUDE=/usr/include/arm_compute/core \
+%endif # OPEN_CL_SUPPORT
+ -DSHARED_BOOST=1 \
+ -DCMAKE_SKIP_RPATH=1 \
%if 0%{?CAFFE_SUPPORT} == 1
- -DBUILD_CAFFE_PARSER=1 \
- -DCAFFE_GENERATED_SOURCES=/usr/include \
+ -DBUILD_CAFFE_PARSER=1 \
+ -DCAFFE_GENERATED_SOURCES=/usr/include \
%endif # CAFFE_SUPPORT
%if 0%{?TF_LITE_SUPPORT} == 1
- -DBUILD_TF_LITE_PARSER=1 \
- -DTF_LITE_GENERATED_PATH=./tensorflow/contrib/lite/schema \
+ -DBUILD_TF_LITE_PARSER=1 \
+ -DTF_LITE_GENERATED_PATH=/usr/include/tensorflow/lite/schema \
+ -DTF_LITE_SCHEMA_PATH=/usr/share/tensorflow/lite/schema \
+ -DFLATBUFFERS_INCLUDE_PATH=/usr/include/ \
+ -DFLATC=/usr/bin/flatc \
%endif # TF_LITE_SUPPORT
- -DFLATBUFFERS_INCLUDE_PATH=/usr/include/ \
- -DFLATC=/usr/bin/flatc \
- -DBUILD_TESTS=1 \
+ -DBUILD_TESTS=1 \
+ -DARMCOMPUTE_CORE_LIBRARY_DEBUG=/usr/lib/libarm_compute_core.so \
+ -DARMCOMPUTE_CORE_LIBRARY_RELEASE=/usr/lib/libarm_compute_core.so \
+ -DARMCOMPUTE_LIBRARY_DEBUG=/usr/lib/libarm_compute.so \
+ -DARMCOMPUTE_LIBRARY_RELEASE=/usr/lib/libarm_compute.so
-make -j8
+CPU_JOB_NUM=`grep processor /proc/cpuinfo | awk '{field=$NF};END{print field+1}'`
+make -j ${CPU_JOB_NUM}
%install
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig
mkdir -p %{buildroot}%{_bindir}/armnn
mkdir -p %{buildroot}%{_includedir}/armnn
+mkdir -p %{buildroot}%{_includedir}/armnn/backends
+mkdir -p %{buildroot}%{_includedir}/armnn/backends/profiling
+mkdir -p %{buildroot}%{_includedir}/armnn/profiling
+mkdir -p %{buildroot}%{_includedir}/armnn/utility
%if 0%{?CAFFE_SUPPORT} == 1
mkdir -p %{buildroot}%{_includedir}/armnnCaffeParser
%endif # CAFFE_SUPPORT
+%if 0%{?TF_SUPPORT} == 1
mkdir -p %{buildroot}%{_includedir}/armnnTfParser
+%endif # TF_SUPPORT
%if 0%{?TF_LITE_SUPPORT} == 1
mkdir -p %{buildroot}%{_includedir}/armnnTfLiteParser
%endif # TF_LITE_SUPPORT
-#prepare stb
-mkdir -p %{buildroot}%{_includedir}
-cp -ar external/stb %{buildroot}%{_includedir}
-
install armnn.pc %{buildroot}%{_libdir}/pkgconfig/
install -m 0755 bin/*-Armnn %{buildroot}%{_bindir}/armnn/
install -m 0755 UnitTests %{buildroot}%{_bindir}/armnn/
install -m 0644 lib*.so %{buildroot}%{_libdir}/
-install -m 0644 include/armnn/* %{buildroot}%{_includedir}/armnn/
+install -m 0644 include/armnn/*.hpp %{buildroot}%{_includedir}/armnn/
+install -m 0644 include/armnn/backends/*.hpp %{buildroot}%{_includedir}/armnn/backends/
+install -m 0644 include/armnn/backends/profiling/*.hpp %{buildroot}%{_includedir}/armnn/backends/profiling/
+install -m 0644 include/armnn/profiling/*.hpp %{buildroot}%{_includedir}/armnn/profiling/
+install -m 0644 include/armnn/utility/*.hpp %{buildroot}%{_includedir}/armnn/utility/
%if 0%{?CAFFE_SUPPORT} == 1
install -m 0644 include/armnnCaffeParser/* %{buildroot}%{_includedir}/armnnCaffeParser/
%endif # CAFFE_SUPPORT
+%if 0%{?TF_SUPPORT} == 1
install -m 0644 include/armnnTfParser/* %{buildroot}%{_includedir}/armnnTfParser/
+%endif # TF_SUPPORT
%if 0%{?TF_LITE_SUPPORT} == 1
install -m 0644 include/armnnTfLiteParser/* %{buildroot}%{_includedir}/armnnTfLiteParser/
%endif # TF_LITE_SUPPORT
%files devel
%manifest %{name}.manifest
%{_libdir}/pkgconfig/armnn.pc
-%{_includedir}/*
+%{_includedir}/armnn/*
+%if 0%{?TF_LITE_SUPPORT} == 1
+%{_includedir}/armnnTfLiteParser/*
+%endif # TF_LITE_SUPPORT
%files tools
%manifest %{name}.manifest