Compile a macro without running?

Hello, I normally run my macros with a command like

which compiles the macro if the source has changed and then exectutes the function mymacro(parameter). Is there a way to separate the two actions, to compile separately without actually executing the macro? I know that from inside a root session I can do .L mymacro.C+, but what about from the command line outside of root?


1 Like

[url]Compile and run from command prompt
See also and


You can even compile it without loading the resulting shated library by calling ACLiC directly (gSystem->CompileMacro).

See for a complete example of a macro used to leverage ACLiC from a Makefile:


What do you actually try to say?

“Compile it with loading” can easily be achieved by:

“Compile it with loading and executing” can easily be achieved by:
gROOT->Macro(“filename++(arg1, arg2)”);

Well, unless you wanted to say “compile it WITHOUT loading” … then one would really need:
gSystem->CompileMacro(“filename”, “kfc”);

BTW. What’s the difference between “.x filename” and “.X filename”?


I meant without (i corrected the post).

In ROOT there is no difference between .x and .X (in standalone CINT one can handle only unnamed macro and the other only named macro).