Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ To build C++ tests manually with CMake, run the following from the repository ro

```bash
cmake . -Bcmake-out -DCMAKE_INSTALL_PREFIX=cmake-out -DEXECUTORCH_BUILD_TESTS=ON
cmake --build cmake-out -j9 --target install
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install
```

You can then use `ctest` to list or run individual C++ tests directly:
Expand Down
2 changes: 1 addition & 1 deletion backends/xnnpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ cmake \
Then you can build the runtime componenets with

```bash
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config Release
```

Now you should be able to find the executable built at `./cmake-out/executor_runner` you can run the executable with the model you generated as such
Expand Down
7 changes: 4 additions & 3 deletions docs/source/using-executorch-building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ When building as a submodule as part of a user CMake build, ExecuTorch CMake opt
CMake configuration for standalone runtime build:
```bash
cmake -B cmake-out --preset [preset] [options]
cmake --build cmake-out -j10
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 ))
```

#### Build Presets
Expand Down Expand Up @@ -265,8 +265,9 @@ cd executorch
#
# NOTE: The `-j` argument specifies how many jobs/processes to use when
# building, and tends to speed up the build significantly. It's typical to use
# "core count + 1" as the `-j` value.
cmake --build cmake-out -j9
# "core count + 1" as the `-j` value; the command below derives that
# dynamically (`nproc` on Linux, `sysctl -n hw.ncpu` on macOS).
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 ))
```

> **_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.
Expand Down
4 changes: 2 additions & 2 deletions examples/xnnpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cmake \
Then you can build the runtime components with

```bash
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config Release
```

Now finally you should be able to run this model with the following command
Expand Down Expand Up @@ -105,7 +105,7 @@ cmake \
Then you can build the runtime componenets with

```bash
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config Release
```

Now you should be able to find the executable built at `./cmake-out/executor_runner` you can run the executable with the model you generated as such
Expand Down
2 changes: 1 addition & 1 deletion extension/training/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ cmake \
Then you can build the runtime componenets with

```bash
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config Release
```

Now you should be able to find the executable built at `./cmake-out/extension/training/train_xor` you can run the executable with the model you generated as such
Expand Down
4 changes: 2 additions & 2 deletions kernels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=python \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config Release
```
2. The generated `NativeFunctions.h` file is located in
```
Expand Down Expand Up @@ -367,7 +367,7 @@ cmake . \
-DEXECUTORCH_BUILD_TESTS=ON \
-Bcmake-out

cmake --build cmake-out -j9 --target install
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install
```
2. Run tests. You should see your test here.
```
Expand Down
4 changes: 2 additions & 2 deletions test/build_optimized_size_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ cmake_install_executorch_lib() {
-DEXECUTORCH_OPTIMIZE_SIZE=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config MinSizeRel
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config MinSizeRel
}

test_cmake_size_test() {
CXXFLAGS="-g" retry cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test

echo "Build size test"
cmake --build cmake-out/test -j9 --config MinSizeRel
cmake --build cmake-out/test -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --config MinSizeRel

echo 'ExecuTorch with no ops binary size, unstripped:'
ls -al cmake-out/test/size_test
Expand Down
4 changes: 2 additions & 2 deletions test/build_size_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cmake_install_executorch_lib() {
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
${EXTRA_BUILD_ARGS} \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config Release
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install --config Release
}

test_cmake_size_test() {
Expand All @@ -43,7 +43,7 @@ test_cmake_size_test() {
-Bcmake-out/test test

echo "Build size test"
cmake --build cmake-out/test -j9 --config Release
cmake --build cmake-out/test -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --config Release

echo 'ExecuTorch with no ops binary size, unstripped:'
ls -al cmake-out/test/size_test
Expand Down
2 changes: 1 addition & 1 deletion test/run_oss_cpp_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ build_executorch() {
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_TESTS=ON \
-Bcmake-out
cmake --build cmake-out -j9 --target install
cmake --build cmake-out -j$(( $(nproc 2>/dev/null || sysctl -n hw.ncpu) + 1 )) --target install
}

build_and_run_test() {
Expand Down
Loading