Re: [ROOT] Explicit library dependencies on Linux

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Apr 17 2003 - 10:46:10 MEST


Hi Pere,

We have discussed your proposal in the team and we all agree that
it makes sense. We will implement an option in the next release of the Makefile.
We want to keep the current shared library build by default. When doing
development, it is interesting to rebuild only the shared lib containing
the class(es) that has been modified and not all its dependencies.
On the other hand, when building the shared libs for the distribution,
it is easy to relink all the libraries like you suggest.

Thanks for your comments and proposal.

Rene Brun

Pere Mato Vila wrote:
> 
> Dear Rene et al,
> 
>   The way currently the ROOT dynamic libraries are built do not show the
> dependencies between them on linux. If I do for example
> 
> > ldd libGpad.so
>         libstdc++.so.5 => /usr/local/gcc-alt-3.2/lib/libstdc++.so.5
> (0x400da000)
>         libm.so.6 => /lib/i686/libm.so.6 (0x4019f000)
>         libgcc_s.so.1 => /usr/local/gcc-alt-3.2/lib/libgcc_s.so.1
> (0x401c1000)
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> 
>   But in reality this library depends on libCore.so among others. This
> is not a problem when using the root.exe main executable since this one
> has been linked explicitly with all the necessary libraries. Therefore,
> the symbols are available at run time from the main program. The problem
> is when using another main program (for example the python shell). In
> this case, the main program has not been linked with any ROOT libraries
> and when trying to dynamically load ROOT libraries like libGpad.so,
> which depends on others, the loading fails with unresolved symbols. If
> the dependency would be explicit (by linking with them during build
> time) there will be no problem. A "hack work around" I found is to
> explicitly dlopen dependent libraries with RTLD_GLOBAL flag on, even if
> they have been already loaded. But this is really not very nice and not
> robust a all.
> 
>   Would it be possible to change the way ROOT libraries are built such
> that dependencies become explicit?
> 
> ------------------------------------------------------------
> Pere Mato  CERN, EP Division, CH 1211 Geneva 23, Switzerland
>            e-mail: Pere.Mato@cern.ch    tel: +41 22 76 78696
>            fax:  +41 22 76 79425        gsm: +41 79 20 10855
> 
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET