• Home
  • Raw
  • Download

Lines Matching +full:setup +full:- +full:x86_64

4 # Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved.
5 # SPDX-License-Identifier: MIT
9 # setup-armnn.sh must be executed in the same directory, before running this script
11 set -o nounset # Catch references to undefined variables.
12 set -o pipefail # Catch non zero exit codes within pipelines.
13 set -o errexit # Catch and propagate non zero exit codes.
24 if [ "$flag_debug" -eq 1 ]; then
33 # Force -fPIC so that ACL is suitable for inclusion in Arm NN library
34 local extra_cxx_flags="extra_cxx_flags='-fPIC'"
42 acl_arch="arch=arm64-v8a"
45 "x86_64")
46 acl_arch="arch=x86_64"
50 echo -e "\n***** Building ACL for $TARGET_ARCH *****"
52 if [ "$flag_clean" -eq 1 ]; then
53 echo -e "\n***** Clean flag detected: removing existing ACL build *****"
54 rm -rf "$ACL_BUILD_TARGET"
57 mkdir -p "$ACL_BUILD_TARGET"
65 -j "$NUM_THREADS"
67 echo -e "\n***** Built ACL for $TARGET_ARCH *****"
74 mkdir -p "$ARMNN_BUILD_TARGET"
78 if [ "$flag_debug" -eq 1 ]; then
90 if [ "$flag_clean" -eq 1 ]; then
91 echo -e "\n***** Clean flag detected: removing existing Arm NN build *****"
92 rm -rf "$ARMNN_BUILD_TARGET"
95 echo -e "\n***** Building Arm NN for $TARGET_ARCH *****"
98 cmake -DCMAKE_BUILD_TYPE="$build_type" \
99 -DBUILD_CLASSIC_DELEGATE="$flag_tflite_delegate" \
100 -DBUILD_TF_LITE_PARSER="$flag_tflite_parser" \
101 -DBUILD_ONNX_PARSER="$flag_onnx_parser" \
102 -DARMCOMPUTENEON="$flag_neon_backend" \
103 -DARMCOMPUTECL="$flag_cl_backend" \
104 -DARMNNREF="$flag_ref_backend" \
105 -DARMCOMPUTE_ROOT="$ACL_SRC" \
106 -DARMCOMPUTE_BUILD_DIR="$ACL_BUILD_TARGET" \
107 -DTENSORFLOW_ROOT="$TENSORFLOW_SRC" \
108 -DTF_LITE_SCHEMA_INCLUDE_PATH="$TFLITE_BUILD_ROOT" \
109 -DTFLITE_LIB_ROOT="$TFLITE_BUILD_TARGET" \
110 -DFLATBUFFERS_ROOT="$FLATBUFFERS_BUILD_TARGET" \
111 -DFLATC_DIR="$FLATBUFFERS_BUILD_HOST" \
112 -DONNX_GENERATED_SOURCES="$ONNX_BUILD_TARGET" \
113 -DPROTOBUF_ROOT="$PROTOBUF_BUILD_HOST" \
114 -DPROTOBUF_LIBRARY_DEBUG="$PROTOBUF_LIBRARY_TARGET" \
115 -DPROTOBUF_LIBRARY_RELEASE="$PROTOBUF_LIBRARY_TARGET" \
119 make -j "$NUM_THREADS"
122 if [ "$flag_onnx_parser" -eq 1 ]; then
124 rm -f libprotobuf.so libprotobuf.so.23 libprotobuf.so.23.0.0
126 ln -s libprotobuf.so.23.0.0 ./libprotobuf.so.23
127 ln -s libprotobuf.so.23.0.0 ./libprotobuf.so
132 rm -rf include
133 cp -r "$SOURCE_DIR"/armnn/include .
135 echo -e "\n***** Built Arm NN for $TARGET_ARCH *****"
138 echo -e "\n***** Creating tarball of Arm NN build at $tarball_path *****"
141 rm -f "$tarball_path"
142 tar -czf "$tarball_path" "$ARMNN_BUILD_DIR_NAME"
144 …echo -e "\n***** Created tarball of Arm NN build at $ROOT_DIR/armnn_$ARMNN_BUILD_DIR_NAME.tar.gz *…
145 echo -e "\n***** To extract tarball, run: tar -xzf armnn_$ARMNN_BUILD_DIR_NAME.tar.gz *****\n"
154 echo -e "\n***** Downloading Arm NN *****"
156 rm -rf "$ARMNN_SRC"
159 git clone https://github.com/ARM-software/armnn.git armnn
162 local armnn_branch="$(git rev-parse --abbrev-ref HEAD)"
164 echo -e "\n***** Arm NN Downloaded: $armnn_branch *****"
171 local armnn_branch="$(git rev-parse --abbrev-ref HEAD)"
173 echo -e "\n***** Downloading corresponding ACL version using Arm NN branch: $armnn_branch *****"
177 rm -rf "$ACL_SRC"
179 git clone https://github.com/ARM-software/ComputeLibrary.git acl
183 …l_tag="$(echo "$armnn_branch" | tr '\n' ' ' | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | …
188 echo -e "\n***** ACL Downloaded: $acl_tag *****"
194 build-armnn.sh - Build Arm NN and ACL
195 build-armnn.sh [OPTION]...
196 --tflite-delegate
198 --tflite-parser
200 --onnx-parser
202 --all
204 --target-arch=[aarch64|x86_64]
206 --neon-backend
208 --cl-backend
210 --ref-backend
212 --clean
214 --debug
216 --armnn-cmake-args=<ARG LIST STRING>
217 provide additional comma-separated CMake arguments string for building Arm NN (optional)
218 --acl-scons-params=<PARAM LIST STRING>
219 provide additional comma-separated scons parameters string for building ACL (optional)
220 --num-threads=<INTEGER>
222 -h, --help
224 -x
227 At least one component (i.e. --tflite-delegate, --tflite-parser, --onnx-parser) must be provided or…
228 At least one backend (i.e. --neon-backend, --cl-backend, --ref-backend) must be chosen.
229 This script must be executed from the same root directory in which setup-armnn.sh was executed from.
233 …acl" repo is optional since it is only required if backend flags --neon-backend or --cl-backend ar…
239 <PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --neon-backend --cl-backend
241 …<PATH_TO>/build-armnn.sh --target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='…
242 Setup for aarch64 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args:
243 …<PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMP…
264 # If --num-threads is not set, the default NUM_THREADS value in common.sh will be used
270 if [ $# -eq 0 ]; then
275-ohx -l tflite-delegate,tflite-parser,onnx-parser,all,target-arch:,neon-backend,cl-backend,ref-bac…
276 eval set -- "$args"
277 while [ $# -gt 0 ]; do
278 if [ -n "${opt_prev:-}" ]; then
283 elif [ -n "${opt_append:-}" ]; then
284 if [ -n "$1" ]; then
285 eval "$opt_append=\"\${$opt_append:-} \$1\""
292 --tflite-parser)
296 --tflite-delegate)
300 --onnx-parser)
304 --all)
310 --target-arch)
314 --neon-backend)
318 --cl-backend)
322 --ref-backend)
326 --clean)
330 --debug)
334 --armnn-cmake-args)
338 --acl-scons-params)
342 --num-threads)
346 -h | --help)
351 -x)
352 set -x
355 --)
368 if [ "$flag_neon_backend" -eq 0 ] && [ "$flag_cl_backend" -eq 0 ] && [ "$flag_ref_backend" -eq 0 ];…
369 …echo -e "\n$name: at least one of flags --neon-backend, --cl-backend or --ref-backend must be set."
373 if [ "$target_arch" == "x86_64" ]; then
374 if [ "$flag_neon_backend" -eq 1 ] || [ "$flag_cl_backend" -eq 1 ]; then
375 …echo "$name: Accelerated backends --neon-backend and --cl-backend are supported on Arm targets onl…
380 # Verify that root source and build directories are present (post execution of setup-armnn.sh)
381 if [ ! -d "$SOURCE_DIR" ]; then
382 echo -e "\nERROR: Root source directory does not exist at $SOURCE_DIR"
384 echo "1. setup-armnn.sh was executed successfully prior to running this script"
385 echo "2. This script is being executed in the same directory as setup-armnn.sh"
390 if [ ! -d "$BUILD_DIR" ]; then
391 echo -e "\nERROR: Root build directory does not exist at $BUILD_DIR"
393 echo "1. setup-armnn.sh was executed successfully prior to running this script"
394 echo "2. This script is being executed in the same directory as setup-armnn.sh"
401 if [ -d "$ARMNN_SRC" ] && check_if_repository "$ARMNN_SRC"; then
402 …echo -e "\n***** Arm NN source repository already located at $ARMNN_SRC. Skipping cloning of Arm N…
409 # Only download ACL if backend options --neon-backend and --cl-backend are chosen
410 if [ "$flag_neon_backend" -eq 1 ] || [ "$flag_cl_backend" -eq 1 ]; then
412 if [ -d "$ACL_SRC" ] && check_if_repository "$ACL_SRC"; then
413 …echo -e "\n***** ACL source repository already located at $ACL_SRC. Skipping cloning of ACL. *****"
419 …echo -e "\n***** Backend options --neon-backend and --cl-backend not selected - skipping cloning o…
424 if [ "$flag_debug" -eq 1 ]; then
441 echo -e "\nINFO: Displaying configuration information before execution of $name"
442 echo " target-arch: $TARGET_ARCH"
443 echo " host-arch: $HOST_ARCH"
444 echo " tflite-delegate: $flag_tflite_delegate"
445 echo " tflite-parser: $flag_tflite_parser"
446 echo " onnx-parser: $flag_onnx_parser"
447 echo " neon-backend: $flag_neon_backend"
448 echo " cl-backend: $flag_cl_backend"
449 echo " ref-backend: $flag_ref_backend"
452 echo "armnn-cmake-args: $armnn_cmake_args"
453 echo "acl-scons-params: $acl_scons_params"
454 echo " num-threads: $NUM_THREADS"
459 echo -e "\nScript execution will begin in 10 seconds..."
463 if [ "$flag_neon_backend" -eq 1 ] || [ "$flag_cl_backend" -eq 1 ]; then
466 echo -e "\n***** Skipping ACL build: --neon-backend and --cl-backend not set in options. *****"