From 5c533a0232be2e2e899756b1019c8863a259e6ed Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 18 Jun 2021 05:46:37 -0400 Subject: [PATCH] tensorflow-lite: set CXXSTANDARD to c++17 (#127209) --- .../science/math/tensorflow-lite/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/tensorflow-lite/default.nix b/pkgs/development/libraries/science/math/tensorflow-lite/default.nix index f407303d9878..cf2346bad271 100644 --- a/pkgs/development/libraries/science/math/tensorflow-lite/default.nix +++ b/pkgs/development/libraries/science/math/tensorflow-lite/default.nix @@ -83,6 +83,12 @@ stdenv.mkDerivation rec { url = "https://github.com/tensorflow/tensorflow/commit/f3c4f4733692150fd6174f2cd16438cfaba2e5ab.patch"; sha256 = "0zx4hbz679kn79f30159rl1mq74dg45cvaawii0cyv48z472yy4k"; }) + # TODO: remove on the next version bump + (fetchpatch { + name = "cxxstandard-var.patch"; + url = "https://github.com/tensorflow/tensorflow/commit/9b128ae4200e10b4752f903492d1e7d11957ed5c.patch"; + sha256 = "1q0izdwdji5fbyqll6k4dmkzfykyvvz5cvc6hysdj285nkn2wy6h"; + }) ]; buildInputs = [ zlib flatbuffers ]; @@ -140,7 +146,14 @@ stdenv.mkDerivation rec { # tensorflow lite expects to compile abseil into `libtensorflow-lite.a` ln -s ${abseil-cpp.src} "$prefix/absl" - buildFlagsArray+=(INCLUDES="-I $PWD ${includes}" TARGET_TOOLCHAIN_PREFIX="" -j$NIX_BUILD_CORES all) + # set CXXSTANDARD=c++17 here because abseil-cpp in nixpkgs is set as + # such and would be used in dependents like libedgetpu + buildFlagsArray+=( + INCLUDES="-I $PWD ${includes}" + CXXSTANDARD="-std=c++17" + TARGET_TOOLCHAIN_PREFIX="" + -j$NIX_BUILD_CORES + all) ''; installPhase = ''