Re: Use of existing libraries

Valery Fine (fine@mail.cern.ch)
Thu, 25 Sep 1997 09:36:59 +0100


On 25 Sep 97 at 3:21, Dirk Geppert wrote:

> is it possible to link existing libraries (C and/or Fortran)
> to an interactive root session and if yes, how?

Yes, (For C/C++ it is VERY way we recommend to use) you need to
produce the share (dynamic) library from those and this library must
contain the ROOT dictionary (You are required to apply ROOTCINT
utility for that (see our root/test/Makefile and
http://root.cern.ch/root/CintGenerator.html).

( By the way I've just realizex this scetion might confuse user. I'd
like to mention that this section should be changed. It said that

" . . .
To make this class accessible via the command line we need to link
it with a small ROOT main program, main.C, that creates and calls the
command line interpreter:
. . . "

But it MUST be first

" . . .
To make this class accessible via the command line we need to
create a dynamic/share library and load it into intercative ROOT
session
. . . "

been followed by a text of the Makefile from the Root/test
distribution !!!

Since RootCint can not produce a dictionary from Fortran source
directly one is required to create a small C wrapper functions or C++
wrapper class calling those Fortran functions (for CERNLIB one may
apply CFortran set of the headers file to simplify things).
(NOTE for Windows user: to be able to call "FORTRAN" wrapping
functions one needs to launch a special version of ROOT: It is called
Root4For.exe and it is available along with a normal "pure C/C++"
ROOT.exe from Root/bin as well. It is linked with Microsoft Fortran
Powerstaion v4.0 I/O Run-time system and assumes MSFRT40.DLL on the
PATH).

Probably it is a point for ROOT HOWTO Web page. (I believe some
of our users did this already and might be contribute).

With my best regards,
Valery
Dr. Valeri Faine (Valery Fine)
------------ ------------- Phone: +41 22 767 4921
CERN FAX : +41 22 767 7155
CH-1211 Geneva, 23 mailto:fine@mail.cern.ch
Switzerland http://nicewww.cern.ch/~fine