Can't compile ROOT 5.14 with gcc 3.4.6

I need the old ROOT 5.14, so I tried to compile it on my machine. With gcc 4 it doesn’t work (I read somewhere that 5.14 has not been ported for gcc4), so I installed gcc 3.4.6 and tried again. I got an errors like these:

g++ -shared -Wl,-soname,libCintex.so -m32 -O -lstdc++ -o lib/libCintex.so cintex/src/CINTClassBuilder.o cintex/src/CINTEnumBuilder.o cintex/src/CINTFunctionBuilder.o cintex/src/CINTFunctional.o cintex/src/CINTScopeBuilder.o cintex/src/CINTTypedefBuilder.o cintex/src/CINTUtils.o cintex/src/CINTVariableBuilder.o cintex/src/Cintex.o cintex/src/ROOTClassEnhancer.o  
`.L2976' referenced in section `.rodata' of cintex/src/CINTUtils.o: defined in discarded section `.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIlE6toCintEP8G__valuePv' of cintex/src/CINTUtils.o                                                                                    
`.L2974' referenced in section `.rodata' of cintex/src/CINTUtils.o: defined in discarded section `.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIlE6toCintEP8G__valuePv' of cintex/src/CINTUtils.o  

and a hundred more like the ones above. Over the net I found that this should be a gcc bug, corrected in version 4, but I know that ROOT 5.14 can be compiled wit gcc 3. So maybe is it a configuration or library problem?
My operating system is ArchLinux, in the case it will be useful heres’ the output of gcc --print-search-dirs:

$ gcc --print-search-dirs
install: /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/
programs: =/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/libexec/gcc/i686-pc-linux-gnu/3.4.6/:/usr/libexec/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bin/
libraries: =/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/lib/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../i686-pc-linux-gnu/3.4.6/:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../:/lib/i686-pc-linux-gnu/3.4.6/:/lib/:/usr/lib/i686-pc-linux-gnu/3.4.6/:/usr/lib/

and here’s the configuration I used to build:

