Skip to content

Commit a5a147f

Browse files
authored
Update cmake docs to reflect the recommended way of running cmake (#6329)
* Update cmake docs to reflect the latest recommended way of running cmake Summary: Update the library name and make the cmake command a bit better Test Plan: Reviewers: Subscribers: Tasks: Tags: * Point to release/0.4 sources Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent d59a511 commit a5a147f

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

docs/source/runtime-build-and-cross-compilation.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ likely to be useful to embedded systems users.
1212
- `libexecutorch.a`: The core of the ExecuTorch runtime. Does not contain any
1313
operator/kernel definitions or backend definitions.
1414
- `libportable_kernels.a`: The implementations of ATen-compatible operators,
15-
following the signatures in `//kernels/portable/functions.yaml`.
16-
- `libportable_kernels_bindings.a`: Generated code that registers the contents
15+
following the signatures in `[functions.yaml](https://github.com/pytorch/executorch/blob/release/0.4/kernels/portable/functions.yaml)`.
16+
- `libportable_ops_lib.a`: Generated code that registers the contents
1717
of `libportable_kernels.a` with the runtime.
1818
- NOTE: This must be linked into your application with a flag like
1919
`-Wl,-force_load` or `-Wl,--whole-archive`. It contains load-time functions
@@ -43,9 +43,9 @@ dependencies may have changed.
4343
# cd to the root of the executorch repo
4444
cd executorch
4545

46-
# Clean and configure the CMake build system. It's good practice to do this
46+
# Clean cmake cache directory (cmake-out). It's a good practice to do this
4747
# whenever cloning or pulling the upstream repo.
48-
(rm -rf cmake-out && mkdir cmake-out && cd cmake-out && cmake ..)
48+
bash install_requirements.sh --clean
4949
```
5050

5151
Once this is done, you don't need to do it again until you pull from the upstream repo again, or if you modify any CMake-related files.
@@ -54,28 +54,25 @@ Once this is done, you don't need to do it again until you pull from the upstrea
5454

5555
The release build offers optimizations intended to improve performance and reduce binary size. It disables program verification and executorch logging, and adds optimizations flags.
5656
```bash
57-
-DCMAKE_BUILD_TYPE=Release
57+
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release"
5858
```
5959

60-
To further optimize the release build for size, use both:
60+
To further optimize the release build for size, add:
6161
```bash
62-
-DCMAKE_BUILD_TYPE=Release \
63-
-DOPTIMIZE_SIZE=ON
62+
CMAKE_FLAGS="$CMAKE_FLAGS -DOPTIMIZE_SIZE=ON"
6463
```
6564

66-
See [CMakeLists.txt](https://github.com/pytorch/executorch/blob/main/CMakeLists.txt)
65+
See [CMakeLists.txt](https://github.com/pytorch/executorch/blob/release/0.4/CMakeLists.txt)
6766

6867
## Build the runtime components
6968

7069
Build all targets with
7170

7271
```bash
73-
# cd to the root of the executorch repo
74-
cd executorch
75-
7672
# Build using the configuration that you previously generated under the
7773
# `cmake-out` directory.
78-
#
74+
cmake "$CMAKE_FLAGS" -Bcmake-out .
75+
7976
# NOTE: The `-j` argument specifies how many jobs/processes to use when
8077
# building, and tends to speed up the build significantly. It's typical to use
8178
# "core count + 1" as the `-j` value.

0 commit comments

Comments
 (0)