How to use ACLiC

Bellow is a ROOT script, hello.C, which prints out hello world:

void hello(){
std::cout << "Hello world\n" ;
return;
}

Can someone please give me step-by-step instructions (or better yet point me to a tutorial?) on how to take this function and compile it using AClick a) either into a stand-alone code (with main() and everything) or b) into a library that can be linked to?

Hi,

You first need to update you code to be compilable by a C++ compiler: #include <iostream> void hello(){ std::cout << "Hello world\n" ; return; }and then you can load the script with root [] .L script.C+
or gROOT->LoadMacro("script.C+"); or for more advanced case use TSystem::CompileMacro
as in the following script: root.cern.ch/viewvc/trunk/script … t=roottest
which is used in roottest’s Makefile to generate shared library.

Cheers,
Philippe.

Thanks Philippe!

Hi,

Can i somehow set the path of created shared object and other products (.d and .pcm) separately? And how to set the name of future shared object?

Best,
Nazar

Hi @nazar_sokour,
welcome to the ROOT forum! Please create a new thread with your question – the post you replied to is from 2011! :smiley:

Cheers,
Enrico