Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
60435a8
Add support for TF 2.16.0-rc0
feranick Mar 7, 2024
27b1288
Use c++17 for all platforms
feranick Mar 7, 2024
5c3cae5
Add support for TF 2.16.1 stable
feranick Mar 7, 2024
f3e9264
Simplify versioning in debian
feranick Mar 7, 2024
bf24e54
Merge branch 'google-coral:master' into master
feranick Mar 14, 2024
1adc5c5
Initial support for TF 2.17.0-rc0
feranick Jun 20, 2024
a3e55fb
Updated debian changelog for TF 2.17.0-rc0
feranick Jun 20, 2024
ef12033
Disable previous version of TF in workspace.bzl
feranick Jun 20, 2024
d167fd7
Bug fixes on debian changelog
feranick Jun 20, 2024
1494008
Updated README.md
feranick Jun 21, 2024
05beb38
Updated Dockerfile.windows with latest dependencies
feranick Jun 21, 2024
d609eaa
Added Support for TF 2.17.0-rc1
feranick Jul 7, 2024
28287cf
Add support for TF 2.17.0 stable.
feranick Jul 12, 2024
d254c1a
Added support for Ubuntu:24.04
feranick Aug 11, 2024
1390341
Updated third party libraries Docker.windows
feranick Aug 11, 2024
4f8de82
Updates Makefile for modern versions of Tensorflow
feranick Sep 18, 2024
0f7fb7a
Update makefile_build/README.md
feranick Sep 18, 2024
16d801e
Updated README.md
feranick Sep 30, 2024
7a23e51
Added support for TF 2.18.0-rc0
feranick Oct 1, 2024
3347dd6
Updated Software sources for Docker-windows
feranick Oct 1, 2024
242f258
Bug fix
feranick Oct 1, 2024
b281c55
Update building only with a Makefile
feranick Oct 7, 2024
b68ae68
Added support for Tensorflow 2.17.1
feranick Oct 28, 2024
2dc1461
Updated README.md
feranick Oct 28, 2024
ba7db81
Typo fix.
feranick Oct 28, 2024
ea190a7
Typo fix
feranick Oct 29, 2024
bf2a7fd
Update README.md with info about MacOS cross-compilation
feranick Oct 29, 2024
8f1cb87
Updated Windows libraries
feranick Apr 29, 2025
aa9ae6c
Removed software-properties-common
feranick Sep 5, 2025
71a5dfb
Update Windows build libraries
feranick Sep 5, 2025
266f542
Added support for Debian Trixie
feranick Sep 5, 2025
277c271
Added links for recent TF versions
feranick Sep 5, 2025
ea44e12
Add support for Tensorflow 2.18.1
feranick Sep 17, 2025
68b69c1
Updated debian/changelog
feranick Sep 17, 2025
2758c06
Updated version of libusb for windows to version 1.0.29 in Makefile
feranick Sep 17, 2025
a26a2de
Added support for tensorflow 2.19.1
feranick Sep 17, 2025
c38ac3f
Updated README
feranick Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ endif
EDGETPU_RUNTIME_DIR := /tmp/edgetpu_runtime
#LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.7z
#LIBUSB_SHA256 := 620cec4dbe4868202949294157da5adb75c9fbb4f04266146fc833eef85f90fb
LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z
LIBUSB_SHA256 := 19835e290f46fab6bd8ce4be6ab7dc5209f1c04bad177065df485e51dc4118c8
#LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z
#LIBUSB_SHA256 := 19835e290f46fab6bd8ce4be6ab7dc5209f1c04bad177065df485e51dc4118c8
LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z
LIBUSB_SHA256 := 964a38152ca9a104cd00ec8d2f0617b89cd814f9b635e29763c68563d951521d
USBDK_URL := https://github.com/daynix/UsbDk/releases/download/v1.00-22/UsbDk_1.0.22_x64.msi
USBDK_SHA256 := 91f6f695e1e13c656024e6d3b55620bf08d8835ef05ee0496935ba6bb62466a5
LIBEDGETPU_BIN ?= $(MAKEFILE_DIR)/out/
Expand Down Expand Up @@ -172,7 +174,7 @@ chmod a+w /; \
groupadd --gid $(shell id -g) $(shell id -g -n); \
useradd -m -e '' -s /bin/bash --gid $(shell id -g) --uid $(shell id -u) $(shell id -u -n); \
echo '$(shell id -u -n) ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers; \
su $(shell id -u -n) $(if $(1),-c '$(1)',)
su $(if $(1),-c '$(1)',)
endef

