forked from facebookarchive/caffe2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_android.py
46 lines (37 loc) · 1.41 KB
/
build_android.py
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
"""Configuration for the Caffe2 installation targeted for Android.
To run the build, first create a standalone toolchain from the NDK root using:
./build/tools/make-standalone-toolchain.sh \
--arch=arm --platform=android-21 \
--toolchain=arm-linux-androideabi-4.9 \
--install-dir=./standalone-toolchains/arm-linux-androideabi-4.9-android-21
(change the platform and toolchain if necessary) and update the
STANDALONE_TCHAIN_ROOT variable below.
"""
from build import Config
STANDALONE_TCHAIN_ROOT = (
'/opt/android_ndk/android-ndk-r10e/'
'standalone-toolchains/arm-linux-androideabi-4.9-android-21/')
# We change necessary components in the Config class.
Config.VERBOSE_BUILD = True
Config.CC = STANDALONE_TCHAIN_ROOT + 'bin/arm-linux-androideabi-g++'
Config.AR = STANDALONE_TCHAIN_ROOT + 'bin/arm-linux-androideabi-ar'
Config.GENDIR = "gen-android"
Config.USE_SYSTEM_PROTOBUF = False
Config.PROTOC_BINARY = 'gen/third_party/protoc'
Config.USE_LITE_PROTO = False
Config.USE_SYSTEM_EIGEN = False
Config.USE_GLOG = False
Config.USE_GFLAGS = False
Config.USE_RTTI = False
Config.USE_OPENMP = False
Config.CUDA_DIR = "non-existing"
Config.MPICC = "non-existing"
Config.MPIRUN = "non-existing"
Config.OMPI_INFO = "non-existing"
Config.PYTHON_CONFIG = "non-existing"
Config.OPTIMIZATION_FLAGS = ["-Os"]
# brew.py
if __name__ == '__main__':
from brewtool.brewery import Brewery
import sys
Brewery.Run(Config, sys.argv)