Added Command Line Option to Select Arm Zephyr Toolchain#12077
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12077
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6eb6daa with merge base 1b42512 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Contributor
Author
|
@pytorchbot label "release notes: none" |
Contributor
Author
|
@digantdesai @zingo @perheld The Arm Zephyr cmake Preset PR was getting too big and including features that weren't directly related to the goal of that PR. I'm splitting into other smaller, more modular PRs to make them easier to review and land. This one is exclusively adding the toolchain option to the |
f2d468c to
6eb6daa
Compare
BujSet
added a commit
that referenced
this pull request
Jul 3, 2025
### Summary This change adds a cmake preset for Arm Zephyr RTOS toolchain. This requires the toolchain cmake compilation target to be added to `PATH` (see #12077 for more details). This change includes update to CI flows, modifying the CI `build_size_test` to run the test using either arm bare metal or Zephyr toolchains. Additionally, the CI for building presets is updated to target the new cmake Zephyr preset. ### Test plan Tested with `test/build_size_test.sh` to determine the correct threshold for running the size test for the arm zephyr toolchain. When the CI runs the size test for the arm zephyr toolchain, the new cmake preset is used directly. The following commands are run by the CI, and can be manually invoked to confirm functionality: ``` CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out . cmake --build cmake-out -j9 --target install --config Release CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(realpath examples/zephyr/arm-x86-64-eabi-gcc.cmake) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test cmake --build cmake-out/test -j9 --config Release arm-zephyr-eabi-strip cmake-out/test/size_test ls -la cmake-out/test/size_test ``` Output should corroborate CI test threshold, reporting a resultant `size_test` binary size of ~125Kb (threshold set to 130KB toin CI test tolerate variability). --------- Co-authored-by: ZephyrUser <zephyruser@gmail.com> Co-authored-by: Github Executorch <github_executorch@arm.com>
Tanish2101
pushed a commit
to Tanish2101/executorch
that referenced
this pull request
Jul 9, 2025
### Summary Adds the command line option `--target-toolchain` to the `examples/arm/setup.sh` script so that Arm Zephyr toolchain for x86-64 Linux host systems can be used. Sourcing the generated `setup_path.sh` puts the selected toolchain on the `PATH` environment variable. ### Test plan Running: ``` ./examples/arm/setup.sh --i-agree-to-the-contained-eula --target-toolchain zephyr source /home/zephyruser/executorch/examples/arm/ethos-u-scratch/setup_path.sh arm-zephyr-eabi-gcc --version ``` Now produces the following output: ``` arm-zephyr-eabi-gcc (Zephyr SDK 0.17.2) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` While running: ``` ./examples/arm/setup.sh --i-agree-to-the-contained-eula source /home/zephyruser/executorch/examples/arm/ethos-u-scratch/setup_path.sh arm-none-eabi-gcc --version ``` Still produces the following output: ``` arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
Tanish2101
pushed a commit
to Tanish2101/executorch
that referenced
this pull request
Jul 9, 2025
### Summary This change adds a cmake preset for Arm Zephyr RTOS toolchain. This requires the toolchain cmake compilation target to be added to `PATH` (see pytorch#12077 for more details). This change includes update to CI flows, modifying the CI `build_size_test` to run the test using either arm bare metal or Zephyr toolchains. Additionally, the CI for building presets is updated to target the new cmake Zephyr preset. ### Test plan Tested with `test/build_size_test.sh` to determine the correct threshold for running the size test for the arm zephyr toolchain. When the CI runs the size test for the arm zephyr toolchain, the new cmake preset is used directly. The following commands are run by the CI, and can be manually invoked to confirm functionality: ``` CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out . cmake --build cmake-out -j9 --target install --config Release CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(realpath examples/zephyr/arm-x86-64-eabi-gcc.cmake) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test cmake --build cmake-out/test -j9 --config Release arm-zephyr-eabi-strip cmake-out/test/size_test ls -la cmake-out/test/size_test ``` Output should corroborate CI test threshold, reporting a resultant `size_test` binary size of ~125Kb (threshold set to 130KB toin CI test tolerate variability). --------- Co-authored-by: ZephyrUser <zephyruser@gmail.com> Co-authored-by: Github Executorch <github_executorch@arm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the command line option
--target-toolchainto theexamples/arm/setup.shscript so that Arm Zephyr toolchain for x86-64 Linux host systems can be used. Sourcing the generatedsetup_path.shputs the selected toolchain on thePATHenvironment variable.Test plan
Running:
Now produces the following output:
While running:
Still produces the following output: