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
diff --git a/build-tool/scripts/setup-armnn.sh b/build-tool/scripts/setup-armnn.sh
index 6a9c22e..d6f6fce 100755
--- a/build-tool/scripts/setup-armnn.sh
+++ b/build-tool/scripts/setup-armnn.sh
@@ -22,7 +22,7 @@
{
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 @@
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 @@
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 @@
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 "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 @@
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