aboutsummaryrefslogtreecommitdiff
path: root/build-tool/scripts/setup-armnn.sh
diff options
context:
space:
mode:
authorJames Conroy <james.conroy@arm.com>2022-08-04 16:55:05 +0100
committerNikhil Raj <nikhil.raj@arm.com>2022-08-05 16:33:41 +0100
commit210897d7afb4007fe06d390c2ec333a732390b5c (patch)
treefc172104328e511c3c262135f40cba0f25a96068 /build-tool/scripts/setup-armnn.sh
parentdba6773af86ac3f79171503fd3b48b0bd1618239 (diff)
downloadarmnn-210897d7afb4007fe06d390c2ec333a732390b5c.tar.gz
IVGCVSW-6777 Add Arm NN build-tool Dockerfile
* Adds Dockerfile associated with Arm NN build-tool scripts. * The Dockerfile encapsulates the installation of system-wide packages (install-packages.sh), download/install of Arm NN dependencies (setup-armnn.sh) and the building of Arm NN and ACL (build-armnn.sh). * A helper script for copying build contents from the built Docker image is provided for by docker-copy-to-host.sh. * Modified existing scripts: moved the cloning of Arm NN and ACL from setup-armnn.sh to build-armnn.sh and decoupled setup-armnn.sh from scripts outside of build-tool directory e.g. armnn/scripts/get_tensorflow.sh. * The build-armnn.sh script clones the latest release branches of Arm NN and ACL by default. Custom repos can be placed in the build-tool directory prior to 'docker build' and they will be used instead (advanced usage). * Support added for Linux targets only, Android to be added in future work. Signed-off-by: James Conroy <james.conroy@arm.com> Change-Id: I336013cf93821d2cd3e5d9fe2ca4e955ffdd2386
Diffstat (limited to 'build-tool/scripts/setup-armnn.sh')
-rwxr-xr-xbuild-tool/scripts/setup-armnn.sh55
1 files changed, 3 insertions, 52 deletions
diff --git a/build-tool/scripts/setup-armnn.sh b/build-tool/scripts/setup-armnn.sh
index 6a9c22ebef..d6f6fce9db 100755
--- a/build-tool/scripts/setup-armnn.sh
+++ b/build-tool/scripts/setup-armnn.sh
@@ -22,7 +22,7 @@ download_and_extract()
{
cd "$SOURCE_DIR"
- echo -e "\n***** Downloading $1 *****"
+ echo -e "\n***** Downloading $1 *****\n"
wget -O "$3" "$2"
echo -e "\n***** Extracting archive *****"
@@ -135,7 +135,7 @@ download_tensorflow()
git clone https://github.com/tensorflow/tensorflow.git
cd "$TENSORFLOW_SRC"
- git checkout "$("$ARMNN_SRC"/scripts/get_tensorflow.sh -p)"
+ git checkout "$TENSORFLOW_VERSION"
echo -e "\n***** TensorFlow downloaded *****"
}
@@ -220,39 +220,6 @@ generate_onnx_sources()
echo -e "\n***** Generated ONNX sources for $TARGET_ARCH *****"
}
-download_armnn()
-{
- cd "$SOURCE_DIR"
-
- echo -e "\n***** Downloading Arm NN *****"
-
- # Latest release branch of Arm NN is checked out by default
- git clone https://github.com/ARM-software/armnn.git armnn
-
- cd "$ARMNN_SRC"
- armnn_branch="$(git rev-parse --abbrev-ref HEAD)"
-
- echo -e "\n***** Arm NN Downloaded: $armnn_branch *****"
-}
-
-download_acl()
-{
- cd "$SOURCE_DIR"
-
- echo -e "\n***** Downloading ACL *****"
-
- git clone https://github.com/ARM-software/ComputeLibrary.git acl
-
- # Get corresponding release tag for ACL by parsing release branch number for Arm NN
- local acl_tag=""
- acl_tag="$(echo "$armnn_branch" | tr '\n' ' ' | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /./g')"
-
- cd "$ACL_SRC"
- git checkout v"$acl_tag"
-
- echo -e "\n***** ACL Downloaded: $acl_tag *****"
-}
-
usage()
{
cat <<EOF
@@ -279,10 +246,6 @@ At least one dependency flag (e.g. --tflite-delegate) must be provided or else p
Directories called "source" and "build" will be generated in the current directory (ROOT_DIR) from which this script is called.
It's recommended to call this script in a directory outside of this Arm NN source repo, to avoid nested repositories.
-This script will download the latest release branches of Arm NN and ACL, by default.
-Alternatively, manually create a "source" directory in ROOT_DIR and place custom repositories there.
-Custom repositories in "source" must be named "armnn" and "acl".
-
Examples:
Setup for aarch64 with all Arm NN dependencies:
<PATH_TO>/setup-armnn.sh --target-arch=aarch64 --all
@@ -387,7 +350,7 @@ echo " root directory: $ROOT_DIR"
echo "source directory: $SOURCE_DIR"
echo " build directory: $BUILD_DIR"
-if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" ]; then
+if check_if_repository .; then
echo -e "\n***** WARNING: Running script inside a git repository. To avoid nested repos, call this script from outside of this repo. *****"
fi
@@ -398,18 +361,6 @@ sleep 10
mkdir -p "$SOURCE_DIR"
mkdir -p "$BUILD_DIR"
-if [ -d "$ARMNN_SRC" ]; then
- echo -e "\n***** Arm NN source repository already located at $ARMNN_SRC. Skipping cloning of Arm NN. *****"
-else
- download_armnn
-fi
-
-if [ -d "$ACL_SRC" ]; then
- echo -e "\n***** ACL source repository already located at $ACL_SRC. Skipping cloning of ACL. *****"
-else
- download_acl
-fi
-
if [ "$flag_tflite_delegate" -eq 1 ] || [ "$flag_tflite_parser" -eq 1 ]; then
download_flatbuffers