docker-image:
Expand Down
43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ debuild -us -uc -tc -b -a amd64 -d
```

### Bazel
The version of `bazel` needs to be the same as that recommended for the corresponding version of tensorflow. For example, it requires `Bazel 6.5.0` to compile TF 2.16.1.
The version of `bazel` needs to be the same as that recommended for the corresponding version of tensorflow. For example, it requires `Bazel 6.5.0` to compile TF 2.19.1.

Current version of tensorflow supported is `2.16.1`.
The current version of Tensorflow supported is `2.19.1`.

Build native binaries on Linux and macOS:
```
Expand All @@ -61,6 +61,12 @@ $ CPU=armv7a make
$ CPU=aarch64 make
```

Cross-compile for Apple Silicon (arm64), or Intel (x86_64) on MacOS:
```
$ CPU=darwin_arm64 make
$ CPU=darwin_x86_64 make
```

To package a Debian deb:
```
debuild -us -uc -tc -b
Expand All @@ -77,18 +83,42 @@ Repeat compilation.

If only building for native systems, it is possible to significantly reduce the complexity of the build by removing Bazel (and Docker). This simple approach builds only what is needed, removes build-time depenency fetching, increases the speed, and uses upstream Debian packages.

To prepare your system, you'll need the following packages (both available on Debian Bookworm, Bullseye or Buster-Backports):
To prepare your system, you'll need the following packages:
```
sudo apt install libabsl-dev libflatbuffers-dev
```

Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.15, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/tree/r2.15) get the latest commit for that stable release and then checkout that address:
For Ubuntu 24.10 or newer you also need:
```
sudo apt install libflatbuffers-dev
```
For previous versions, you need a newer version of `libflatbuffers-dev` than the one available from the distribution:

```
git clone https://github.com/google/flatbuffers.git
cd flatbuffers/
git checkout v23.5.26
mkdir build && cd build
cmake .. -DFLATBUFFERS_BUILD_SHAREDLIB=ON -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
```


Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF 2.19.1, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/tree/r2.19) get the latest commit for that stable release and then checkout that address:
```
git clone https://github.com/tensorflow/tensorflow
git checkout v2.16.1
git checkout v2.19.1
```

To build the library for Debian/Ubuntu:
```
TFROOT=<path to tensorflow source>/ LD_LIBRARY_PATH=/usr/local/lib/ make -f makefile_build/Makefile libedgetpu-throttled
TFROOT=<path to tensorflow source>/ LD_LIBRARY_PATH=/usr/local/lib/ make -f makefile_build/Makefile libedgetpu-throttled
debuild -us -uc -tc -b -a amd64 -d
```

To build the library:
To build the library for MacOS:
```
TFROOT=<Directory of Tensorflow> make -f makefile_build/Makefile -j$(nproc) libedgetpu
```
Expand Down Expand Up @@ -116,3 +146,4 @@ Google does not accept any responsibility for any loss or damage if the device
is operated outside of the recommended ambient temperature range.

Note: This issue affects only USB-based Coral devices, and is irrelevant for PCIe devices.
ß
7 changes: 6 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ load(
"python_repository",
)

python_repository(name = "python_version_repo")
#python_repository(name = "python_version_repo")

local_repository(
name = "python_version_repo",
path = "local_repo/python_version_repo"
)

load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION")

