Re: Compiling vs loading library libEvent.so : USE the ROOT SCRIPT COMPILER

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Wed Jan 26 2000 - 15:16:39 MET


Hi Rene, 

From: Rene Brun <Rene.Brun@cern.ch>
> Script Compiler
>   ===============
>   This new ROOT facility facilitates the use of an external compiler to
>   'interpret' a C++ root macro (script).  The external compiler will
>   be called to create a shared library that is automatically loaded.

Although increased functionality is nice, and generally a good thing,
I fail to see the rational of this feature. Why not just shift to your
terminal, create a dynamicly loadable object:

	  > g++ -fPIC -g -O2 -c foo.cc -o foo.o 
	  > g++ -Wl,-soname,foo.so -o foo.so foo.o
 	  
shift back to ROOT, load the object

          root [1234] gSystem->Load("foo.so");

and do whatever it is you need to do! I guess this is more or less
what the `.L foo.cc++' does, but really, what you need to do to
compile ROOT may very well be different from what you need to compile
your own code. I, for one, would like to have complete control over my
compiling processes (`why doesn't this library contain debug
info. Oh, I know, F**king Visual C++ doesn't do the job ...'). 

Also, I guess ROOT isn't going to be a Intergrated Development
Environment (hmm, yet another meaning of the abbrv. IDE!). Rather,
ROOT should aspire at being the best God damn analysis toolkit around,
which I believe should respect things like templates and
namespaces. The people behind Blitz++ (http://oonumerics.org/blitz/)
seem to say, that via templates they can beat Fortran at computation
time, and namespaces are a nice way of restricting your function-space
(in a wide sense).  

And while I'm here, a question:
If you compile ROOT with the THREAD flag (--with-thread=-lpthread),
what are the changes? Are ROOT multi-threaded then? Is it thread-safe?
Can you do
 
  root[6789] Thread* mythread = new Thread(((void*)(*)(void*))&myfunc);
  root[6790] mythread->Run((void*)myarg);

or something similar? I'm asking this because a fellow student of mine
is creating a High Voltage control program for BRAHMS, and he needs
threads. Also, how thread safe are the ROOT GUI. My friend reports,
that after a "SendMessage(...)", it may take some time before the
corrosponding "ProcessMessage(...)" is executed. It seems the some
semaphores whould be in order here, but can they sfaely be used inside
ROOT? 

Finally, I'd like to, once again, direct your attention to my ROOT
Debian GNU/Linux package (avaliable from www.nbi.dk/~cholm/Downloads)
and the changes that I made to the compile system in meking that
package (get the file root_2.23.11-1.diff.gz, and patch a 2.23.11
source tree). The changes are documented on the above web-page. 

Christian Holm Christensen 
______________________________________________________________________
Address:                                     Phone:  (+45) 35 35 96 91 
  Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 307 
  DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm    
  Denmark                                    Email:       cholm@nbi.dk
 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:17 MET