aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Conroy <james.conroy@arm.com>2022-11-18 10:17:27 +0000
committerJames Conroy <james.conroy@arm.com>2022-11-18 10:17:27 +0000
commitc8d7a663dbcc0b92793c79d88685982e7ca908a5 (patch)
treed123bca6d029999fef9fe99cb82403d01655f017
parent31441595009182c985dacbedc70c41ee6664d070 (diff)
downloadarmnn-c8d7a663dbcc0b92793c79d88685982e7ca908a5.tar.gz
IVGCVSW-7330 Fix build-tool args for Docker builds
* This change requests users to supply a comma separated string of CMake/scons args so that they can passed down from Docker into the bash script correctly. * Updated documentation to reflect this. Signed-off-by: James Conroy <james.conroy@arm.com> Change-Id: Icbd1d1458e11382936690ca6cc4417677e063ddb
-rw-r--r--build-tool/README.md8
-rwxr-xr-xbuild-tool/scripts/build-armnn.sh15
2 files changed, 15 insertions, 8 deletions
diff --git a/build-tool/README.md b/build-tool/README.md
index b56a6907c5..34c8998569 100644
--- a/build-tool/README.md
+++ b/build-tool/README.md
@@ -168,8 +168,8 @@ The ```BUILD_ARGS``` string should start and end with **double quotes** ```"```.
| --cl-backend | **flag:** build Arm NN with the OpenCL backend (GPU acceleration from ACL) |
| --ref-backend | **flag:** build Arm NN with the reference backend<br/>**Should be used for verification purposes only.<br/>Does not provide any performance acceleration.** |
| --debug | **flag:** build Arm NN (and ACL) with debug turned on (optional: defaults to off) |
-| --armnn-cmake-args= | **option:** provide additional space-separated CMake arguments string for building Arm NN (optional)<br/>String should start and end with **single quotes** ```'```<br/>Please refer to **armnn/cmake/GlobalConfig.cmake** |
-| --acl-scons-params= | **option**: provide additional space-separated scons parameters string for building ACL (optional)<br/>String should start and end with **single quotes** ```'```<br/>ACL provide [documentation](https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml#S1_1_build_options) for their build options |
+| --armnn-cmake-args= | **option:** provide additional comma-separated CMake arguments string for building Arm NN (optional)<br/>String should start and end with **single quotes** ```'```<br/>Please refer to **armnn/cmake/GlobalConfig.cmake** |
+| --acl-scons-params= | **option**: provide additional comma-separated scons parameters string for building ACL (optional)<br/>String should start and end with **single quotes** ```'```<br/>ACL provide [documentation](https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml#S1_1_build_options) for their build options |
**At least one component** (i.e. ```--tflite-delegate```, ```--tflite-parser```, ```--onnx-parser```) must be provided or else provide ```--all``` to build all Arm NN components.<br>
@@ -181,10 +181,10 @@ Build for aarch64 with all Arm NN components, NEON enabled and OpenCL enabled:<b
```BUILD_ARGS="--target-arch=aarch64 --all --neon-backend --cl-backend"```
Build for aarch64 with TF Lite Delegate, OpenCL enabled and additional ACL scons params:<br>
-```BUILD_ARGS="--target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1 benchmark_examples=1'"```
+```BUILD_ARGS="--target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1,benchmark_examples=1'"```
Setup for aarch64 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args:<br>
-```BUILD_ARGS="--target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1 -DBUILD_UNIT_TESTS=0'"```
+```BUILD_ARGS="--target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1,-DBUILD_UNIT_TESTS=0'"```
**Example _valid_ combination of SETUP_ARGS and BUILD_ARGS:**<br>
```
diff --git a/build-tool/scripts/build-armnn.sh b/build-tool/scripts/build-armnn.sh
index c0e4f93277..af663418d5 100755
--- a/build-tool/scripts/build-armnn.sh
+++ b/build-tool/scripts/build-armnn.sh
@@ -208,9 +208,9 @@ build-armnn.sh [OPTION]...
--debug
build Arm NN (and ACL) with debug turned on (optional: defaults to off)
--armnn-cmake-args=<ARG LIST STRING>
- provide additional space-separated CMake arguments string for building Arm NN (optional)
+ provide additional comma-separated CMake arguments string for building Arm NN (optional)
--acl-scons-params=<PARAM LIST STRING>
- provide additional space-separated scons parameters string for building ACL (optional)
+ provide additional comma-separated scons parameters string for building ACL (optional)
--num-threads=<INTEGER>
specify number of threads/cores to build dependencies with (optional: defaults to number of online CPU cores on host)
-h, --help
@@ -232,9 +232,9 @@ Examples:
Build for aarch64 with all Arm NN components, NEON enabled and OpenCL enabled:
<PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --neon-backend --cl-backend
Build for aarch64 with TF Lite Delegate, OpenCL enabled and additional ACL scons params:
- <PATH_TO>/build-armnn.sh --target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1 benchmark_examples=1'
+ <PATH_TO>/build-armnn.sh --target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1,benchmark_examples=1'
Setup for aarch64 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args:
- <PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1 -DBUILD_UNIT_TESTS=0'
+ <PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1,-DBUILD_UNIT_TESTS=0'
EOF
}
@@ -419,6 +419,13 @@ if [ "$flag_debug" -eq 1 ]; then
DEBUG_POSTFIX="_debug"
fi
+# Replace commas with spaces in additional Arm NN / ACL build args
+# shellcheck disable=SC2001
+armnn_cmake_args="$(echo "$armnn_cmake_args" | sed 's/,/ /g')"
+
+# shellcheck disable=SC2001
+acl_scons_params="$(echo "$acl_scons_params" | sed 's/,/ /g')"
+
# Directories for Arm NN and ACL build outputs
ARMNN_BUILD_ROOT="$BUILD_DIR"/armnn
ARMNN_BUILD_DIR_NAME="$TARGET_ARCH"_build"$DEBUG_POSTFIX"