summaryrefslogtreecommitdiff
path: root/packaging/libarmcl.spec
blob: d9d813377fbdddfda049422132352b222ae354c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
Name:           libarmcl
Version:        v19.05
Release:        0
License:        MIT
Url:            https://github.com/ARM-software/ComputeLibrary
Summary:        The ARM Computer Vision and Machine Learning library
Group:          Graphics & UI Framework/Libraries
Source0:        %{name}-%{version}.tar.bz2
Source1001:	%name.manifest
ExclusiveArch:	%{arm} aarch64

BuildRequires: python3-base
BuildRequires:	python
BuildRequires: scons

%define OPEN_CL_SUPPORT		1
%define NEON_SUPPORT		1
%define BENCHMARK_TEST		1

%description
The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs using SIMD technologies

%package -n %{name}-release
Summary:        ARM Compute Library file

%description -n %{name}-release
Summary:        ARM Compute Library file

%package devel
Summary:        Userspace interface to ARM Compute Library
Requires:	%{name}-release = %{version}-%{release}

%description devel
Summary:        Userspace interface to ARM Compute Library

%package -n %{name}-tools
Summary:	Sample application and benchmark binaries to test ARM Compute Library

%description -n %{name}-tools
Summary:	Sample application and benchmark binaries to test ARM Compute Library

%prep
%setup -q
cp %{SOURCE1001} .

%build
echo %{_builddir}
scons -j8 		\
	Werror=0 	\
	debug=0  	\
%if 0%{?NEON_SUPPORT} == 1
	neon=1		\
%endif
%if 0%{?OPEN_CL_SUPPORT} == 1
	opencl=1	\
%endif
	os=linux	\
%ifarch aarch64
	arch=arm64-v8.2-a	\
%else
	arch=armv7a	\
%endif
	embed_kernels=1 \
%if 0%{?BENCHMARK_TEST} == 1
	benchmark_tests=1
%endif

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%install
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_libdir}/data
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}/usr/include/arm_compute
mkdir -p %{buildroot}/usr/include/support
mkdir -p %{buildroot}/usr/include/CL
mkdir -p %{buildroot}/usr/include/half
mkdir -p %{buildroot}/usr/include/libnpy

install -m 644 build/libarm_compute_core.so %{buildroot}%{_libdir}
install -m 644 build/libarm_compute.so %{buildroot}%{_libdir}
install -m 644 build/libarm_compute_graph.so %{buildroot}%{_libdir}
install -m 644 build/opencl-1.2-stubs/libOpenCL.so %{buildroot}%{_libdir}

install -m 644 build/examples/cl_convolution %{buildroot}%{_bindir}
install -m 644 build/examples/cl_events %{buildroot}%{_bindir}
install -m 644 build/examples/cl_sgemm %{buildroot}%{_bindir}
install -m 644 build/examples/graph_alexnet %{buildroot}%{_bindir}
install -m 644 build/examples/graph_googlenet %{buildroot}%{_bindir}
install -m 644 build/examples/graph_inception_v3 %{buildroot}%{_bindir}
install -m 644 build/examples/graph_inception_v4 %{buildroot}%{_bindir}
install -m 644 build/examples/graph_lenet %{buildroot}%{_bindir}
install -m 644 build/examples/graph_mobilenet %{buildroot}%{_bindir}
install -m 644 build/examples/graph_resnet50 %{buildroot}%{_bindir}
install -m 644 build/examples/graph_resnext50 %{buildroot}%{_bindir}
install -m 644 build/examples/graph_squeezenet %{buildroot}%{_bindir}
install -m 644 build/examples/graph_squeezenet_v1_1 %{buildroot}%{_bindir}
install -m 644 build/examples/graph_vgg16 %{buildroot}%{_bindir}
install -m 644 build/examples/graph_vgg19 %{buildroot}%{_bindir}
install -m 644 build/examples/neon_cartoon_effect %{buildroot}%{_bindir}
install -m 644 build/examples/neoncl_scale_median_gaussian %{buildroot}%{_bindir}
install -m 644 build/examples/neon_cnn %{buildroot}%{_bindir}
install -m 644 build/examples/neon_convolution %{buildroot}%{_bindir}
install -m 644 build/examples/neon_copy_objects %{buildroot}%{_bindir}
install -m 644 build/examples/neon_scale %{buildroot}%{_bindir}

cp -r %{_builddir}/%{name}-%{version}/arm_compute/* %{buildroot}/usr/include/arm_compute/
cp -r %{_builddir}/%{name}-%{version}/support/* %{buildroot}/usr/include/support/
cp -r %{_builddir}/%{name}-%{version}/include/CL/* %{buildroot}/usr/include/CL/
cp -r %{_builddir}/%{name}-%{version}/include/half/* %{buildroot}/usr/include/half/
cp -r %{_builddir}/%{name}-%{version}/include/libnpy/* %{buildroot}/usr/include/libnpy/

%if 0%{?BENCHMARK_TEST} == 1
install -m 644 %{_builddir}/%{name}-%{version}/build/tests/arm_compute_benchmark %{buildroot}%{_bindir}
cp -r %{_builddir}/%{name}-%{version}/data/* %{buildroot}%{_libdir}/data/
%endif

%files -n %{name}-release
%manifest %{name}.manifest
%{_libdir}/libarm_compute*.so

%files devel
%manifest %{name}.manifest
%{_libdir}/libOpenCL.so
%{_includedir}/arm_compute/*
%{_includedir}/support/*
%{_includedir}/CL/*
%{_includedir}/half/*
%{_includedir}/libnpy/*

%files -n %{name}-tools
%manifest %{name}.manifest
%{_bindir}/cl_convolution
%{_bindir}/cl_events
%{_bindir}/cl_sgemm
%{_bindir}/graph_alexnet
%{_bindir}/graph_googlenet
%{_bindir}/graph_inception_v3
%{_bindir}/graph_inception_v4
%{_bindir}/graph_lenet
%{_bindir}/graph_mobilenet
%{_bindir}/graph_resnet50
%{_bindir}/graph_resnext50
%{_bindir}/graph_squeezenet
%{_bindir}/graph_squeezenet_v1_1
%{_bindir}/graph_vgg16
%{_bindir}/graph_vgg19
%{_bindir}/neon_cartoon_effect
%{_bindir}/neoncl_scale_median_gaussian
%{_bindir}/neon_cnn
%{_bindir}/neon_convolution
%{_bindir}/neon_copy_objects
%{_bindir}/neon_scale
%if 0%{?BENCHMARK_TEST} == 1
%{_bindir}/arm_compute_benchmark
%{_libdir}/data/*
%endif