Expand Down
14 changes: 13 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
libedgetpu (16.0tf2.19.1-1) stable; urgency=medium
* Build against TF v2.19.1
-- Nicola Ferralis <feranick@hotmail.com> Mon, 17 Sep 2025 12:34:40 -0400
libedgetpu (16.0tf2.18.1-1) stable; urgency=medium
* Build against TF v2.18.1
-- Nicola Ferralis <feranick@hotmail.com> Mon, 17 Sep 2025 11:33:39 -0400
libedgetpu (16.0tf2.17.1-1) stable; urgency=medium
* Build against TF v2.17.1
-- Nicola Ferralis <feranick@hotmail.com> Mon, 24 Oct 2024 11:33:39 -0400
libedgetpu (16.0tf2.17.0-1) stable; urgency=medium
* Build against TF v2.17.0
-- Nicola Ferralis < feranick@hotmail.com> Fri, 12 Jul 2024 09:41:18 -0400
libedgetpu (16.0tf2.16.1-1) stable; urgency=medium
* Build against TF v2.16.1
-- Nicola Ferralis < feranick@hotmail.com> Thu, 07 Mar 2024 14:01:34 -0500
-- Nicola Ferralis <feranick@hotmail.com> Thu, 07 Mar 2024 14:01:34 -0500
libedgetpu (16.0tf2.15.0-1) stable; urgency=medium
* Build against TF v2.15.0
-- Nicola Ferralis <feranick@hotmail.com> Tue, 31 Jan 2024 09:10:34 -0500
Expand Down
10 changes: 9 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ RUN apt-get update \
wget \
git \
tree \
software-properties-common \
$(grep Ubuntu /etc/os-release > /dev/null && echo vim-common || echo xxd)

# Debian Trixie
RUN if grep 'trixie' /etc/os-release > /dev/null; then \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
binutils-gold \
binutils-gold-aarch64-linux-gnu \
binutils-gold-arm-linux-gnueabihf \
&& export TF_PYTHON_VERSION=3.13; \
fi

# Bionic Beaver == Ubuntu 18.04
RUN if grep 'Bionic Beaver' /etc/os-release > /dev/null; then \
add-apt-repository ppa:ubuntu-toolchain-r/test \
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ RUN choco install -y 7zip
RUN setx /M PATH $($Env:PATH + ';C:\Program Files\7-Zip')

# Install msys2
ARG MSYS_VERSION=20240113
ARG MSYS_VERSION=20250830
ADD http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-${MSYS_VERSION}.tar.xz c:/windows/temp
RUN 7z.exe x c:\windows\temp\msys2-base-x86_64-$env:MSYS_VERSION.tar.xz
RUN 7z.exe x c:\msys2-base-x86_64-$env:MSYS_VERSION.tar -o"c:\\"
RUN setx /M PATH $($Env:PATH + ';C:\msys64\usr\bin')

# Install patch
ARG PATCH_VERSION=2.7.6-1
ARG PATCH_VERSION=2.7.6-3
ADD http://repo.msys2.org/msys/x86_64/patch-${PATCH_VERSION}-x86_64.pkg.tar.xz c:/windows/temp
RUN 7z.exe x -y c:\windows\temp\patch-$env:PATCH_VERSION-x86_64.pkg.tar.xz
RUN 7z.exe x -y c:\patch-$env:PATCH_VERSION-x86_64.pkg.tar -o"c:\\msys64"

# Install vim (for xxd)
ARG VIM_VERSION=9.1.0000-1
ARG VIM_VERSION=9.1.1730-1
ADD http://repo.msys2.org/msys/x86_64/vim-${VIM_VERSION}-x86_64.pkg.tar.zst c:/windows/temp
RUN 7z.exe x -y c:\windows\temp\vim-$env:VIM_VERSION-x86_64.pkg.tar.zst
RUN 7z.exe x -y c:\vim-$env:VIM_VERSION-x86_64.pkg.tar -o"c:\\msys64"

# Install libusb release package
ARG LIBUSB_VERSION=1.0.27
ARG LIBUSB_VERSION=1.0.29
ADD https://github.com/libusb/libusb/releases/download/v${LIBUSB_VERSION}/libusb-${LIBUSB_VERSION}.7z c:/windows/temp
RUN 7z x -oc:\libusb c:\windows\temp\libusb-$env:LIBUSB_VERSION.7z

Expand Down
39 changes: 39 additions & 0 deletions docker/update_sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,47 @@

sed -i "s/deb\ /deb \[arch=amd64\]\ /g" /etc/apt/sources.list

if [ ${UBUNTU_CODENAME} == "noble" ]; then

echo "NOBLE"

rm /etc/apt/sources.list.d/ubuntu.sources
cat <<EOT >> /etc/apt/sources.list.d/ubuntu.sources

Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: ${UBUNTU_CODENAME} ${UBUNTU_CODENAME}-updates ${UBUNTU_CODENAME}-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: amd64

