This page describes how to build the TensorFlow Lite tflite_runtime Python library for ARM devices using musl libc.
- Clone TensorFlow repository:
git clone --depth 1 --branch v2.5.2 https://github.com/tensorflow/tensorflow
cd tensorflow
- Install the musl-based toolchains download tool:
wget https://github.com/kasitoru/tflite_runtime-musl/raw/v2.5.1/download_toolchains.sh -O tensorflow/lite/tools/cmake/download_toolchains.sh
- Fix issue google/XNNPACK#981:
wget https://github.com/kasitoru/tflite_runtime-musl/raw/v2.5.1/xnnpack.patch
git apply xnnpack.patch
rm xnnpack.patch
- Start compiling (more details):
tensorflow/tools/ci_build/ci_build.sh PI-PYTHON38 tensorflow/lite/tools/pip_package/build_pip_package_with_cmake.sh armhf
The binary files will be located in the directory tensorflow/lite/tools/pip_package/gen/tflite_pip/python3.8/dist/
.
- Official Build TensorFlow Lite for ARM boards guide
- Automated cross toolchain builder: musl-cross-make
- Pre-built GCC musl-based toolchains: muls.cc
- Cross-compilation toolchains for Linux: toolchains.bootlin.com