Problem compiling root v5.23 : hadd linking fails

Hi all,
I’m experiencing a problem when compiling and linking hadd after having compiled root from the source.
At the very end of my compiling job I get:
==> lib/libCore.so done
g++ -m32 -O2 -o bin/hadd main/src/hadd.o
-Llib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lMatrix -lMathCore -lThread -lm -ldl -pthread -rdynamic
lib/libRIO.so: undefined reference to int TStreamerInfo::ReadBuffer<TVirtualArray>(TBuffer&, TVirtualArray const&, int, int, int, int)' lib/libRIO.so: undefined reference toint TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, int, int, int, int)'
collect2: ld returned 1 exit status
make: *** [bin/hadd] Error 1

This happens both in v5.22 and 23…
Of course libRIO.so is available and its compilation went well with no problem.
What is the source of that poroblem? Should I set some env variable or there is some new configuration flag that I should use?

Thank you so much.
alessio

HI,

On which platform does this happen?

Cheers,
Philippe.

I’m running fedora 10 updated:
Linux pcsarti2 2.6.29-21.fc11.i586 #1 SMP Mon Mar 30 05:12:32 EDT 2009 i686 i686 i386 GNU/Linux

Details on compiler:
asarti@pcsarti2 root]$ g++ -v
Using built-in specs.
Target: i586-redhat-linux
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i586 --build=i586-redhat-linux
Thread model: posix
gcc version 4.4.0 20090330 (Red Hat 4.4.0-0.31) (GCC)

Output of configure is:
[asarti@pcsarti2 root]$ ./configure --enable-roofit --enable-xrootd
Configuring for linux
Checking for GNU Make version >= 3.79.1 … ok
Checking for C compiler … gcc
Checking for C++ compiler … g++
Checking for linker (LD) … g++
Checking for F77 compiler … gfortran
Checking for libX11 … /usr/lib
Checking for X11/Xlib.h … /usr/include
Checking for X11/Xft/Xft.h … /usr/include
Checking for X11/extensions/shape.h … /usr/include
Checking for libXpm … /usr/lib
Checking for libXft … /usr/lib
Checking for libXext … /usr/lib
Checking whether to build included libfreetype6 … yes
Checking whether to build included libftgl … yes
Checking whether to build included libpcre … yes
Checking whether to build included zlib … yes
Checking for GL/gl.h … /usr/include
Checking for libGL, or libMesaGL … /usr/lib
Checking for libGLU, or libMesaGLU … /usr/lib
Checking for mysql_config … /usr/bin/mysql_config
Checking for libmysqlclient version >= 3.23.* … ok
Checking for mysql.h … no
Checking for occi.h … no
Checking for libclntsh, or oci … no
Checking for libocci, or oraocci10 … no
Checking for libpq-fe.h … no
Checking for libpq … no
Checking for sql.h … no
Checking for libsqlod … no
Checking for sqlext.h … no
Checking for libiodbc, libodbc, or odbc32 … no
Checking for rfio_api.h … no
Checking for librfio, libshift, shiftmd, or shift … no
Checking for rfio_api.h … no
Checking for stager_api.h … no
Checking for libshift, shiftmd, or shift … no
Checking for gfal_api.h … no
Checking for libgfal … no
Checking for G4Navigator.hh … no
Checking for libG4navigation … no
Checking for CLHEP/Vector/Rotation.h … no
Checking for ApMon.h … no
Checking for libapmoncpp … no
Checking for fftw3.h … no
Checking for libfftw3, or libfftw3-3 … no
Checking for libPythia6 … no
Checking for Pythia.h … no
Checking for libpythia8 … no
Checking for dcap.h … no
Checking for libdcap … no
Checking for chirp_client.h … no
Checking for libchirp_client … no
Checking for libglite-api-wrapper … no
Checking for gapiUI.h … no
Checking for libgapiUI … no
Checking for jpeglib.h … /usr/include
Checking for png.h … /usr/include
Checking for tiffio.h … no
Checking for gif_lib.h … no
Checking for libjpeg … /usr/lib
Checking for libtiff … no
Checking for libungif … no
Checking for libz … /usr/lib
Checking for libpng … /usr/lib
Checking whether to build included libAfterImage … yes
Checking for ldap.h … no
Checking for libldap … no
Checking for Python.h … /usr/include/python2.6
Checking for python2.6, libpython2.6, libpython, python, or Python … /usr/lib/python2.6/config
Checking for xml2-config … not found
Checking for libxml/tree.h … no
Checking for libxml2_a, or libxml2 … no
Checking whether to build xrootd … yes
Checking for libssl … /usr/lib
Checking for libcrypto … /usr/lib
Checking for openssl/bio.h … /usr/include
Checking for openssl/blowfish.h … /usr/include
Checking for openssl/err.h … /usr/include
Checking for openssl/pem.h … /usr/include
Checking for openssl/rand.h … /usr/include
Checking for openssl/rsa.h … /usr/include
Checking for t_server.h … no
Checking for libsrp … no
Checking for libgmp … no
Checking for libmisc … no
Checking for pwauth.h … no
Checking for krb5.h … /usr/include
Checking for libk5crypto … /usr/lib
Checking whether we’re using MIT Kerberos … yes
Checking for libkrb5 … /usr/lib
Checking for libcrypto … /usr/lib
Checking for kinit … /usr/kerberos/bin/kinit
Checking for libcom_err … /usr/lib
Checking for shadow passwords … yes
Checking for gsl/gsl_version.h … /usr/include
Checking for GSL version >= 1.8 … ok
Checking for libgsl, gslML, or gsl … /usr/lib
Checking for libgslcblas, gslcblasML, gslcblas, or cblas … /usr/lib
Checking whether to build libMathMore … yes
Checking whether to build libGenVector … yes
Checking whether to build CINT7 … no
Checking whether to build libCintex … yes
Checking whether to build libReflex … yes
Checking whether to build libRooFit … yes
Checking whether to build libMinuit2 … no
Checking whether to build libUnuran … no
Checking whether to build libGdml … no
Checking whether to build libTable … no
Checking whether to build libMemStat … yes
Checking for Clarens support … no
Checking for PEAC support … no
Generating cint dictionaries.
Checking whether setresuid declared in /usr/include/unistd.h … yes
Writing config/Makefile.config … done
Writing config/Makefile.comp … done
Writing include/RConfigure.h … done
Writing include/RConfigOptions.h … done
Writing bin/root-config … done
Writing etc/system.rootrc … done
Writing etc/system.rootauthrc … done
Writing etc/system.rootdaemonrc … done
Writing etc/root.mimes … done
Writing etc/daemons/rootd.rc.d … done
Writing etc/daemons/rootd.xinetd … done
Writing etc/daemons/proofd.rc.d … done
Writing etc/daemons/proofd.xinetd … done
Writing etc/daemons/xrootd.rc.d … done
Writing etc/daemons/olbd.rc.d … done
Writing bin/memprobe … done
Writing build/misc/root-help.el … done
Writing macros/html.C … done
Writing bin/thisroot.sh … done
Writing bin/thisroot.csh … done
Writing bin/genreflex … done
Writing bin/genreflex-rootcint … done
Writing config.status … done

