Skip to content

Commit 7783ade

Browse files
refactor no longer needed EXECUTORCH_BUILD_HOST_TARGETS (#10320)
### Summary Removes EXECUTORCH_BUILD_HOST_TARGETS per @mergennachin [comment](#9306 (review)). Fixes #9404 ### Test plan Ensure executorch and cadence builds successfully: ``` ./install_executorch.sh mkdir cmake-out cmake -DCMAKE_TOOLCHAIN_FILE=backends/cadence/cadence.cmake \ -DCMAKE_INSTALL_PREFIX=cmake-out \ -DCMAKE_BUILD_TYPE=Debug \ -DPYTHON_EXECUTABLE=python3 \ -DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \ -DEXECUTORCH_BUILD_HOST_TARGETS=ON \ -DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \ -DEXECUTORCH_BUILD_PTHREADPOOL=OFF \ -DEXECUTORCH_BUILD_CPUINFO=OFF \ -Bcmake-out . cmake --build cmake-out -j8 --target install --config Debug cmake -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_TOOLCHAIN_FILE=examples/backends/cadence.cmake \ -DCMAKE_PREFIX_PATH=cmake-out \ -DMODEL_PATH=add.pte \ -DNXP_SDK_ROOT_DIR=/home/user_name/nxp-sdk \ -DNN_LIB_BASE_DIR=/home/user_name/nnlib-hifi4 \ -Bcmake-out/examples/cadence \ examples/cadence cmake --build cmake-out/examples/cadence -j8 -t cadence_executorch_example ls cmake-xt/*.bin ``` * Test plan assumes nxp-sdk and nnlib-hifir are in user's home directory and Xtensa compiler is available (env vars set). See [cadence docs](https://github.com/pytorch/executorch/blob/main/docs/source/backends-cadence.md) * Since these are modifications to the build system, I leave it to discretion if CI builds provide enough risk protection to merge. * Happy to write tests if needed - I'll need a little direction here if needed. #9306 ran `./install_executorch.sh`, `build_apple_frameworks.sh` and `build_android_library.sh`. --------- Co-authored-by: Mergen Nachin <[email protected]>
1 parent 5f59b76 commit 7783ade

File tree

5 files changed

+2
-40
lines changed

5 files changed

+2
-40
lines changed

CMakeLists.txt

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -410,20 +410,6 @@ endif()
410410
message(STATUS "executorch: Using sources file ${EXECUTORCH_SRCS_FILE}")
411411
include(${EXECUTORCH_SRCS_FILE})
412412

413-
#
414-
# Modify default options when cross-compiling.
415-
#
416-
# The intent is for the EXECUTORCH_BUILD_HOST_TARGETS option to affect the
417-
# default ON/OFF values of host targets around the tree. This way, a user can
418-
# disable EXECUTORCH_BUILD_HOST_TARGETS to disable all host targets, and then
419-
# optionally re-enable some of those targets. Or they could leave
420-
# EXECUTORCH_BUILD_HOST_TARGETS enabled and then optionally disable any given
421-
# host target.
422-
#
423-
# We can then use various cross-compilation hints to set the default value of
424-
# EXECUTORCH_BUILD_HOST_TARGETS, which can still be overridden if desired.
425-
#
426-
427413
# Detect if an iOS toolchain is set.
428414
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
429415
set(CMAKE_TOOLCHAIN_IOS ON)
@@ -458,16 +444,6 @@ if(EXECUTORCH_USE_CPP_CODE_COVERAGE)
458444
endif()
459445
endif()
460446

461-
# EXECUTORCH_BUILD_HOST_TARGETS: Option to control the building of host-only
462-
# tools like `flatc`, along with example executables like `executor_runner` and
463-
# libraries that it uses, like `gflags`. Disabling this can be helpful when
464-
# cross-compiling, but some required tools that would have been built need to be
465-
# provided directly.
466-
cmake_dependent_option(
467-
EXECUTORCH_BUILD_HOST_TARGETS "Build host-only targets." ON
468-
"NOT CMAKE_TOOLCHAIN_IOS" OFF
469-
)
470-
471447
#
472448
# flatc: Flatbuffer commandline tool to generate .h files from .fbs files
473449
#
@@ -665,10 +641,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/configurations)
665641
#
666642
# gflags: Commandline flag host library.
667643
#
668-
cmake_dependent_option(
669-
EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON
670-
EXECUTORCH_BUILD_HOST_TARGETS OFF
671-
)
644+
option(EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON)
672645
if(EXECUTORCH_BUILD_GFLAGS)
673646
add_subdirectory(third-party/gflags)
674647
endif()
@@ -692,10 +665,7 @@ install(FILES tools/cmake/executorch-config.cmake DESTINATION lib/cmake/ExecuTor
692665
#
693666
# executor_runner: Host tool that demonstrates program execution.
694667
#
695-
cmake_dependent_option(
696-
EXECUTORCH_BUILD_EXECUTOR_RUNNER "Build the executor_runner executable" ON
697-
EXECUTORCH_BUILD_HOST_TARGETS OFF
698-
)
668+
option(EXECUTORCH_BUILD_EXECUTOR_RUNNER "Build the executor_runner executable" ON)
699669

700670
# Add googletest if any test targets should be built
701671
if(BUILD_TESTING)

backends/cadence/build_cadence_fusionG3.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ if $STEPWISE_BUILD; then
4040
-DCMAKE_TOOLCHAIN_FILE=/home/zonglinpeng/ws/zonglinpeng/executorch/backends/cadence/cadence.cmake \
4141
-DCMAKE_INSTALL_PREFIX=cmake-out \
4242
-DCMAKE_BUILD_TYPE=Release \
43-
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
4443
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
4544
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
4645
-DEXECUTORCH_BUILD_CADENCE=ON \
@@ -65,7 +64,6 @@ else
6564
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
6665
-DCMAKE_INSTALL_PREFIX=cmake-out \
6766
-DCMAKE_BUILD_TYPE=Release \
68-
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
6967
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
7068
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
7169
-DEXECUTORCH_BUILD_CPUINFO=OFF \

backends/cadence/build_cadence_hifi4.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ if $STEPWISE_BUILD; then
3939
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
4040
-DCMAKE_INSTALL_PREFIX=cmake-out \
4141
-DCMAKE_BUILD_TYPE=Release \
42-
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
4342
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
4443
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
4544
-DEXECUTORCH_BUILD_CADENCE=ON \
@@ -63,7 +62,6 @@ else
6362
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
6463
-DCMAKE_INSTALL_PREFIX=cmake-out \
6564
-DCMAKE_BUILD_TYPE=Release \
66-
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
6765
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
6866
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
6967
-DEXECUTORCH_BUILD_CPUINFO=OFF \

docs/source/backends-cadence.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ cmake -DCMAKE_TOOLCHAIN_FILE=<path_to_executorch>/backends/cadence/cadence.cmake
170170
-DCMAKE_BUILD_TYPE=Debug \
171171
-DPYTHON_EXECUTABLE=python3 \
172172
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
173-
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
174173
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
175174
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
176175
-DEXECUTORCH_BUILD_CPUINFO=OFF \

tools/cmake/Utils.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ function(executorch_print_configuration_summary)
9393
STATUS
9494
" EXECUTORCH_BUILD_GFLAGS : ${EXECUTORCH_BUILD_GFLAGS}"
9595
)
96-
message(STATUS " EXECUTORCH_BUILD_HOST_TARGETS : "
97-
"${EXECUTORCH_BUILD_HOST_TARGETS}"
98-
)
9996
message(STATUS " EXECUTORCH_BUILD_KERNELS_CUSTOM : "
10097
"${EXECUTORCH_BUILD_KERNELS_CUSTOM}"
10198
)

0 commit comments

Comments
 (0)