mmc - Melbourne Mercury Compiler, version 22.01.8 on x86_64-alpine-linux-musl

NAME  SYNOPSIS  NOTES  ARGUMENTS  OPTIONS  WARNING OPTIONS  VERBOSITY OPTIONS  OUTPUT OPTIONS  AUXILIARY OUTPUT OPTIONS  LANGUAGE SEMANTICS OPTIONS  TERMINATION ANALYSIS OPTIONS  COMPILE TIME GARBAGE COLLECTION OPTIONS  COMPILATION MODEL OPTIONS  Target selection compilation model options:  Optional feature compilation model options:  LLDS back−end compilation model options:  MLDS back−end compilation model options:  Developer compilation model options:  CODE GENERATION OPTIONS  Code generation target options:  OPTIMIZATION OPTIONS  High−level (HLDS −> HLDS) optimizations:  Medium−level (HLDS −> LLDS) optimizations:  Low−level (LLDS −> LLDS) optimizations:  MLDS −> MLDS optimizations:  Output−level (LLDS −> C) optimizations:  Target code compilation:  LINK OPTIONS  BUILD SYSTEM OPTIONS  MISCELLANEOUS OPTIONS  AUTHORS  COPYRIGHT  SEE ALSO 

NAME

mmc −− Melbourne Mercury Compiler, version 22.01.8 on x86_64−alpine−linux−musl

SYNOPSIS

mmc [<options>] <arguments>

NOTES

mmc is one of the development tools that are part of the Mercury distribution.

This manual page is limited to a brief summary. For further information see the Mercury User’s Guide.

ARGUMENTS

Arguments ending in ‘.m’ are assumed to be source file names. Arguments that do not end in ‘.m’ are assumed to be module names. Arguments in the form @file are replaced with the contents of the file.

OPTIONS

−?, −h, −−help

Print this usage message.

WARNING OPTIONS

−w, −−inhibit−warnings

Disable all warning messages.

−−inhibit−style−warnings

Disable all warning messages about programming style.

−−halt−at−warn

This option causes the compiler to treat all warnings as if they were errors when generating target code. This means that if the compiler issues any warning, it will not generate target code −−− instead, it will return a non−zero exit status.

−−halt−at−warn−make−interface

This option causes the compiler to treat all warnings as if they were errors when generating an interface file (a .int, .int0, .int2 or .int3 file). This means that if the compiler issues any warnings at that time, it will not generate the interface file −−− instead, it will return a non−zero exit status.

−−halt−at−warn−make−opt

This option causes the compiler to treat all warnings as if they were errors when generating an optimization file (.opt or .trans_opt file.) This means that if the compiler issues any warnings at that time, it will not generate the optimization file −−− instead, it will return a non−zero exit status.

−−halt−at−syntax−errors

This option causes the compiler to halt immediately after syntax checking and not do any semantic checking if it finds any syntax errors in the program.

−−no−halt−at−invalid−interface

This option operates when the compiler is invoked with the −−make−−interface option to generate .int and .int2 files for one or more modules. In its default setting, −−halt−at−invalid−interface, it causes the compiler to check the consistency of those parts of each of those modules that are intended to end up in the .int and .int2 files. If these checks find any problems, the compiler will stop without generating those files after printing an error message for each problem. Users can prevent this behavior, and thus allow the generation of invalid interface files, by specifying −−no−halt−at−invalid−interface.

−−no−warn−accumulator−swaps

Do not warn about argument order rearrangement caused by ‘−−introduce−accumulators’.

−−no−warn−singleton−vars, −−no−warn−singleton−variables

Do not warn about variables which only occur once.

−−no−warn−overlapping−scopes

Do not warn about variables which occur in overlapping scopes.

−−no−warn−det−decls−too−lax

Do not warn about determinism declarations which could have been stricter.

−−no−warn−inferred−erroneous

Do not warn about procedures whose determinism is inferred erroneous but whose determinism declarations are laxer.

−−no−warn−insts−without−matching−type

Do not warn about insts that are not consistent with any of the types in scope.

−−warn−insts−with−functors−without−type

Warn about insts that do specify functors but do not specify what type they are for.

−−warn−unused−imports

Warn about modules that are imported but not used.

−−no−warn−nothing−exported

Do not warn about modules which export nothing.

−−warn−unused−args

Warn about predicate arguments which are not used.

−−no−warn−interface−imports

Do not warn about modules imported in the interface, but which are not used in the interface.

−−warn−interface−imports−in−parents

Warn about modules that are imported in the interface of a parent module, but not used in the interface of that module.

−−no−warn−missing−opt−files

Disable warnings about ‘.opt’ files which cannot be opened.

−−warn−missing−trans−opt−files

Enable warnings about ‘.trans_opt’ files which cannot be opened.

−−no−warn−missing−trans−opt−deps

Disable warnings produced when the information required to allow ‘.trans_opt’ files to be read when creating other ‘.trans_opt’ files has been lost. The information can be recreated by running ‘mmake <mainmodule>.depend’

−−warn−inconsistent−pred−order−clauses

Generate a warning if the order of the definitions does not match the order of the declarations for either the exported predicates and functions of the module, or for the nonexported predicates and functions of the module. Applies for definitions by Mercury clauses.

−−warn−inconsistent−pred−order−foreign−procs

Generate a warning if the order of the definitions does not match the order of the declarations for either the exported predicates and functions of the module, or for the nonexported predicates and functions of the module. Applies for definitions by either Mercury clauses or foreign_proc pragmas.

−−no−warn−non−contiguous−decls

Do not generate a warning if the mode declarations of a predicate or function don’t all immediately follow its predicate or function declaration.

−−no−warn−non−contiguous−clauses

Do not generate a warning if the clauses of a predicate or function are not contiguous.

−−warn−non−contiguous−foreign−procs

Generate a warning if the clauses and foreign_procs of a predicate or function are not contiguous.

−−warn−non−stratification

Warn about possible non−stratification of the predicates and/or functions in the module. Non−stratification occurs when a predicate or function can call itself negatively through some path along its call graph.

−−no−warn−unification−cannot−succeed

Disable warnings about unifications which cannot succeed.

−−no−warn−simple−code

Disable warnings about constructs which are so simple that they are likely to be programming errors.

−−warn−duplicate−calls

Warn about multiple calls to a predicate with the same input arguments.

−−warn−implicit−stream−calls

Warn about calls to I/O predicates that could take explicit stream arguments, but do not do so.

−−no−warn−missing−module−name

Disable warnings for modules that do not start with a ‘:− module’ declaration.

−−no−warn−wrong−module−name

Disable warnings for modules whose ‘:− module’ declaration does not match the module’s file name.

−−no−warn−smart−recompilation

Disable warnings from the smart recompilation system.

−−no−warn−undefined−options−vars
−−no−warn−undefined−options−variables

Do not warn about references to undefined variables in options files with ‘−−make’.

−−warn−suspicious−recursion

Warn about recursive calls which are likely to have problems, such as leading to infinite recursion.

−−warn−non−tail−recursion <type>

Warn about recursive calls that are not tail calls, <type> may be "self", "self−and−mutual" or "none".

−−warn−obvious−non−tail−recursion

Warn about recursive calls that are not tail calls even if they obviously cannot be tail calls, because they are followed by other recursive calls.

−−no−warn−up−to−date

Do not warn if targets specified on the command line with ‘−−make’ are already up−to−date.

−−no−warn−stubs

Disable warnings about procedures for which there are no clauses. Note that this option only has any effect if the ‘−−allow−stubs’ option (described in the "Language Semantics Options" section below) is enabled.

−−warn−dead−procs

