Hello,
I’m trying to install Root v5.34.01 on my linux machine (SLC 4.8, kernel 2.6.9-104.ELsmp, gcc 3.4.6, root source code from the trunk), but I have problems in linking libGeom.so:
geom/geom/src/TGeoManager.o(.text+0xce98): In function TGeoManager::ThreadId()': : undefined reference to___tls_get_addr’
geom/geom/src/TGeoManager.o(.text+0xcf61): In function TGeoManager::ThreadId()': : undefined reference to___tls_get_addr’
collect2: ld returned 1 exit status
make: *** [lib/libGeom.so] Error 1
the configuration file is produced by
./configure linux --enable-roofit
I know the machine is old, but on it root v5.32.04 compiles correctly without any problem.
Any idea?
Thanks for your help,
Alessandra
no, ok, let me try
up to v5.32.04 everything was running smoothly with a simple gmake after running the configuration script, no need to add other options or change the Makefile. Let me check what happens with your suggestions.
Thanks!
ah yes sure… without root working, it is a little hard to have a root-config running…
Let me be more verbose, this is the last stanza of the output:
g++ -shared -Wl,-soname,libQuadp.so -m32 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libQuadp.so math/quadp/src/TGondzioSolver.o math/quadp/src/TMehrotraSolver.o math/quadp/src/TQpDataBase.o math/quadp/src/TQpDataDens.o math/quadp/src/TQpDataSparse.o math/quadp/src/TQpLinSolverBase.o math/quadp/src/TQpLinSolverDens.o math/quadp/src/TQpLinSolverSparse.o math/quadp/src/TQpProbBase.o math/quadp/src/TQpProbDens.o math/quadp/src/TQpProbSparse.o math/quadp/src/TQpResidual.o math/quadp/src/TQpSolverBase.o math/quadp/src/TQpVar.o math/quadp/src/G__Quadp.o -Llib -lMatrix -Llib -lCore -lCint -ldl
geom/geom/src/TGeoManager.o(.text+0xce98): In function TGeoManager::ThreadId()': : undefined reference to___tls_get_addr’
geom/geom/src/TGeoManager.o(.text+0xcf61): In function TGeoManager::ThreadId()': : undefined reference to___tls_get_addr’
collect2: ld returned 1 exit status
gmake: *** [lib/libGeom.so] Error 1
gmake: *** Waiting for unfinished jobs…
==> lib/libQuadp.so done
so, apparently it looks that the linking of this library is successful in spite of the error. But the compilation stops here. This is the first occurrence.
I can gmake on, the compilation proceeds making other shared libraries but then stops again with the same error when trying to make lib/libGeom.so.
I think it’s just a stdout / stderr streams’ buffering that mixes different outputs.
You need to find the line which begins with “g++ -shared -Wl,-soname,libGeom.so …”
and then the compilation stops. The complaint is always the same.
Let me see if I can find some other hint by redirecting the full gmake output on a file, and analysing it carefully.
Thanks.
I just wanted to have a v5.34 even on my old desktop pc since I have this new version installed and working on my ubuntu 11.10 laptop - I produced there some rootfiles which I would have like to work on also with my desktop, but with v5.32 I cannot read the files.
I wasn’t aware of the end of compatibility with older compilers with v5.34.
After unpacking the ROOT 5.34 source code, edit the “root/config/Makefile.linux” file for the “32-bit / i686 + gcc” target, or the “root/config/Makefile.linuxx8664gcc” file for the “64-bit / x86_64 + gcc” target, and remove the string “-Wl,–no-undefined” from the “LDFLAGS” inside. cd root
sed -i -e '{s/-Wl,--no-undefined //}' config/Makefile.* Then configure and make ROOT as usual.
P.S. The problem is that, if the “-Wl,–no-undefined” option is in force, then the old gcc 3.4.6 would need the “/lib/ld-linux.so.2” for the “32-bit / i686 + gcc” target and the “/lib64/ld-linux-x86-64.so.2” for the “64-bit / x86_64 + gcc” target to be explicitly added to the link command line (e.g. after “-ldl”).
After unpacking the ROOT 5.34(.02) source code, execute this … cd root
sed -i -e '{s/-Wl,--no-undefined/-Wl%--no-undefined/}' Makefile … or that … cd root
sed -i -e '{s/$(filter-out -Wl,--no-undefined,$(LDFLAGS))/$(LDFLAGS:-Wl,--no-undefined=)/}' Makefile … and then configure and make ROOT as usual.