Logo ROOT   6.18/05
Reference Guide
rootcling-argparse.py
Go to the documentation of this file.
1import argparse
2import sys
3
4EPILOG = """
5The options -p, -c, -l, -cint, -reflex and -gccxml are deprecated and
6currently ignored.
7
8
9
10IMPORTANT:
111) LinkDef.h must be the last argument on the rootcling command line.
122) Note that the LinkDef file name must contain the string:
13 LinkDef.h, Linkdef.h or linkdef.h, i.e. NA49_LinkDef.h.
14
15Before specifying the first header file one can also add include
16file directories to be searched and preprocessor defines, like:
17 -I$MYPROJECT/include -DDebug=1
18
19NOTA BENE: the dictionaries that will be used within the same project must
20have unique names
21
22
23
24The (optional) file LinkDef.h looks like:
25
26#ifdef __CLING__
27
28#pragma link off all globals;
29#pragma link off all classes;
30#pragma link off all functions;
31
32#pragma link C++ class TAxis;
33#pragma link C++ class TAttAxis-;
34#pragma link C++ class TArrayC-!;
35#pragma link C++ class AliEvent+;
36
37#pragma link C++ function StrDup;
38#pragma link C++ function operator+(const TString&,const TString&);
39
40#pragma link C++ global gROOT;
41#pragma link C++ global gEnv;
42
43#pragma link C++ enum EMessageTypes;
44
45#endif
46
47This file tells rootcling which classes will be persisted on disk and what
48entities will trigger automatic load of the shared library which contains
49it. A trailing - in the class name tells rootcling to not generate the
50Streamer() method. This is necessary for those classes that need a
51customized Streamer() method. A trailing ! in the class name tells rootcling
52to not generate the operator>>(TBuffer &b, MyClass *&obj) function. This is
53necessary to be able to write pointers to objects of classes not inheriting
54from TObject. See for an example the source of the TArrayF class.
55If the class contains a ClassDef macro, a trailing + in the class
56name tells rootcling to generate an automatic Streamer(), i.e. a
57streamer that let ROOT do automatic schema evolution. Otherwise, a
58trailing + in the class name tells rootcling to generate a ShowMember
59function and a Shadow Class. The + option is mutually exclusive with
60the - option. For legacy reasons it is not yet the default.
61When the linkdef file is not specified a default version exporting
62the classes with the names equal to the include files minus the .h
63is generated.
64
65The default constructor used by the ROOT I/O can be customized by
66using the rootcling pragma:
67 #pragma link C++ ioctortype UserClass;
68For example, with this pragma and a class named MyClass,
69this method will called the first of the following 3
70constructors which exists and is public:
71 MyClass(UserClass*);
72 MyClass(TRootIOCtor*);
73 MyClass(); // Or a constructor with all its arguments defaulted.
74
75When more than one pragma ioctortype is used, the first seen has
76priority. For example with:
77 #pragma link C++ ioctortype UserClass1;
78 #pragma link C++ ioctortype UserClass2;
79
80ROOT considers the constructors in this order:
81 MyClass(UserClass1*);
82 MyClass(UserClass2*);
83 MyClass(TRootIOCtor*);
84 MyClass(); // Or a constructor with all its arguments defaulted.
85"""
86def get_argparse():
87 parser = argparse.ArgumentParser(add_help=False, prog='rootcling',
88 description = 'This program generates the dictionaries needed for performing I/O of classes.',
89 epilog = EPILOG
90)
91 parser.add_argument('-f', help='Overwrite an existing output file\nThe output file must have the .cxx, .C, .cpp, .cc or .cp extension.\n')
92 parser.add_argument('-v', help='Display all messages')
93 parser.add_argument('-v0', help='Display no messages at all')
94 parser.add_argument('-v1', help='Display only error messages')
95 parser.add_argument('-v2', help='Display error and warning messages (default).')
96 parser.add_argument('-v3', help='Display error, warning and note messages')
97 parser.add_argument('-v4', help='Display all messages\n')
98 parser.add_argument('-m', help="""Specify absolute or relative path Clang pcm file to be loaded
99The pcm file (module) produced by this invocation of rootcling
100will not include any of the declarations already included in the
101pcm files loaded via -m. There can be more than one -m
102""")
103 parser.add_argument('-rmf', help="""Rootmap file name
104Name of the rootmap file. In order to be picked up by ROOT it must
105have .rootmap extension
106""")
107 parser.add_argument('-rml', help="""Rootmap library name
108Specify the name of the library which contains the autoload keys. This
109switch can be specified multiple times to autoload several libraries in
110presence of a particular key
111""")
112 parser.add_argument('-split', help="""Split the dictionary
113Split the dictionary in two, putting the ClassDef functions in a separate
114file
115""")
116 parser.add_argument('-s', help="""Target library name
117The flag -s must be followed by the name of the library that will
118contain the object file corresponding to the dictionary produced by
119this invocation of rootcling.
120The name takes priority over the one specified for the rootmapfile.
121The name influences the name of the created pcm:
122 1) If it is not specified, the pcm is called libINPUTHEADER_rdict.pcm
123 2) If it is specified, the pcm is called libTARGETLIBRARY_rdict.pcm
124 Any "liblib" occurence is transformed in the expected "lib"
125 3) If this is specified in conjunction with --multiDict, the output is
126 libTARGETLIBRARY_DICTIONARY_rdict.pcm
127""")
128 parser.add_argument('-multiDict', help="""Enable support for multiple pcms in one library
129Needs the -s flag. See its documentation.
130""")
131 parser.add_argument('-inlineInputHeader', help="""Add the argument header to the code of the dictionary
132This allows the header to be inlined within the dictionary
133""")
134 parser.add_argument('-interpreteronly', help='No IO information in the dictionary\n')
135 parser.add_argument('-noIncludePaths', help="""Do not store the headers' directories in the dictionary
136Instead, rely on the environment variable $ROOT_INCLUDE_PATH at runtime
137""")
138 parser.add_argument('-excludePath', help="""Specify a path to be excluded from the include paths
139specified for building this dictionary
140""")
141 parser.add_argument('--lib-list-prefix', help="""Specify libraries needed by the header files parsed
142This feature is used by ACliC (the automatic library generator).
143Rootcling will read the content of xxx.in for a list of rootmap files (see
144rlibmap). Rootcling will read these files and use them to deduce a list of
145libraries that are needed to properly link and load this dictionary. This
146list of libraries is saved in the first line of the file xxx.out; the
147remaining lines contains the list of classes for which this run of
148rootcling produced a dictionary
149""")
150 return parser
151
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
auto * a
Definition: textangle.C:12