Re: [ROOT] Profiling on Linux An example of script

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jul 04 2000 - 09:23:34 MEST


Hi George,
In the attachment, you will find the small script that I use to create
an archive library libRoot.a containing all the Root classes
and the link procedure to create a static module roota on Linux RH6.1

One must force some code (the G__*.o) files to be loaded explicitly.

To use the profiler, you have to compile the root source code with the option
-pg.

Modify the script to add your own classes and G_ code.


Rene Brun


George Heintzelman wrote:
> 
> Rooters,
> 
> I'm trying to do some profiling of programs linked with root libraries,
> using gprof. As those of you who have tried to do this will know,
> profiling with shared libraries does not work. So I wonder if anyone
> has a 'recipe' for making root with static libraries.  I did manage to
> build things with some static libraries but I still seem to be running
> into problems arising from ROOT's explicit linking of shared libraries
> in LoadClass and similar places. Anyone know ways of fixing/getting
> around this? Profiling is a very important tool in achiving
> performance, and I am quite unhappy with not being able to do it
> effectively.
> 
> George Heintzelman
>

/bin/rm roota
/bin/rm libRoot.a
ar rv libRoot.a \
$ROOTSYS/base/src/*.o \
$ROOTSYS/cint/src/*.o \
$ROOTSYS/clib/src/*.o \
$ROOTSYS/cont/src/*.o \
$ROOTSYS/g3d/src/*.o \
$ROOTSYS/gpad/src/*.o \
$ROOTSYS/graf/src/*.o \
$ROOTSYS/gui/src/*.o \
$ROOTSYS/hist/src/*.o \
$ROOTSYS/histpainter/src/*.o \
$ROOTSYS/html/src/*.o \
$ROOTSYS/matrix/src/*.o \
$ROOTSYS/meta/src/*.o \
$ROOTSYS/minuit/src/*.o \
$ROOTSYS/net/src/*.o \
$ROOTSYS/physics/src/*.o \
$ROOTSYS/postscript/src/*.o \
$ROOTSYS/proof/src/*.o \
$ROOTSYS/rint/src/*.o \
$ROOTSYS/tree/src/*.o \
$ROOTSYS/treeplayer/src/*.o \
$ROOTSYS/treeviewer/src/*.o \
$ROOTSYS/unix/src/*.o \
$ROOTSYS/x11/src/*.o \
$ROOTSYS/x11ttf/src/*.o \
$ROOTSYS/x3d/src/*.o \
$ROOTSYS/zip/src/*.o
echo 'int  G__globalsetup() {}' >globalsetup.c
cc -c globalsetup.c
g++ -o roota \
$ROOTSYS/main/src/rmain.o \
$ROOTSYS/html/src/G*.o \
$ROOTSYS/histpainter/src/G*.o \
$ROOTSYS/treeplayer/src/G*.o \
$ROOTSYS/treeviewer/src/G*.o \
$ROOTSYS/x3d/src/G*.o \
$ROOTSYS/postscript/src/G*.o \
libRoot.a \
globalsetup.o \
$HOME/xpm-3.4j/lib/libXpm.a \
/usr/X11R6/lib/libX11.a -lm -ldl -rdynamic



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