-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.sh
executable file
·219 lines (207 loc) · 3.76 KB
/
configure.sh
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/bin/bash
tag="${1}"
makefile="Makefile"
function enable_gpu() {
echo "enable GPU flag"
sed -i -e 's/GPU=0/GPU=1/g' $makefile
}
function enable_cudnn() {
echo "enable CUDNN flag"
sed -i -e 's/CUDNN=0/CUDNN=1/g' $makefile
}
function enable_cudnn_half() {
echo "enable CUDNN_HALF flag"
sed -i -e 's/CUDNN_HALF=0/CUDNN_HALF=1/g' $makefile
}
function enable_opencv() {
echo "enable OPENCV flag"
sed -i -e 's/OPENCV=0/OPENCV=1/g' $makefile
}
function enable_avx() {
echo "enable AVX flag"
sed -i -e 's/AVX=0/AVX=1/g' $makefile
}
function enable_openmp() {
echo "enable OPENMP flag"
sed -i -e 's/OPENMP=0/OPENMP=1/g' $makefile
}
function enable_libso() {
echo "enable LIBSO flag"
sed -i -e 's/LIBSO=0/LIBSO=1/g' $makefile
}
function enable_zed_camera() {
echo "enable ZED_CAMERA flag"
sed -i -e 's/ZED_CAMERA=0/ZED_CAMERA=1/g' $makefile
}
function enable_debug() {
echo "enable DEBUG flag"
sed -i -e 's/DEBUG=0/DEBUG=1/g' $makefile
}
function enable_arch() {
echo "enable ARCH= -gencode arch=compute_$1,code[sm_$1,compute_$1"
sed -i -e "s/# ARCH= -gencode arch=compute_$1/ARCH= -gencode arch=compute_$1/g" $makefile
}
case ${tag} in
"cpu" | "cpu-u1804")
enable_avx
enable_openmp
enable_libso
;;
"cpu-noopt" | "cpu-noopt-u1804")
enable_openmp
enable_libso
;;
"cpu-cv" | "cpu-cv-u1804")
enable_opencv
enable_avx
enable_openmp
enable_libso
;;
"cpu-noopt-cv" | "cpu-noopt-cv-u1804")
enable_opencv
enable_openmp
enable_libso
;;
"gpu" | "gpu-u1804")
enable_gpu
enable_cudnn
enable_libso
;;
"gpu-cv" | "gpu-cv-u1804")
enable_opencv
enable_gpu
enable_cudnn
enable_libso
;;
"gpu-cc53" | "gpu-cc53-u1804")
enable_gpu
enable_cudnn
enable_arch 53
enable_libso
;;
"gpu-cv-cc53" | "gpu-cv-cc53-u1804")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 53
enable_libso
;;
"gpu-cc60" | "gpu-cc60-u1804")
enable_gpu
enable_cudnn
enable_arch 60
enable_libso
;;
"gpu-cv-cc60" | "gpu-cv-cc60-u1804")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 60
enable_libso
;;
"gpu-cc61" | "gpu-cc61-u1804")
enable_gpu
enable_cudnn
enable_arch 61
enable_libso
;;
"gpu-cv-cc61" | "gpu-cv-cc61-u1804")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 61
enable_libso
;;
"gpu-cc62" | "gpu-cc62-u1804")
enable_gpu
enable_cudnn
enable_arch 62
enable_libso
;;
"gpu-cv-cc62" | "gpu-cv-cc62-u1804")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 62
enable_libso
;;
"gpu-cc70" | "gpu-cc70-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 70
enable_libso
;;
"gpu-cv-cc70" | "gpu-cv-cc70-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 70
enable_libso
;;
"gpu-cc72" | "gpu-cc72-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 72
enable_libso
;;
"gpu-cv-cc72" | "gpu-cv-cc72-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 72
enable_libso
;;
"gpu-cc75" | "gpu-cc75-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 75
enable_libso
;;
"gpu-cv-cc75" | "gpu-cv-cc75-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 75
enable_libso
;;
"gpu-cc80" | "gpu-cc80-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 80
enable_libso
;;
"gpu-cv-cc80" | "gpu-cv-cc80-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 80
enable_libso
;;
"gpu-cc86" | "gpu-cc86-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 86
enable_libso
;;
"gpu-cv-cc86" | "gpu-cv-cc86-u1804")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 86
enable_libso
;;
*)
echo "error: $tag is not supported"
exit 1
;;
esac