Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 747547 - sci-libs/tensorflow-2.3.1 fails to build against grpc-1.32
Summary: sci-libs/tensorflow-2.3.1 fails to build against grpc-1.32
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-10-10 12:41 UTC by Marcin
Modified: 2020-10-20 00:33 UTC (History)
7 users (show)

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


Attachments
Error log (emerge_tensorflow_error.txt,10.54 KB, text/plain)
2020-10-10 12:41 UTC, Marcin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin 2020-10-10 12:41:25 UTC
Created attachment 664501 [details]
Error log

emerge tensorflow fails to compile (error in attachment). At the same time I'm able to compile tensorflow both branch r2.3 and tag v2.3.1 following instructions from here - https://www.tensorflow.org/install/source


My emerge --info is:
Portage 3.0.8 (python 3.7.9-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-8.4.0, glibc-2.32-r2, 5.8.13-gentoo x86_64)
=================================================================
System uname: Linux-5.8.13-gentoo-x86_64-Intel-R-_Core-TM-_i9-9900K_CPU_@_3.60GHz-with-gentoo-2.7
KiB Mem:    32815756 total,   7841580 free
KiB Swap:  134217724 total,  63960084 free
Timestamp of repository gentoo: Fri, 09 Oct 2020 22:00:01 +0000
Head commit of repository gentoo: 80c324169f08266fd4a384487d7a01ff20a29537
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.6.11-r2::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo, 3.10.0_alpha1::gentoo
dev-util/cmake:           3.18.4::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.2::gentoo
sys-devel/binutils:       2.34-r2::gentoo, 2.35.1::gentoo
sys-devel/gcc:            8.4.0-r1::gentoo, 9.3.0-r1::gentoo, 10.2.0-r2::gentoo
sys-devel/gcc-config:     2.3.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.8::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

myrepo
    location: /var/db/repos/myrepo
    strict-misc-digests: false
    sync-openpgp-key-refresh: no
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="rsync://ftp.vectranet.pl/gentoo/ http://ftp.vectranet.pl/gentoo/ ftp://ftp.vectranet.pl/gentoo/"
LANG="pl_PL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j17"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt cuda cups dbus declarative dri dts dvd dvdr elogind emboss encode examples exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 jpeg kde kipi kwallet lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opencl opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio python qml qt5 readline sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 foufou33 2020-10-11 05:59:01 UTC
I'm trying this patch here:
https://github.com/tensorflow/tensorflow/commit/c870489b518e64e585e0c8ce40e030bd44d7be91.patch

fingers crossed
Comment 2 Harris Landgarten 2020-10-11 11:39:15 UTC
Same here
Comment 3 Marcin 2020-10-12 12:34:42 UTC
(In reply to foufou33 from comment #1)
> I'm trying this patch here:
> https://github.com/tensorflow/tensorflow/commit/
> c870489b518e64e585e0c8ce40e030bd44d7be91.patch
> 
> fingers crossed

I tried it. I put the patch to /etc/portage/patches/sci-libs/tensorflow-2.3.1 and tried to emerge it but get another error:
ERROR: /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7/tensorflow/cc/BUILD:545:22: Linking of rule '//tensorflow/cc:ops/sparse_ops_gen_cc' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7-bazel-base/execroot/org_tensorflow && \
  exec env - \
    PATH=/var/tmp/portage/sci-libs/tensorflow-2.3.1/temp/python3.7/bin:/usr/lib/portage/python3.7/ebuild-helpers/xattr:/usr/lib/portage/python3.7/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/10/bin:/opt/cuda/bin \
    PWD=/proc/self/cwd \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc @bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/cc/ops/sparse_ops_gen_cc-2.params)
