This wiki explains how to build Tensorflow Lite library (libtensorflow-lite.a) for Atom x5-z8350 airmont silvermont cpu, Android OS, target=i686-android-linux, API Level 21
Instrictions were tested on Ubuntu 18.04. It is recommended to run the build on Ubuntu 18.04 but not on Mac OS. TFLite library which is built on Ubuntu will work 10-20% faster.
wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
# unzip and move the folder to /opt
unzip android-ndk-r18b-linux-x86_64.zip
sudo mv android-ndk-r18b /opt/
# make /opt/ndk link (needed to build cpufeatures/cpu-features.c)
cd /opt
sudo ln -s android-ndk-r18b ndk
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
git checkout r1.13
# put build_i686-linux-android21_silvermont_lib.sh to tensorflow/lite/tools/make
cd tensorflow/lite/tools/make
Get build_i686-linux-android21_silvermont_lib.sh
chmod +x build_i686-linux-android21_silvermont_lib.sh
# put i686-linux-android_makefile.inc to tensorflow/lite/tools/make/targets/
cd targets
Get i686-linux-android_makefile.inc
# return back to the root of the repository
cd ../../../../..
Optionally we can modify tensorflow/lite/tools/make/Makefile
to build shared library libtensorflow-lite.so
Get Makefile.diff and put it to /tmp folder (Alternative version of Makefile2.diff)
git apply /tmp/Makefile.diff
Download all the dependencies
# Run this script at the root of the repository to download all the dependencies
./tensorflow/lite/tools/make/download_dependencies.sh
# Run this script at the root of the repository to start the build
./tensorflow/lite/tools/make/build_i686-linux-android21_silvermont_lib.sh
# libtensorflow-lite.a (and optionally libtensorflow-lite.so) files should appear in the following folder
ls -la tensorflow/lite/tools/make/gen/i686-linux-android_silvermont/lib/libtensorflow-lite.a
ls -la tensorflow/lite/tools/make/gen/i686-linux-android_silvermont/lib/libtensorflow-lite.so
# size:
# libtensorflow-lite.a - 3,281,174
# libtensorflow-lite.so - 2,507,032
# To rerun the build remove tensorflow/lite/tools/make/gen folder first.
The wiki page run-ssd.cpp.md explains how to run SSD models on the device using tensorflow lite C++ API