Build Guide (Advanced Users)
One page summary of how to build a Band.
We provide pre-built binaries for Android and Windows. However, if you want to build Band from source code, please follow the instructions below. It is currently tested on Ubuntu 18.04 and Windows 10.
Prerequisites
We recommend using Visual Studio Code dev container to build Band. We provide the container to build Band without installing any dependencies. For more details, please refer to Visual Studio Code Dev Container. If you use the container, you can skip to Prerequisites for Android and How to build & run.
Clone Band repository
git clone https://github.com/mrsnu/band.git
Install submodules
cd band git submodule update --init --recursive
Install Bazel
Prerequisites for Android
Configure Android SDK, NDK
python configure.py
How to build & run
We provide useful scripts to build and run Band. Please refer to [root]/script
for more details. Test and Benchmark script allows you to cross-compile from the docker container (from our dev container) on the host machine’s docker context and download the built binary to the host machine (-docker
option). If you want to build locally, please remove -docker
option.
Run test - Our test script will build and run tests for all platforms (Android, Linux, Windows). If not specified, it will build and run tests for the native platform (Linux or Windows) that executes the script.
python script/run_test.py -android -docker
Build Android AAR - Our build script will build AAR for Android and copy it to
[root]
.sh script/build_aar_armv8.sh
Build C API - Our build script will build C API for Android, and output files are located at
[root]/bazel-bin/band/c/band_c_pkg.tar
python script/build_c_api.py -android
Run Benchmark - Our benchmark script will build and run the benchmark for all platforms (Android, Linux, Windows). If not specified, it will build and run the benchmark for native platforms (Linux or Windows) that execute the script.
python script/run_benchmark.py --config band/test/data/benchmark_config.json -android -docker