Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 787938 - sci-libs/tensorflow-2.4.0 gcc-11 error: 'numeric_limits' is not a member of 'std'
Summary: sci-libs/tensorflow-2.4.0 gcc-11 error: 'numeric_limits' is not a member of '...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Jason Zaman
URL:
Whiteboard: ~arch only
Keywords: PATCH
Depends on:
Blocks: gcc-11 boost-1.77
  Show dependency tree
 
Reported: 2021-05-03 17:35 UTC by ppdplayer
Modified: 2021-09-21 22:27 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build Log (build.log,279.28 KB, text/x-log)
2021-05-03 17:35 UTC, ppdplayer
Details
tensorflow-2.5.0-r1-build-with-std-c-14.patch (0001-sci-libs-tensorflow-2.5.0-r1-build-with-std-c-14.patch,3.77 KB, patch)
2021-09-21 07:08 UTC, Kerin Millar
Details | Diff
tensorflow-2.5.0-r1-build-with-std-c-14.patch (amended) (0001-sci-libs-tensorflow-2.5.0-r1-build-with-std-c-14.patch,3.81 KB, patch)
2021-09-21 07:23 UTC, Kerin Millar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ppdplayer 2021-05-03 17:35:23 UTC
sci-libs/tensorflow fails to build a external dependency that doesn't define <limits>

This blocks gcc-11.

Reproducible: Always
Comment 1 ppdplayer 2021-05-03 17:35:48 UTC
Created attachment 705774 [details]
Build Log
Comment 2 Kerin Millar 2021-09-05 19:32:30 UTC
I have committed versions 1.15.5-r2 and 2.5.0-r2 to my repo:-

https://codeberg.org/kerframil/portage-overlay/src/commit/e2bf96c/sci-libs/tensorflow

Both should build successfully with gcc-11, though I have only tested 1.15.5-r2 so far (2.5.0-r2 testing is presently underway).
Comment 3 Kerin Millar 2021-09-05 20:27:09 UTC
As far as 2.5.0 is concerned, bazel also requires patching. So far, I've only fixed bazel-0.27.2 but will work on the other versions soon.
Comment 4 Sam James archtester gentoo-dev Security 2021-09-19 01:41:37 UTC
(In reply to Kerin Millar from comment #2)
> I have committed versions 1.15.5-r2 and 2.5.0-r2 to my repo:-
> 
> https://codeberg.org/kerframil/portage-overlay/src/commit/e2bf96c/sci-libs/
> tensorflow
> 
> Both should build successfully with gcc-11, though I have only tested
> 1.15.5-r2 so far (2.5.0-r2 testing is presently underway).

Can I tempt you into offering a patch for ::gentoo for TF now Bazel is fixed (thanks to you)?
Comment 5 Kerin Millar 2021-09-19 03:07:11 UTC
(In reply to Sam James from comment #4)

> Can I tempt you into offering a patch for ::gentoo for TF now Bazel is fixed
> (thanks to you)?

Yes, though 2.5.0-r2 still doesn't built yet. It shouldn't be too difficult to resolve, though. I'll report back in due course.
Comment 6 Kerin Millar 2021-09-21 07:08:29 UTC
Created attachment 740430 [details, diff]
tensorflow-2.5.0-r1-build-with-std-c-14.patch

Note that I don't use CUDA and have only tested with the python USE flag enabled.
Comment 7 Kerin Millar 2021-09-21 07:23:00 UTC
Created attachment 740454 [details, diff]
tensorflow-2.5.0-r1-build-with-std-c-14.patch (amended)

Re-attaching the patch. It's the same, only this bug is now referenced by the commit message.
Comment 8 Larry the Git Cow gentoo-dev 2021-09-21 22:27:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fb980be2673097805afdd00aeeb2babd46753d7

commit 7fb980be2673097805afdd00aeeb2babd46753d7
Author:     Kerin Millar <kfm@plushkava.net>
AuthorDate: 2021-09-21 06:55:42 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-09-21 22:27:01 +0000

    sci-libs/tensorflow: build with -std=c++14 in 2.5.0-r1
    
    TensorFlow is not yet compatible with the C++17 dialect. Allow it to
    build with gcc:11 by appending -std=c++14 to CXXFLAGS, prior to composing
    bazelrc. The flag doesn't encompass the building of the ruy library, so
    this is accompanied by a patch to include the <limits> header in the one
    place that ruy needs it.
    
    Filter out the -fvtable-verify=@(std|preinit) flag, if present. While
    ostensibly useful for hardening, it prevents TensorFlow from building
    successfully. Note that, while the pattern is in the form of an
    extglob, the accompanying shopt does _not_ need to be enabled.
    
    Have src_install localise "l", rather than "j", because the function in
    question never employs the latter.
    
    Closes: https://bugs.gentoo.org/787938
    Signed-off-by: Kerin Millar <kfm@plushkava.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/0008-patch-ruy-for-gcc-11.patch          | 37 ++++++++++++++++++++++
 sci-libs/tensorflow/tensorflow-2.5.0-r1.ebuild     |  7 +++-
 2 files changed, 43 insertions(+), 1 deletion(-)