# {{root}} interpreter and runtime compiler {{uranie}} can be used through the C++ interpreter of {{root}}, either using the command line, or in **batch** mode, the successive commands being stored in a file called a **{{root}} macro**. To run the macro `"MyMacro.C"` from a shell prompt, use the command: ```bash root -l MyMacro.C ``` The `-l` option prevents from launching the {{root}} login window. Other options that may be useful are: - `-q`: quit {{root}} interpreter when the script is run. - `-b`: run in batch mode (without DISPLAY) These options are typically used when your job needs to be distributed. To execute a Macro from the {{root}} prompt, use the command: ```bash .x MyMacro.C ``` {{root}} interpreter offers some facilities for macro writing. In particular, it takes care of loading the needed libraries, and does not need the `#include` directives. {{ROOT6WARN}} The new versions of {{root}} (from {{root}} 6.0) is now using Cling the interpreter that does also a compilation on the fly thanks to LLVM and Clang. It is now much more compliant with the C++ syntax that previous version, allowing only few simplifications (some namespace loaded and include lines brought). Another way to run a macro in a compile way is to append one or two "+" at the end of the script. ```bash root -l MyMacro.C+ ``` A "+" compiles the macro if the source changes, while "++" forces a recompilation. From {{root}} 6, this method does not go faster that the "interpreted" one. The only difference remaining now is to produce easily a library (`.so`) file. This runtime compiler still deals with libraries auto-load, but needs the `#include` directives. {{root}} looks for include files in standard location and in the `$ROOTSYS/include` directory. If {{uranie}} is installed elsewhere, you have to specify where to find its include files. One way to do so is to use the `.rootrc` file. Here is an example: ````{admonition} .rootrc ```none ACLiC.IncludePaths: -DJIT -I$URANIESYS/include -I/another/include/path ``` ```` It defines a list of C++ compiler options that are added at compile time: `-I` adds an include path; `-D` defines a CPP macro. This CPP macro can be used to write a single source code for both interpreted or compiled runs, hiding or showing part of source lines (`#include` declarations for example). Another way is to use the `rootlogon.C` file. If this file is available in the active directory, it will be systematically loaded by {{root}} before the application is launched. A more thorough discussion on this file can be found in [](#overview_root_namespace). ````{admonition} rootlogon.C ```cpp gInterpreter->AddIncludePath("$URANIESYS/include"); gInterpreter->AddIncludePath("/another/include/path"); ``` ```` This allows both the interpreter and the compiler to find the needed files. One important advantage of runtime compilation is that error messages are more easily understandable.