See also

TSystem
Abstract base class defining a generic interface to the underlying
Operating System.
This is not an ABC in the strict sense of the (C++) word. For
every member function their is an implementation (often not more
than a call to AbstractMethod() which prints a warning saying
that the method should be overridden in a derived class), which
allows a simple partial implementation for new OS'es.

Process pending events (GUI, timers, sockets). Returns the result of
TROOT::IsInterrupted(). The interrupt flag (TROOT::SetInterrupt())
can be set during the handling of the events. This mechanism allows
macros running in tight calculating loops to be interrupted by some
GUI event (depending on the interval with which this method is
called). For example hitting ctrl-c in a canvas will set the
interrupt flag.

Make a file system directory. Returns 0 in case of success and
-1 if the directory could not be created.
Returns -1 if the directory exist.
If 'recursive' is true, makes parent directories as needed,
or returns 0 if the directory already exist.

Expand a pathname getting rid of special shell characters like ~.$, etc.
For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
environment variables in a pathname. If compatibility is not an issue
you can use on Unix directly $XXX. This is a protected function called
from the OS specific system classes, like TUnixSystem and TWinNTSystem.

Expand a pathname getting rid of special shell characaters like ~.$, etc.
For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
environment variables in a pathname. If compatibility is not an issue
you can use on Unix directly $XXX.

Expand a pathname getting rid of special shell characaters like ~.$, etc.
For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
environment variables in a pathname. If compatibility is not an issue
you can use on Unix directly $XXX. The user must delete returned string.

Load a shared library. Returns 0 on successful loading, 1 in
case lib was already loaded and -1 in case lib does not exist
or in case of error. When entry is specified the loaded lib is
search for this entry point (return -1 when entry does not exist,
0 otherwise). When the system flag is kTRUE, the library is consisdered
a permanent systen library that should not be unloaded during the
course of the session.

Return a space separated list of loaded shared libraries.
This list is of a format suitable for a linker, i.e it may contain
-Lpathname and/or -lNameOfLib.
Option can be any of:
S: shared libraries loaded at the start of the executable, because
they were specified on the link line.
D: shared libraries dynamically loaded after the start of the program.

