Problems with libGeom.so in ROOT 5.34.01

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

I can add, if useful, that the error occurs during the making of the library lib/libQuadp.so

Do you add “-pthread” when compiling and linking your “lib/libQuadp.so” (well, I believe you should)?
Try:
root-config --cflags
root-config --evelibs

Sorry, I mixed it … you don’t have ROOT installed, so my answer is wrong.
Actually I don’t get why you get a libGeom problem when linking libQuadp.

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 …”

this is reached when I go on with a second gmake after the first stop:

g++ -shared -Wl,-soname,libGeom.so -m32 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libGeom.so geom/geom/src/TGeoArb8.o geom/geom/src/TGeoAtt.o geom/geom/src/TGeoBBox.o geom/geom/src/TGeoBoolNode.o geom/geom/src/TGeoBranchArray.o geom/geom/src/TGeoBuilder.o geom/geom/src/TGeoCache.o geom/geom/src/TGeoCompositeShape.o geom/geom/src/TGeoCone.o geom/geom/src/TGeoElement.o geom/geom/src/TGeoEltu.o geom/geom/src/TGeoGlobalMagField.o geom/geom/src/TGeoHalfSpace.o geom/geom/src/TGeoHelix.o geom/geom/src/TGeoHype.o geom/geom/src/TGeoManager.o geom/geom/src/TGeoMaterial.o geom/geom/src/TGeoMatrix.o geom/geom/src/TGeoMedium.o geom/geom/src/TGeoNavigator.o geom/geom/src/TGeoNode.o geom/geom/src/TGeoParaboloid.o geom/geom/src/TGeoPara.o geom/geom/src/TGeoPatternFinder.o geom/geom/src/TGeoPcon.o geom/geom/src/TGeoPgon.o geom/geom/src/TGeoPhysicalNode.o geom/geom/src/TGeoPolygon.o geom/geom/src/TGeoScaledShape.o geom/geom/src/TGeoShapeAssembly.o geom/geom/src/TGeoShape.o geom/geom/src/TGeoSphere.o geom/geom/src/TGeoStateInfo.o geom/geom/src/TGeoTorus.o geom/geom/src/TGeoTrd1.o geom/geom/src/TGeoTrd2.o geom/geom/src/TGeoTube.o geom/geom/src/TGeoVolume.o geom/geom/src/TGeoVoxelFinder.o geom/geom/src/TGeoXtru.o geom/geom/src/TVirtualGeoPainter.o geom/geom/src/TVirtualGeoTrack.o geom/geom/src/TVirtualMagField.o geom/geom/src/G__Geom1.o geom/geom/src/G__Geom2.o -Llib -lRIO -lThread -lMathCore -pthread -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

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.

uhm no, I cannot find anything special apart from a few warnings and notes, which do not seem to be correlated with libGeom…

Well, it may be that you face the problem that I tried to raise at least two times without any luck (see my last posts):
[url]ROOT Production Release 5.34/00
… and earlier:
[url]ACLiC problem (ROOT v5-32-01) on CentOS 6.2 x86_64 SMP

ah… I see, thank you for the info.

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.

Maybe you could try:
rpm -qa | grep -i glibc
ls -al /usr/lib/libdl.so
ldd /usr/lib/libdl.so
nm -D /lib/ld-linux.so.2 | grep ___tls_get_addr

P.S. I myself am also interested in getting ROOT 5.34 on SLC 4.8 i686 with gcc 3.4.6.

I think I have a brutal fix …

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”).

Thank you for the suggestion, I’ll try asap and let you know!

See also: [url]Sl 4.x / slc 4.x

compilation succeded with your trick!
thanks a lot! :smiley:

This should now be fixed in the trunk and in root-v5-34-00-patches.

Cheers, Fons.

The fix implemented in the newest “root-v5-34-00-patches” doesn’t work … g++ -shared -Wl,-soname,libGeom.so.5.34 --no-undefined,-m32 -O2 -Wl,--no-undefined -Wl,--as-needed -o lib/libGeom.so.5.34 geom/geom/src/TGeoArb8.o geom/geom/src/TGeoAtt.o geom/geom/src/TGeoBBox.o geom/geom/src/TGeoBoolNode.o geom/geom/src/TGeoBranchArray.o geom/geom/src/TGeoBuilder.o geom/geom/src/TGeoCache.o geom/geom/src/TGeoCompositeShape.o geom/geom/src/TGeoCone.o geom/geom/src/TGeoElement.o geom/geom/src/TGeoEltu.o geom/geom/src/TGeoGlobalMagField.o geom/geom/src/TGeoHalfSpace.o geom/geom/src/TGeoHelix.o geom/geom/src/TGeoHype.o geom/geom/src/TGeoManager.o geom/geom/src/TGeoMaterial.o geom/geom/src/TGeoMatrix.o geom/geom/src/TGeoMedium.o geom/geom/src/TGeoNavigator.o geom/geom/src/TGeoNode.o geom/geom/src/TGeoParaboloid.o geom/geom/src/TGeoPara.o geom/geom/src/TGeoPatternFinder.o geom/geom/src/TGeoPcon.o geom/geom/src/TGeoPgon.o geom/geom/src/TGeoPhysicalNode.o geom/geom/src/TGeoPolygon.o geom/geom/src/TGeoScaledShape.o geom/geom/src/TGeoShapeAssembly.o geom/geom/src/TGeoShape.o geom/geom/src/TGeoSphere.o geom/geom/src/TGeoStateInfo.o geom/geom/src/TGeoTorus.o geom/geom/src/TGeoTrd1.o geom/geom/src/TGeoTrd2.o geom/geom/src/TGeoTube.o geom/geom/src/TGeoVolume.o geom/geom/src/TGeoVoxelFinder.o geom/geom/src/TGeoXtru.o geom/geom/src/TVirtualGeoPainter.o geom/geom/src/TVirtualGeoTrack.o geom/geom/src/TVirtualMagField.o geom/geom/src/G__Geom1.o geom/geom/src/G__Geom2.o -Llib -lRIO -lThread -lMathCore -pthread -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'
Note, it actually introduces a bug … it adds an additional “–no-undefined,” to the LDFLAGS …

I think I have a brutal fix …

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.

I think this time I correctly fixed it.

Cheers, Fons.