## Ubuntu security updates. Aside from URIs and Suites,
## this should mirror your choices in the previous section.
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: ${UBUNTU_CODENAME}-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: amd64

Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports
Suites: ${UBUNTU_CODENAME} ${UBUNTU_CODENAME}-updates ${UBUNTU_CODENAME}-security
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Architectures: arm64 armhf

EOT

else

cat <<EOT >> /etc/apt/sources.list
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${UBUNTU_CODENAME} main universe
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${UBUNTU_CODENAME}-updates main universe
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${UBUNTU_CODENAME}-security main universe
EOT

fi



Empty file.
2 changes: 2 additions & 0 deletions local_repo/python_version_repo/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DO NOT EDIT: automatically generated WORKSPACE file for python_repository rule
workspace(name = "python_version_repo")
6 changes: 6 additions & 0 deletions local_repo/python_version_repo/py_version.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

TF_PYTHON_VERSION = "3.12"
HERMETIC_PYTHON_VERSION = "3.12"
WHEEL_NAME = "tensorflow"
WHEEL_COLLAB = "False"
USE_PYWRAP_RULES = "1"
22 changes: 9 additions & 13 deletions makefile_build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LIBEDGETPU_CFLAGS := \
LIBEDGETPU_CXXFLAGS := \
-fPIC \
-Wall \
-std=c++14 \
-std=c++17 \
-DDARWINN_PORT_DEFAULT

LIBEDGETPU_LDFLAGS := \
Expand Down Expand Up @@ -59,7 +59,7 @@ LIBEDGETPU_INCLUDES := \
$(BUILDDIR)/$(BUILDROOT)
LIBEDGETPU_INCLUDES := $(addprefix -I,$(LIBEDGETPU_INCLUDES))

LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common.c
LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common_internal.cc
LIBEDGETPU_COBJS := $(call TOBUILDDIR,$(patsubst %.c,%.o,$(LIBEDGETPU_CSRCS)))

LIBEDGETPU_CCSRCS := \
Expand Down Expand Up @@ -140,7 +140,9 @@ LIBEDGETPU_CCSRCS := \
$(BUILDROOT)/tflite/edgetpu_c.cc \
$(BUILDROOT)/tflite/edgetpu_delegate_for_custom_op.cc \
$(BUILDROOT)/tflite/edgetpu_delegate_for_custom_op_tflite_plugin.cc \
$(TFROOT)/tensorflow/lite/util.cc
$(TFROOT)/tensorflow/lite/core/c/common.cc \
$(TFROOT)/tensorflow/lite/util.cc \
$(TFROOT)/tensorflow/lite/array.cc
LIBEDGETPU_CCOBJS := $(call TOBUILDDIR,$(patsubst %.cc,%.o,$(LIBEDGETPU_CCSRCS)))

# In order to support direct and throttled mode - we need to compile two files
Expand Down Expand Up @@ -180,12 +182,6 @@ firmware:
done
@echo "} // namespace" >> $(LIBEDGETPU_FW_OUTPUT)


$(LIBEDGETPU_COBJS) : $(BUILDDIR)/%.o: %.c
@$(MKDIR)
@echo "Compiling $<"
@$(CC) $(LIBEDGETPU_CFLAGS) $(LIBEDGETPU_INCLUDES) -c $< -MD -MT $@ -MF $(@:%o=%d) -o $@

$(LIBEDGETPU_CCOBJS) : $(BUILDDIR)/%.o: %.cc
@$(MKDIR)
@echo "Compiling $<"
Expand All @@ -201,14 +197,14 @@ $(LIBEDGETPU_STD_CCOBJS) : $(BUILDDIR)/%-throttled.o: %.cc
@echo "Compiling $<"
@$(CXX) -DTHROTTLE_EDGE_TPU $(LIBEDGETPU_CXXFLAGS) $(LIBEDGETPU_INCLUDES) -c $< -MD -MT $@ -MF $(@:%o=%d) -o $@

