Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 789270 - sci-libs/tensorflow-2.4.0: checking whether the gcc version is supported by CUDA is wrong in src_configure, the pattern "*$(gcc-version)*" should be to the right of !=
Summary: sci-libs/tensorflow-2.4.0: checking whether the gcc version is supported by C...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-05-10 06:56 UTC by Lin Jian
Modified: 2021-06-20 22:05 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lin Jian 2021-05-10 06:56:44 UTC
In the 235th line of the ebuild of sci-libs/tensorflow-2.4.0, checking whether the gcc version is supported by CUDA is done by
 `if [[ *$(gcc-version)* != $(cuda-config -s) ]]`.

However, according the manual of bash[1], "When the ‘==’ and ‘!=’ operators are used, the string to the right of the operator is considered a pattern and matched according to the rules described below in Pattern Matching".

So, we should swap the positions of `*$(gcc-version)*` and `$(cuda-config -s)`.

[1]: https://www.gnu.org/software/bash/manual/bash.html

Reproducible: Always

Steps to Reproduce:
1.Use gcc-10.2.0 to build tensorflow (or use `ebuild /var/db/repos/gentoo/sci-libs/tensorflow/tensorflow-2.4.0.ebuild clean configure`)

Actual Results:  
You will see these warnings even if $(cuda-config -s) contains your gcc version:
 * TensorFlow is being built with Nvidia CUDA support. Your default compiler
 * version is not supported by the currently installed CUDA. TensorFlow will
 * instead be compiled using: /usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/x86_64-pc-linux-gnu-gcc.
 * If the build fails with linker errors try rebuilding the relevant
 * dependencies using the same compiler version.

Expected Results:  
No such warnings if $(cuda-config -s) contains your gcc version.
Comment 1 Ionen Wolkens gentoo-dev 2021-05-10 07:17:47 UTC
May also want to see related discussion in:
https://github.com/gentoo/gentoo/pull/18663#discussion_r590059862
Comment 2 Lin Jian 2021-05-10 08:03:05 UTC
(In reply to Ionen Wolkens from comment #1)
> May also want to see related discussion in:
> https://github.com/gentoo/gentoo/pull/18663#discussion_r590059862

Thanks. That is the same bug as this one.
Comment 3 Larry the Git Cow gentoo-dev 2021-06-20 22:05:00 UTC
The bug has been closed via the following commit(s):

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

commit a99862388c0fcc72b52f87421630b8383061c317
Author:     Jian Lin <jlin.gentoo@outlook.com>
AuthorDate: 2021-05-10 07:30:13 +0000
Commit:     Jason Zaman <perfinion@gentoo.org>
CommitDate: 2021-06-20 22:04:43 +0000

    sci-libs/tensorflow: check gcc version correctly
    
    Closes: https://bugs.gentoo.org/789270
    Closes: https://github.com/gentoo/gentoo/pull/20750
    Package-Manager: Portage-3.0.18, Repoman-3.0.2
    Signed-off-by: Jian Lin <jlin.gentoo@outlook.com>
    Signed-off-by: Jason Zaman <perfinion@gentoo.org>

 sci-libs/tensorflow/tensorflow-2.4.0.ebuild | 2 +-
 sci-libs/tensorflow/tensorflow-2.5.0.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)