Making an exe file with ROOT functions

Hello Everyone,

I am currently compiling ROOT with gcc using the following command :

Is there a way to compile the code so that I can run it on a computer where there is no ROOT installed. Eventually I would like to make .exe files to run the code on various computers without ROOT. Any suggestions will be appreciated.

Thanks.

Karthik

For this you have to build a statically linked version of you application. To do that you have to start from source and do:

./configure
make
make static

next link your application with the lib/libRoot.a library.

Cheers, Fons.

Thanks Fons.

I recompiled my Root from source. I now have a libRoot.a file (144530778 bytes) in my $ROOTSYS/lib directory.
However when I compile I get a [quote]/usr/bin/ld: cannot find -lCore[/quote] error.

The appropriate lines in my application Makefile are:

CPPFLAGS += -pthread -m64 CPPFLAGS += -I/home/ROOT-STATIC-BUILD/include CPPFLAGS += -L/home/ROOT-STATIC-BUILD/lib CPPFLAGS += -lRoot -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lGui -pthread -lm -ldl -rdynamic CPPFLAGS += -static

Any ideas? Thank you.

Hi,

currently there is no very easy way yet to build a static version of your program. If you run:

make static

you see how the program “roota”, a statically linked version of root.exe, is created. Just copy this statement and use it to link your program.

Cheers, Fons.