libedgetpu: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS)
libedgetpu: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS)
@mkdir -p $(BUILDDIR)/direct/k8
@echo "Building libedgetpu.so"
@$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS) -o $(BUILDDIR)/direct/k8/libedgetpu.so.1.0
@$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) ${LDFLAGS} $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS) -o $(BUILDDIR)/direct/k8/libedgetpu.so.1.0
@ln -sf $(BUILDDIR)/direct/k8/libedgetpu.so.1.0 $(BUILDDIR)/direct/k8/libedgetpu.so.1

libedgetpu-throttled: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS)
libedgetpu-throttled: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS)
@mkdir -p $(BUILDDIR)/throttled/k8
@echo "Building throttled libedgetpu.so"
@$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS) -o $(BUILDDIR)/throttled/k8/libedgetpu.so.1.0
@$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) ${LDFLAGS} $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS) -o $(BUILDDIR)/throttled/k8/libedgetpu.so.1.0
@ln -sf $(BUILDDIR)/throttled/k8/libedgetpu.so.1.0 $(BUILDDIR)/throttled/k8/libedgetpu.so.1
32 changes: 27 additions & 5 deletions makefile_build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,40 @@

If only building for native systems, it is possible to significantly reduce the complexity of the build by removing Bazel (and Docker). This simple approach builds only what is needed, removes build-time depenency fetching, increases the speed, and uses upstream Debian packages.

To prepare your system, you'll need the following packages (both available on Debian Bullseye):
To prepare your system, you'll need the following packages (both available on Debian Bookworm / Ubuntu 22.04):
```
sudo apt install libabsl-dev libflatbuffers-dev
sudo apt install libabsl-dev libusb-1.0-0-dev xxd
```

Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.5, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/commit/a4dfb8d1a71385bd6d122e4f27f86dcebb96712d) and then checkout that address:
Next, build [FlatBuffers](https://github.com/google/flatbuffers) from source. This is because the version of Flatbuffers provided in the package is different from the version required by TensorFlow v2.16.1.

```
git clone https://github.com/google/flatbuffers.git
cd flatbuffers/
git checkout v23.5.26
mkdir build && cd build
cmake .. \
-DFLATBUFFERS_BUILD_SHAREDLIB=ON \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local
make -j$(nproc)
sudo make install
```

Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.16.1, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/tree/v2.16.1) and then checkout that address:

```
git clone https://github.com/tensorflow/tensorflow
git checkout a4dfb8d1a71385bd6d122e4f27f86dcebb96712d -b tf2.5
cd tensorflow
git checkout v2.17.0
```

To build the library:
Note: The `LDFLAGS` flag is required if you specify flatbuffers to be installed to `"/usr/local"`.

```
TFROOT=<Directory of Tensorflow> make -j$(nproc) libedgetpu
git clone https://github.com/google-coral/libedgetpu.git
cd libedgetpu/makefile_build
TFROOT=/home/pi/tensorflow/ LDFLAGS="-L/usr/local/lib" make -j$(nproc) libedgetpu
```
Empty file added patches/BUILD.bazel
Empty file.
19 changes: 19 additions & 0 deletions patches/add_configure_cuda.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff -Nru org_tensorflow.orig/tensorflow/workspace2.bzl org_tensorflow/tensorflow/workspace2.bzl
--- org_tensorflow.orig/tensorflow/workspace2.bzl 2025-09-17 13:39:35
+++ org_tensorflow/tensorflow/workspace2.bzl 2025-09-17 13:40:35
@@ -29,6 +29,7 @@
load("//third_party/FP16:workspace.bzl", FP16 = "repo")
load("//third_party/gemmlowp:workspace.bzl", gemmlowp = "repo")
load("//third_party/git:git_configure.bzl", "git_configure")
+load("//third_party/gpus:cuda_configure.bzl", "cuda_configure")
load("//third_party/gpus:rocm_configure.bzl", "rocm_configure")
load("//third_party/gpus:sycl_configure.bzl", "sycl_configure")
load("//third_party/hexagon:workspace.bzl", hexagon_nn = "repo")
@@ -104,6 +105,7 @@
# Note that we check the minimum bazel version in WORKSPACE.
clang6_configure(name = "local_config_clang6")
cc_download_clang_toolchain(name = "local_config_download_clang")
+ cuda_configure(name = "local_config_cuda")
tensorrt_configure(name = "local_config_tensorrt")
git_configure(name = "local_config_git")
syslibs_configure(name = "local_config_syslibs")
Loading