1#!/bin/bash 2 3function AssertZeroExitCode { 4 EXITCODE=$? 5 if [ $EXITCODE -ne 0 ]; then 6 echo "$1" 7 echo "+++ Command exited with code $EXITCODE. Please fix the above errors and re-run" 8 exit 1 9 fi 10} 11 12if [ ! -d boost_1_64_0 ]; then 13 echo "++ Downloading Boost" 14 15 BOOST_PKG=boost_1_64_0.tar.gz 16 17 # There is a problem with downloading boost from the external. Issue can be found here:https://github.com/boostorg/boost/issues/299. 18 # Using a mirror link to download boost. 19 curl -LOk https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz 20 # curl -LOk https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.gz # had switched to this mirror as we were not able to download boost from boostorg. 21 AssertZeroExitCode "Downloading Boost failed" 22 23 tar xzf $BOOST_PKG 24 AssertZeroExitCode "Unpacking Boost failed" 25 26 rm -rf $BOOST_PKG 27fi 28 29if [ ! -d armnn ]; then 30 echo "++ Downloading armnn" 31 32 git clone git@github.com:ARM-software/armnn armnn 33 AssertZeroExitCode "Cloning armnn failed" 34fi 35 36if [ ! -d clframework ]; then 37 echo "++ Downloading clframework" 38 39 git clone git@github.com:ARM-software/ComputeLibrary clframework 40 AssertZeroExitCode "Cloning clframework failed" 41fi 42 43# Get scons to create the generated source code which clframework needs to compile. 44# This is required for the Android build system to build clframework (see below) 45pushd clframework 46scons os=android build=embed_only neon=0 opencl=1 embed_kernels=1 validation_tests=0 \ 47 arch=arm64-v8a build_dir=android-arm64v8a benchmark_tests=0 -j16 \ 48 build/android-arm64v8a/src/core/arm_compute_version.embed build/android-arm64v8a/src/core/CL/cl_kernels 49AssertZeroExitCode "Precompiling clframework failed" 50popd 51 52