66
77set -eu
88
9- script_dir=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
9+ script_dir=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
1010et_root_dir=$( cd ${script_dir} /../../.. && pwd)
1111et_root_dir=$( realpath ${et_root_dir} )
1212setup_path_script=${et_root_dir} /examples/arm/ethos-u-scratch/setup_path.sh
1313_setup_msg=" please refer to ${et_root_dir} /examples/arm/setup.sh to properly install necessary tools."
14- source " ${script_dir} /utils.sh"
15-
1614build_type=" Release"
1715build_with_etdump=false
1816extra_build_flags=" "
1917output_folder=" cmake-out-vkml"
18+ build_with_etdump_flags=" -DEXECUTORCH_ENABLE_EVENT_TRACER=OFF"
19+
20+ source " ${script_dir} /utils.sh"
21+
2022
21- build_with_etdump_flags=" -DEXECUTORCH_ENABLE_EVENT_TRACER=OFF -DEXECUTORCH_BUILD_DEVTOOLS=OFF"
2223help () {
2324 echo " Usage: $( basename $0 ) [options]"
2425 echo " Options:"
25- echo " --build_type=<TYPE> Build with Release, Debug or RelWithDebInfo, default is ${build_type} "
26- echo " --etdump Adds Devtools etdump support to track timing, etdump area will be base64 encoded in the log"
27- echo " --extra_build_flags=<FLAGS> Extra flags to pass to cmake. Default: none "
28- echo " --output=<FOLDER> Output folder Default: $( output_folder) "
26+ echo " --build_type=<TYPE> Build with Release, Debug or RelWithDebInfo, default is ${build_type} "
27+ echo " --etdump Adds Devtools etdump support to track timing, etdump area will be base64 encoded in the log"
28+ echo " --extra_build_flags=<FLAGS> Extra flags to pass to cmake. Default: none "
29+ echo " --output=<FOLDER> Output folder Default: $( output_folder) "
2930 exit 0
3031}
3132
3233for arg in " $@ " ; do
3334 case $arg in
34- -h|--help) help ;;
35- --build_type=* ) build_type=" ${arg#* =} " ;;
36- --etdump) build_with_etdump=true ;;
37- --extra_build_flags=* ) extra_build_flags=" ${arg#* =} " ;;
38- --output=* ) output_folder=" ${arg#* =} " ;;
39- --select_ops_list=* ) select_ops_list=" ${arg#* =} " ;;
40- * )
41- ;;
35+ -h|--help) help ;;
36+ --build_type=* ) build_type=" ${arg#* =} " ;;
37+ --etdump) build_with_etdump=true ;;
38+ --extra_build_flags=* ) extra_build_flags=" ${arg#* =} " ;;
39+ --output=* ) output_folder=" ${arg#* =} " ;;
40+ --select_ops_list=* ) select_ops_list=" ${arg#* =} " ;;
41+ * )
42+ ;;
4243 esac
4344done
4445
@@ -52,23 +53,24 @@ source ${setup_path_script}
5253mkdir -p " ${output_folder} "
5354output_folder=$( realpath " ${output_folder} " )
5455
55- echo " --------------------------------------------------------------------------------"
56- echo " Build Arm VKML executor runner: '${output_folder} ' with extra build flags: ${extra_build_flags} "
57- echo " --------------------------------------------------------------------------------"
58-
5956cd ${et_root_dir} /examples/arm/executor_runner
6057
6158if [ " $build_with_etdump " = true ] ; then
62- build_with_etdump_flags=" -DEXECUTORCH_ENABLE_EVENT_TRACER=ON -DEXECUTORCH_BUILD_DEVTOOLS=ON "
59+ build_with_etdump_flags=" -DEXECUTORCH_ENABLE_EVENT_TRACER=ON"
6360fi
6461
65- echo " Building with extra flags: ${build_with_etdump_flags} ${extra_build_flags} "
62+ echo " -----------------------------------------------------------------------------------------------"
63+ echo " Build Arm VKML executor runner: '${output_folder} ' with extra build flags: "
64+ echo " ${build_with_etdump_flags} ${extra_build_flags} "
65+ echo " -----------------------------------------------------------------------------------------------"
66+
6667cmake \
6768 -S " ${et_root_dir} " \
6869 -B " ${output_folder} " \
6970 -Wall \
7071 -Werror \
7172 -DCMAKE_BUILD_TYPE=${build_type} \
73+ -DCMAKE_CXX_FLAGS=" ${extra_build_flags} ${CMAKE_CXX_FLAGS:- } " \
7274 -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
7375 -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
7476 -DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
@@ -80,9 +82,9 @@ cmake \
8082 -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
8183 -DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON \
8284 -DEXECUTORCH_ENABLE_LOGGING=ON \
85+ -DEXECUTORCH_BUILD_DEVTOOLS=ON \
8386 -DPYTHON_EXECUTABLE=" $( which python3) " \
84- ${build_with_etdump_flags} \
85- ${extra_build_flags}
87+ ${build_with_etdump_flags}
8688
8789echo " [${BASH_SOURCE[0]} ] Configured CMAKE"
8890
0 commit comments