summaryrefslogtreecommitdiff
path: root/packaging/libcaffeonacl.spec
blob: 2168a1d3397531fd27885f8a707526c8a5d755e5 (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
Name:           libcaffeonacl
Version:        v0.5.0
Release:        0
License:        MIT
Url:            https://github.com/OAID/CaffeOnACL
Summary:        Caffe Machine Learning library on ARM Compute Library 
Group:          Machine Learning Framework/Libraries
Source0:        %{name}-%{version}.tar.bz2
Source1001:	%name.manifest
ExclusiveArch:	%{arm} aarch64

BuildRequires:	python-devel	
BuildRequires:	python-numpy-devel
BuildRequires:	protobuf-devel
BuildRequires:  boost-devel	
BuildRequires:  gflags-devel	
BuildRequires:  glog-devel	
BuildRequires:  cblas-devel	
BuildRequires:  hdf5-devel	
BuildRequires:  opencv-devel	
BuildRequires:  lmdb-devel	
BuildRequires:  leveldb-devel	
BuildRequires:  snappy-devel	
BuildRequires:  openblas-devel 
BuildRequires:  libarmcl-devel

%description
CaffeOnACL is a project that is maintained by OPEN AI LAB, it uses Arm Compute Library (NEON+GPU) to speed up Caffe and provide utilities to debug, profile and tune application performance.

%ifarch aarch64
%package -n %{name}-release-aarch64
%else
%package -n %{name}-release
%endif
Summary:        CaffeOnACL Library

%ifarch aarch64
%description -n %{name}-release-aarch64
%else
%description -n %{name}-release
%endif
Summary:        CaffeOnACL Library

%ifarch aarch64
%package -n %{name}-devel-aarch64
%else
%package -n %{name}-devel
%endif
Summary:        Userspace interface and Library to CaffeOnACL

%ifarch aarch64
%description -n %{name}-devel-aarch64
%else
%description -n %{name}-devel
%endif
Summary:        Userspace interface and Library to CaffeOnACL

%ifarch aarch64
%package -n %{name}-tools-aarch64
%else
%package -n %{name}-tools
%endif
Summary:	Sample applications for CaffeOnACL

%ifarch aarch64
%description -n %{name}-tools-aarch64
%else
%description -n %{name}-tools
%endif
Summary:	Sample applications for CaffeOnACL

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

%build
make proto
make all -j 5

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%install
make distribute

mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_libdir}/distribute/bin
mkdir -p %{buildroot}%{_libdir}/distribute/python
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_includedir}/caffe/include
mkdir -p %{buildroot}%{_includedir}/caffe/proto

cp -r %{_builddir}/%{name}-%{version}/distribute/lib/lib* %{buildroot}%{_libdir}/
cp -r %{_builddir}/%{name}-%{version}/distribute/bin/* %{buildroot}%{_libdir}/distribute/bin/
cp -r %{_builddir}/%{name}-%{version}/distribute/python/* %{buildroot}%{_libdir}/distribute/python/
cp -r %{_builddir}/%{name}-%{version}/distribute/include/* %{buildroot}%{_includedir}/

cp -r %{_builddir}/%{name}-%{version}/distribute/proto/* %{buildroot}%{_includedir}/caffe/proto/
cp -r %{_builddir}/%{name}-%{version}/.build_release/src/caffe/proto/caffe.pb.cc %{buildroot}%{_includedir}/caffe/proto/
cp -r %{_builddir}/%{name}-%{version}/distribute/include/caffe/proto/caffe.pb.h %{buildroot}%{_includedir}/caffe/proto/

%ifarch aarch64
%files -n %{name}-release-aarch64
%else
%files -n %{name}-release
%endif
%manifest %{name}.manifest
%{_libdir}/lib*

%ifarch aarch64
%files -n %{name}-devel-aarch64
%else
%files -n %{name}-devel
%endif
%manifest %{name}.manifest
%{_libdir}/lib*
%{_includedir}/caffe/*

%ifarch aarch64
%files -n %{name}-tools-aarch64
%else
%files -n %{name}-tools
%endif
%manifest %{name}.manifest
%{_libdir}/distribute/bin/*
%{_libdir}/distribute/python/*