From 60435a818d5d5582858f2ef7d693ff17c30bbad4 Mon Sep 17 00:00:00 2001 From: Nicola Ferralis Date: Thu, 7 Mar 2024 10:05:43 -0500 Subject: [PATCH 1/4] Add support for TF 2.16.0-rc0 --- README.md | 6 +++--- debian/changelog | 3 +++ docker/Dockerfile | 2 +- docker/Dockerfile.windows | 2 +- workspace.bzl | 10 +++++++--- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3ece434..760d43d 100644 --- a/README.md +++ b/README.md @@ -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.1.0` to compile TF 2.15.0. +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.0. -Current version of tensorflow supported is `2.15.0`. +Current version of tensorflow supported is `2.16.0`. Build native binaries on Linux and macOS: ``` @@ -85,7 +85,7 @@ 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: ``` git clone https://github.com/tensorflow/tensorflow -git checkout r2.15 +git checkout v2.16.0 ``` To build the library: diff --git a/debian/changelog b/debian/changelog index dcb14f0..b41e940 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,6 @@ +libedgetpu (16.0.1~tf2.16.0-1) stable; urgency=medium + * Build against TF v2.16.0 +-- Nicola Ferralis < feranick@hotmail.com> Thu, 07 Mar 2024 10:01:34 -0500 libedgetpu (16.0tf2.15.0-1) stable; urgency=medium * Build against TF v2.15.0 -- Nicola Ferralis Tue, 31 Jan 2024 09:10:34 -0500 diff --git a/docker/Dockerfile b/docker/Dockerfile index f440551..0fcbcb4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -54,7 +54,7 @@ RUN if grep 'Bionic Beaver' /etc/os-release > /dev/null; then \ && DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-9 g++-9; \ fi -ARG BAZEL_VERSION=6.1.0 +ARG BAZEL_VERSION=6.5.0 RUN wget -O /bazel https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh && \ bash /bazel && \ rm -f /bazel diff --git a/docker/Dockerfile.windows b/docker/Dockerfile.windows index e607917..89d5cd5 100644 --- a/docker/Dockerfile.windows +++ b/docker/Dockerfile.windows @@ -52,5 +52,5 @@ ADD https://github.com/libusb/libusb/releases/download/v${LIBUSB_VERSION}/libusb RUN 7z x -oc:\libusb c:\windows\temp\libusb-$env:LIBUSB_VERSION.7z # Install Bazel -ARG BAZEL_VERSION=6.1.0 +ARG BAZEL_VERSION=6.5.0 ADD https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.exe c:/windows/system32/bazel.exe diff --git a/workspace.bzl b/workspace.bzl index 6610037..d1f2151 100644 --- a/workspace.bzl +++ b/workspace.bzl @@ -41,9 +41,13 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") #TENSORFLOW_COMMIT = "99d80a9e254c9df7940b2902b14d15914dbbbcd9" #TENSORFLOW_SHA256 = "bede963ce97c4badcbb3149acd7c35a6a4954fa3361b777272a58a300e7e8f1d" -# TF release 2.15.0 as of 11/10/2023. Current -TENSORFLOW_COMMIT = "6887368d6d46223f460358323c4b76d61d1558a8" -TENSORFLOW_SHA256 = "bb25fa4574e42ea4d452979e1d2ba3b86b39569d6b8106a846a238b880d73652" +#TENSORFLOW_COMMIT = "6887368d6d46223f460358323c4b76d61d1558a8"| +#TENSORFLOW_SHA256 = "bb25fa4574e42ea4d452979e1d2ba3b86b39569d6b8106a846a238b880d73652" + +# TF release 2.16.0-rc® as of 02/27/2024. +Current - Pre-Release +TENSORFLOW_COMMIT = "4bdc149ac84738b06a592473595c1c9c2bd2a9a3"| +TENSORFLOW_SHA256 = "1bbdd3dd266de720e08b7093d2441a9bca183c32d7c8e4c84e05d17e770974bf" #CORAL_CROSSTOOL_COMMIT = "6bcc2261d9fc60dff386b557428d98917f0af491" #CORAL_CROSSTOOL_SHA256 = "38cb4da13009d07ebc2fed4a9d055b0f914191b344dd2d1ca5803096343958b4" From 27b12882e45afa3ee29071302f99e63933c53eba Mon Sep 17 00:00:00 2001 From: Nicola Ferralis Date: Thu, 7 Mar 2024 10:07:33 -0500 Subject: [PATCH 2/4] Use c++17 for all platforms --- .bazelrc | 5 +++-- WORKSPACE | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index 49d2bb8..7e05507 100644 --- a/.bazelrc +++ b/.bazelrc @@ -7,10 +7,11 @@ build --enable_platform_specific_config build:linux --crosstool_top=@crosstool//:toolchains build:linux --compiler=gcc +build:linux --cxxopt=-std=c++17 -build:macos --cxxopt=-std=c++14 +build:macos --cxxopt=-std=c++17 build:macos --copt=-fvisibility=hidden build:windows --incompatible_restrict_string_escapes=false build:windows --copt=/DWIN32_LEAN_AND_MEAN -build:windows --cxxopt=/std:c++14 +build:windows --cxxopt=/std:c++17 diff --git a/WORKSPACE b/WORKSPACE index 84afa94..3d031a4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -102,4 +102,4 @@ load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0") tf_workspace0() load("@coral_crosstool//:configure.bzl", "cc_crosstool") -cc_crosstool(name = "crosstool", cpp_version = "c++14") +cc_crosstool(name = "crosstool", cpp_version = "c++17") From 5c3cae5064a8ef74cecbb747a0d51d5c12d39fec Mon Sep 17 00:00:00 2001 From: Nicola Ferralis Date: Thu, 7 Mar 2024 15:46:10 -0500 Subject: [PATCH 3/4] Add support for TF 2.16.1 stable --- README.md | 6 +++--- debian/changelog | 6 +++--- workspace.bzl | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 760d43d..a8f85cc 100644 --- a/README.md +++ b/README.md @@ -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.0. +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. -Current version of tensorflow supported is `2.16.0`. +Current version of tensorflow supported is `2.16.1`. Build native binaries on Linux and macOS: ``` @@ -85,7 +85,7 @@ 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: ``` git clone https://github.com/tensorflow/tensorflow -git checkout v2.16.0 +git checkout v2.16.1 ``` To build the library: diff --git a/debian/changelog b/debian/changelog index b41e940..6786f49 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -libedgetpu (16.0.1~tf2.16.0-1) stable; urgency=medium - * Build against TF v2.16.0 --- Nicola Ferralis < feranick@hotmail.com> Thu, 07 Mar 2024 10:01:34 -0500 +libedgetpu (16.0.1~tf2.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 libedgetpu (16.0tf2.15.0-1) stable; urgency=medium * Build against TF v2.15.0 -- Nicola Ferralis Tue, 31 Jan 2024 09:10:34 -0500 diff --git a/workspace.bzl b/workspace.bzl index d1f2151..979e44d 100644 --- a/workspace.bzl +++ b/workspace.bzl @@ -41,13 +41,13 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") #TENSORFLOW_COMMIT = "99d80a9e254c9df7940b2902b14d15914dbbbcd9" #TENSORFLOW_SHA256 = "bede963ce97c4badcbb3149acd7c35a6a4954fa3361b777272a58a300e7e8f1d" -#TENSORFLOW_COMMIT = "6887368d6d46223f460358323c4b76d61d1558a8"| +# TF release 2.15.0 as of 11/10/2023. +#TENSORFLOW_COMMIT = "6887368d6d46223f460358323c4b76d61d1558a8" #TENSORFLOW_SHA256 = "bb25fa4574e42ea4d452979e1d2ba3b86b39569d6b8106a846a238b880d73652" -# TF release 2.16.0-rc® as of 02/27/2024. -Current - Pre-Release -TENSORFLOW_COMMIT = "4bdc149ac84738b06a592473595c1c9c2bd2a9a3"| -TENSORFLOW_SHA256 = "1bbdd3dd266de720e08b7093d2441a9bca183c32d7c8e4c84e05d17e770974bf" +# TF release 2.16.1 as of 03/07/2024. Current. +TENSORFLOW_COMMIT = "5bc9d26649cca274750ad3625bd93422617eed4b" +TENSORFLOW_SHA256 = "fe592915c85d1a89c20f3dd89db0772ee22a0fbda78e39aa46a778d638a96abc" #CORAL_CROSSTOOL_COMMIT = "6bcc2261d9fc60dff386b557428d98917f0af491" #CORAL_CROSSTOOL_SHA256 = "38cb4da13009d07ebc2fed4a9d055b0f914191b344dd2d1ca5803096343958b4" From f3e9264865e85b7f2d66dc5eccd6581cec1b12f5 Mon Sep 17 00:00:00 2001 From: Nicola Ferralis Date: Thu, 7 Mar 2024 16:07:56 -0500 Subject: [PATCH 4/4] Simplify versioning in debian To conform with git tag --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6786f49..d0f73ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libedgetpu (16.0.1~tf2.16.1-1) stable; urgency=medium +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 libedgetpu (16.0tf2.15.0-1) stable; urgency=medium