2.4 Options to Set the Compiler State

For the following options, the order is important, and even in which order they are intermixed with the input files: When an input file is processed, the compiler state is determined by all options preceding it. Options may be overridden by other options given later on the command line.

Macro Directives

-D NAME, --define=NAME

Define macro NAME. Macros allow for conditional compilation using \ifdef NAME and \ifndef NAME macro directives.

-U NAME, --undefine=NAME

Undefines macro NAME.


-l MODULES, --environment=MODULES

Makes MODULES, a comma-separated list of pairs VAR=URL, available in the environment. For each VAR=URL, the module available through the functor at URL is obtained and VAR is bound to it. The source files then compiled can reference variable VAR.

Inserting Files

-I DIR, --incdir=DIR

Adds DIR to the head of OZPATH which is used to locate files to \insert.


Compile and execute the statement in FILE before processing the remaining options. For instance, this can be used to extend the compilation environment by executing a declare.

Compiler Switches

Most of the compiler switches can be set via command line options. Please refer to Appendix A of ``The Mozart Compiler'' for more detailed descriptions and defaults.

-g, --(no)debuginfo

Emits code with debugging information. Use this option if you want to use the Mozart Debugger. The -g option is actually an abbreviation for the combination of --controlflowinfo and --staticvarnames.


Include control flow information.


Include static variable name information.


Attach print names to variables created at run-time.

-p, --(no)profile

Emits code with profiling information. Use this option if you want to use the Mozart Profiler.


Allow Gump definitions.


Show compiler passes.


Warn about top-level redeclarations.


Warn about all redeclarations.


Warn about unused variables.


Warn about unused variables and formals.


Warn about forward class declarations.


Warn about missed optimizations.


Expect expressions, not statements.


Allow use of deprecated syntax.


Run static analysis.


Output the real non-fancy core syntax.


Annotate variable values in core output.


Annotate variable types in core output.

Compiler Options


Limit the number of errors reported to N.


Set the base URL to resolve imports of computed functors to STRING.


Set the directory where Gump output files are placed to STRING.

Denys Duchier, Leif Kornstaedt and Christian Schulte
Version 1.4.0 (20080702)