Warn about procedures which are never called.

−−warn−dead−preds

Warn about predicates that have no procedures which are ever called.

−−no−warn−target−code

Disable warnings from the compiler used to process the target code (e.g. gcc).

−−no−warn−table−with−inline

Disable warnings about tabled procedures that also have a ‘pragma inline’ declaration.

−−no−warn−non−term−special−preds

Do not warn about types that have user−defined equality or comparison predicates that cannot be proved to terminate. This option is only enabled when termination analysis is enabled. (See the "Termination Analysis Options" section below).

−−no−warn−known−bad−format−calls

Do not warn about calls to string.format or io.format that the compiler knows for sure contain mismatches between the format string and the supplied values.

−−no−warn−only−one−format−string−error

If a format string has more one than mismatch with the supplied, values, generate a warning for all mismatches, not just the first. The later mismatches may be avalanche errors caused by earlier mismatches.

−−warn−unknown−format−calls

Warn about calls to string.format or io.format for which the compiler cannot tell whether there are any mismatches between the format string and the supplied values.

−−no−warn−obsolete

Do not warn about calls to predicates or functions that have been marked as obsolete.

−−inform−ite−instead−of−switch

Generate informational messages for if−then−elses that could be replaced by switches.

−−inform−incomplete−switch

Generate informational messages for switches that do not cover all the function symbols that the switched−on variable could be bound to.

−−inform−incomplete−switch−threshold <N>

Have the −−inform−incomplete−switch option generate its messages only for switches that *do* cover at least N% of the function symbols that the switched−on variable could be bound to.

−−no−warn−unresolved−polymorphism

Do not warn about unresolved polymorphism.

−−warn−suspicious−foreign−procs

Warn about possible errors in the bodies of foreign procedures.

−−warn−suspicious−foreign−code

Warn about possible errors in the bodies of foreign code pragmas.

−−no−warn−state−var−shadowing

Do not warn about one state variable shadowing another.

−−no−warn−suspected−occurs−check−failure

Do not warn about code that looks like it unifies a variable with a term that contains that same variable. Such code cannot succeed because it fails what is called the ‘occurs check’.

−−warn−potentially−ambiguous−pragma

Generate warnings for pragmas that do not specify whether they are for a predicate or a function.

−−no−warn−stdlib−shadowing

Do not generate warnings for module names that either duplicate the name of a module in the Mercury standard library, or contain a subsequence of name components that do so.

−−no−inform−inferred

Do not generate messages about inferred types or modes.

−−no−inform−inferred−types

Do not generate messages about inferred types.

−−no−inform−inferred−modes

Do not generate messages about inferred modes.

−−inform−suboptimal−packing

Generate messages if the arguments of a data constructor could be packed more tightly if they were reordered.

VERBOSITY OPTIONS

−v, −−verbose

Output progress messages at each stage in the compilation.

−V, −−very−verbose

Output very verbose progress messages.

−E, −−verbose−error−messages

Explain error messages. Asks the compiler to give you a more detailed explanation of any errors it finds in your program.

−−no−verbose−make

Disable messages about the progress of builds using the ‘−−make’ option.

−−verbose−commands

Output each external command before it is run. Note that some commands will only be printed with ‘−−verbose’.

−−verbose−recompilation

When using ‘−−smart−recompilation’, output messages explaining why a module needs to be recompiled.

−−find−all−recompilation−reasons

Find all the reasons why a module needs to be recompiled, not just the first. Implies ‘−−verbose−recompilation’.

−−output−compile−error−lines <n>

With ‘−−make’, output the first <n> lines of the ‘.err’ file after compiling a module (default: 15).

−−report−cmd−line−args−doterr

Report the command line arguments.

−−report−cmd−line−args−in−doterr

Report the command line arguments for compilations whose output mmake normally redirects to a ‘.err’ file.

−S, −−statistics

Output messages about the compiler’s time/space usage. At the moment this option implies ‘−−no−trad−passes’, so you get information at the boundaries between phases of the compiler.

−−proc−size−statistics <filename>

Append information about the size of each procedure in the module in terms of goals and variables to the end of the named file.

−−limit−error−contexts filename:minline1−maxline1,minline2−maxline2

Print errors and warnings for the named file only when their line number is in one of the specified ranges. The minimum or maximum line number in each range may be omitted, in which case the range has no lower or upper bound respectively. Multiple −−limit−error−context options accumulate. If more than one −−limit−error−context option is given for the same file, only the last one will have an effect. If the file name and colon are missing, the limit will apply to all files.

−N, −−debug−modes

Output debugging traces of the mode checking.

−−debug−modes−statistics

Output statistics after each step of mode checking.

−−debug−modes−minimal

Output only minimal debugging traces of the mode checking.

−−debug−modes−verbose

Output detailed debugging traces of the mode checking.

−−debug−modes−pred−id <n>

With ‘−−debug−modes’, restrict the debugging traces to the mode checking of the predicate or function with the specified pred id.

−−debug−det, −−debug−determinism

Output detailed debugging traces of determinism analysis.

−−debug−opt

Output detailed debugging traces of the optimization process.

−−debug−opt−pred−id <n>

Output detailed debugging traces of the optimization process only for the predicate/function with the specified pred id.

−−debug−opt−pred−name <name>

Output detailed debugging traces of the optimization process only for the predicate/function with the specified name.

−−debug−pd

Output detailed debugging traces of the partial deduction and deforestation process.

−−debug−liveness <pred_id>

Output detailed debugging traces of the liveness analysis of the predicate with the given predicate id.

−−debug−make

Output detailed debugging traces of the ‘−−make’ option.

−−debug−trail−usage

Output detailed debugging traces of the ‘−−analyse−trail−usage’ option.

−−debug−intermodule−analysis

Output detailed debugging traces of the ‘−−intermodule−analysis’ option.

−−debug−indirect−reuse

Output detailed debugging traces of the indirect reuse pass of the ‘−−structure−reuse’ option.

−−debug−type−rep

Output debugging traces of type representation choices.

OUTPUT OPTIONS

These options are mutually exclusive. Only the first one specified will apply. If none of these options are specified, the default action is to link the named modules to produce an executable.
−f, −−generate−source−file−mapping

Output the module name to file name mapping for the list of source files given as non−option arguments to mmc to ‘Mercury.modules’. This must be done before ‘mmc −−generate−dependencies’ if there are any modules for which the file name does not match the module name. If there are no such modules the mapping need not be generated.

−M, −−generate−dependencies

Output ‘Make’−style dependencies for the module and all of its dependencies to ‘<module>.dep’.

−−generate−dependency−file

Output ‘Make’−style dependencies for the module to ‘<module>.d’.

−−generate−module−order

Output the strongly connected components of the module dependency graph in top−down order to ‘<module>.order’. Effective only if −−generate−dependencies is also specified.

−−generate−standalone−interface <basename>

Output a stand−alone interface. <basename> is used as the basename of any files generated for the stand−alone interface. (See the Stand−alone Interface chapter of the Mercury User’s Guide for further details.)

−i, −−make−int, −−make−interface

Write the module interface to ‘<module>.int’, and write the short interface to ‘<module>.int2’ This option should only be used by mmake.

−−make−priv−int, −−make−private−interface

Write the private interface to ‘<module>.int0’. This option should only be used by mmake.

−−make−short−int, −−make−short−interface

Write the unqualified short interface to ‘<module>.int3’. This option should only be used by mmake.

−−make−opt−int, −−make−optimization−interface

Write inter−module optimization information to ‘<module>.opt’. This option should only be used by mmake.

−−make−trans−opt
−−make−transitive−optimization−interface

