Conversation
The existing building skill only covered runners (Makefile targets) and CMake workflow presets. This expands it to be a comprehensive guide for building ExecuTorch from source, including: - Prerequisites and toolchain requirements - Building the Python package (install_executorch.sh with all flags) - Building the C++ runtime standalone (presets, workflows, manual CMake) - Building model runners (Makefile) - Cross-compilation (Android, iOS, macOS, Windows) - Complete build options reference with dependency chains - Common build patterns (minimal, XNNPACK, profiling, tests, subdirectory) - Troubleshooting section covering 12 common build issues: - Submodule issues - Stale build artifacts - CMake version conflicts - Python version mismatch - Dependency version conflicts - Missing python-dev headers - Linking errors with --whole-archive - XNNPACK build failures - Windows symlink errors - MSVC kernel compilation failures - Intel macOS limitations - Duplicate kernel registration - Build output reference table - Tips for faster and more reliable builds
Reorganize the building skill to be concise and action-driven rather than encyclopedic. Key changes: - Add "do not ask questions" directive — detect and fix env issues automatically - Make conda the mandatory path (no venvs, no system Python) - Auto-fix for cmake >= 4.0 and PEP 668 errors - Default action is `./install_executorch.sh --editable` - Complete runner table from actual Makefile (adds voxtral, voxtral_realtime, sortformer, silero-vad, llava, debug variants) - Fix macOS commands: $(sysctl -n hw.ncpu) instead of $(nproc) - Note that --preset macos uses Xcode generator - Condense troubleshooting into scannable table - Trim cmake options to most-used flags (full list in CMakeLists.txt) Co-authored-by: Claude <noreply@anthropic.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18045
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 PendingAs of commit da50e3f with merge base 518daa8 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
Updates the internal “building” skill documentation to cover end-to-end ExecuTorch builds (conda env setup, Python package install, Makefile runners, CMake presets/workflows, cross-compilation, and troubleshooting).
Changes:
- Expanded build guidance to include conda environment setup and a recommended default install path (
install_executorch.sh). - Added consolidated instructions for model runners, C++ runtime builds (presets + workflows + manual), and cross-compilation (Apple frameworks / Android AAR).
- Added a flags reference table plus troubleshooting and build-output sections.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add venv fallback when conda is not installed - Handle conda PermissionError by checking env directory on disk - Auto-fix cmake: missing or < 3.24 gets pip-installed, >= 4.0 works fine - Add troubleshooting entries for conda not found and PEP 668 errors - Remove heavy-handed directive banner; let skill structure guide behavior Co-authored-by: Claude <noreply@anthropic.com>
Explicit decision tree at the top of Step 2 so Claude routes to the right section based on keywords (Android, iOS, model names, cmake) instead of always defaulting to the Python package build. Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add ANDROID_NDK requirement and verification to Android section - Fix CMAKE_BUILD_TYPE description: not all presets set it - Separate build output table by flow (pip vs cmake vs cross-compilation) Co-authored-by: Claude <noreply@anthropic.com>
Three issues that would break a fresh Mac checkout: - Add Xcode Command Line Tools prerequisite check - Add conda shell.bash hook for non-interactive shells (Claude Code / CI) - Add brew install python@3.12 guidance for venv path when only 3.14+ exists Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Key build options | ||
|
|
||
| Most commonly needed flags (full list: `CMakeLists.txt`): | ||
|
|
There was a problem hiding this comment.
Android cross-compilation prerequisites are incorrect/incomplete. scripts/build_android_library.sh expects ANDROID_NDK and also uses ANDROID_SDK (mapped to ANDROID_HOME when running Gradle); it does not require the NDK to be “on PATH”. Please update this section to instruct users to export ANDROID_NDK and ANDROID_SDK/ANDROID_HOME (per docs), otherwise the script may fall back to /opt/ndk and /opt/android/sdk and fail on most dev machines.
|
|
||
| | Platform | Command | | ||
| |----------|---------| | ||
| | macOS | `cmake -B cmake-out --preset macos` (uses Xcode generator — requires Xcode) | |
There was a problem hiding this comment.
Nit: Linux specifies Release. Should we specify release mode for all of them?
|
CC @cbilgin - recently mentioned Claude having trouble building ET. |
The skill now has an explicit routing table at the top of Step 2:
┌──────────────────────────────────────┬────────────────────────────┐
│ User says │ Claude goes to │
├──────────────────────────────────────┼────────────────────────────┤
│ "build from sources" │ Python package (default) │
├──────────────────────────────────────┼────────────────────────────┤
│ "build for Android" │ Cross-compilation: Android │
├──────────────────────────────────────┼────────────────────────────┤
│ "build for iOS" / "build frameworks" │ Cross-compilation: iOS │
├──────────────────────────────────────┼────────────────────────────┤
│ "build llama" / "build whisper" │ LLM/ASR model runner │
├──────────────────────────────────────┼────────────────────────────┤
│ "build C++ runtime" / "cmake" │ C++ runtime standalone │
└──────────────────────────────────────┴────────────────────────────┘