ocamlrun - The Objective Caml bytecode interpreter
filename argument ...
command executes bytecode files produced by the
linking phase of the
The first non-option argument is taken to be the name of the file
containing the executable bytecode. (That file is searched in the
executable path as well as in the current directory.) The remaining
arguments are passed to the Objective Caml program, in the string array
Element 0 of this array is the name of the
bytecode executable file; elements 1 to
are the remaining arguments.
In most cases, the bytecode
executable files produced by the
command are self-executable,
and manage to launch the
command on themselves automatically.
The following command-line options are recognized by
When the program aborts due to an uncaught exception, print a detailed
"back trace" of the execution, showing where the exception was
raised and which function calls were outstanding at this point. The
back trace is printed only if the bytecode executable contains
debugging information, i.e. was compiled and linked with the
set. This option is equivalent to setting the
flag in the OCAMLRUNPARAM environment variable (see below).
Search the directory
for dynamically-loaded libraries, in addition to the standard search path.
Print the names of the primitives known to this version of
Direct the memory manager to print verbose messages on standard error.
This is equivalent to setting
in the OCAMLRUNPARAM environment variable (see below).
Print version and exit.
The following environment variable are also consulted:
Additional directories to search for dynamically-loaded libraries.
The directory containing the Objective Caml standard
is not set,
will be used instead.) Used to locate the ld.conf configuration file for
dynamic loading. If not set,
default to the library directory specified when compiling Objective Caml.
Set the runtime system options and garbage collection parameters.
(If OCAMLRUNPARAM is not set, CAMLRUNPARAM will be used instead.)
This variable must be a sequence of parameter specifications.
A parameter specification is an option letter followed by an =
sign, a decimal number (or a hexadecimal number prefixed by
and an optional multiplier. There are nine options, six of which
correspond to the fields of the
record documented in
The Objective Caml user's manual,
chapter "Standard Library", section "Gc".
Trigger the printing of a stack backtrace
when an uncaught exception aborts the program.
This option takes no argument.
Turn on debugging support for
parsers. When this option is on,
the pushdown automaton that executes the parsers prints a
trace of its actions. This option takes no argument.
The policy used for allocating in the OCaml heap. Possible values
are 0 for the next-fit policy, and 1 for the first-fit
policy. Next-fit is somewhat faster, but first-fit is better for
avoiding fragmentation and the associated heap compactions.
The size of the minor heap (in words).
The default size increment for the major heap (in words).
The major GC speed setting.
The heap compaction trigger setting.
The limit (in words) of the stack size.
The initial size of the major heap (in words).
What GC messages to print to stderr. This is a sum of values selected
from the following:
Start of major GC cycle.
Minor collection and major GC slice.
Growing and shrinking of the heap.
Resizing of stacks and memory manager tables.
The multiplier is
for multiplication by 2^10, 2^20, and 2^30 respectively.
For example, on a 32-bit machine under bash, the command
tells a subsequent
to set its initial minor heap size to 1 megabyte and to print
a message at the start of each major GC cycle.
If OCAMLRUNPARAM is not found in the environment, then CAMLRUNPARAM
will be used instead. If CAMLRUNPARAM is not found, then the default
values will be used.
List of directories searched to find the bytecode executable file.
The Objective Caml user's manual,
chapter "Runtime system".