Problem with statically-linked executable

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Fri, 28 Aug 2009 10:00:39 -0500


When I link my program with Root using static libraries, I get the following warning (this is Linux, SLF 309):

/home/tjrob/g4bl/G4beamline/lib/Linux-g++/libRoot.a(TUnixSystem.o)(.text+0x3d11): In function `TUnixSystem::GetGroupInfo(int)': : Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ... about a dozen similar warnings.

The program does execute, but of course I do have those shared libraries present at runtime. I have no idea if it is actually loading and using them. ldd says "not a dynamic executable".

The whole point of linking statically is to avoid dependence on ANY shared libraries at runtime.

Is it possible to build Root so it is static safe?

Note the only Root code I actually need is TFile and TNtuple and the stuff they need. And even that's overkill, as I am ONLY reading and writing TNtuples (so I don't really need all the stuff to read/write arbitrary objects).

I'm having so much trouble re-doing my build scripts using Root, I have to wonder: is there some small and simple subset of Root code I could pull out, that just does what I need? IIRC there was an old RIO package....

BTW I have been completely unable to link statically on Mac OS X, for reasons unrelated to Root. Fortunately there's no burning need to do that.

Tom Roberts

FYI here is how I configure Root 5.24. This is every disable I could get away with -- the only things not disabled are cint5 and zlib: ./configure \
--disable-afs --disable-alien --disable-asimage --disable-astiff
--disable-bonjour --disable-builtin-afterimage --disable-builtin-ftgl
--disable-builtin-freetype --disable-builtin-glew --disable-builtin-pcre
--disable-castor --disable-chirp --disable-cint7 --disable-cintex
--disable-clarens --disable-dcache --disable-exceptions --disable-explicitlink
--disable-fftw3 --disable-gdml --disable-gfal --disable-g4root --disable-globus
--disable-glite --disable-gsl-shared --disable-krb5 --disable-ldap
--disable-genvector --disable-mathmore --disable-memstat --disable-minuit2
--disable-monalisa --disable-mysql --disable-odbc --disable-opengl
--disable-oracle --disable-pch --disable-peac --disable-pgsql --disable-pythia6
--disable-pythia8 --disable-python --disable-qt --disable-qtgsi --disable-reflex
--disable-rfio --disable-roofit --disable-rpath --disable-ruby --disable-sapdb
--disable-shadowpw --disable-shared --disable-soversion --disable-srp
--disable-ssl --disable-table --disable-unuran --disable-winrtdebug
--disable-xml --disable-xrootd --disable-xft
Received on Fri Aug 28 2009 - 17:00:48 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 29 2009 - 23:50:03 CEST