Skip to content

Commit f1e02c1

Browse files
committed
Merge remote-tracking branch 'origin/main' into android-preset
2 parents dba1337 + 07b6059 commit f1e02c1

File tree

991 files changed

+52955
-16236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

991 files changed

+52955
-16236
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.ci/docker/build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
set -exu
99

10-
IMAGE_NAME="$1"
10+
FULL_IMAGE_NAME="$1"
1111
shift
1212

13+
IMAGE_NAME=$(echo "${FULL_IMAGE_NAME}" | sed 's/ci-image://')
14+
1315
echo "Building ${IMAGE_NAME} Docker image"
1416

1517
OS=ubuntu
@@ -41,6 +43,10 @@ case "${IMAGE_NAME}" in
4143
ARM_SDK=yes
4244
CLANG_VERSION=12
4345
;;
46+
executorch-ubuntu-22.04-zephyr-sdk)
47+
ZEPHYR_SDK=yes
48+
GCC_VERSION=11
49+
;;
4450
executorch-ubuntu-22.04-qnn-sdk)
4551
QNN_SDK=yes
4652
CLANG_VERSION=12
@@ -85,6 +91,7 @@ docker build \
8591
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
8692
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
8793
--build-arg "ARM_SDK=${ARM_SDK:-}" \
94+
--build-arg "ZEPHYR_SDK=${ZEPHYR_SDK:-}" \
8895
--build-arg "QNN_SDK=${QNN_SDK:-}" \
8996
--build-arg "MEDIATEK_SDK=${MEDIATEK_SDK:-}" \
9097
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a3942627f5ac048e06b4b1d703b0a6a53bf6da5b
1+
36e3dd54effb3f6d13d792029609292fdd5502bb
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7cda4017ddda554752e89069ae205be5e8388f59
1+
6fc0ad22f0a07b6f38d138861c56a765d5a9bb02
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
#!/bin/bash
3+
# Copyright (c) Meta Platforms, Inc. and affiliates.
4+
# All rights reserved.
5+
#
6+
# This source code is licensed under the BSD-style license found in the
7+
# LICENSE file in the root directory of this source tree.
8+
9+
set -ex
10+
11+
# shellcheck source=/dev/null
12+
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
13+
14+
# Double check if the NDK version is set
15+
[ -n "${ZEPHYR_SDK}" ]
16+
17+
install_prerequiresites() {
18+
rm /var/lib/dpkg/info/libc-bin.*
19+
apt-get clean
20+
apt-get -y update
21+
apt-get install -y libc-bin
22+
apt-get -y update
23+
apt-get clean
24+
apt-get install --no-install-recommends -y dos2unix
25+
apt-get install --no-install-recommends -y ca-certificates
26+
apt-get install -y --reinstall libc-bin
27+
apt-get install --no-install-recommends -y file
28+
apt-get install --no-install-recommends -y locales
29+
apt-get install --no-install-recommends -y git
30+
apt-get install --no-install-recommends -y build-essential
31+
apt-get install --no-install-recommends -y cmake
32+
apt-get install --no-install-recommends -y ninja-build gperf
33+
apt-get install --no-install-recommends -y device-tree-compiler
34+
apt-get install --no-install-recommends -y wget
35+
apt-get install --no-install-recommends -y curl
36+
apt-get install --no-install-recommends -y xz-utils
37+
apt-get install --no-install-recommends -y dos2unix
38+
apt-get install --no-install-recommends -y vim
39+
apt-get install --no-install-recommends -y nano
40+
apt-get install --no-install-recommends -y mc
41+
apt-get install --no-install-recommends -y openssh-server
42+
apt-get install -y gdb
43+
44+
# Zephyr SDK relies on python 3.12
45+
apt install software-properties-common -y
46+
add-apt-repository ppa:deadsnakes/ppa -y
47+
apt update
48+
apt install -y python3.12 python3.12-dev python3.12-venv python3-pip
49+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
50+
51+
# Upgrade cmake ot 3.24
52+
apt update
53+
apt install cmake
54+
apt install software-properties-common lsb-release
55+
apt update
56+
test -f /usr/share/doc/kitware-archive-keyring/copyright || \
57+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
58+
"deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list > /dev/null
59+
apt update
60+
apt install cmake
61+
62+
# Install additional required software for Zephyr
63+
apt install --no-install-recommends -y ccache \
64+
dfu-util \
65+
python3-setuptools \
66+
python3-tk \
67+
python3-wheel \
68+
make \
69+
gcc \
70+
libsdl2-dev \
71+
libmagic1 \
72+
xterm \
73+
telnet \
74+
net-tools
75+
apt install --no-install-recommends -y gcc-multilib g++-multilib
76+
apt-get clean -y
77+
apt-get autoremove --purge -y
78+
rm -rf /var/lib/apt/lists/*
79+
wget https://apt.kitware.com/kitware-archive.sh && \
80+
chmod +x kitware-archive.sh && \
81+
./kitware-archive.sh && \
82+
rm -f kitware-archive.sh
83+
pip_install --no-cache-dir west
84+
pip_install pyelftools
85+
}
86+
87+
install_prerequiresites

.ci/docker/ubuntu/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ RUN rm install_android.sh
8484

8585
ARG ARM_SDK
8686

87+
ARG ZEPHYR_SDK
88+
COPY ./common/install_zephyr.sh install_zephyr.sh
89+
COPY ./common/utils.sh utils.sh
90+
RUN if [ -n "${ZEPHYR_SDK}" ]; then bash ./install_zephyr.sh; fi
91+
RUN rm install_zephyr.sh utils.sh
92+
8793
ARG QNN_SDK
8894

8995
ARG MEDIATEK_SDK

.ci/scripts/build-mediatek-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ build_neuron_backend() {
1414
export NEURON_BUFFER_ALLOCATOR_LIB=${MEDIATEK_SDK_ROOT}/libneuron_buffer_allocator.so
1515
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
1616

17-
1817
cd ${EXECUTORCH_ROOT}
1918
./backends/mediatek/scripts/mtk_build.sh
19+
./examples/mediatek/mtk_build_examples.sh
2020
}
2121

2222
build_neuron_backend

.ci/scripts/build-qnn-sdk.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ set_up_aot() {
3333
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
3434
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3535
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
36+
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM=ON \
37+
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM_RUNNER=ON \
3638
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
3739
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3840
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \

.ci/scripts/build_llama_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install_executorch_and_backend_lib() {
1919
echo "Installing executorch and xnnpack backend"
2020
clean_executorch_install_folders
2121
mkdir cmake-android-out
22-
ANDROID_NDK=/opt/ndk
22+
ANDROID_NDK=${ANDROID_NDK:-/opt/ndk}
2323
BUCK2=buck2
2424
ANDROID_ABI=arm64-v8a
2525
cmake --preset llm \

0 commit comments

Comments
 (0)