Enabled support for asimage, astiff, builtin_afterimage, builtin_ftgl, builtin_freetype, builtin_pcre, builtin_zlib, cintex, exceptions, krb5, genvector, mathmore, memstat, opengl, python, reflex, roofit, shadowpw, shared, ssl, xft, xrootd.

The failing command after building all libs is:
bin/rlibmap -o lib/libPyROOT.rootmap -l lib/libPyROOT.so
-d -c bindings/pyroot/inc/LinkDef.h
g++ -m32 -O2 -o bin/hadd main/src/hadd.o
-Llib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lMatrix -lMathCore -lThread -lm -ldl -pthread -rdynamic
lib/libRIO.so: undefined reference to int TStreamerInfo::ReadBuffer<TVirtualArray>(TBuffer&, TVirtualArray const&, int, int, int, int)' lib/libRIO.so: undefined reference toint TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, int, int, int, int)'
collect2: ld returned 1 exit status
make: *** [bin/hadd] Error 1

Hi,

[quote]gcc version 4.4.0 20090330 (Red Hat 4.4.0-0.31) (GCC) [/quote]I have not tried yet (but we already got another distinct report related to a bug in gcc 4.4.x). Can you try:gmake distclean ./configure --enable-roofit --enable-xrootd --build=debug

Cheers,
Philippe.

That indeed fixed the root making problem.
What’s the magic behind the --build=debug?

Another problem: after the build it seems that I’m no longer able to load the roofit libaries…
root [0] gSystem->Load(“libRooFit.so”)
dlopen error: /home/Packages/root/lib/libRooFit.so: undefined symbol: _ZNK9RooAbsArg7CompareEPK7TObject
Load Error: Failed to load Dynamic link library /home/Packages/root/lib/libRooFit.so
Error in TCint::AutoLoadCallback: failure loading library libRooFit.so for class RooFit

Does this has anything to do with the build configuration being different?
Should I try make clean instead of gmake distclean and then rebuild everything?

alessio

[quote]What’s the magic behind the --build=debug? [/quote]It builds ROOT with -g instead -O2. I am guessing that this means that gcc 4.4 is being too aggressive in striping symbols from the library during optimization …

root gSystem->Load(“libRooFitCore”);
root gSystem->Load(“libRooFit”);[/code]

Cheers,
Philippe

It should not … anyway the following should work
Code:
root gSystem->Load(“libRooFitCore”);
root gSystem->Load(“libRooFit”);

It does not.
I’m still getting:
root [0] gSystem->Load(“libRooFitCore”);
dlopen error: /home/Packages/root/lib/libRooFit.so: undefined symbol: _ZNK9RooAbsArg7CompareEPK7TObject
Load Error: Failed to load Dynamic link library /home/Packages/root/lib/libRooFit.so
Error in TCint::AutoLoadCallback: failure loading library libRooFit.so for class RooFit

I’ll try to remake it…

We are reiving far too many reports about bugs in gcc4.4.
We do not support this compiler.

Rene

I found that if I force R__BROKEN_FUNCTION_TEMPLATES to be defined
in io/io/inc/TStreamerInfo.h
then I may get rid of that undefined reference error.

I also make some other changes to the codes so that root can be compiled
in Fedora 11(gcc 4.4.0)

I’m not sure if these changes will break anything. But, it run all my programs
without problem.
gcc-4.4.patch.gz (1.73 KB)

Hi,

don’t do that - it reduces ROOT’s I/O speed. Simply update to the current subversion trunk or wait for the pro release to be published end of this month: both support GCC 4.4.

Cheers, Axel.

[quote=“Axel”]Hi,

don’t do that - it reduces ROOT’s I/O speed. Simply update to the current subversion trunk or wait for the pro release to be published end of this month: both support GCC 4.4.

Cheers, Axel.[/quote]

Hi,

Thanks.

But the
invalid conversion from ‘const char*’ to 'char*'
error still occur in current subversion trunk.

The error message:
XrdNetDNS.cc: In static member function ‘static int XrdNetDNS::Host2Dest(const char*, sockaddr&, char**)’:
XrdNetDNS.cc:485: error: invalid conversion from ‘const char*’ to ‘char*’

If I change char to const char in the relevant line, will that make any harm?

Regards.

Hi,

The trunk was updated yesterday in this regard. This should now work.

Cheers,
Philippe.