Execution platform: @local_execution_config_platform//:platform
/usr/bin/ld: /usr/lib64/libjsoncpp.so.24: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
Comment 4 Marcin 2020-10-12 17:46:26 UTC
(In reply to Marcin from comment #3)
> (In reply to foufou33 from comment #1)
> > I'm trying this patch here:
> > https://github.com/tensorflow/tensorflow/commit/
> > c870489b518e64e585e0c8ce40e030bd44d7be91.patch
> > 
> > fingers crossed
> 
> I tried it. I put the patch to
> /etc/portage/patches/sci-libs/tensorflow-2.3.1 and tried to emerge it but
> get another error:
> ERROR:
> /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7/
> tensorflow/cc/BUILD:545:22: Linking of rule
> '//tensorflow/cc:ops/sparse_ops_gen_cc' failed (Exit 1):
> crosstool_wrapper_driver_is_not_gcc failed: error executing command 
>   (cd
> /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7-
> bazel-base/execroot/org_tensorflow && \
>   exec env - \
>    
> PATH=/var/tmp/portage/sci-libs/tensorflow-2.3.1/temp/python3.7/bin:/usr/lib/
> portage/python3.7/ebuild-helpers/xattr:/usr/lib/portage/python3.7/ebuild-
> helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/
> bin:/usr/lib/llvm/10/bin:/opt/cuda/bin \
>     PWD=/proc/self/cwd \
>  
> external/local_config_cuda/crosstool/clang/bin/
> crosstool_wrapper_driver_is_not_gcc
> @bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/cc/ops/sparse_ops_gen_cc-2.
> params)
> Execution platform: @local_execution_config_platform//:platform
> /usr/bin/ld: /usr/lib64/libjsoncpp.so.24: undefined reference to
> `std::__cxx11::basic_ostringstream<char, std::char_traits<char>,
> std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
> collect2: error: ld returned 1 exit status


I recompiled jsoncpp and now it works for me with the patch.
Comment 5 picnic.sun 2020-10-13 16:32:37 UTC
ERROR: /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7/tensorflow/core/data/service/BUILD:263:11: C++ compilation of rule '//tensorflow/core/data/service:data_service' failed (Exit 1): gcc failed: error executing command 
  (cd /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7-bazel-base/execroot/org_tensorflow && \
  exec env - \
    HOME=/var/tmp/portage/sci-libs/tensorflow-2.3.1/homedir \
    PATH=/var/tmp/portage/sci-libs/tensorflow-2.3.1/temp/python3.7/bin:/usr/lib/portage/python3.7/ebuild-helpers/xattr:/usr/lib/portage/python3.7/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/10/bin \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/usr/bin/python3.7 \
    PYTHON_LIB_PATH=/usr/lib/python3.7/site-packages \
    TF2_BEHAVIOR=1 \
    TF_CONFIGURE_IOS=0 \
    TF_SYSTEM_LIBS=absl_py,astor_archive,astunparse_archive,boringssl,com_github_googleapis_googleapis,com_github_googlecloudplatform_google_cloud_cpp,com_github_grpc_grpc,com_google_protobuf,curl,cython,dill_archive,double_conversion,enum34_archive,flatbuffers,functools32_archive,gast_archive,gif,hwloc,icu,jsoncpp_git,libjpeg_turbo,lmdb,nasm,nsync,opt_einsum_archive,org_sqlite,pasta,pcre,png,pybind11,six_archive,snappy,swig,tblib_archive,termcolor_archive,wrapt,zlib \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/tensorflow/core/data/service/_objs/data_service/data_service.pic.d '-frandom-seed=bazel-out/k8-opt/bin/tensorflow/core/data/service/_objs/data_service/data_service.pic.o' -fPIC -D__CLANG_SUPPORT_DYN_ANNOTATION__ -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -iquote . -iquote bazel-out/k8-opt/bin -iquote external/com_google_absl -iquote bazel-out/k8-opt/bin/external/com_google_absl -iquote external/nsync -iquote bazel-out/k8-opt/bin/external/nsync -iquote external/eigen_archive -iquote bazel-out/k8-opt/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/k8-opt/bin/external/local_config_sycl -iquote external/gif -iquote bazel-out/k8-opt/bin/external/gif -iquote external/libjpeg_turbo -iquote bazel-out/k8-opt/bin/external/libjpeg_turbo -iquote external/com_google_protobuf -iquote bazel-out/k8-opt/bin/external/com_google_protobuf -iquote external/com_googlesource_code_re2 -iquote bazel-out/k8-opt/bin/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/k8-opt/bin/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/k8-opt/bin/external/fft2d -iquote external/highwayhash -iquote bazel-out/k8-opt/bin/external/highwayhash -iquote external/zlib -iquote bazel-out/k8-opt/bin/external/zlib -iquote external/com_github_grpc_grpc -iquote bazel-out/k8-opt/bin/external/com_github_grpc_grpc -isystem external/eigen_archive -isystem bazel-out/k8-opt/bin/external/eigen_archive -isystem external/farmhash_archive/src -isystem bazel-out/k8-opt/bin/external/farmhash_archive/src -w -DAUTOLOAD_DYNAMIC_KERNELS -I/usr/include/jsoncpp '-std=c++14' '-mtune=haswell' -O2 -pipe -msse -msse2 -msse3 -msse4.1 -msse4.2 -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c tensorflow/core/data/service/data_service.cc -o bazel-out/k8-opt/bin/tensorflow/core/data/service/_objs/data_service/data_service.pic.o)
Execution platform: @local_execution_config_platform//:platform
tensorflow/core/data/service/data_service.cc: In member function 'tensorflow::Status tensorflow::data::DataServiceDispatcherClient::GetTasks(tensorflow::int64, std::vector<tensorflow::data::TaskInfo>*, bool*)':
tensorflow/core/data/service/data_service.cc:120:14: error: 'ClientContext' is not a member of 'grpc_impl'; did you mean 'grpc::ClientContext'?
  120 |   grpc_impl::ClientContext ctx;
      |              ^~~~~~~~~~~~~
In file included from /usr/include/grpcpp/impl/codegen/call_op_set.h:32,
                 from /usr/include/grpcpp/impl/codegen/server_context_impl.h:33,
                 from /usr/include/grpcpp/impl/codegen/async_stream_impl.h:24,
                 from /usr/include/grpcpp/impl/codegen/async_generic_service.h:24,
                 from bazel-out/k8-opt/bin/tensorflow/core/data/service/dispatcher.grpc.pb.h:11,
                 from ./tensorflow/core/data/service/data_service.h:19,
                 from tensorflow/core/data/service/data_service.cc:16:
/usr/include/grpcpp/impl/codegen/client_context.h:195:7: note: 'grpc::ClientContext' declared here
  195 | class ClientContext {
      |       ^~~~~~~~~~~~~
tensorflow/core/data/service/data_service.cc:121:37: error: 'ctx' was not declared in this scope
  121 |   grpc::Status s = stub_->GetTasks(&ctx, req, &resp);
      |                                     ^~~
tensorflow/core/data/service/data_service.cc: In member function 'tensorflow::Status tensorflow::data::DataServiceDispatcherClient::GetWorkers(std::vector<tensorflow::data::WorkerInfo>*)':
tensorflow/core/data/service/data_service.cc:138:14: error: 'ClientContext' is not a member of 'grpc_impl'; did you mean 'grpc::ClientContext'?
  138 |   grpc_impl::ClientContext ctx;
      |              ^~~~~~~~~~~~~
In file included from /usr/include/grpcpp/impl/codegen/call_op_set.h:32,
                 from /usr/include/grpcpp/impl/codegen/server_context_impl.h:33,
                 from /usr/include/grpcpp/impl/codegen/async_stream_impl.h:24,
                 from /usr/include/grpcpp/impl/codegen/async_generic_service.h:24,
                 from bazel-out/k8-opt/bin/tensorflow/core/data/service/dispatcher.grpc.pb.h:11,
                 from ./tensorflow/core/data/service/data_service.h:19,
                 from tensorflow/core/data/service/data_service.cc:16:
/usr/include/grpcpp/impl/codegen/client_context.h:195:7: note: 'grpc::ClientContext' declared here
  195 | class ClientContext {
      |       ^~~~~~~~~~~~~
tensorflow/core/data/service/data_service.cc:139:39: error: 'ctx' was not declared in this scope
  139 |   grpc::Status s = stub_->GetWorkers(&ctx, req, &resp);
      |                                       ^~~
tensorflow/core/data/service/data_service.cc: In member function 'tensorflow::Status tensorflow::data::DataServiceWorkerClient::GetElement(tensorflow::int64, tensorflow::data::CompressedElement*, bool*)':
tensorflow/core/data/service/data_service.cc:166:14: error: 'ClientContext' is not a member of 'grpc_impl'; did you mean 'grpc::ClientContext'?
  166 |   grpc_impl::ClientContext ctx;
      |              ^~~~~~~~~~~~~
In file included from /usr/include/grpcpp/impl/codegen/call_op_set.h:32,
                 from /usr/include/grpcpp/impl/codegen/server_context_impl.h:33,
                 from /usr/include/grpcpp/impl/codegen/async_stream_impl.h:24,
                 from /usr/include/grpcpp/impl/codegen/async_generic_service.h:24,
                 from bazel-out/k8-opt/bin/tensorflow/core/data/service/dispatcher.grpc.pb.h:11,
                 from ./tensorflow/core/data/service/data_service.h:19,
                 from tensorflow/core/data/service/data_service.cc:16:
/usr/include/grpcpp/impl/codegen/client_context.h:195:7: note: 'grpc::ClientContext' declared here
  195 | class ClientContext {
      |       ^~~~~~~~~~~~~
tensorflow/core/data/service/data_service.cc:167:39: error: 'ctx' was not declared in this scope
  167 |   grpc::Status s = stub_->GetElement(&ctx, req, &resp);
      |                                       ^~~
Comment 6 foufou33 2020-10-14 05:09:46 UTC
(In reply to Marcin from comment #4)
> (In reply to Marcin from comment #3)
> > (In reply to foufou33 from comment #1)
> > > I'm trying this patch here:
> > > https://github.com/tensorflow/tensorflow/commit/
> > > c870489b518e64e585e0c8ce40e030bd44d7be91.patch
> > > 
> > > fingers crossed
> > 
> > I tried it. I put the patch to
> > /etc/portage/patches/sci-libs/tensorflow-2.3.1 and tried to emerge it but
> > get another error:
> > ERROR:
> > /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7/
> > tensorflow/cc/BUILD:545:22: Linking of rule
> > '//tensorflow/cc:ops/sparse_ops_gen_cc' failed (Exit 1):
> > crosstool_wrapper_driver_is_not_gcc failed: error executing command 
> >   (cd
> > /var/tmp/portage/sci-libs/tensorflow-2.3.1/work/tensorflow-2.3.1-python3_7-
> > bazel-base/execroot/org_tensorflow && \
> >   exec env - \
> >    
> > PATH=/var/tmp/portage/sci-libs/tensorflow-2.3.1/temp/python3.7/bin:/usr/lib/
> > portage/python3.7/ebuild-helpers/xattr:/usr/lib/portage/python3.7/ebuild-
> > helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/
> > bin:/usr/lib/llvm/10/bin:/opt/cuda/bin \
> >     PWD=/proc/self/cwd \
> >  
> > external/local_config_cuda/crosstool/clang/bin/
> > crosstool_wrapper_driver_is_not_gcc
> > @bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/cc/ops/sparse_ops_gen_cc-2.
> > params)
> > Execution platform: @local_execution_config_platform//:platform
> > /usr/bin/ld: /usr/lib64/libjsoncpp.so.24: undefined reference to
> > `std::__cxx11::basic_ostringstream<char, std::char_traits<char>,
> > std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
> > collect2: error: ld returned 1 exit status
> 
> 
> I recompiled jsoncpp and now it works for me with the patch.
IIIRC jsoncpp needs to be built with gcc-8.x.
Comment 7 Jouni Kosonen 2020-10-15 15:28:50 UTC
(In reply to foufou33 from comment #6)
> (In reply to Marcin from comment #4)
> > I recompiled jsoncpp and now it works for me with the patch.
> IIIRC jsoncpp needs to be built with gcc-8.x.
Surely not? 

The patch helps but I've been getting this in the final linkage ([3,912 / 3,914]):

> bazel-out/k8-opt/bin/tensorflow/core/util/proto/_objs/descriptors/descriptors.pic.o:descriptors.cc:function 
> tensorflow::GetDescriptorPool(tensorflow::Env*, std::__cxx11::basic_string<char, std::char_traits<char>, 
> std::allocator<char> > const&, google::protobuf::DescriptorPool const**, std::unique_ptr<google::protobuf::DescriptorPool, 
> std::default_delete<google::protobuf::DescriptorPool> >*): error: undefined reference to 
> 'google::protobuf::FileDescriptorSet::FileDescriptorSet(google::protobuf::Arena*)'

and the only reason for that I can think of is that protobuf was built with my default gcc-10 while the tensorflow is getting compiled with clang-10. 

I don't see why that should make any difference whatsoever but I've now recompiled protobuf with clang-10 too and and am trying once more. I kind of wish now I had realized that my jsoncpp was built with gcc-9 back in August, though... Well, At least I know what to tweak next.
Comment 8 Harris Landgarten 2020-10-15 15:38:02 UTC
I have everything built with gcc-10.2 and tensorflow built to completion with no issues with the patch. You may have to rebuild google-cloud-cpp. if you have having to sort of issues you are showing.
Comment 9 Jouni Kosonen 2020-10-15 18:59:54 UTC
(In reply to Harris Landgarten from comment #8)
> I have everything built with gcc-10.2 and tensorflow built to completion
> with no issues with the patch. You may have to rebuild google-cloud-cpp. if
> you have having to sort of issues you are showing.

google-cloud-cpp needs to be rebuilt whenever grpc gets bumped, even though there's no subslotting in place to enforce this.

Looks like compiling protobuf with the same compiler as used for tensorflow got me at least over the std::__cxx11::basic_string hump, still building the rest of it.
Comment 10 Fabio Scaccabarozzi 2020-10-16 05:58:51 UTC
Can confirm the issue when compiling 2.3.1.
Can also confirm that after applying the patch and recompiling protobuf and google-cloud-cpp with clang, I was finally able to successfully compile and install tensorflow 2.3.1.
Comment 11 gevisz@gmail.com 2020-10-17 17:36:24 UTC
Exactly on 2020-10-10, tensorflow-2.3.1 failed to update on my computer as well.

Here is the error message:

FAILED: Build did NOT comlete successfully
* ERROR: sci-libs/tensorflow-2.3.1::gentoo failed (compile phase):
* ebazel failed
*
* Call stack:
*    ebuild.sh, line 125:  Called src_compile
* environment, line 4177:  Called ebazel 'build' ...
* environment, line 2389:  Called die
* The specific snippet of code:
*      "S{@}" || die "ebazel failed"
...

The detailed description can be found in the thread "tensorflow-2.3.1 failed to compile" of the gentoo-user mailing list stated today.
Comment 12 Michael Orlitzky gentoo-dev 2020-10-17 17:37:56 UTC
The ClientContext error probably happens with (~arch) grpc-1.32.x, since that version was released after this commit:

https://github.com/grpc/grpc/commit/751b9c105fd19eac1eb052e060e2e62e82361af1
Comment 13 foufou33 2020-10-17 23:33:18 UTC
(In reply to Jouni Kosonen from comment #7)
> (In reply to foufou33 from comment #6)
> > (In reply to Marcin from comment #4)
> > > I recompiled jsoncpp and now it works for me with the patch.
> > IIIRC jsoncpp needs to be built with gcc-8.x.
> Surely not? 
> 
> The patch helps but I've been getting this in the final linkage ([3,912 /
> 3,914]):
> 
> > bazel-out/k8-opt/bin/tensorflow/core/util/proto/_objs/descriptors/descriptors.pic.o:descriptors.cc:function 
> > tensorflow::GetDescriptorPool(tensorflow::Env*, std::__cxx11::basic_string<char, std::char_traits<char>, 
> > std::allocator<char> > const&, google::protobuf::DescriptorPool const**, std::unique_ptr<google::protobuf::DescriptorPool, 
> > std::default_delete<google::protobuf::DescriptorPool> >*): error: undefined reference to 
> > 'google::protobuf::FileDescriptorSet::FileDescriptorSet(google::protobuf::Arena*)'
> 
> and the only reason for that I can think of is that protobuf was built with
> my default gcc-10 while the tensorflow is getting compiled with clang-10. 
> 
> I don't see why that should make any difference whatsoever but I've now
> recompiled protobuf with clang-10 too and and am trying once more. I kind of
> wish now I had realized that my jsoncpp was built with gcc-9 back in August,
> though... Well, At least I know what to tweak next.

with USE=cuda (cuda at taht time only supported gcc8 or somnthing like that), IIRC,  It failed and had to rebuild jasoncpp with gcc8.4 (I set in /etc/portage/env) didn't touch it since!
I'll have to try and rebuild without then env set to see ..
Comment 14 Jason Zaman gentoo-dev 2020-10-20 00:28:22 UTC
There are several separate things in the comments here so I'm making this bug just for grpc-1.32.

I tested c870489b518e64e585e0c8ce40e030bd44d7be91 and it works with both grpc-1.28 and grpc-1.32 so I'm including it in 2.3.1-r1. Luckily don't have to deal with conditional patching.

The jsoncpp linking issue is not a TensorFlow issue, its because CUDA uses an older compiler. jsoncpp needs to be rebuild with the compiler that CUDA uses. another similar bug is: https://bugs.gentoo.org/703272
TF-2.4 will work with CUDA-11 which supports gcc-9 so hopefully this will be less of an issue.
Comment 15 Larry the Git Cow gentoo-dev 2020-10-20 00:33:51 UTC
The bug has been closed via the following commit(s):

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

commit 06e15d5614b5c837bffe319144e6bff07a54c63f
Author:     Jason Zaman <perfinion@gentoo.org>
AuthorDate: 2020-10-19 22:50:04 +0000
Commit:     Jason Zaman <perfinion@gentoo.org>
CommitDate: 2020-10-19 22:50:04 +0000

    sci-libs/tensorflow: Fix compile error against grpc-1.32
    
    Closes: https://bugs.gentoo.org/747547
    Package-Manager: Portage-3.0.8, Repoman-3.0.2
    Signed-off-by: Jason Zaman <perfinion@gentoo.org>

 sci-libs/tensorflow/Manifest                   |   1 +
 sci-libs/tensorflow/tensorflow-2.3.1-r1.ebuild | 405 +++++++++++++++++++++++++
 2 files changed, 406 insertions(+)