telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | function 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 | |
| 12 | if [ ! -d boost_1_64_0 ]; then |
| 13 | echo "++ Downloading Boost" |
| 14 | |
| 15 | BOOST_PKG=boost_1_64_0.tar.gz |
| 16 | |
Nikhil Raj | a984702 | 2020-03-30 10:12:26 +0100 | [diff] [blame] | 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. |
Nikhil Raj | a0301f1 | 2020-05-25 10:21:46 +0100 | [diff] [blame] | 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. |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 21 | AssertZeroExitCode "Downloading Boost failed" |
| 22 | |
| 23 | tar xzf $BOOST_PKG |
| 24 | AssertZeroExitCode "Unpacking Boost failed" |
| 25 | |
| 26 | rm -rf $BOOST_PKG |
| 27 | fi |
| 28 | |
Sadik Armagan | f36e10b | 2021-01-11 16:34:01 +0000 | [diff] [blame] | 29 | |
| 30 | if [ ! -d v1.12.0 ]; then |
| 31 | echo "++ Downloading FlatBuffers" |
| 32 | |
| 33 | FLATBUFFERS_PKG=v1.12.0.tar.gz |
| 34 | |
| 35 | curl -LOk https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz |
| 36 | AssertZeroExitCode "Downloading FlatBuffers failed" |
| 37 | |
| 38 | tar xzf $FLATBUFFERS_PKG |
| 39 | AssertZeroExitCode "Unpacking FlatBuffers failed" |
| 40 | |
| 41 | rm -rf $FLATBUFFERS_PKG |
| 42 | fi |
| 43 | |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 44 | if [ ! -d armnn ]; then |
| 45 | echo "++ Downloading armnn" |
| 46 | |
surmeh01 | 7666005 | 2018-03-29 16:33:54 +0100 | [diff] [blame] | 47 | git clone git@github.com:ARM-software/armnn armnn |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 48 | AssertZeroExitCode "Cloning armnn failed" |
| 49 | fi |
| 50 | |
| 51 | if [ ! -d clframework ]; then |
| 52 | echo "++ Downloading clframework" |
| 53 | |
surmeh01 | 7666005 | 2018-03-29 16:33:54 +0100 | [diff] [blame] | 54 | git clone git@github.com:ARM-software/ComputeLibrary clframework |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 55 | AssertZeroExitCode "Cloning clframework failed" |
| 56 | fi |
| 57 | |
| 58 | # Get scons to create the generated source code which clframework needs to compile. |
| 59 | # This is required for the Android build system to build clframework (see below) |
| 60 | pushd clframework |
| 61 | scons os=android build=embed_only neon=0 opencl=1 embed_kernels=1 validation_tests=0 \ |
Nikhil Raj | 21469d2 | 2020-11-04 10:28:43 +0000 | [diff] [blame] | 62 | arch=arm64-v8.2-a build_dir=android-arm64v8.2-a benchmark_tests=0 -j16 \ |
| 63 | build/android-arm64v8.2-a/src/core/arm_compute_version.embed build/android-arm64v8.2-a/src/core/CL/cl_kernels |
| 64 | AssertZeroExitCode "Precompiling clframework failed for v82.a" |
| 65 | |
| 66 | scons os=android build=embed_only neon=0 opencl=1 embed_kernels=1 validation_tests=0 \ |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 67 | arch=arm64-v8a build_dir=android-arm64v8a benchmark_tests=0 -j16 \ |
| 68 | build/android-arm64v8a/src/core/arm_compute_version.embed build/android-arm64v8a/src/core/CL/cl_kernels |
Nikhil Raj | 21469d2 | 2020-11-04 10:28:43 +0000 | [diff] [blame] | 69 | AssertZeroExitCode "Precompiling clframework failed for v8a." |
telsoa01 | 5307bc1 | 2018-03-09 13:51:08 +0000 | [diff] [blame] | 70 | popd |
| 71 | |