From 1bd434e1d618b6222968202531e36a922c7c44f7 Mon Sep 17 00:00:00 2001 From: Kshitij Sisodia Date: Fri, 17 Mar 2023 10:40:45 +0000 Subject: MLECO-3842, MLECO-3801, MLECO-3899: Minor improvements Some minor improvements in this patch: * Added notes on troubleshooting WSL2 build issues. * Fixed a stray guard for MPS3_PLATFORM from noise reduction use-case. * The default build script `build_default.py` will now return an error code to the calling process if it fails. Change-Id: I4557a402646fdf903b2cb043bf68d5d0b0d12972 Signed-off-by: Kshitij Sisodia --- build_default.py | 12 +++++++++++- docs/documentation.md | 1 + docs/sections/troubleshooting.md | 24 ++++++++++++++++++++++-- source/use_case/noise_reduction/src/MainLoop.cc | 7 ++++--- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/build_default.py b/build_default.py index e35aa1c..1badb02 100755 --- a/build_default.py +++ b/build_default.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -130,6 +130,11 @@ def run( cmake_command, shell=True, stdout=logpipe, stderr=subprocess.STDOUT ) + if state.returncode != 0: + logging.error("Failed to configure the project.") + logpipe.close() + sys.exit(state.returncode) + make_command = f"{cmake_path} --build {build_dir} -j{make_jobs}" if make_verbose: make_command += "--verbose" @@ -138,6 +143,11 @@ def run( make_command, shell=True, stdout=logpipe, stderr=subprocess.STDOUT ) + if state.returncode != 0: + logging.error("Failed to build project.") + logpipe.close() + sys.exit(state.returncode) + logpipe.close() diff --git a/docs/documentation.md b/docs/documentation.md index 6302c68..6e016e6 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -23,6 +23,7 @@ - Arm® and Corstone™ are registered trademarks or trademarks of Arm® Limited (or its subsidiaries) in the US and/or elsewhere. - Arm®, Keil® and µVision® are registered trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. +- Microsoft® and Windows® are proprietary registered trademarks of Microsoft and its group of companies. - TensorFlow™, the TensorFlow logo, and any related marks are trademarks of Google Inc. ## Prerequisites diff --git a/docs/sections/troubleshooting.md b/docs/sections/troubleshooting.md index 0b6f4f9..b29b30a 100644 --- a/docs/sections/troubleshooting.md +++ b/docs/sections/troubleshooting.md @@ -10,6 +10,7 @@ - [How to update Python3 package to 3.7 version](./troubleshooting.md#how-to-update-python3-package-to-newer-version) - [Error trying to build on Arm Virtual Hardware](./troubleshooting.md#error-trying-to-build-on-arm-virtual-hardware) - [Internal Compiler Error](./troubleshooting.md#internal-compiler-error) + - [Build issues with WSL2](./troubleshooting.md#build-issues-with-wsl2) ## Inference results are incorrect for my custom files @@ -268,9 +269,28 @@ Please include the complete backtrace with any bug report. See for instructions. ``` -This is expected to be fixed in the next release of the toolchain. We recommend using the previous version 11.3.Rel1 -(from August 2022). +It has been worked around by a CMSIS-NN patch from Dec 23, 2023. Make sure you are on a later commit of CMSIS-NN. See - [GCC patches: PR107987](https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607963.html) - [CMSIS-NN issue 13](https://github.com/ARM-software/CMSIS-NN/issues/13) +- [Workaround for GNU Toolchain 12.x bug ](https://github.com/ARM-software/CMSIS-NN/commit/245089501eef18e8b638865c5afd6cdf2d03386f) + +## Build issues with WSL2 + +Builds using Windows® Subsystem For Linux (WSL2) can run into issues if their +environment's PATH variable has paths containing unescaped space characters. +The error might look like: + +``` +****Building TensorFlow Lite Micro library… /bin/sh: 1: Syntax error: “(” unexpected + make[2]: *** [CMakeFiles/tensorflow_build.dir/build.make:71: CMakeFiles/tensorflow_build] Error 2 + make[1]: *** [CMakeFiles/Makefile2:537: CMakeFiles/tensorflow_build.dir/all] Error 2 + make[1]: *** Waiting for unfinished jobs… +``` + +The error here was caused by `C:/Program Files (x86)/` being part of the PATH. +To resolve this issue, remove any paths with spaces. Alternatively, if these +paths are required, escape them using `\` or enclose them with quotes. + +Another example of a similar issue: [Discourse issue 171: Build error in makefile](https://discuss.mlplatform.org/t/build-error-in-makefile/171). diff --git a/source/use_case/noise_reduction/src/MainLoop.cc b/source/use_case/noise_reduction/src/MainLoop.cc index ae160be..3eef94c 100644 --- a/source/use_case/noise_reduction/src/MainLoop.cc +++ b/source/use_case/noise_reduction/src/MainLoop.cc @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates + * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -92,7 +92,7 @@ void main_loop() caseContext.Set("model", model); SetAppCtxClipIdx(caseContext, 0); -#if defined(MEM_DUMP_BASE_ADDR) && defined(MPS3_PLATFORM) +#if defined(MEM_DUMP_BASE_ADDR) /* For this use case, for valid targets, we dump contents * of the output tensor to a certain location in memory to * allow offline tools to pick this data up. */ @@ -102,7 +102,8 @@ void main_loop() caseContext.Set("MEM_DUMP_LEN", memDumpMaxLen); caseContext.Set("MEM_DUMP_BASE_ADDR", memDumpBaseAddr); caseContext.Set("MEM_DUMP_BYTE_WRITTEN", &memDumpBytesWritten); -#endif /* defined(MEM_DUMP_BASE_ADDR) && defined(MPS3_PLATFORM) */ +#endif /* defined(MEM_DUMP_BASE_ADDR) */ + /* Loop. */ do { int menuOption = MENU_OPT_RUN_INF_NEXT; -- cgit v1.2.1