Skip to content

Commit 8c9b1c8

Browse files
committed
remove the ability to bring flatc
1 parent 0ccf509 commit 8c9b1c8

File tree

7 files changed

+7
-134
lines changed

7 files changed

+7
-134
lines changed

.ci/scripts/build_llama_android.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,5 @@ build_llama_runner() {
6060

6161
cmake --build cmake-android-out/examples/models/llama -j4 --config Release
6262
}
63-
install_flatc_from_source
6463
install_executorch_and_backend_lib
6564
build_llama_runner

.ci/scripts/utils.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,6 @@ install_pytorch_and_domains() {
7272
sccache --show-stats || true
7373
}
7474

75-
install_flatc_from_source() {
76-
# NB: This function could be used to install flatbuffer from source
77-
pushd third-party/flatbuffers || return
78-
79-
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
80-
if [ "$(uname)" == "Darwin" ]; then
81-
CMAKE_JOBS=$(( $(sysctl -n hw.ncpu) - 1 ))
82-
else
83-
CMAKE_JOBS=$(( $(nproc) - 1 ))
84-
fi
85-
cmake --build . -j "${CMAKE_JOBS}"
86-
87-
# Copy the flatc binary to conda path
88-
EXEC_PATH=$(dirname "$(which python)")
89-
cp flatc "${EXEC_PATH}"
90-
91-
popd || return
92-
}
93-
9475
build_executorch_runner_buck2() {
9576
# Build executorch runtime with retry as this step is flaky on macos CI
9677
retry buck2 build //examples/portable/executor_runner:executor_runner

CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,9 @@ cmake_dependent_option(
471471
#
472472
cmake_dependent_option(
473473
EXECUTORCH_BUILD_FLATC "Build the flatc executable." ON
474-
"NOT FLATC_EXECUTABLE;EXECUTORCH_BUILD_HOST_TARGETS" OFF
474+
"NOT FLATC_EXECUTABLE" OFF
475475
)
476476

477-
478477
set(FLATBUFFERS_BUILD_FLATC OFF CACHE BOOL "")
479478
set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "")
480479
set(FLATBUFFERS_BUILD_FLATLIB OFF CACHE BOOL "")
@@ -507,6 +506,9 @@ if(EXECUTORCH_BUILD_FLATC)
507506
-DFLATBUFFERS_BUILD_TESTS=${FLATBUFFERS_BUILD_TESTS}
508507
-DFLATBUFFERS_INSTALL=${FLATBUFFERS_INSTALL}
509508
-DCMAKE_CXX_FLAGS="-DFLATBUFFERS_MAX_ALIGNMENT=${FLATBUFFERS_MAX_ALIGNMENT}"
509+
# Flags "unset" to prevent platform flags from being propagated.
510+
$<$<BOOL:${CMAKE_TOOLCHAIN_IOS}>:-DCMAKE_TOOLCHAIN_FILE=>
511+
$<$<BOOL:${CMAKE_TOOLCHAIN_IOS}>:-DCMAKE_OSX_SYSROOT=>
510512
INSTALL_COMMAND ""
511513
BUILD_BYPRODUCTS <BINARY_DIR>/flatc
512514
)
@@ -515,6 +517,8 @@ if(EXECUTORCH_BUILD_FLATC)
515517
# flatbuffers does not use CMAKE_BUILD_TYPE. Internally, the build forces Release
516518
# config, but from CMake's perspective the build type is always Debug.
517519
set(FLATC_EXECUTABLE ${BINARY_DIR}/$<CONFIG>/flatc.exe)
520+
elseif(CMAKE_TOOLCHAIN_IOS)
521+
set(FLATC_EXECUTABLE ${BINARY_DIR}/$<CONFIG>/flatc)
518522
else()
519523
set(FLATC_EXECUTABLE ${BINARY_DIR}/flatc)
520524
endif()
@@ -528,12 +532,7 @@ if(NOT FLATC_EXECUTABLE)
528532
find_program(FLATC_EXECUTABLE flatc)
529533

530534
if(NOT FLATC_EXECUTABLE)
531-
message(
532-
FATAL_ERROR
533-
"FLATC_EXECUTABLE must be set when EXECUTORCH_BUILD_FLATC is disabled. "
534-
"Note that EXECUTORCH_BUILD_FLATC may be disabled implicitly when "
535-
"cross-compiling or when EXECUTORCH_BUILD_HOST_TARGETS is disabled."
536-
)
535+
message(FATAL_ERROR "FLATC_EXECUTABLE must be set when EXECUTORCH_BUILD_FLATC is disabled.")
537536
endif()
538537
endif()
539538

build/build_android_library.sh

100644100755
File mode changed.

build/build_apple_frameworks.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ OUTPUT="cmake-out"
1212
MODES=()
1313
TOOLCHAIN=""
1414
PYTHON=$(which python3)
15-
FLATC=$(which flatc)
1615
COREML=OFF
1716
CUSTOM=OFF
1817
MPS=OFF
@@ -83,7 +82,6 @@ usage() {
8382
echo " --Release Build Release version."
8483
echo " --toolchain=FILE CMake toolchain file. Default: '\$SOURCE_ROOT_DIR/third-party/ios-cmake/ios.toolchain.cmake'"
8584
echo " --python=FILE Python executable path. Default: Path of python3 in \$PATH"
86-
echo " --flatc=FILE FlatBuffers Compiler executable path. Default: Path of flatc in \$PATH"
8785
echo " --coreml Build the Core ML backend."
8886
echo " --custom Build the Custom kernels."
8987
echo " --mps Build the Metal Performance Shaders backend."
@@ -113,7 +111,6 @@ for arg in "$@"; do
113111
;;
114112
--toolchain=*) TOOLCHAIN="${arg#*=}" ;;
115113
--python=*) PYTHON="${arg#*=}" ;;
116-
--flatc=*) FLATC="${arg#*=}" ;;
117114
--coreml) COREML=ON ;;
118115
--custom) CUSTOM=ON ;;
119116
--mps) MPS=ON ;;
@@ -152,7 +149,6 @@ check_command() {
152149
check_command cmake
153150
check_command rsync
154151
check_command "$PYTHON"
155-
check_command "$FLATC"
156152

157153
echo "Building libraries"
158154

@@ -173,7 +169,6 @@ cmake_build() {
173169
-DCMAKE_C_FLAGS="-ffile-prefix-map=$SOURCE_ROOT_DIR=/executorch -fdebug-prefix-map=$SOURCE_ROOT_DIR=/executorch" \
174170
-DCMAKE_CXX_FLAGS="-ffile-prefix-map=$SOURCE_ROOT_DIR=/executorch -fdebug-prefix-map=$SOURCE_ROOT_DIR=/executorch" \
175171
-DPYTHON_EXECUTABLE="$PYTHON" \
176-
-DFLATC_EXECUTABLE="$FLATC" \
177172
-DEXECUTORCH_BUILD_COREML=$COREML \
178173
-DEXECUTORCH_BUILD_MPS=$MPS \
179174
-DEXECUTORCH_BUILD_XNNPACK=$XNNPACK \

build/install_flatc.sh

Lines changed: 0 additions & 99 deletions
This file was deleted.

build/test_ios.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ say "Installing Requirements"
6464
pip install --upgrade cmake pip setuptools wheel zstd
6565

6666
./install_executorch.sh --pybind coreml mps xnnpack
67-
export PATH="$(realpath third-party/flatbuffers/cmake-out):$PATH"
68-
./build/install_flatc.sh
6967

7068
say "Installing CoreML Backend Requirements"
7169

0 commit comments

Comments
 (0)