$ ./configure linux --disable-krb5
Configuring for linux                              
Checking for libX11 ... /usr/lib                   
Checking for X11/Xlib.h ... /usr/include           
Checking for libXpm ... /usr/lib                   
Checking whether to build included libfreetype6 ... 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 occi.h ... no                             
Checking for libclntsh, or oci ... no                  
Checking for libocci, or oraocci10 ... no              
Checking for libpq-fe.h ... /usr/include               
Checking for libpq ... /usr/lib                        
Checking for sql.h ... no                              
Checking for libsqlod ... no                           
Checking for sqlext.h ... /usr/include                 
Checking for libiodbc, libodbc, or odbc32 ... /usr/lib 
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 monalisawsclient.h ... no                  
Checking for libmonalisawsclient ... no                 
Checking for fftw3.h ... /usr/include                   
Checking for libfftw3, or libfftw3-3 ... /usr/lib       
Checking for libpacklib_noshift, libpacklib, packmd, or packlib ... no
Checking for libkernlib_noshift, libkernlib, kernmd, or kernlib ... no
Checking for libPythia6 ... no                                        
Checking for dcap.h ... no                                            
Checking for libdcap ... no                                           
Checking for chirp_client.h ... no                                    
Checking for libchirp_client ... 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 ... /usr/include                                
Checking for gif_lib.h ... /usr/include                               
Checking for libjpeg ... /usr/lib                                     
Checking for libtiff ... /usr/lib                                     
Checking for libungif ... /usr/lib                                    
Checking for libz ... /usr/lib                                        
Checking for libpng ... /usr/lib                                      
Checking whether to build included libAfterImage ... yes              
Checking for ldap.h ... /usr/include                                  
Checking for libldap ... /usr/lib                                     
Checking for liblber ... /usr/lib                                     
Checking for python/Python.h, python2.5/Python.h, python2.4/Python.h, python2.3/Python.h, python2.2/Python.h, or Python.h ... no                                                      
Checking for libpython, libpython2.5, libpython2.4, libpython2.3, libpython2.2, python25, python24, python23, or Python ... no                                                        
Checking for xml2-config ... /usr/bin/xml2-config                                          
Checking for libxml2 version >= 2.4.x ... ok                                               
Checking whether to build xrootd ... yes                                                   
Checking for for globusdir ... no                                                          
Checking for GLOBUS_LOCATION ... no                                                        
Checking for openssl/x509.h ... no                                                         
basename: missing operand                                                                  
Usare `basename --help' per ulteriori informazioni.                                        
Checking for openssl/pem.h ... no                                                          
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 ... /usr/lib                                                           
Checking for libmisc ... no                                                                
Checking for pwauth.h ... no                                                               
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 whether to build libMathMore ... yes                                              
Checking whether to build libMathCore ... yes                                              
Checking whether to build CINT7 ... no                                                     
Checking whether to build libCintex ... yes                                                
Checking whether to build libReflex ... yes                                                
Checking whether to build libRooFit ... no                                                 
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 for Clarens support ... yes                                                       
Checking for PEAC support ... yes                                                          
Generating cint dictionaries.                                                              
Checking whether setresuid declared in /usr/include/unistd.h ... yes                       
Writing config/Makefile.config ... done                                                    
Writing include/RConfigure.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 config.status ... done

Enabled support for asimage, astiff, builtin_afterimage, builtin_freetype, builtin_pcre, builtin_zlib, cintex, clarens, exceptions, fftw3, ldap, mathcore, mathmore, mysql, odbc, opengl, pch, peac, pgsql, reflex, shadowpw, shared, ssl, thread, xml, xrootd.

I also modified Makefile.linux to use gfortran as Fortran compiler instead of g77.

Thanks everyone for any help you may give me.

[quote]With gcc 4 it doesn’t work (I read somewhere that 5.14 has not been ported for gcc4), [/quote]When moving from one version of gcc to the other, did you remember to either call “gmake distclean” or re-download the ROOT source?

Cheers,
Philippe.

Thank you Philippe for your help. I downloaded once the tarball, and to be sure that no config file was left from prevoius compilation, each time I changed the compiler I erased the entire root folder and unpacked the tarball again, then adjusted the option for the fortran compiler (quite a brute force way to clean but one that leaves no doubt on the success of the cleaning process, I think…)

Hi,

Is this error ‘only’ for Cintex or do you see it for other library (if it is only for cintex, you can most likely simple disable it (option --disable-cintex passed to configure script))?

Cheers,
Philippe.

[quote=“pcanal”]Hi,

Is this error ‘only’ for Cintex or do you see it for other library (if it is only for cintex, you can most likely simple disable it (option --disable-cintex passed to configure script))?

Cheers,
Philippe.[/quote]
I think it’s only for cintex (at least, it did show up only for that, until now). I didn’t know if it was a key component, so I didn’t disabled it. Will I loose any key feature of root by disabling cintex?
Anyway, I’ll give it a try. Thanks Philippe.

Hi,

the original error stems from a mismatch in your build environment: glibc or libstdc++ or simply the linker not matching your GCC version. With v5.14 this was a bit difficult to configure; you’ll basically have to make sure that GCC 3 is the default one, that g++ and gcc are the right ones in your $PATH, and that the binutils work for your compiler version.

You don’t lose anything by disabling libCintex unless you want to run Atlas / CMS / LHCb reconstruction software.

Cheers, Axel.

I tried to disable cintex, but still got some errors. Axel, how can I be sure that I set up a correct build environment? I mean, which environment variables do I have to set and which options in which config files do I have to set to use the correct gcc version through all the build process? I only modified Makefile.linux since I ran configure with option linux.
Did I miss some important setting?

I finally made it work. I had to tweak the configuration heavily. First of all, there’s a small bug in the configure script which won’t allow you to use the GNU Scientific Library whose subversion is a two digit number (eg., >= 1.10). This is needed to enable mathmore support; fix it like this:

--- configure-bug       2009-01-18 20:41:56.000000000 +0100
+++ configure   2009-01-18 16:12:48.000000000 +0100
   @@ -3503,7 +3503,7 @@
        # check for gsl version >= 1.8
        if test ! "x$found_dir" = "x"; then
           message "Checking for GSL version >= 1.8"
   -       gsl_version=`grep "define GSL" $found_dir/gsl/gsl_version.h | sed 's/^.*"\([0-9]\.[0-9]\)"/\1/' |  awk 'BEGIN { FS="." } { printf "%d", $1 * 1000 + $2 }'`
   +       gsl_version=`grep "define GSL" $found_dir/gsl/gsl_version.h | sed 's/^.*"\([0-9]\.[0-9]*\)"/\1/' |  awk 'BEGIN { FS="." } { printf "%d", $1 * 1000 + $2 }'`
           if test $gsl_version -lt 1008; then
               gslskip="skip"
               result "no

To make sure that gcc-3.4 and g+±3.4 (these are the names for gcc 3.4 compilers on my system) are used through all the build process you have to set it in /config/Makefile.linux (both in the compiling and linking options). In the same file, I had also to change the fortran complier from g77 to gfortran. If you want to use xrootd then you have to perform also this operation: unpack the /xrootd/src/xrootd-20060928-1600.src.tgz tarball before launching configure, change gcc -> gcc-3.4 and g++ -> g+±3.4 everywhere in configure, configure.ac andd config/GNUmake.rules.gcc, then pack the tarball again and substitute the original one with the modified one. This is because xrootd seems to have its own configuration files, and doesn’t refer to Makefile.linux.
With these tweaks, this configuration worked for me:

./configure linux --enable-minuit2 --enable-mathmore --disable-krb5 --disable-cintex --disable-clarens

You should be able to enable kerberos support with MIT Kerberos (in my system there’s heimdal kerberos which is not compatible with root).

Lorenzo already answered in Savannah since a couple of weeks.

see: already answer to him in Savannah since a couple of weeks

Rene