Why static ROOT compilation doesn't work

Hi experts,
I have been trying every now and then, install static root libraries with “make static” command… and it failed for pretty much any release of root (since 5) on any Linux version that I tried, e.g. Fedora, Ubuntu, Cent OS .
For example, latest Pro version https://root.cern.ch/download/root_v6.10.06.source.tar.gz on CentOS Linux release 7.4.1708 (Core) says (after make static):
lib/libRoot.a(TUnfoldBinningXML.o): In function TUnfoldBinningXML::AddAxisXML(TXMLNode*)': TUnfoldBinningXML.cxx:(.text+0x137f): undefined reference toTXMLNode::GetChildren()’
… etc

It’s not an urgent issue. I have long since figured out how to avoid dealing with static applications all together. I’m just a curious user: why is it that you always provide a
"make static" option with every release, and why doesn’t it ever work?

(I’ll just talk in generality, not knowing the exact process of what ROOT tries/tried to do for static compilation…)

statically linking C++ is known to be very difficult.
I mean, statically compiling+linking a simple hello world is doable but an entire application, in C++?
it’s rather hairy, beause of the C++ runtime library that needs to be compiled in.

Besides, in the C++ world, everybody is going the dlopen road (because compiling+linking takes soooooo much time), so when you rely on many externals, it’s just non tractable.

I am not even sure the nice deployment story of a completely statically compiled binary in C++ wins over the headache of producing it in the first place. (and it’s probably a nice testimony to Go’s build system to manage to ship completely static binaries that carry a runtime with a garbage collector :slight_smile: from day one 'til today, with great compilation turn around.)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.