https://github.com/tphakala/tflite_c
TensorFlow Lite C precompiled library for Windows, Linux and macOS
https://github.com/tphakala/tflite_c
c library linux prebuilt prebuilt-libraries tensorflow tensorflow-lite tflite windows
Last synced: 11 months ago
JSON representation
TensorFlow Lite C precompiled library for Windows, Linux and macOS
- Host: GitHub
- URL: https://github.com/tphakala/tflite_c
- Owner: tphakala
- Created: 2023-11-05T11:11:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-30T11:14:55.000Z (over 1 year ago)
- Last Synced: 2024-12-30T12:21:47.073Z (over 1 year ago)
- Topics: c, library, linux, prebuilt, prebuilt-libraries, tensorflow, tensorflow-lite, tflite, windows
- Homepage:
- Size: 2.93 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TensorFlow Lite C API library precompiled for Linux and Windows systems
## Compile process for Linux
### Prerequisites for Linux build
- bazelisk
- clang 18
```bash
$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow
$ git checkout tags/v2.17.1
$ CC=clang bazelisk build -c opt //tensorflow/lite/c:libtensorflowlite_c.so
```
Compiled library is at bazel-bin/tensorflow/lite/c/
- libtensorflowlite_c.so
## Compile process for macOS
### Prerequisites for macOS build
- bazelisk
- xcode
```zsh
> git clone https://github.com/tensorflow/tensorflow.git
> cd tensorflow
> git checkout tags/v2.17.1
> CC=clang CXX=clang++ bazelisk build \
-c opt \
--copt=-O3 \
--copt=-flto \
--linkopt=-flto \
--define=tflite_enable_xnnpack=true \
--define=xnnpack_enable_subgraph_reshaping=true \
--define=no_tensorflow_py_deps=true \
--strip=always \
//tensorflow/lite/c:libtensorflowlite_c.dylib
```
Compiled libraries are at bazel-bin/tensorflow/lite/c
- libtensorflowlite_c.dylib
## Compile process for Windows
### Prerequisites for Windows build
- bazelisk
- clang 18
- msys2
```powershell
> git clone https://github.com/tensorflow/tensorflow.git
> cd tensorflow
> git checkout tags/v2.17.1
> $env:BAZEL_SH="C:/msys64/usr/bin/bash.exe"
> bazelisk.exe build --config=opt //tensorflow/lite/c:tensorflowlite_c
```
Compiled libraries are at bazel-bin\tensorflow\lite\c
- tensorflowlite_c.dll