diff options
author | James Conroy <james.conroy@arm.com> | 2022-11-18 10:17:27 +0000 |
---|---|---|
committer | Teresa Charlin <teresa.charlinreyes@arm.com> | 2022-11-18 11:34:48 +0000 |
commit | b85b291dede9c6994c4a1aa4a0b595e17fa3fa77 (patch) | |
tree | a72c3ffe085e201107f7703b4b6257b3167ed4d1 | |
parent | ae16e55f0d75f3e79d789de6c5464078730d01bd (diff) | |
download | armnn-b85b291dede9c6994c4a1aa4a0b595e17fa3fa77.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.md | 8 | ||||
-rwxr-xr-x | build-tool/scripts/build-armnn.sh | 15 |
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" |