forked from sh1r0/caffe-android-lib
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·42 lines (36 loc) · 1.06 KB
/
build.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
#!/usr/bin/env sh
set -e
if [ -z "$NDK_ROOT" ] && [ "$#" -eq 0 ]; then
echo 'Either $NDK_ROOT should be set or provided as argument'
echo "e.g., 'export NDK_ROOT=/path/to/ndk' or"
echo " '${0} /path/to/ndk'"
exit 1
else
export NDK_ROOT="${NDK_ROOT}"
fi
WD=`pwd`
cd ${WD}
export ANDROID_ABI="${ANDROID_ABI:-"armeabi-v7a-hard-softfp with NEON"}"
export USE_OPENBLAS=${USE_OPENBLAS:-0}
export N_JOBS=${N_JOBS:-4}
if [ ${USE_OPENBLAS} -eq 1 ]; then
echo "using openblas"
if [ "${ANDROID_ABI}" = "armeabi-v7a-hard-softfp with NEON" ]; then
./scripts/build_openblas_hard.sh
elif [ "${ANDROID_ABI}" = "armeabi-v7a with NEON" ]; then
./scripts/get_openblas.sh
else
echo "Warning: not support OpenBLAS for ABI: ${ANDROID_ABI}, use Eigen instead"
export USE_OPENBLAS=0
./scripts/get_eigen.sh
fi
else
./scripts/get_eigen.sh
fi
./scripts/build_boost.sh
./scripts/build_gflags.sh
./scripts/build_opencv.sh
./scripts/build_protobuf_host.sh
./scripts/build_protobuf.sh
./scripts/build_caffe.sh
echo "DONE!!"