diff --git a/.github/workflows/tflm.yml b/.github/workflows/tflm.yml index 8e46606..2278b17 100644 --- a/.github/workflows/tflm.yml +++ b/.github/workflows/tflm.yml @@ -38,6 +38,16 @@ jobs: fail-fast: true steps: + - name: '🛠 Configure locale' + run: | + sudo locale-gen "en_US.UTF-8" + sudo dpkg-reconfigure locales + sudo update-locale LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + export LANG=C.UTF-8 + export LANGUAGE=en_US.UTF-8 + locale + - name: '⏳ Checkout main' uses: actions/checkout@v4 with: @@ -62,6 +72,9 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: source tools/ci.sh && ci_install_arm_gcc + - name: '🛠 Install Make ' + run: source tools/ci.sh && ci_install_make + - name: '🐍 Set up Python' uses: actions/setup-python@v5 with: @@ -75,6 +88,13 @@ jobs: - name: '🏗 Build TFLM' run: | source tools/ci.sh + arm-none-eabi-gcc --version + make --version + sudo update-locale LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + export LANG=C.UTF-8 + export LANGUAGE=en_US.UTF-8 + locale ci_build_target ${{ matrix.target.name }} \ ${{ matrix.target.arch }} \ "${{ matrix.target.kernel }}" \ @@ -111,7 +131,7 @@ jobs: if-no-files-found: error push-artifacts: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: [build-tflm] if: github.event_name == 'push' permissions: diff --git a/tools/ci.sh b/tools/ci.sh index a75729e..fda9360 100644 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -11,13 +11,26 @@ TFLM_REPO_PATH=tflite-micro TOOLCHAIN_PATH=${HOME}/cache/gcc export PATH=${TOOLCHAIN_PATH}/bin:${PATH} +MAKE_URL="https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz" TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz" ci_install_arm_gcc() { mkdir -p ${TOOLCHAIN_PATH} wget --no-check-certificate -O - ${TOOLCHAIN_URL} | tar --strip-components=1 -Jx -C ${TOOLCHAIN_PATH} export PATH=${TOOLCHAIN_PATH}/bin:${PATH} - arm-none-eabi-gcc --version +} + +ci_install_make() { + MAKE_PATH=make-build + # extract and build make then copy to ${TOOLCHAIN_PATH} + mkdir -p ${MAKE_PATH} + wget --no-check-certificate -O - ${MAKE_URL} | tar --strip-components=1 -xz -C ${MAKE_PATH} + + pushd ${MAKE_PATH} + ./configure --prefix=/usr + make -j$(nproc) + sudo make install + popd } # Update Submodules. @@ -38,14 +51,14 @@ ci_build_target() { ETHOSU_CONFIG="-DNPU_QCONFIG=0 -DNPU_REGIONCFG_0=0 -DAXI_LIMIT0_MAX_BEATS_BYTES=1 -DAXI_LIMIT0_MEM_TYPE=2 -DAXI_LIMIT1_MAX_BEATS_BYTES=1 -DAXI_LIMIT1_MEM_TYPE=2 -DAXI_LIMIT2_MAX_BEATS_BYTES=1 -DAXI_LIMIT2_MEM_TYPE=2 -DAXI_LIMIT3_MAX_BEATS_BYTES=1 -DAXI_LIMIT3_MEM_TYPE=2" + echo "make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \ + TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \ + ${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \ + KERNEL_OPTIMIZATION_LEVEL=-O2 THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-O2 \ + TARGET_TOOLCHAIN_ROOT=${TOOLCHAIN_PATH}/bin/ TARGET_TOOLCHAIN_PREFIX=arm-none-eabi- \ + ETHOSU_EXTRA_FLAGS=${ETHOSU_CONFIG} BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite" + pushd ${TFLM_REPO_PATH} -echo "make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \ -TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \ -${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \ -KERNEL_OPTIMIZATION_LEVEL=-O2 THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-O2 \ -TARGET_TOOLCHAIN_ROOT=${TOOLCHAIN_PATH}/bin/ TARGET_TOOLCHAIN_PREFIX=arm-none-eabi- \ -ETHOSU_EXTRA_FLAGS=${ETHOSU_CONFIG} BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite" - make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \ TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \ ${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \