ROOT and dynamic linkig ....

From: GOLONKA PIOTR (GOLONKA_PIOTR@novell.ftj.agh.edu.pl)
Date: Wed Apr 23 1997 - 17:55:14 MEST


Hi!

I downloaded TVenus compiled for LINUX last weekend and impatiently 
wanted to try it out - I've untar'ed it in my home directory and 
started ROOT. Firstly i tried to run graphics demo : Of course it 
failed because I hadn't any data file then. So I started second 
example which was to generate such a file :
    [root.1] .x venus.C
And here I got a very "nice" message: "cannot resolve aaset_" ( or 
"cannot execute/find" ? -i can't remember now) All in all
ROOT HAS CRASHED - I got my shell prompt in xterm...
After a few minutes of analysis I found the reason: It seems that
ROOT cannot find (and "see") dynamicaly linked libraries.
In that example, there are following lines:
    gSystem->Load("libvenus.so")
    gSystem->Load("libEG.so");
    gSystem->Load("f2c.so");
    
'libEG' seemes to be OK. I can find classes TVenus,TGenerator, etc.
The problem is I can see ONLY(!!!) classes - no subroutines (and no
variables I guess). And here's the reason: While executing a 
constructor of TVenus, a function called aaset_ is called (among 
others). This function is implemented in F77 source of VENUS. 
I thought, it will be readable to ROOT after loading it by 
gSystem->Load (Line: gSystem->Load("libvenus.so") -above).And in fact 
I cannot find whether it is loaded...

I tried to do some tests: wrote my own , simple library with only one
global function and a class : You can guess: Of course ROOT didn't 
found the function though it found the class. [At the beginning I had
some troubles with class, either, but after "learning" what ClassDef()
and ClassImp() are for , and linking it to shared lib with g++ instead 
of ld - it started to work...]
/Why isn't it mentioned anywhere else?/
Then I looked at documentation of TSystem: Beatiful functions
gSystem->ShowLibraries() and ListSymbols() [or something like that]
are mentioned there. Impatiently tried it out ... of course both 
made NOTHING. Rather confused I looked into sources ( fortunately
I've already downloaded them). After "a few" minutes of searching 
through them I found it"

>>void TUnixSystem::ShowLibraries(char*, char*)
>>{
>>#ifdef HP
>>    ....
>>    ....
>>    ....
>>#endif
>>}

So you can guess what were the reasons...

Conclusion: 
^^^^^^^^^^^
    What is the TRUTH about root and shared libraries?

Is that only my trouble, or anyone already had such problems.
My current platform is RedHat Linux 4.0 on an AMD's Pentium 90 /16Megs 
RAM/MotherBoard Intel TRITON II. Kernel: 2.0.27 . ld version 
2.??(cannot remember , but it's also quite new, as all binutils, 
gcc,g++).

Help me please...

Piotr Golonka
WFiTJ AGH Krakow
Institute of Nuclear Physics, Krakow



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:18 MET