Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 736194 - sci-libs/tensorflow-2.2.0 fails on gentoo prefix because the host's ld is used when building
Summary: sci-libs/tensorflow-2.2.0 fails on gentoo prefix because the host's ld is use...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-07 01:10 UTC by Yiyang Wu
Modified: 2020-09-25 12:08 UTC (History)
2 users (show)

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


Attachments
xz compressed build.log (build.log.xz,44.43 KB, application/x-xz)
2020-08-07 01:12 UTC, Yiyang Wu
Details
emerge --info ooutput (emerge-info.txt,6.16 KB, text/plain)
2020-08-07 01:13 UTC, Yiyang Wu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yiyang Wu 2020-08-07 01:10:52 UTC
When emerging sci-libs/tensorflow-2.2.0, some linking errors are thrown: 
[6,326 / 7,470] 255 actions running
    Compiling tensorflow/core/kernels/tile_functor_cpu.cc; 68s local
    Compiling tensorflow/core/kernels/argmax_op.cc; 61s local
    Compiling tensorflow/core/kernels/batch_matmul_op_complex.cc; 58s local
    Compiling tensorflow/core/kernels/batch_matmul_op_real.cc; 58s local
    Compiling tensorflow/core/kernels/scatter_op.cc; 55s local
    Compiling tensorflow/core/kernels/training_ops.cc; 54s local
    Compiling tensorflow/core/kernels/einsum_op_impl_complex128.cc; 54s local
    Compiling .../core/kernels/einsum_op_impl_complex64.cc; 54s local ...
/usr/bin/ld: warning: libjsoncpp.so.24, needed by bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libdouble-conversion.so.3, needed by bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::toStyledString[abi:cxx11]() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::~Value()'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Reader::Reader()'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Json::Value const&) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isBool() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isString() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::asBool() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::Value(Json::Value const&)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::size() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `double_conversion::StringToDoubleConverter::StringToFloat(char const*, int, int*) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isMember(char const*) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::Value(Json::ValueType)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::null'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::get(char const*, Json::Value const&) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::asInt64() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isNumeric() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Reader::parse(std::istream&, Json::Value&, bool)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::asCString() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::operator=(Json::Value&&)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Reader::parse(char const*, char const*, Json::Value&, bool)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::get(unsigned int, Json::Value const&) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isObject() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::operator==(Json::Value const&) const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::asString[abi:cxx11]() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::Value(char const*, char const*)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::Value(unsigned long)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isArray() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isIntegral() const'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::operator[](char const*)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::Value(char const*)'
/usr/bin/ld: bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Scc_Cops_Sfunctional_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.2: undefined reference to `Json::Value::isNull() const'
collect2: error: ld returned 1 exit status


This is unusual, scince /usr/bin/ld is not in gentoo prefix. It should use ${EPREFIX}/usr/bin/ld, but the building system is misled. Any ideas?

Reproducible: Always

Steps to Reproduce:
1. Bootsrap a gentoo prefix on a host linux without the latest jsoncpp development package installed (for example debian sid's libjsoncpp-dev's version is not enough so this error won't be hidden)
2. Go into this prefix
3. emerge -v =sci-libs/tensorflow-2.2.0
Actual Results:  
Linking error thrown by non-gentoo_prefix linker

Expected Results:  
No error occurs, successful installation
Comment 1 Yiyang Wu 2020-08-07 01:12:44 UTC
Created attachment 653440 [details]
xz compressed build.log
Comment 2 Yiyang Wu 2020-08-07 01:13:20 UTC
Created attachment 653442 [details]
emerge --info ooutput
Comment 3 Benda Xu gentoo-dev 2020-09-25 04:08:21 UTC
Thanks for your report.  I have reproduced this bug.
Comment 4 Benda Xu gentoo-dev 2020-09-25 04:39:02 UTC
It only happens when USE=cuda is set.
Comment 5 Larry the Git Cow gentoo-dev 2020-09-25 12:08:38 UTC
The bug has been closed via the following commit(s):

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

commit 03743bab4401db4277b5413d81f9a12650f7e63b
Author:     Benda Xu <heroxbd@gentoo.org>
AuthorDate: 2020-09-25 12:05:54 +0000
Commit:     Benda Xu <heroxbd@gentoo.org>
CommitDate: 2020-09-25 12:08:31 +0000

    sci-libs/tensorflow{,-estimator}: add Python 3.8 and prefix support.
    
    tensorflow cuda build system hard codes /usr/bin/ld by default.  This
    patch prefixifies it.
    
    Reported-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
    Closes: https://bugs.gentoo.org/736194
    Package-Manager: Portage-3.0.5, Repoman-3.0.1
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>

 .../tensorflow-estimator-2.2.0-r2.ebuild           |  74 ++++
 sci-libs/tensorflow/tensorflow-2.2.0-r2.ebuild     | 382 +++++++++++++++++++++
 2 files changed, 456 insertions(+)