Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.79 KB

how-to-build.md

File metadata and controls

45 lines (34 loc) · 1.79 KB

How to build

These are notes on how tflite-dist is prepared.

Android

The build for Android is done using the build-android.sh script. It has to run on Linux machine (WSL is OK) that was configured for Tensorflow Android builds. Can check this blog post.

The script will build the C lib and the GPU delegate.

This script will also gather all the include files for tflite-dist (include files are the same for all platforms).

The script has 2 arguments: path to the tensorflow folder and the tensorflow tag/commit to checkout to.

For example:

./build-android.sh ~/MyProjects/tensorflow v2.14.0

iOS

Building the C ios framework should be done on a configured mac machine, instructions are per Tensorflow Lite instructions

Then the build command is:

bazel build --config=ios_fat -c opt \
  //tensorflow/lite/ios:TensorFlowLiteC_framework

Windows

Building for windows requires a machine with Python, Numpy and a supported version of Bazel, the supported version can be found under in the tensorflow repository under .bazelversion file.

IMPORTANT! If you are using VS 2022 the mnimum supported Bazel version is 6.3.0, so although TF v2.14.0 requires Bazel 6.1.0 I was able to build with Bazel 6.3.0

To build the C library, run the following command from Git bash with admin privileges:

cd [tensorflow-root-repo]
git checkot [wanted tag]
python configure.py
bazel build //tensorflow/lite/c:tensorflowlite_c.dll -c opt

One can also build the C++ library, but due to its size it is not included in tflite-dist, the build command is:

bazel build //tensorflow/lite:tensorflowlite.dll -c opt