Output transitive optimization information into the ‘<module>.trans_opt’ file. This option should only be used by mmake.

−x,−−make−xml−doc,−−make−xml−documentation

Output XML documentation of the module into the ‘<module>.xml’ file. This option should only be used by mmake.

−P, −−convert−to−mercury

Convert to Mercury. Output to file ‘<module>.ugly’ This option acts as a Mercury ugly−printer.

−t, −−typecheck−only

Just check that the code is syntactically correct and type−correct. Don’t check modes or determinism, and don’t generate any code.

−e, −−errorcheck−only

Check the module for errors, but do not generate any code.

−C, −−target−code−only

Generate target code (i.e. C code in ‘<module>.c’, C# code in ‘<module>.cs’, or Java code in ‘<module>.java’), but not object code.

−c, −−compile−only

Generate C code in ‘<module>.c’ and object code in ‘<module>.o’ but do not attempt to link the named modules.

−−output−grade−string

Compute the canonical string representing the currently selected grade, and print it on the standard output.

−−output−link−command

Print to standard output the command used to link executables.

−−output−shared−lib−link−command

Print to standard output the command used to link shared libraries

−−output−stdlib−grades

Print to standard output the list of compilation grades in which the Mercury standard library is available with this compiler.

−−output−libgrades

Print to standard output the list of compilation grades in which a library to be installed should be built.

−−output−cc

Print to standard output the command used to invoke the C compiler.

−−output−cc−type, −−output−c−compiler−type

Print the C compiler type to the standard output.

−−output−cflags

Print to standard output the flags with which the C compiler will be invoked.

−−output−csharp−compiler

Print to standard output the command used to invoke the C# compiler.

−−output−csharp−compiler−type

Print the C# compiler type to the standard output.

−−output−library−link−flags

Print to standard output the flags that are passed to linker in order to link against the current set of libraries. This includes the standard library, as well as any other libraries specified via the −−ml option.

−−output−grade−defines

Print to standard output the flags that are passed to the C compiler to define the macros whose values specify the compilation grade.

−−output−c−include−dir−flags, −−output−c−include−directory−flags

Print to standard output the flags that are passed to the C compiler to specify which directories to search for C header files. This includes the C header files from the standard library.

−−output−target−arch

Print the target architecture to the standard output.

−−output−class−dir, −−output−class−directory
−−output−java−class−dir, −−output−java−class−directory

Print to standard output the name of the directory in which generated Java class files will be placed.

−−output−stdlib−modules

Print to standard output the names of the modules in the Mercury standard library.

AUXILIARY OUTPUT OPTIONS

−−smart−recompilation

When compiling, write program dependency information to be used to avoid unnecessary recompilations if an imported module’s interface changes in a way which does not invalidate the compiled code. ‘−−smart−recompilation’ does not yet work with ‘−−intermodule−optimization’.

−−generate−mmc−deps
−−generate−mmc−make−module−dependencies

Generate dependencies for use by ‘mmc −−make’ even when using Mmake. This is recommended when building a library for installation.

−−trace {minimum, shallow, deep, rep, default}

Generate code that includes the specified level of execution tracing. See the Debugging chapter of the Mercury User’s Guide for details.

−−exec−trace−tail−rec

Generate TAIL events for self−tail−recursive calls instead of EXIT events. This allows these recursive calls to reuse their parent call’s stack frame, but it also means that the debugger won’t have access to the contents of the reused stack frames

−−trace−optimized

Do not disable optimizations that can change the trace.

−−trace−flag <keyword>

Enable the trace goals that depend on the <keyword> trace flag.

−−profile−optimized

Do not disable optimizations that can distort deep profiles.

−−no−delay−death

When the trace level is ‘deep’, the compiler normally preserves the values of variables as long as possible, even beyond the point of their last use, in order to make them accessible from as many debugger events as possible. However, it will not do this if this option is given.

−−delay−death−max−vars <N>

Delay the deaths of variables only when the number of variables in the procedure is no more than N. The default value is 1000.

−−stack−trace−higher−order

Enable stack traces through predicates and functions with higher−order arguments, even if stack tracing is not supported in general.

−−generate−bytecode

Output a bytecode form of the module for use by an experimental debugger.

−n, −−line−numbers

Put source line numbers into the generated code. The generated code may be in C (the usual case), or in Mercury (with the option −−convert−to−mercury).

−−no−line−numbers−around−foreign−code

Do not put source line numbers into the generated code around inclusions of foreign language code.

−−line−numbers−for−c−headers

Put source line numbers in the generated C header files. This can make it easier to track down any problems with C code in foreign_decl pragmas, but may cause unnecessary recompilations of other modules if any of these line numbers changes (e.g. because the location of a predicate declaration changes in the Mercury source file).

−−auto−comments

Output comments in the generated target language file. (The code may be easier to understand if you also use the ‘−−no−llds−optimize’ option.)

−−max−error−line−width <n>

Set the maximum width of an error message line to <n> characters (unless a long single word forces the line over this limit). Specifying −−no−max−error−line−width removes the limit.

−−show−definitions

Write out a list of the types, insts, modes, predicates, functions typeclasses and instances defined in the module to ‘<module>.defns’.

−−show−definition−line−counts

Write out a list of the predicates and functions defined in the module, together with the names of the files containing them and their approximate line counts, to ‘<module>.defn_line_counts’. The list will be ordered on the names and arities of the predicates and functions.

−−show−definition−extents

Write out a list of the predicates and functions defined in the module, together with the approximate line numbers of their first and last lines, to ‘<module>.defn_extents’. The list will be ordered on the starting line numbers of the predicates and functions.

−−show−local−type−representations

Write out information about the representations of all types defined in the module being compiled to ‘<module>.type_repns’.

−−show−all−type−representations

Write out information about the representations of all types visible in the module being compiled to ‘<module>.type_repns’.

−−show−dependency−graph

Write out the dependency graph to ‘<module>.dependency_graph’.

−−imports−graph

Write out the imports graph to ‘<module>.imports_graph’. The imports graph contains the directed graph module A imports module B. The resulting file can be processed by the graphviz tools. Effective only if −−generate−dependencies is also specified.

−d <n>, −−dump−hlds <stage number or name>

Dump the HLDS (high level intermediate representation) after the specified stage to ‘<module>.hlds_dump.<num>−<name>’. Stage numbers range from 1−599. Multiple dump options accumulate.

−−dump−hlds−pred−id <n>

Dump the HLDS only of the predicate/function with the given pred id.

−−dump−hlds−pred−name <name>

Dump the HLDS only of the predicate/function with the given name.

−−dump−hlds−options <options>

With ‘−−dump−hlds’, include extra detail in the dump. Each type of detail is included in the dump if its corresponding letter occurs in the option argument (see the Mercury User’s Guide for details).

−−dump−hlds−inst−limit <N>

Dump at most N insts in each inst table.

−−dump−hlds−file−suffix <suffix>

Append the given suffix to the names of the files created by the ‘−−dump−hlds’ option.

−−dump−same−hlds

Create a file for a HLDS stage even if the file notes only that this stage is identical to the previously dumped HLDS stage.

−−dump−mlds <stage number or name>

Dump the MLDS (medium level intermediate representation) after the specified stage, as C code, to‘<module>.c_dump.<num>−<name>’, and ‘<module>.h_dump.<num>−<name>’. Stage numbers range from 1−99. Multiple dump options accumulate.

−−dump−mlds−pred−name <pred or func name>

Dump the MLDS (medium level intermediate representation) of the predicate or function with the specified name at the stages specified by the −−dump−mlds option. The dump file will consist of the predicates and functions named by all the occurrences of this option (there may be more than one), and nothing else.

−−verbose−dump−mlds <stage number or name>

Dump the internal compiler representation of the MLDS, after the specified stage, to ‘<module>.mlds_dump.<num>−<name>’.

LANGUAGE SEMANTICS OPTIONS

(See the Mercury language reference manual for detailed explanations.)
−−no−reorder−conj

Execute conjunctions left−to−right except where the modes imply that reordering is unavoidable.

−−no−reorder−disj

Execute disjunctions strictly left−to−right.

−−no−fully−strict

Allow infinite loops or goals with determinism erroneous to be optimised away.

−−allow−stubs

Allow procedures to have no clauses. Any calls to such procedures will raise an exception at run−time. This option is sometimes useful during program development. (See also the documentation for the ‘−−warn−stubs’ option in the "Warning Options" section.)

−−infer−all

Abbreviation for ‘−−infer−types −−infer−modes −−infer−det’.

−−infer−types

If there is no type declaration for a predicate or function, try to infer the type, rather than just reporting an error.

−−infer−modes

If there is no mode declaration for a predicate, try to infer the modes, rather than just reporting an error.

−−no−infer−det, −−no−infer−determinism

If there is no determinism declaration for a procedure, don’t try to infer the determinism, just report an error.

−−type−inference−iteration−limit <n>

Perform at most <n> passes of type inference (default: 60).

−−mode−inference−iteration−limit <n>

Perform at most <n> passes of mode inference (default: 30).

−−event−set−file−name <filename>

Get the specification of user−defined events from <filename>.

TERMINATION ANALYSIS OPTIONS

−−enable−term, −−enable−termination

Analyse each predicate to discover if it terminates.

−−chk−term, −−check−term, −−check−termination

Enable termination analysis, and emit warnings for some predicates or functions that cannot be proved to terminate. In many cases where the compiler is unable to prove termination the problem is either a lack of information about the termination properties of other predicates, or because language constructs (such as higher order calls) were used which could not be analysed. In these cases the compiler does not emit a warning of non−termination, as it is likely to be spurious.

−−verb−chk−term, −−verb−check−term, −−verbose−check−termination

Enable termination analysis, and emit warnings for all predicates or functions that cannot be proved to terminate.

−−term−single−arg <n>, −−termination−single−argument−analysis <n>

When performing termination analysis, try analyzing recursion on single arguments in strongly connected components of the call graph that have up to <n> procedures. Setting this limit to zero disables single argument analysis.

−−termination−norm {simple, total, num−data−elems}

The norm defines how termination analysis measures the size of a memory cell. The ‘simple’ norm says that size is always one. The ‘total’ norm says that it is the number of words in the cell. The ‘num−data−elems’ norm says that it is the number of words in the cell that contain something other than pointers to cells of the same type.

−−term−err−limit <n>, −−termination−error−limit <n>

Print at most <n> reasons for any single termination error (default: 3).

−−term−path−limit <n>, −−termination−path−limit <n>

Perform termination analysis only on predicates with at most <n> paths (default: 256).

COMPILE TIME GARBAGE COLLECTION OPTIONS

−−structure−sharing

Perform structure sharing analysis.

−−structure−sharing−widening <n>

Perform widening when the set of structure sharing pairs becomes larger than <n>. When n=0, widening is not enabled. (default: 0).

−−structure−reuse, −−ctgc

Perform structure reuse analysis (Compile Time Garbage Collection).

−−structure−reuse−constraint {same_cons_id, within_n_cells_difference}
−−ctgc−constraint {same_cons_id, within_n_cells_difference}

Constraint on the way we allow structure reuse. ‘same_cons_id’ specifies that reuse is only allowed between terms of the same type and constructor. ‘within_n_cells_difference’ states that reuse is allowed as long as the arities between the reused term and new term does not exceed a certain threshold. The threshold needs to be set using ‘−−structure−reuse−constraint−arg’. (default: within_n_cells_difference, with threshold 0)

−−structure−reuse−constraint−arg, −−ctgc−constraint−arg

Specify the maximum difference in arities between the terms that can be reused, and the terms that reuse these terms. (default: 0)

COMPILATION MODEL OPTIONS

The following compilation options affect the generated code in such a way that the entire program must be compiled with the same setting of these options, and it must be linked to a version of the Mercury library which has been compiled with the same setting.
−s <grade>, −−grade <grade>

Select the compilation model. The <grade> should be one of the base grades ‘none’, ‘reg’, ‘asm_fast’, ‘hlc’, ‘java’ or, ‘csharp’. or one of those with one or more of the grade modifiers ‘.gc’, ‘.prof’, ‘.memprof’, ‘.profdeep’, ‘.tr’, ‘.spf’, ‘.stseg’, ‘.debug’, and/or ‘.par’ appended. Depending on your particular installation, only a subset of these possible grades will have been installed. Attempting to use a grade which has not been installed will result in an error at link time.

Target selection compilation model options:

−−target c (grades: none, reg, asm_fast, hlc)
−−target csharp (grades: csharp)
−−target java (grades: java)

Specify the target language: C, C# or Java. The default is C. Targets other than C imply ‘−−high−level−code’ (see below).

−−csharp

An abbreviation for ‘−−target csharp’.

−−csharp−only

An abbreviation for ‘−−target csharp −−target−code−only’. Generate C# code in ‘<module>.cs’, but do not generate object code.

−−java

An abbreviation for ‘−−target java’.

−−java−only

An abbreviation for ‘−−target java −−target−code−only’. Generate Java code in ‘<module>.java’, but do not generate object code.

−−compile−to−c

An abbreviation for ‘−−target c −−target−code−only’. Generate C code in ‘<module>.c’, but do not generate object code.

Optional feature compilation model options:

Debugging
−−debug (grade modifier: ‘.debug’)

Enable Mercury−level debugging. See the Debugging chapter of the Mercury User’s Guide for details. This option is not yet supported for the ‘−−high−level−code’ back−ends.

−−decl−debug (grade modifier: ‘.decldebug’)

Enable full support for declarative debugging. This allows subterm dependency tracking in the declarative debugger. See the Debugging chapter of the Mercury User’s Guide for details. This option is not yet supported for the ‘−−high−level−code’ back−ends.

Profiling
−p, −−profiling, −−time−profiling

(grade modifier: ‘.prof’) Enable time and call profiling. Insert profiling hooks in the generated code, and also output some profiling information (the static call graph) to the file ‘<module>.prof’. This option is not supported for the C# or Java back−ends.

−−memory−profiling (grade modifier: ‘.memprof’)

Enable memory and call profiling. This option is not supported for the C# or Java back−ends.

−−deep−profiling (grade modifier: ‘.profdeep’)

Enable deep profiling. This option is not supported for the high−level C, C# or Java back−ends.

−−no−coverage−profiling

Disable coverage profiling.

−−profile−for−feedback

Select deep profiling options suitable for profiler directed implicit parallelism. −−profile−for−implicit−parallelism is a deprecated synonym for this option

−−experimental−complexity <filename>

Enable experimental complexity analysis for the predicates listed in the given file. This option is supported for the C back−end, with ‘−−no−highlevel−code’.

−−threadscope (grade modifier: ‘.threadscope’)

Enable support for profiling parallel execution. This option is supported by the low−level C back−end parallel grades on some processors, See README.ThreadScope for details.

Miscellaneous optional features
−−gc {none, boehm, hgc, accurate, automatic}
−−garbage−collection {none, boehm, hgc, accurate, automatic}

(‘java’ and ‘csharp’ grades use ‘−−gc automatic’, ‘.gc’ grades use ‘−−gc boehm’, ‘.hgc’ grades use ‘−−gc hgc’, other grades use ‘−−gc none’.) Specify which method of garbage collection to use (default: boehm). ‘boehm’ is Hans Boehm et al’s conservative collector. ‘hgc’ is our own conservative collector; ‘accurate’ is our own type−accurate copying GC; it requires ‘−−high−level−code’. ‘automatic’ means the target language provides it. This is the case for the C# and Java back−ends, which always use the garbage collector of the underlying implementation.

−−use−trail (grade modifier: ‘.tr’)

Enable use of a trail. This is necessary for interfacing with constraint solvers, or for backtrackable destructive update. This option is not yet supported for the C# or Java backends.

−−trail−segments (grade modifier: ‘.trseg’)

This option is deprecated as trail segments are now used by default. The ‘.trseg’ grade modifier is a synonym for ‘.tr’.

−−parallel (grade modifier: ‘.par’)

Enable parallel execution support for the low−level C grades. Enable concurrency (via pthreads) for the high−level C grades.

−−maybe−thread−safe {yes, no}

Specify how to treat the ‘maybe_thread_safe’ foreign code attribute. ‘yes’ means that a foreign procedure with the ‘maybe_thread_safe’ option is treated as though it has a ‘thread_safe’ attribute. ‘no’ means that the foreign procedure is treated as though it has a ‘not_thread_safe’ attribute. The default is ‘no’.

−−single−prec−float (grade modifier: ‘.spf’)

Use single precision floats so that, on 32−bit machines, floating point values don’t need to be boxed. Double precision floats are used by default. This option is not supported for the C# or Java back−ends.

LLDS back−end compilation model options:

−−gcc−global−registers (grades: reg, asm_fast)
−−no−gcc−global−registers (grades: none)

Specify whether or not to use GNU C’s global register variables extension. This option is ignored if the ‘−−high−level−code’ option is enabled.

−−gcc−non−local−gotos (grades: asm_fast)
−−no−gcc−non−local−gotos (grades: none, reg)

Specify whether or not to use GNU C’s "labels as values" extension. This option is ignored if the ‘−−high−level−code’ option is enabled.

−−asm−labels (grades: asm_fast)
−−no−asm−labels (grades: none, reg)

Specify whether or not to use GNU C’s asm extensions for inline assembler labels. This option is ignored if the ‘−−high−level−code’ option is enabled.

−−stack−segments (grade modifier: ‘.stseg’)

Specify whether to use dynamically sized stacks that are composed of small segments. This can help to avoid stack exhaustion at the cost of increased execution time. This option is not supported by the ‘−−high−level−code’ back−ends.

MLDS back−end compilation model options:

−H, −−high−level−code (grades: hlc, csharp, java)

Use an alternative back−end that generates high−level code rather than the very low−level code that is generated by our original back−end.

Developer compilation model options:

Data representation
−−num−ptag−bits <n> (This option is not for general use.)

Use <n> primary tag bits.

Developer optional features
−−use−minimal−model−stack−copy

(This option is not for general use.) Enable the use of the standard form of minimal model tabling.

−−use−minimal−model−own−stacks

(This option is not for general use.) Enable the use of an experimental form of minimal model tabling.

−−minimal−model−debug

(This option is not for general use.) Enables extra data structures that assist in debugging minimal model tabling.

−−no−type−layout

(This option is not for general use.) Don’t output type_ctor_layout structures or references to them. (The C code also needs to be compiled with ‘−DNO_TYPE_LAYOUT’).

CODE GENERATION OPTIONS

−−no−trad−passes

The default ‘−−trad−passes’ completely processes each predicate before going on to the next predicate. This option tells the compiler to complete each phase of code generation on all predicates before going on the next phase on all predicates.

−−no−reclaim−heap−on−nondet−failure

Don’t reclaim heap on backtracking in nondet code.

−−no−reclaim−heap−on−semidet−failure

Don’t reclaim heap on backtracking in semidet code.

−−no−reclaim−heap−on−failure

Combines the effect of the two options above.

−−max−jump−table−size=<n>

The maximum number of entries a jump table can have. The special value 0 indicates the table size is unlimited. This option can be useful to avoid exceeding fixed limits imposed by some C compilers.

−−fact−table−max−array−size <n>

Specify the maximum number of elements in a single ‘:− pragma fact_table’ data array (default: 1024).

−−fact−table−hash−percent−full <percentage>

Specify how full the ‘:− pragma fact_table’ hash tables should be allowed to get. Given as an integer percentage (valid range: 1 to 100, default: 90).

Code generation target options:

−−branch−delay−slot (This option is not for general use.)

Assume that branch instructions have a delay slot.

−−num−real−r−regs <n> (This option is not for general use.)

Assume registers r1 up to r<n> are real general purpose registers.

−−num−real−f−regs <n> (This option is not for general use.)

Assume registers f1 up to f<n> are real floating point registers.

−−num−real−r−temps <n> (This option is not for general use.)

Assume that <n> non−float temporaries will fit into real machine registers.

−−num−real−f−temps <n> (This option is not for general use.)

Assume that <n> float temporaries will fit into real machine registers.

OPTIMIZATION OPTIONS

−O <n>, −−opt−level <n>, −−optimization−level <n>

Set optimization level to <n>. Optimization level −1 means no optimization while optimization level 6 means full optimization.

−−opt−space, −−optimize−space

Turn on optimizations that reduce code size and turn off optimizations that significantly increase code size.

−−intermod−opt
−−intermodule−optimization

Perform inlining and higher−order specialization of the code for predicates imported from other modules. This option must be set throughout the compilation process.

−−trans−intermod−opt
−−transitive−intermodule−optimization

Import the transitive intermodule optimization data. This data is imported from ‘<module>.trans_opt’ files. Note that ‘−−transitive−intermodule−optimization’ does not work with ‘mmc −−make’.

−−no−read−opt−files−transitively

Only read the inter−module optimization information for directly imported modules, not the transitive closure of the imports.

−−use−opt−files

Perform inter−module optimization using any ‘.opt’ files which are already built, e.g. those for the standard library, but do not build any others.

−−use−trans−opt−files

Perform inter−module optimization using any ‘.trans_opt’ files which are already built, e.g. those for the standard library, but do not build any others.

−−intermodule−analysis

Perform analyses such as termination analysis and unused argument elimination across module boundaries. This option is not yet fully implemented.

−−analysis−repeat <n>

The maximum number of times to repeat analyses of suboptimal modules with ‘−−intermodule−analysis’ (default: 0).

High−level (HLDS −> HLDS) optimizations:

−−no−inlining

Disable all forms of inlining.

−−no−inline−simple

Disable the inlining of simple procedures.

−−no−inline−builtins

Generate builtins (e.g. arithmetic operators) as calls to out−of−line procedures. This is done by default when, debugging, as without this option the execution of builtins is not traced.

−−no−inline−single−use

Disable the inlining of procedures called only once.

−−inline−call−cost <cost>

Assume that the cost of a call is the given parameter. Used only in conjunction with ‘−−inline−compound−threshold’. multiplied by the number of times it is called,

−−inline−compound−threshold <threshold>

Inline a procedure if its size (measured roughly in terms of the number of connectives in its internal form) less the assumed call cost, multiplied by the number of times it is called is below the given threshold.

−−inline−simple−threshold <threshold>

Inline a procedure if its size is less than the given threshold.

−−intermod−inline−simple−threshold

Similar to ‘−−inline−simple−threshold’, except used to determine which predicates should be included in ‘.opt’ files. Note that changing this between writing the ‘.opt’ file and compiling to C may cause link errors, and too high a value may result in reduced performance.

−−inline−vars−threshold <threshold>

Don’t inline a call if it would result in a procedure containing more than <threshold> variables. Procedures containing large numbers of variables can cause slow compilation.

−−inline−linear−tail−rec−sccs

Given a set of mutually recursive procedures (an SCC, or strongly connected component, of the call graph) in which each procedure contains exactly tail call to a procedure in the SCC, so that the tail recursive calls form a linear chain through the SCC, inline the callee at every one of those mutually tail recursive call sites. This converts mutual tail recursion into self tail recursion, which the MLDS backend can turn into code that runs in constant stack space.

−−no−const−struct

Disable the gathering of constant structures in a separate table.

−−no−common−struct

Disable optimization of common term structures.

−−constraint−propagation

Enable the constraint propagation transformation, which attempts to transform the code so that goals which can fail are executed as early as possible.

−−local−constraint−propagation

Enable the constraint propagation transformation, but only rearrange goals within each procedure. Specialized versions of procedures will not be created.

−−no−follow−code

Don’t migrate into the end of branched goals.

−−excess−assign

Remove excess assignment unifications.

−−no−optimize−format−calls

Do not attempt to interpret the format string in calls to string.format and related predicates at compile time; always leave this to be done at runtime.

−−optimize−duplicate−calls

Optimize away multiple calls to a predicate with the same input arguments.

−−loop−invariants

Hoist loop invariants out of loops.

−−delay−constructs

Reorder goals to move construction unifications after primitive goals that can fail.

−−optimize−saved−vars

Minimize the number of variables saved across calls.

−−optimize−unused−args

Remove unused predicate arguments. This will cause the compiler to generate more efficient code for many polymorphic predicates.

−−intermod−unused−args

Perform unused argument removal across module boundaries. This option implies ‘−−optimize−unused−args’ and ‘−−intermodule−optimization’.

−−optimize−higher−order

Enable specialization of higher−order predicates.

−−type−specialization

Enable specialization of polymorphic predicates where the polymorphic types are known.

−−user−guided−type−specialization

Enable specialization of polymorphic predicates for which there are ‘:− pragma type_spec’ declarations.

−−higher−order−size−limit

Set the maximum goal size of specialized versions created by ‘−−optimize−higher−order’ and ‘−−type−specialization’. Goal size is measured as the number of calls, unifications and branched goals.

−−higher−order−arg−limit <limit>

Set the maximum size of higher−order arguments to be specialized by ‘−−optimize−higher−order’ and ‘−−type−specialization’.

−−unneeded−code

Remove goals from computation paths where their outputs are not needed, provided the semantics options allow the deletion or movement of the goal.

−−unneeded−code−copy−limit

Gives the maximum number of places to which a goal may be copied when removing it from computation paths on which its outputs are not needed. A value of zero forbids goal movement and allows only goal deletion; a value of one prevents any increase in the size of the code.

−−introduce−accumulators

Attempt to introduce accumulating variables into procedures, so as to make them tail recursive.

−−optimize−constructor−last−call

Enable the optimization of "last" calls that are followed by constructor application.

−−deforestation

Enable deforestation. Deforestation is a program transformation whose aim is to avoid the construction of intermediate data structures and to avoid repeated traversals over data structures within a conjunction.

−−deforestation−depth−limit <limit>

Specify a depth limit to prevent infinite loops in the deforestation algorithm. A value of −1 specifies no depth limit. The default is 4.

−−deforestation−vars−threshold <threshold>

Specify a rough limit on the number of variables in a procedure created by deforestation. A value of −1 specifies no limit. The default is 200.

−−deforestation−size−threshold <threshold>

Specify a rough limit on the size of a goal to be optimized by deforestation. A value of −1 specifies no limit. The default is 15.

−−analyse−exceptions

Enable exception analysis. Identify those procedures that will not throw an exception. Some optimizations can make use of this information.

−−analyse−trail−usage

Enable trail usage analysis. Identify those procedures that will not modify the trail. This information is used to reduce the overhead of trailing.

−−analyse−mm−tabling

Identify those goals that do not call procedures that are evaluated using minimal model tabling. This information is used to reduce the overhead of minimal model tabling.

Medium−level (HLDS −> LLDS) optimizations:

−−no−smart−indexing

Generate switches as simple if−then−else chains; disable string hashing and integer table−lookup indexing.

−−dense−switch−req−density <percentage>

The jump table generated for an atomic switch must have at least this percentage of full slots (default: 25).

−−lookup−switch−req−density <percentage>

The jump table generated for an atomic switch in which all the outputs are constant terms must have at least this percentage of full slots (default: 25).

−−dense−switch−size <n>

The jump table generated for an atomic switch must have at least this many entries (default: 4).

−−lookup−switch−size <n>

The lookup table generated for an atomic switch must have at least this many entries (default: 4).

−−string−trie−switch−size <n>

The trie generated for a string switch must have at least this many entries (default: 16).

−−string−hash−switch−size <n>

The hash table generated for a string switch must have at least this many entries (default: 8).

−−string−binary−switch−size <n>

The binary search table generated for a string switch must have at least this many entries (default: 4).

−−tag−switch−size <n>

The number of alternatives in a tag switch must be at least this number (default: 3).

−−try−switch−size <n>

The number of alternatives in a try/retry chain switch must be at least this number (default: 3).

−−binary−switch−size <n>

The number of alternatives in a binary search switch must be at least this number (default: 4).

−−no−static−ground−terms

Disable the optimization of constructing constant ground terms at compile time and storing them as static constants. Note that auxiliary data structures created by the compiler for purposes such as debugging will still be created as static constants.

−−no−use−atomic−cells

Don’t use the atomic variants of the Boehm gc allocator calls, even when this would otherwise be possible.

−−no−middle−rec

Disable the middle recursion optimization.

−−no−simple−neg

Don’t generate simplified code for simple negations.

Low−level (LLDS −> LLDS) optimizations:

−−no−common−data

Disable optimization of common data structures.

−−no−common−layout−data

Disable optimization of common subsequences in layout structures.

−−no−llds−optimize

Disable the low−level optimization passes.

−−optimize−dead−procs

Enable dead predicate elimination.

−−no−optimize−peep

Disable local peephole optimizations.

−−no−optimize−jumps

Disable elimination of jumps to jumps.

−−no−optimize−fulljumps

Disable elimination of jumps to ordinary code.

−−pessimize−tailcalls

Disable the optimization of tailcalls.

−−checked−nondet−tailcalls

Convert nondet calls into tail calls whenever possible, even when this requires a runtime check. This option tries to minimize stack consumption, possibly at the expense of speed.

−−no−use−local−vars

Disable the transformation to use local variables in C code blocks wherever possible.

−−no−optimize−labels

Disable elimination of dead labels and code.

−−optimize−dups

Enable elimination of duplicate code within procedures.

−−optimize−proc−dups

Enable elimination of duplicate procedures.

−−no−optimize−frames

Disable stack frame optimizations.

−−no−optimize−delay−slot

Disable branch delay slot optimizations.

−−optimize−reassign

Optimize away assignments to locations that already hold the assigned value.

−−optimize−repeat <n>

Iterate most optimizations at most <n> times (default: 3).

−−layout−compression−limit <n>

Attempt to compress the layout structures used by the debugger only as long as the arrays involved have at most <n> elements (default: 4000).

MLDS −> MLDS optimizations:

−−no−mlds−optimize

Disable the MLDS−>MLDS optimization passes.

−−no−mlds−peephole

Do not perform peephole optimization of the MLDS.

−−no−optimize−tailcalls

Treat tailcalls as ordinary calls, rather than optimizing by turning self−tailcalls into loops.

−−no−optimize−initializations

Leave initializations of local variables as assignment statements, rather than converting such assignment statements into initializers.

−−eliminate−local−vars

Eliminate local variables with known values, where possible, by replacing occurrences of such variables with their values.

−−no−generate−trail−ops−inline

Do not generate trailing operations inline, but instead insert calls to the versions of these operations in the standard library.

Output−level (LLDS −> C) optimizations:

−−use−macro−for−redo−fail

Emit the fail or redo macro instead of a branch to the fail or redo code in the runtime system. This produces slightly bigger but slightly faster code.

−−no−emit−c−loops

Use only gotos, don’t emit C loop constructs.

−−procs−per−c−function <n>

Put the code for up to <n> Mercury procedures in a single C function. The default value of <n> is one. Increasing <n> can produce slightly more efficient code, but makes compilation slower.

−−everything−in−one−c−function

This option has the effect of putting the code for all the Mercury procedures in a single C function, which produces the most efficient code but tends to severely stress the C compiler on large modules.

−−no−local−thread−engine−base

Do not copy the thread−local Mercury engine base address into local variables. This option only affects low−level parallel grades not using the GNU C global register variables extension.

Target code compilation:

Note that if you are using Mmake, you need to pass these options to the target code compiler (e.g. ‘mgnuc’) rather than to ‘mmc’.
−−target−debug

Enable debugging of the generated target code. If the target language is C, this has the same effect as ‘−−c−debug’ (see below). If the target language is C#, this causes the compiler to pass ‘/debug’ to the C# compiler.)

−−cc <compiler−name>

Specify which C compiler to use.

−−no−c−optimize

Don’t enable the C compiler’s optimizations.

−−no−ansi−c

Don’t specify to the C compiler that the ANSI dialect of C should be used. Use the full contents of system headers, rather than the ANSI subset.

−−c−debug

Enable debugging of the generated C code. (This has the same effect as ‘−−cflags "−g"’ and disables stripping of the executable.)

−−c−include−directory <dir>, −−c−include−dir <dir>

Append <dir> to the list of directories to be searched for C header files. Note that if you want to override this list, rather than append to it, then you can set the ‘MERCURY_MC_ALL_C_INCL_DIRS’ environment variable to a sequence of ‘−−c−include−directory’ options.

−−inline−alloc

Inline calls to GC_malloc(). This can improve performance a fair bit, but may significantly increase code size. This option has no effect if ‘−−gc boehm’ is not set or if the C compiler is not GNU C.

−−cflags <options>, −−cflag <option>

Specify options to be passed to the C compiler. ‘−−cflag’ should be used for single words which need to be quoted when passed to the shell.

−−javac <javac>
−−java−compiler <javac>

Specify which Java compiler to use. The default is ‘javac’.

−−java−interpreter <java>

Specify which Java interpreter to use. The default is ‘java’

−−java−flags <options>, −−java−flag <option>

Specify options to be passed to the Java compiler. ‘−−java−flag’ should be used for single words which need to be quoted when passed to the shell.

−−java−classpath <path>

Set the classpath for the Java compiler.

−−java−object−file−extension <ext>

Specify an extension for Java object (bytecode) files By default this is ‘.class’.

−−csharp−compiler <csc>

Specify the name of the C# Compiler. The default is ‘csc’.

−−csharp−flags <options>, −−csharp−flag <option>

Specify options to be passed to the C# compiler. ‘−−csharp−flag’ should be used for single words which need to be quoted when passed to the shell.

−−cli−interpreter <prog>

Specify the program that implements the Common Language Infrastructure (CLI) execution environment, e.g. ‘mono’.

LINK OPTIONS

−o <filename>, −−output−file <filename>

Specify the name of the final executable. (The default executable name is the same as the name of the first module on the command line.) This option is ignored by ‘mmc −−make’.

−−ld−flags <options>, −−ld−flag <option>

Specify options to be passed to the linker command invoked by ml to link an executable. Use ‘ml −−print−link−command’ to find out which command is used. ‘−−ld−flag’ should be used for single words which need to be quoted when passed to the shell.

−−ld−libflags <options>, −−ld−libflag <option>

Specify options to be passed to the linker command invoked by ml to link a shared library. Use ‘ml −−print−shared−lib−link−command’ to find out which command is used. ‘−−ld−libflag’ should be used for single words which need to be quoted when passed to the shell.

−L <directory>, −−library−directory <directory>

Append <directory> to the list of directories in which to search for libraries.

−R <directory>, −−runtime−library−directory <directory>

Append <directory> to the list of directories in which to search for shared libraries at runtime.

−−no−default−runtime−library−directory

Do not add any directories to the runtime search path automatically.

−−shlib−linker−install−name−path <directory>

Specify the path where a shared library will be installed. This option is useful on systems where the runtime search path is obtained from the shared library and not via the −R option above (such as Mac OS X).

−l <library>, −−library <library>

Link with the specified library.

−−link−object <file>

Link with the specified object or archive file.

−−search−lib−files−dir <directory>
−−search−library−files−directory <directory>

Search <directory> for Mercury library files that have not yet been installed. Similar to adding <directory> using all of the ‘−−search−directory’, ‘−−intermod−directory’, ‘−−library−directory’, ‘−−init−file−directory’ and ‘−−c−include−directory’ options.

−−mld <directory>, −−mercury−library−directory <directory>

Append <directory> to the list of directories to be searched for Mercury libraries. This will add ‘−−search−directory’, ‘−−library−directory’, ‘−−init−file−directory’ and ‘−−c−include−directory’ options as needed.

−−mercury−standard−library−directory <directory>
−−mercury−stdlib−dir <directory>

Search <directory> for the Mercury standard library. Implies ‘−−mercury−library−directory <directory>’ and ‘−−mercury−configuration−directory <directory>’.

−−no−mercury−standard−library−directory
−−no−mercury−stdlib−dir

Don’t use the Mercury standard library. Implies ‘−−no−mercury−configuration−directory’.

−−ml <library>, −−mercury−library <library>

Link with the specified Mercury library.

−−linkage {shared, static}

Specify whether to use shared or static linking for executables. Shared libraries are always linked with ‘−−linkage shared’.

−−mercury−linkage {shared, static}

Specify whether to use shared or static linking when linking an executable with Mercury libraries. Shared libraries are always linked with ‘−−mercury−linkage shared’.

−−init−file−directory <directory>

Append <directory> to the list of directories to be searched for ‘.init’ files by c2init.

−−init−file <init−file>

Append <init−file> to the list of ‘.init’ files to be passed to c2init.

−−trace−init−file <init−file>

Append <init−file> to the list of ‘.init’ files to be passed to c2init when tracing is enabled.

−−no−demangle

Don’t pipe link errors through the Mercury demangler.

−−no−main

Don’t generate a C main() function. The user’s code must provide a main() function.

−−no−allow−undefined

Do not allow undefined symbols in shared libraries.

−−no−use−readline

Disable use of the readline library in the debugger.

−−runtime−flags <flags>

Specify flags to pass to the Mercury runtime.

−−extra−initialization−functions, −−extra−inits

Search ‘.c’ files for extra initialization functions. (This may be necessary if the C files contain hand−coded C code with ‘INIT’ comments, rather than containing only C code that was automatically generated by the Mercury compiler.)

−−link−executable−command <command>

Specify the command used to invoke the linker when linking an executable.

−−link−shared−lib−command <command>

Specify the command used to invoke the linker when linking a shared library.

−−no−strip

Do not strip executables.

−−strip−executable−command <command>

Specify the command used to strip executables if no linker flag to do so is available. This option has no effect on ml.

−−strip−executable−shared−flags <options>

Specify options to pass to the strip executable command when linking against Mercury shared libraries.

−−strip−executable−static−flags <options>

Specify options to pass to the strip executable command when linking against Mercury static libraries.

−−java−archive−command <command>

Specify the command used to produce Java archive (JAR) files.

−−framework <framework>

Build and link against the specified framework. (Mac OS X only.)

−F <directory>, −−framework−directory <directory>

Append the specified directory to the framework search path. (Mac OS X only.)

−−sign−assembly <keyfile>

Sign the current assembly with the strong name contained in the specified key file. (This option is only meaningful when generating library assemblies with the C# back−end.)

−−cstack−reserve−size <size>

Set the total size of the C stack in virtual memory for executables. The stack size is given in bytes. (Microsoft Windows only.)

BUILD SYSTEM OPTIONS

−m, −−make

Treat the non−option arguments to ‘mmc’ as files to make, rather than source files. Create the specified files, if they are not already up−to−date. Note that this option also enables ‘−−use−subdirs’.

−r, −−rebuild

Same as ‘−−make’, but always rebuild the target files even if they are up−to−date.

−k, −−keep−going

With ‘−−make’, keep going as far as possible even if an error is detected.

−j <n>, −−jobs <n>

With ‘−−make’, attempt to perform up to <n> jobs concurrently for some tasks.

−−track−flags

With ‘−−make’, keep track of the options used when compiling each module. If an option for a module is added or removed, ‘mmc −−make’ will then know to recompile the module even if the timestamp on the file itself has not changed. Warning, verbosity and build system options are not tracked.

−−pre−link−command <command>

Specify a command to run before linking with ‘mmc −−make’. This can be used to compile C source files which rely on header files generated by the Mercury compiler. The command will be passed the names of all of the source files in the program or library, with the source file containing the main module given first.

−−extra−init−command <command>

Specify a command to produce extra entries in the ‘.init’ file for a library. The command will be passed the names of all of the source files in the program or library, with the source file containing the main module given first.

−−install−prefix <dir>

The directory under which to install Mercury libraries.

−−install−command <command>

Specify the command to use to install the files in Mercury libraries. The given command will be invoked as ‘<command> <source> <target>’ to install each file in a Mercury library. The default command is ‘cp’.

−−install−command−dir−option <option>

Specify the flag to pass to the install command to install a directory. The given command will be invoked as ‘<command> <option> <source> <target>’ to install each directory. The default option is ‘−R’.

−−no−detect−libgrades

Do not scan the installation directory to determine which standard library grades are available.

−−libgrade <grade>

Add <grade> to the list of compilation grades in which a library to be installed should be built.

−−no−libgrade

Clear the list of compilation grades in which a library to be installed should be built.

−−libgrades−include−component <component>
−−libgrades−include <component>

Remove grades that do not contain the specified component from the set of library grades to be installed. (This option does not work with Mmake, only ‘mmc −−make’.)

−−libgrades−exclude−component <component>
−−libgrades−exclude <component>

Remove grades that contain the specified component from the set of library grades to be installed. (This option does not work with Mmake, only ‘mmc −−make’.)

−−lib−linkage {shared, static}

Specify whether libraries should be installed for shared or static linking. This option can be specified multiple times. By default libraries will be installed for both shared and static linking.

−−flags <file>
−−flags−file <file>

Take options from the specified file, and handle them as if they were specified on the command line.

−−options−file <file>

Add <file> to the list of options files to be processed. If <file> is ‘−’, an options file will be read from the standard input. By default the file ‘Mercury.options’ in the current directory will be read.

−−options−search−directory <dir>

Add <dir> to the list of directories to be searched for options files.

−−mercury−configuration−directory <directory>
−−mercury−config−dir <directory>

Search <directory> for Mercury system’s configuration files.

−−config−file <file>

Read the Mercury compiler’s configuration information from <file>. If the ‘−−config−file’ option is not set, a default configuration will be used, unless ‘−−no−mercury−stdlib−dir’ is passed to mmc. The configuration file is just an options file.

−I <dir>, −−search−directory <dir>

Append <dir> to the list of directories to be searched for imported modules.

−−intermod−directory <dir>

Add <dir> to the list of directories to be searched for ‘.opt’ files.

−−no−use−search−directories−for−intermod

Don’t add arguments to ‘−−search−directory’ to the list of directories to search for ‘.opt’ files − use only the directories given by ‘−−intermod−directory’.

−−use−subdirs

Generate intermediate files in a ‘Mercury’ subdirectory, rather than generating them in the current directory.

−−use−grade−subdirs

Generate intermediate files in a ‘Mercury’ subdirectory, laid out so that multiple grades can be built simultaneously. Executables and libraries will be symlinked or copied into the current directory. ‘−−use−grade−subdirs’ does not work with Mmake (it does work with ‘mmc −−make’).

−−no−libgrade−install−check

Do not check that libraries have been installed before attempting to use them. (This option is only meaningful with ‘mmc −−make’.)

−−order−make−by−timestamp

Make ‘mmc −−make’ compile more recently modified source files first.

−−show−make−times

Report run times for commands executed by ‘mmc −−make’.

−−extra−library−header <file>, −−extra−lib−header <file>

Install the specified C header file with along with a Mercury library. (This option is only supported by ‘mmc −−make’.)

−−restricted−command−line

Enable this option if your shell doesn’t support long command lines. This option uses temporary files to pass arguments to sub−commands. (This option is only supported by ‘mmc −−make’.)

−−env−type <type>

Specify the environment type in which the compiler and generated programs will be invoked. The <type> should be one of ‘posix’, ‘cygwin’, ‘msys’, or ‘windows’. This option is equivalent to setting all of ‘−−host−env−type’, ‘−−system−env−type’ and ‘−−target−env−type’ to <type>.

−−host−env−type <type>

Specify the environment type in which the compiler will be invoked.

−−system−env−type <type>

Specify the environment type in which external programs invoked by the compiler will run. If not specified, this defaults to the value given by ‘−−host−env−type’.

−−target−env−type <type>

Specify the environment type in which generated programs will be invoked.

MISCELLANEOUS OPTIONS

−−filenames−from−stdin

Read then compile a newline terminated module name or file name from the standard input. Repeat this until EOF is reached. (This allows a program or user to interactively compile several modules without the overhead of process creation for each one.)

−−typecheck−ambiguity−warn−limit <n>

Set the number of type assignments required to generate a warning about highly ambiguous overloading to <n>.

−−typecheck−ambiguity−error−limit <n>

Set the number of type assignments required to generate an error about excessively ambiguous overloading to <n>. If this limit is reached, the typechecker will not process the predicate or function any further.

−−version

Display the compiler version.

−−control−granularity

Don’t try to generate more parallelism than the machine can handle, which may be specified at runtime or detected automatically.

−−distance−granularity <distance>

Control the granularity of parallel execution using the specified distance value.

−−implicit−parallelism

Introduce parallel conjunctions where it could be worthwhile (implicit parallelism) using information generated by mdprof_create_feedback. The profiling feedback file can be specified using the ‘−−feedback−file’ option.

−−feedback−file <file>

Use the specified profiling feedback file which may currently only be processed for implicit parallelism.

AUTHORS

The Mercury team.

COPYRIGHT

This program and its documentation are copyright by the University of Melbourne and the Mercury team. They may be copied only under the terms of the GNU General Public License − see the file COPYING in the Mercury distribution.

SEE ALSO

The Mercury User’s Guide.

<http://www.mercurylang.org/information/documentation.html>


Updated 2024-01-29 - jenkler.se | uex.se