From e35aed18fea2e2d25d98352e5a5bd357c170bd4d Mon Sep 17 00:00:00 2001 From: feranick Date: Thu, 14 Mar 2024 11:58:56 -0400 Subject: [PATCH] Add support for TF 2.16.1 (#63) * Add support for TF 2.16.0-rc0 * Use c++17 for all platforms * Add support for TF 2.16.1 stable * Simplify versioning in debian To conform with git tag --- .bazelrc | 5 +++-- README.md | 6 +++--- WORKSPACE | 2 +- debian/changelog | 3 +++ docker/Dockerfile | 2 +- docker/Dockerfile.windows | 2 +- workspace.bzl | 10 +++++++--- 7 files changed, 19 insertions(+), 11 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/README.md b/README.md index 3ece434..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.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.1. -Current version of tensorflow supported is `2.15.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 r2.15 +git checkout v2.16.1 ``` To build the library: 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") diff --git a/debian/changelog b/debian/changelog index dcb14f0..d0f73ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,6 @@ +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 * 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..979e44d 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" +# TF release 2.15.0 as of 11/10/2023. +#TENSORFLOW_COMMIT = "6887368d6d46223f460358323c4b76d61d1558a8" +#TENSORFLOW_SHA256 = "bb25fa4574e42ea4d452979e1d2ba3b86b39569d6b8106a846a238b880d73652" + +# 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"