This method compiles and loads a shared library containing
the code from the file "filename".
The possible options are:
k : keep the shared library after the session end.
f : force recompilation.
g : compile with debug symbol
O : optimized the code (ignore if 'd' is specified)
If library_specified is specified, CompileMacro generates the file
"library_specified".soext where soext is the shared library extension for
the current platform.
If build_dir is specified, it is used as an alternative 'root' for the
generation of the shared library. The library is stored in a sub-directories
of 'build_dir' including the full pathname of the script. See also
TSystem::SetBuildDir
If library_specified is not specified, CompileMacro generate a default name
for library by taking the name of the file "filename" but replacing the
dot before the extension by an underscore and by adding the shared
library extension for the current platform.
For example on most platform, hsimple.cxx will generate hsimple_cxx.so
It uses the directive fMakeSharedLibs to create a shared library.
If loading the shared library fails, it tries to output a list of missing
symbols by creating an executable (on some platforms like OSF, this does
not HAVE to be an executable) containing the script. It uses the
directive fMakeExe to do so.
For both directives, before passing them to TSystem::Exec, it expands the
variables $SourceFiles, $SharedLib, $LibName, $IncludePath, $LinkedLibs,
$ExeName and $ObjectFiles. See SetMakeSharedLib() for more information on
those variables.
This method is used to implement the following feature:
Synopsis:
The purpose of this addition is to allow the user to use an external
compiler to create a shared library from its C++ macro (scripts).
Currently in order to execute a script, a user has to type at the root
prompt
.X myfunc.C(arg1,arg2)
We allow him to type:
.X myfunc.C++(arg1,arg2)
or
.X myfunc.C+(arg1,arg2)
In which case an external compiler will be called to create a shared
library. This shared library will then be loaded and the function
myfunc will be called with the two arguments. With '++' the shared library
is always recompiled. With '+' the shared library is recompiled only
if it does not exist yet or the macro file is newer than the shared
library.
HOWEVER, CompileMacro currently does NOT detect if any of the file that
are included by the macro file has been changed!!!
Of course the + and ++ notation is supported in similar way for .x and .L.
Through the function TSystem::SetMakeSharedLib(), the user will be able to
indicate, with shell commands, how to build a shared library (a good
default will be provided). The most common change, namely where to find
header files, will be available through the function
TSystem::SetIncludePath().
A good default will be provided so that a typical user session should be at
most:
root[1] gSystem->SetIncludePath("-I$ROOTSYS/include
-I$HOME/mypackage/include");
root[2] .x myfunc.C++(10,20);
The user may sometimes try to compile a script before it has loaded all the
needed shared libraries. In this case we want to be helpfull and output a
list of the unresolved symbols. So if the loading of the created shared
library fails, we will try to build a executable that contains the
script. The linker should then output a list of missing symbols.
To support this we provide a TSystem::SetMakeExe() function, that sets the
directive telling how to create an executable. The loader will need
to be informed of all the libraries available. The information about
the libraries that has been loaded by .L and TSystem::Load() is accesible
to the script compiler. However, the information about
the libraries that have been selected at link time by the application
builder (like the root libraries for root.exe) are not available and need
to be explictly listed in fLinkedLibs (either by default or by a call to
TSystem::SetLinkedLibs()).
To simplify customization we could also add to the .rootrc support for the
variables
Unix.*.Root.IncludePath: -I$ROOTSYS/include
WinNT.*.Root.IncludePath: -I%ROOTSYS%/include
Unix.*.Root.LinkedLibs: -L$ROOTSYS/lib -lBase ....
WinNT.*.Root.LinkedLibs: %ROOTSYS%/lib/*.lib msvcrt.lib ....
And also support for MakeSharedLibs() and MakeExe().
(the ... have to be replaced by the actual values and are here only to
shorten this comment).

Set the location where ACLiC will create libraries and use as
a scratch area. Note that the libraries are actually stored in
sub-directories of 'build_dir' including the full pathname of the
script. If the script is location at /full/path/name/macro.C
the library will be located at 'build_dir+/full/path/name/macro_C.so'

AclicMode indicates whether the library should be built in
debug mode or optimized. The values are:
TSystem::kDefault : compile the same as the current ROOT
TSystem::kDebug : compiled in debug mode
TSystem::kOpt : optimized the library

Directives has the same syntax as the argument of SetMakeSharedLib but is
used to create an executable. This creation is used as a means to output
a list of unresolved symbols, when loading a shared library has failed.
The required variable is $ExeName rather than $SharedLib, e.g.:
gSystem->SetMakeExe(
"g++ -Wall -fPIC $IncludePath $SourceFiles
-o $ExeName $LinkedLibs -L/usr/X11R6/lib -lX11 -lm -ldl -rdynamic");

IncludePath should contain the list of compiler flags to indicate where
to find user defined header files. It is used to expand $IncludePath in
the directives given to SetMakeSharedLib() and SetMakeExe(), e.g.:
gSystem->SetInclude("-I$ROOTSYS/include -Imydirectory/include");
the default value of IncludePath on Unix is:
"-I$ROOTSYS/include "
and on Windows:
"/I%ROOTSYS%/include "

LinkedLibs should contain the library directory and list of libraries
needed to recreate the current executable. It is used to expand $LinkedLibs
in the directives given to SetMakeSharedLib() and SetMakeExe()
The default value on Unix is: root-config --glibs

The 'suffix' will be appended to the name of a script loaded by ACLiC
and used to locate any eventual additional linkdef information that
ACLiC should used to produce the dictionary.
So by default, when doing .L MyScript.cxx, ACLiC will look
for a file name MyScript_linkdef and having one of the .h (.hpp,
etc.) extensions. If such a file exist, it will be added to
the end of the linkdef file used to created the ACLiC dictionary.
This effectively enable the full customization of the creation
of the dictionary. It should be noted that the file is intended
as a linkdef 'fragment', so usually you would not list the
typical '#pragma link off ....".

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.