Created attachment 527130 [details] build.log.xz The root-6 fails to build on Gentoo Prefix. It fails to find the correct headers. Build log and basic information are attached. emerge --info Portage 2.3.24 (python 3.6.4-final-0, default/linux/amd64/17.0/no-multilib/prefix/kernel-3.2+, gcc-7.3.0, glibc-2.26-r6, 4.4.0-87-generic x86_64) ================================================================= System uname: Linux-4.4.0-87-generic-x86_64-Intel-R-_Xeon-R-_CPU_E5645_@_2.40GHz-with-debian-stretch-sid KiB Mem: 132021432 total, 3080752 free KiB Swap: 134202364 total, 134185244 free Timestamp of repository gentoo: Tue, 10 Apr 2018 23:15:01 +0000 Head commit of repository gentoo: 8b1c79dc5982aa13d7fc4c6fce82e9febe4ed8f7 sh bash 4.4_p19 ld GNU ld (Gentoo 2.30 p1) 2.30.0 distcc 3.3 x86_64-pc-linux-gnu [enabled] app-shells/bash: 4.4_p19::gentoo dev-lang/perl: 5.26.1-r2::gentoo dev-lang/python: 2.7.14-r1::gentoo, 3.5.4-r1::gentoo, 3.6.4::gentoo dev-util/cmake: 3.10.3::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/openrc: 0.35.5::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.69-r4::gentoo sys-devel/automake: 1.16.1-r1::gentoo sys-devel/binutils: 2.30::gentoo sys-devel/gcc: 7.3.0::gentoo sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r4::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-kernel/linux-headers: 4.15::gentoo (virtual/os-headers) sys-libs/glibc: 2.26-r6::gentoo Repositories: gentoo location: /opt/gentoo/usr/portage sync-type: rsync sync-uri: rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage priority: -1000 sync-rsync-verify-metamanifest: no sync-rsync-extra-opts: ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=westmere" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /opt/gentoo/etc/gentoo-release" CXXFLAGS="-O2 -pipe -march=westmere" DISTDIR="/opt/gentoo/usr/portage/distfiles" FCFLAGS="-O2 -pipe -march=westmere" FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distcc distcc-pump distlocks ebuild-locks fixlafiles force-prefix merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged" FFLAGS="-O2 -pipe -march=westmere" GENTOO_MIRRORS="http://mirrors.tuna.tsinghua.edu.cn/gentoo" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-l20 -j80" PKGDIR="/opt/gentoo/usr/portage/packages" PORTAGE_CONFIGROOT="/opt/gentoo/" 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="/dev/shm" USE="X acl amd64 berkdb byte-compile bzip2 cli crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp pcre prefix readline seccomp ssl tcpd threads unicode zlib" ABI_X86="64" 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="kexi words flow plan sheets stage tables krita karbon braindump author" 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 isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="void" 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="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="dummy" 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, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS $ emerge -pv sci-physics/root These are the packages that would be merged, in order: Calculating dependencies ... done! [ebuild R ] sci-physics/root-6.12.06-r1:6.12/06::gentoo USE="X asimage fortran gdml gsl math minuit (prefix) python roofit tbb threads tiff tmva unuran xml -R (-aqua) -avahi -davix -emacs -examples -fftw -fits -graphviz -http -jemalloc -kerberos -ldap -libcxx -memstat -mysql -odbc -opengl -oracle -postgres -pythia6 -pythia8 (-qt4) -root7 -shadow -sqlite -ssl -table {-test} -vc -xinetd -xrootd" PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_4 -python3_5" PYTHON_TARGETS="python2_7 python3_6 -python3_4 -python3_5" 0
Sorry, I messed it up but will look into it today. It's actually a problem with the configuration of llvm/clang, so I will fix them first. I think that we need either DEFAULT_SYSROOT=EPREFIX, or C_INCLUDE_DIRS + GCC_INSTALL_PREFIX, but not both, or things break.
Hi Amadio, (In reply to Guilherme Amadio from comment #1) > Sorry, I messed it up but will look into it today. It's actually a problem > with the configuration of llvm/clang, so I will fix them first. I think that > we need either DEFAULT_SYSROOT=EPREFIX, or C_INCLUDE_DIRS + > GCC_INSTALL_PREFIX, but not both, or things break. I see. Some observations: 1. the failure does not go away with FEATURES=distcc disabled. 2. From the experience of prefixifying root-5, the offending part is at `rootcling -I/opt/gentoo/usr/include...`. rootcling or cint cannot deal with system headers included by "-I". Either we need to hack the build system to filter out $EPREFIX/usr/include, or cling should be hacked to ignore -I$EPREFIX/usr/include. With root-5 we filtered out -I$EPREFIX/usr/include in the Makefile. The cmake may behave differently. Benda Appendix: failing command. > /dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06_build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx -s /dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06_build/lib/libCore.so -excludePath /dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06 -excludePath /dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06_build -rml libCore.so -rmf /dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06_build/lib/libCore.rootmap -DSYSTEM_TYPE_unix -I/dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06 -I/dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06/interpreter/cling/include -I/dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06_build/include -I/dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06/core/base/res -I/dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06/core/base/../foundation/res -I/opt/gentoo/usr/include TApplication.h TApplicationImp.h TAtt3D.h TAttAxis.h TAttBBox.h TAttBBox2D.h TAttFill.h TAttLine.h TAttMarker.h TAttPad.h TAttText.h TBase64.h TBenchmark.h TBrowser.h TBrowserImp.h TBuffer.h TBuffer3D.h TBuffer3DTypes.h TCanvasImp.h TColor.h TColorGradient.h TContextMenu.h TContextMenuImp.h TControlBarImp.h TDatime.h TDirectory.h TEnv.h TError.h TException.h TExec.h TFileCollection.h TFileInfo.h TFolder.h TGuiFactory.h TInetAddress.h TInspectorImp.h TMD5.h TMacro.h TMathBase.h TMemberInspector.h TMessageHandler.h TNamed.h TObjString.h TObject.h TObjectSpy.h TPRegexp.h TParameter.h TPluginManager.h TPoint.h TProcessID.h TProcessUUID.h TQClass.h TQCommand.h TQConnection.h TQObject.h TROOT.h TRedirectOutputGuard.h TRef.h TRefCnt.h TRegexp.h TRemoteObject.h TRootIOCtor.h TStopwatch.h TStorage.h TString.h TStringLong.h TStyle.h TSysEvtHandler.h TSystem.h TSystemDirectory.h TSystemFile.h TTask.h TThreadSlots.h TTime.h TTimeStamp.h TTimer.h TUUID.h TUri.h TUrl.h TVersionCheck.h TVirtualAuth.h TVirtualFFT.h TVirtualGL.h TVirtualMonitoring.h TVirtualMutex.h TVirtualPS.h TVirtualPad.h TVirtualPadEditor.h TVirtualPadPainter.h TVirtualPerfStats.h TVirtualQConnection.h TVirtualRWMutex.h TVirtualTableInterface.h TVirtualViewer3D.h TVirtualX.h GuiTypes.h MessageTypes.h KeySymbols.h Buttons.h strlcpy.h snprintf.h TArray.h TArrayC.h TArrayD.h TArrayF.h TArrayI.h TArrayL.h TArrayL64.h TArrayS.h TBits.h TBtree.h TClassTable.h TClonesArray.h TCollection.h TCollectionProxyInfo.h TExMap.h THashList.h THashTable.h TIterator.h TList.h TMap.h TObjArray.h TObjectTable.h TOrdCollection.h TRefArray.h TRefTable.h TSeqCollection.h TSortedList.h TVirtualCollectionProxy.h ESTLType.h RStringView.h TClassEdit.h ROOT/RArrayView.hxx ROOT/RMakeUnique.hxx ROOT/TypeTraits.hxx ROOT/rhysd_array_view.hxx TUnixSystem.h TClingRuntime.h root_std_complex.h TBaseClass.h TClass.h TClassGenerator.h TClassMenuItem.h TClassRef.h TClassStreamer.h TDataMember.h TDataType.h TDictAttributeMap.h TDictionary.h TEnum.h TEnumConstant.h TFileMergeInfo.h TFunction.h TFunctionTemplate.h TGenericClassInfo.h TGlobal.h TInterpreter.h TInterpreterValue.h TIsAProxy.h TListOfDataMembers.h TListOfEnums.h TListOfEnumsWithLock.h TListOfFunctionTemplates.h TListOfFunctions.h TMemberStreamer.h TMethod.h TMethodArg.h TMethodCall.h TProtoClass.h TRealData.h TSchemaHelper.h TSchemaRule.h TSchemaRuleSet.h TStatusBitsChecker.h TStreamer.h TStreamerElement.h TToggle.h TToggleGroup.h TVirtualIsAProxy.h TVirtualRefProxy.h TVirtualStreamerInfo.h Getline.h /dev/shm/portage/sci-physics/root-6.12.06-r1/work/root-6.12.06/core/base/inc/LinkDef.h
The problem is with the order of include paths, combined with how #include_next works. With a normal installation to /, I have this: $ root ------------------------------------------------------------ | Welcome to ROOT 6.12/06 http://root.cern.ch | | (c) 1995-2017, The ROOT Team | | Built for linuxx8664gcc | | From tag v6-12-06, 9 February 2018 | | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' | ------------------------------------------------------------ root [0] .I -I /opt/root/6.12/etc -I /opt/root/6.12/etc/cling -I /opt/root/6.12/include -cxx-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7 -cxx-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/x86_64-pc-linux-gnu -cxx-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/backward -isystem /usr/local/include -isystem /opt/root/6.12/etc/cling/lib/clang/5.0.0/include -extern-c-isystem /usr/local/include -extern-c-isystem /include -extern-c-isystem /usr/include -resource-dir /opt/root/6.12/etc/cling/lib/clang/5.0.0 -nostdinc++ Any header in one of these directories using #include_next can only be looked up later in the list. If the configuration is such that not all of the directories in the list are prepended with EPREFIX, then the #include_next will fail. This is also a problem present with llvm/clang, so it's not a problem with rootcling itself, but with the configuration of the compiler.
(In reply to Guilherme Amadio from comment #3) > The problem is with the order of include paths, combined with how > #include_next works. With a normal installation to /, I have this: > > $ root > ------------------------------------------------------------ > | Welcome to ROOT 6.12/06 http://root.cern.ch | > | (c) 1995-2017, The ROOT Team | > | Built for linuxx8664gcc | > | From tag v6-12-06, 9 February 2018 | > | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' | > ------------------------------------------------------------ > > root [0] .I > -I > /opt/root/6.12/etc > -I > /opt/root/6.12/etc/cling > -I > /opt/root/6.12/include > -cxx-isystem > /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7 > -cxx-isystem > /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/x86_64-pc-linux-gnu > -cxx-isystem > /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/backward > -isystem > /usr/local/include > -isystem > /opt/root/6.12/etc/cling/lib/clang/5.0.0/include > -extern-c-isystem > /usr/local/include > -extern-c-isystem > /include > -extern-c-isystem > /usr/include > -resource-dir > /opt/root/6.12/etc/cling/lib/clang/5.0.0 > -nostdinc++ > > Any header in one of these directories using #include_next can only be > looked up later in the list. If the configuration is such that not all of > the directories in the list are prepended with EPREFIX, then the > #include_next will fail. This is also a problem present with llvm/clang, so > it's not a problem with rootcling itself, but with the configuration of the > compiler. I support -extern-c-isystem and -I have different priority. -I is always search before -isystem (and -extern-c-isystem?)
For ROOT we have to only use -DDEFAULT_ROOT=$EPREFIX. For clang I have not found the proper fix yet, but I know that -DDEFAULT_ROOT=$EPREFIX does not work because of the custom CMAKE_INSTALL_PREFIX.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bad9f20be20140470cc6f3a5efd4baec22230ab4 commit bad9f20be20140470cc6f3a5efd4baec22230ab4 Author: Guilherme Amadio <amadio@gentoo.org> AuthorDate: 2018-04-12 15:49:31 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2018-04-12 15:49:49 +0000 sci-physics/root: fix bug 652954 C_INCLUDE_DIRS+DEFAULT_SYSROOT lead to double prefix in include dirs. Closes: https://bugs.gentoo.org/652954 Package-Manager: Portage-2.3.28, Repoman-2.3.9 sci-physics/root/root-6.12.06-r1.ebuild | 2 -- 1 file changed, 2 deletions(-)