Skip to content

Commit 247e302

Browse files
committed
fix: cmake -B args inst of cd (#14759)
1 parent ada8e35 commit 247e302

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

docs/source/kernel-library-selective-build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Note that `EXECUTORCH_SELECT_OPS_YAML`, `EXECUTORCH_SELECT_OPS_LIST`, and `EXECU
4747

4848
As an example, to build with only operators used in mv2_xnnpack_fp32.pte, the CMake build can be configured as follows.
4949
```
50-
cmake .. -DEXECUTORCH_SELECT_OPS_MODEL=mv2_xnnpack_fp32.pte
50+
cmake -B cmake-out -DEXECUTORCH_SELECT_OPS_MODEL=mv2_xnnpack_fp32.pte
5151
```
5252

5353
## APIs

docs/source/using-executorch-building-from-source.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ portability details.
4949
conda activate executorch
5050
```
5151

52-
> **_NOTE:_** Addition Windows Setup
52+
> **_NOTE:_** Additional Windows Setup
5353
>
5454
> ExecuTorch requires symlinks to be enabled to build the Python components. To enable symlinks, run the following command before cloning the repository. Missing symlinks will manifest as an error related to `version.py` when running `pip install .`. See [src/README.md](https://github.com/pytorch/executorch/blob/main/src/README.md) for more information.
5555
> ```bash
@@ -129,7 +129,7 @@ When user code is not using CMake, the runtime can be built standalone and linke
129129
| Use Case | How to Build |
130130
| :------------------------- | :--------------------------------------------------------------------------------- |
131131
| C++ with user CMake | Use CMake `add_subdirectory`. |
132-
| C++ without user CMake | Bulild ExecuTorch standalone with CMake. Link libraries with user build. |
132+
| C++ without user CMake | Build ExecuTorch standalone with CMake. Link libraries with user build. |
133133
| Android with Java/Kotlin | Use [scripts/build_android_libraries.sh](#cross-compiling-for-android). |
134134
| Android with C++ | Follow C++ build steps, [cross-compile for Android](#cross-compiling-for-android). |
135135
| iOS | Use [scripts/build_ios_frameworks.sh](#cross-compiling-for-ios). |
@@ -142,7 +142,6 @@ When building as a submodule as part of a user CMake build, ExecuTorch CMake opt
142142
143143
CMake configuration for standalone runtime build:
144144
```bash
145-
mkdir cmake-out
146145
cmake -B cmake-out --preset [preset] [options]
147146
cmake --build cmake-out -j10
148147
```
@@ -161,6 +160,7 @@ Preset values for common scenarios are listed below. Using a platform preset is
161160
* `linux` - Build features and backends for Linux targets.
162161
* `llm` - Build Large Language Model-specific features.
163162
* `profiling` - Build the ExecuTorch runtime with profiling enabled.
163+
* `windows` - Build features and backends for Windows targets.
164164
* `zephyr` - Build for Zephyr RTOS.
165165
166166
User CMake:
@@ -171,7 +171,7 @@ set(EXECUTORCH_BUILD_PRESET_FILE ${CMAKE_SOURCE_DIR}/executorch/tools/cmake/pres
171171
Standalone build:
172172
```bash
173173
# Configure the build with the ios preset.
174-
cmake .. --preset ios
174+
cmake --preset ios
175175
```
176176
177177
#### Build Options
@@ -187,7 +187,7 @@ set(EXECUTORCH_BUILD_XNNPACK ON)
187187
188188
Standalone build:
189189
```bash
190-
cmake -DEXECUTORCH_BUILD_XNNPACK=ON
190+
cmake -B cmake-out -DEXECUTORCH_BUILD_XNNPACK=ON
191191
```
192192
193193
##### Build Type
@@ -196,7 +196,7 @@ The CMake build is typically set to `Debug` or `Release`. For production use or
196196
197197
```bash
198198
# Specify build type during CMake configuration
199-
cmake .. -DCMAKE_BUILD_TYPE=Release
199+
cmake -B cmake-out -DCMAKE_BUILD_TYPE=Release
200200
```
201201
202202
##### Backends
@@ -216,7 +216,7 @@ Typically, each hardware backend exposes a CMake option to control whether the b
216216
217217
```bash
218218
# Build the XNNPACK and Vulkan backends.
219-
cmake .. -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_VULKAN=ON
219+
cmake -B cmake-out -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_VULKAN=ON
220220
```
221221
222222
##### Extensions
@@ -237,7 +237,7 @@ ExecuTorch extensions provide optional functionality outside of the core runtime
237237
238238
```
239239
# Enable the data loader extension.
240-
cmake .. -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
240+
cmake -B cmake-out -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
241241
```
242242
243243
##### Logging
@@ -249,7 +249,7 @@ Logging is enabled by default in debug builds and disabled in release. When enab
249249
250250
```
251251
# Enable logging at debug
252-
cmake .. -DEXECUTORCH_ENABLE_LOGGING=ON -DEXECUTORCH_LOG_LEVEL=debug
252+
cmake -B cmake-out -DEXECUTORCH_ENABLE_LOGGING=ON -DEXECUTORCH_LOG_LEVEL=debug
253253
```
254254
255255
### Building
@@ -269,7 +269,7 @@ cd executorch
269269
cmake --build cmake-out -j9
270270
```
271271
272-
> **_TIP:_** For faster rebuilds, consider installing ccache (see [Compiler Cache section](#compiler-cache-ccache) above). On first builds, ccache populates its cache. Subsequent builds with the same compiler flags can be significantly faster.
272+
> **_TIP:_** For faster rebuilds, consider installing ccache (see [Compiler Cache section](#compiler-cache-ccache) below). On first builds, ccache populates its cache. Subsequent builds with the same compiler flags can be significantly faster.
273273
274274
<hr/>
275275
@@ -298,8 +298,6 @@ To link against the runtime from outside of the CMake ecosystem, the runtime can
298298
`-Wl,-force_load` or `-Wl,--whole-archive`. It contains load-time functions
299299
that automatically register the kernels, but linkers will often prune those
300300
functions by default because there are no direct calls to them.
301-
`libportable_kernels.a`, so the program may use any of the operators it
302-
implements.
303301
304302
Backends typically introduce additional targets. See backend-specific documentation for more details.
305303
@@ -352,7 +350,9 @@ To use the ExecuTorch runtime from native Android C++ code, the runtime can be c
352350
For direct cross-compilation, the ExecuTorch runtime can be configured to build with the NDK toolchain:
353351
```bash
354352
# point -DCMAKE_TOOLCHAIN_FILE to the location where ndk is installed
355-
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a ..
353+
cmake -B cmake-out \
354+
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
355+
-DANDROID_ABI=arm64-v8a
356356
```
357357
358358
<hr/>

docs/source/using-executorch-runtime-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To configure log level when building from source, specify `EXECUTORCH_ENABLE_LOG
1313
See [Building from Source](using-executorch-building-from-source.md) for more information.
1414

1515
```
16-
cmake -b cmake-out -DEXECUTORCH_ENABLE_LOGGING=ON -DEXECUTORCH_LOG_LEVEL=DEBUG ...
16+
cmake -B cmake-out -DEXECUTORCH_ENABLE_LOGGING=ON -DEXECUTORCH_LOG_LEVEL=DEBUG ...
1717
```
1818

1919
## Platform Abstraction Layer (PAL)

0 commit comments

Comments
 (0)