Re: ROOT and dynamic linkig ....

Valery Fine (Valeri.Faine@cern.ch)
Thu, 24 Apr 1997 18:34:47 +0100


Hello Piotr

On 23 Apr 97 at 13:41, you wrote:

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

Rene at the moment off and I hope he'll supply some advanced
information, but apparently to run Venus generator one needs all 3
share libraries where

1. libvenus.so contains the very VENUS, i.e it is produced from the
original Fortran Venus code
2. libEG contains only Event Generator classes. These are
"interface" classes just to wrap the calling the real
Fortran code from the first (libvenus)library, access the
Fortran common blocks and fill the C++ structures from those
common blocks.
3. f2c.co is a Fortran-To-C run-time library, since libvenus was
generated (compiled with this tool)

the "aaset-" is a name of the Fortran Venus subroutine from
libvenus.so. If last was not provided your result is expected.

> gSystem->Load (Line: gSystem->Load("libvenus.so") -above).And in
> fact I cannot find whether it is loaded...

gSystem->Load returns ZERO if it succeded to find and load DLL and
1 otherwise. So just try to print it from MACRO

printf("%i \n",gSystem->Load("libvenus.so"));

or type it from root command prompt "by hand"

root [1] gSystem->Load("libvenus.so")
(Int_t)0 <==== You will see this if the library was loaded

By the way under Windows NT it is impossible at all to separate EG
class dynamic libary and Venus library and I linked both of them
together into, the single DLL Root_EG.DLL. I.e the Windows
Root_EG.DLL contains as EG class def's as Venus Fortran code itself
(apparently there is no f2c.so at all, but MSFRT40.DLL must be
present anyway)

Hope this helps.
Valery
=================================================================
Dr. Valery Fine Telex : 911621 dubna su
-----------
LCTA/Joint Inst.for NuclearRes Phone : +7 09621 6 40 80
141980 Dubna, Moscow region Fax : +7 09621 6 51 45
Russia mailto:fine@main1.jinr.dubna.su

Dr. Valeri Faine
------------ Phone: +41 22 767 6468
CERN FAX : +41 22 782 2601
CH-1211 Geneva, 23 mailto:fine@mail.cern.ch
Switzerland http://nicewww.cern.ch/~fine