-
Notifications
You must be signed in to change notification settings - Fork 302
/
caffe-1.0.recipe
150 lines (138 loc) · 4.27 KB
/
caffe-1.0.recipe
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
SUMMARY="A deep learning framework"
DESCRIPTION="Caffe is a deep learning framework made with expression, speed, \
and modularity in mind. It is developed by Berkeley AI Research (BAIR)/The \
Berkeley Vision and Learning Center (BVLC) and community contributors."
HOMEPAGE="http://caffe.berkeleyvision.org/"
COPYRIGHT="2014 Randolph Voorhies, Shane Grant"
LICENSE="BSD (2-clause)"
REVISION="11"
SOURCE_URI="https://github.com/BVLC/caffe/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="71d3c9eb8a183150f965a465824d01fe82826c22505f7aa314f700ace03fa77f"
PATCHES="caffe-$portVersion.patchset
1b317bab3f6413a1b5d87c9d3a300d785a4173f9.patch
7f503bd9a19758a173064e299ab9d4cac65ed60f.patch"
# Patches found at: https://aur.archlinux.org/packages/caffe
# https://github.com/BVLC/caffe/pull/6625
# https://github.com/BVLC/caffe/pull/7044
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
caffe$secondaryArchSuffix = $portVersion
cmd:caffe$commandSuffix
cmd:classification$commandSuffix
cmd:compute_image_mean$commandSuffix
cmd:convert_cifar_data$commandSuffix
cmd:convert_imageset$commandSuffix
cmd:convert_mnist_data$commandSuffix
cmd:convert_mnist_siamese_data$commandSuffix
cmd:device_query$commandSuffix
cmd:extract_features$commandSuffix
cmd:finetune_net$commandSuffix
cmd:net_speed_benchmark$commandSuffix
cmd:test_net$commandSuffix
cmd:train_net$commandSuffix
cmd:upgrade_net_proto_binary$commandSuffix
cmd:upgrade_net_proto_text$commandSuffix
cmd:upgrade_solver_proto_text$commandSuffix
lib:libcaffe$secondaryArchSuffix = 1.0.0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libboost_atomic$secondaryArchSuffix
lib:libboost_chrono$secondaryArchSuffix
lib:libboost_date_time$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
lib:libgflags$secondaryArchSuffix
lib:libglog$secondaryArchSuffix
lib:libhdf5$secondaryArchSuffix
lib:liblmdb$secondaryArchSuffix
lib:libopenblas$secondaryArchSuffix
lib:libopencv_core$secondaryArchSuffix
lib:libopencv_highgui$secondaryArchSuffix
lib:libopencv_imgcodecs$secondaryArchSuffix
lib:libopencv_imgproc$secondaryArchSuffix
lib:libprotobuf$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
caffe${secondaryArchSuffix}_devel = $portVersion
devel:libcaffe$secondaryArchSuffix = 1.0.0
devel:libproto$secondaryArchSuffix
"
REQUIRES_devel="
caffe$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libboost_atomic$secondaryArchSuffix >= 1.69.0
devel:libboost_chrono$secondaryArchSuffix >= 1.69.0
devel:libboost_date_time$secondaryArchSuffix >= 1.69.0
devel:libboost_filesystem$secondaryArchSuffix >= 1.69.0
devel:libboost_system$secondaryArchSuffix >= 1.69.0
devel:libboost_thread$secondaryArchSuffix >= 1.69.0
devel:libgflags$secondaryArchSuffix
devel:libglog$secondaryArchSuffix
devel:libhdf5$secondaryArchSuffix
devel:liblmdb$secondaryArchSuffix
devel:libopenblas$secondaryArchSuffix
devel:libopencv_core$secondaryArchSuffix
devel:libopencv_highgui$secondaryArchSuffix
devel:libopencv_imgcodecs$secondaryArchSuffix
devel:libopencv_imgproc$secondaryArchSuffix
devel:libprotobuf$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
# cmd:f2py3
cmd:ld$secondaryArchSuffix
cmd:make
# cmd:python3
"
BUILD()
{
#Main settings
cat > Makefile.config << EOF
CPU_ONLY := 1
BLAS := open
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
USE_PKG_CONFIG := 1
EOF
cmake -B build -S . \
$cmakeDirArgs \
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
-DCMAKE_BUILD_TYPE='Release' \
-DUSE_LEVELDB:BOOL=OFF \
-DUSE_OPENCV:BOOL=ON \
-DCPU_ONLY:BOOL=ON \
-DBUILD_python:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=ON
make -C build $jobArgs
}
INSTALL()
{
make -C build install
# Python support disabled for now.
rm -rf $prefix/python
prepareInstalledDevelLibs libcaffe libproto
# devel package
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
make -C build test
make -C build runtest
}