Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904086 - sci-libs/caffe2-2.0.0-r1 fails to compile with GCC 13 due to missing #include at several places (GCC-13-SYSTEM)
Summary: sci-libs/caffe2-2.0.0-r1 fails to compile with GCC 13 due to missing #include...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tupone Alfredo
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-13
  Show dependency tree
 
Reported: 2023-04-10 01:03 UTC by Adrien Dessemond
Modified: 2023-04-23 13:10 UTC (History)
1 user (show)

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


Attachments
All-in-one fix for Gentoo bug #904086 (gentoo-bugfix-904086.patch,1.17 KB, patch)
2023-04-10 01:05 UTC, Adrien Dessemond
Details | Diff
complete build log (build.log.gz,145.02 KB, application/gzip)
2023-04-16 07:21 UTC, he.ousia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrien Dessemond 2023-04-10 01:03:00 UTC
GCC 13 is much less forgiving! Trying to emerge sci-libs/caffe2 leads to various compilation errors:

1. /var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0/c10/util/Registry.h:89:22: error: ‘runtime_error’ is not a member of ‘std’
   89 |           throw std::runtime_error(err_msg);

Fixed by: adding a ‘#include <stdexcept>' in pytorch-2.0.0/c10/util/Registry.h

2. /var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0/torch/csrc/jit/passes/quantization/quantization_type.h:9:16: error: found ‘:’ in nested-name-specifier, expected ‘::’
    9 | enum QuantType : uint8_t { DYNAMIC = 0, STATIC 
 
Fixed by: adding a ‘#include <cstdint>' in pytorch-2.0.0/torch/csrc/jit/passes/quantization/quantization_type.h

3. /var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0/torch/csrc/jit/runtime/logging.cpp: In member function ‘virtual int64_t torch::jit::logging::LockingLogger::getCounterValue(const std::string&) const’:
/var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0/torch/csrc/jit/runtime/logging.cpp:36:14: error: ‘runtime_error’ is not a member of ‘std’
   36 |   throw std::runtime_error("Unknown aggregation type!");

Fixed by: adding a ‘#include <stdexcept>' in pytorch-2.0.0/torch/csrc/jit/runtime/logging.cpp

4. /var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0/torch/csrc/lazy/core/multi_wait.cpp: In member function ‘void torch::lazy::MultiWait::Wait(double)’:
/var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0/torch/csrc/lazy/core/multi_wait.cpp:34:16: error: ‘runtime_error’ is not a member of ‘std’
   34 |     throw std::runtime_error("Timeout");

Fixed by: adding a ‘#include <stdexcept>' in pytorch-2.0.0/torch/csrc/lazy/core/multi_wait.cpp

Attached patch is all-in-one fix for those 4 issues.
Comment 1 Adrien Dessemond 2023-04-10 01:05:23 UTC
Created attachment 859782 [details, diff]
All-in-one fix for Gentoo bug #904086
Comment 2 Larry the Git Cow gentoo-dev 2023-04-12 17:58:10 UTC
The bug has been closed via the following commit(s):

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

commit 6c34a781ed2d42b1923889fc4f6d015813d2fcdf
Author:     Alfredo Tupone <tupone@gentoo.org>
AuthorDate: 2023-04-12 17:56:54 +0000
Commit:     Alfredo Tupone <tupone@gentoo.org>
CommitDate: 2023-04-12 17:57:45 +0000

    sci-libs/caffe2: to build with gcc-13
    
    Closes: https://bugs.gentoo.org/904086
    Signed-off-by: Alfredo Tupone <tupone@gentoo.org>

 sci-libs/caffe2/caffe2-2.0.0-r1.ebuild         |  1 +
 sci-libs/caffe2/files/caffe2-2.0.0-gcc13.patch | 41 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
Comment 3 he.ousia 2023-04-16 07:19:56 UTC
Even with this patch, I see linking error:

/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sci-libs/caffe2-2.0.0-r1/work/pytorch-2.0.0_build/lib/libtorch_cpu.so: undefined reference to `ska_ordered::detailv3::sherwood_v3_table<std::pair<c10::IValue, c10::IValue>, c10::IValue, c10::detail::DictKeyHash, ska_ordered::detailv3::KeyOrValueHasher<c10::IValue, std::pair<c10::IValue, c10::IValue>, c10::detail::DictKeyHash>, c10::detail::DictKeyEqualTo, ska_ordered::detailv3::KeyOrValueEquality<c10::IValue, std::pair<c10::IValue, c10::IValue>, c10::detail::DictKeyEqualTo>, std::allocator<std::pair<c10::IValue, c10::IValue> >, std::allocator<ska_ordered::detailv3::sherwood_v3_entry<std::pair<c10::IValue, c10::IValue> > > >::initSentinel()'

This is specific for gcc-13.

Portage 3.0.46 (python 3.10.11-final-0, default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.37-r2, 6.2.11-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.2.11-gentoo-dist-x86_64-AMD_Ryzen_9_7950X_16-Core_Processor-with-glibc2.37
KiB Mem:    65553872 total,   7929160 free
KiB Swap:  268435452 total, 268435452 free
Timestamp of repository gentoo: Sat, 15 Apr 2023 13:30:01 +0000
Head commit of repository gentoo: bd2a5326983f6a1de6df2d46f2f853a149577dd5
sh bash 5.2_p15-r2
ld GNU ld (Gentoo 2.40 p4) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.10.11::gentoo, 3.11.3::gentoo
dev-lang/rust:             1.68.2::gentoo
dev-util/cmake:            3.26.3::gentoo
dev-util/meson:            1.0.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.46::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r4::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r1::gentoo, 16.0.1::gentoo
sys-devel/gcc:             12.2.1_p20230304::gentoo, 13.0.1_pre20230409-r4::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.1::gentoo
sys-devel/llvm:            15.0.7::gentoo, 16.0.1::gentoo
sys-devel/make:            4.4.1::gentoo
sys-kernel/linux-headers:  6.2::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r2::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64 ~*"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver4 -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/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=znver4 -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live 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="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/     http://mirror.leaseweb.com/gentoo/     http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/     http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/     http://mirror.netcologne.de/gentoo/     http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/     http://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/     http://mirror.init7.net/gentoo/     http://tux.rainside.sk/gentoo/     http://gentoo.mirror.web4u.cz/"
LANG="en_US"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j30"
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"
SHELL="/bin/bash"
USE="X a52 aac acl alsa amd64 bzip2 cli connection-sharing context contrib contribdnn crypt cups dbus dcaenc dhcpcd dri dts emboss exif fam fbcon fdk ffmpeg fortran frei0r ftp gdbm geoclue geolocation gimp gps gui iconv icu iptables jpeg kde lame latex libass libglvnd libtirpc llvm lm-sensors lto mac minizip ncurses no-multilib nptl nvenc ogg opencl opengl openmp opus pam parallel-compiler pcre plasma pthread pulseaudio qml qt5 readline resolvconf sdl seccomp split-usr ssl syslog tbb test-rust text theora threads unicode v4l vaapi vector-icons vorbis vulkan x264 x265 xattr xml zlib" ABI_X86="64" ADA_TARGET="gnat_2021" AMDGPU_TARGETS="gfx1031" 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="stage" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer nlpsolver" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby32" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev amd radeon radeonsi vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 4 he.ousia 2023-04-16 07:21:30 UTC
Created attachment 860178 [details]
complete build log
Comment 5 Anton Bolshakov 2023-04-22 14:36:38 UTC
just a wild guess, it could be a different bug:
https://bugs.gentoo.org/873055
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-23 08:23:05 UTC
Yeah, let's handle that in a new bug, especially given Adrien doesn't seem to have hit that issue.
Comment 7 Adrien Dessemond 2023-04-23 13:10:10 UTC
(In reply to Sam James from comment #6)
> Yeah, let's handle that in a new bug, especially given Adrien doesn't seem
> to have hit that issue.

Never encountered it with my main machine (AMD GPU). However I trapped another issue with caffe2/pytorch on an another Gentoo machine with a nVidia GPU+CUDA. Will be reported in another Gentoo bug :)