-fPIC | Generate position-independent machine code (default) | help + man |
-fno-PIC | Generate position-dependent machine code. | help + man |
-a | Build a library (.cmxa/.a file) with the object files (.cmx/.o files) given on the command line, instead of linking them into an executable file. | help + man |
-alert list | Enable or disable alerts according to <list>: +<alertname> enable alert <alertname> | help |
-absname | Show absolute filenames in error messages. | help + man |
-no-absname | Do not try to show absolute filenames in error messages (default) | help + man |
-annot | (deprecated) Save information in <filename>.annot | help + man |
-bin-annot | Dump detailed information about the compilation (types, bindings, tail-calls, etc) in binary format. | help + man |
-bin-annot-occurrences | Store every occurrence of a bound name in the .cmt file. | help |
-inline-branch-factor n>|<round>=<n | Estimate the probability of a branch being cold as 1/(1+n) (used for inlining) (default 0.10) | help |
-c | Compile only (do not link) | help + man |
-cc command | Use ccomp as the C linker called to build the final executable and as the C compiler for compiling .c source files. | help + man |
-cclib opt | Pass option <opt> to the C linker | help |
-ccopt opt | Pass the given option to the C compiler and linker. | help + man |
-cmi-file file | Type-check the source implementation to be compiled against the specified interface file (bypasses the normal lookup for .mli and .cmi files). | help + man |
-clambda-checks | Instrument clambda code with closure and field access checks (for debugging the compiler) | help |
-Oclassic | Make inlining decisions at function definition time rather than at the call site (replicates previous behaviour of the compiler) | help + man |
-color auto|always|never | Enable or disable colors in compiler messages The following settings are supported: auto use heuristics to enable colors only if supported always enable colors never disable colors The default… | help + man |
-error-style contextual|short | Control the way error messages and warnings are printed The following settings are supported: short only print the error and its location contextual like "short", but also display the source code… | help + man |
-compact | Optimize the produced code for space rather than for time. | help + man |
-config | Print the version number of ocamlopt(1) and a detailed summary of its configuration, then exit. | help + man |
-config-var | Print the value of a configuration variable, without a newline, and exit (print nothing and exit with error value if the variable does not exist) | help + man |
-dtypes | (deprecated) same as -annot | help |
-for-pack ident | Generate an object file (.cmx and .o files) that can later be included as a sub-module (with the given access path) of a compilation unit constructed with -pack. | help + man |
-g | Add debugging information while compiling and linking. | help + man |
-no-g | Do not record debugging information (default). | help + man |
-function-sections | Generate each function in a separate section if target supports it | help |
-i | Cause the compiler to print all defined names (with their inferred types or their definitions) when compiling an implementation (.ml file). | help + man |
-i-variance | Cause the compiler to print the computed variance of type parameters for every type declaration. | help + man |
-I dir | Add the given directory to the list of directories searched for compiled interface files (.cmi), compiled object code files (.cmx), and libraries (.cmxa). | help + man |
-H dir | Add <dir> to the list of "hidden" include directories (Like -I, but the program can not directly reference these dependencies) | help |
-impl file | Compile the file filename as an implementation file, even if its extension is not .ml. | help + man |
-inline n>|<round>=<n | Aggressiveness of inlining (default 1.25, higher numbers mean more aggressive) | help + man |
-inline-toplevel n>|<round>=<n | Aggressiveness of inlining at toplevel (higher numbers mean more aggressive) | help |
-inline-alloc-cost n>|<round>=<n | The cost of not removing an allocation during inlining (default 7, higher numbers more costly) | help |
-inline-branch-cost n>|<round>=<n | The cost of not removing a conditional during inlining (default 5, higher numbers more costly) | help |
-inline-call-cost n>|<round>=<n | The cost of not removing a call during inlining (default 5, higher numbers more costly) | help |
-inline-prim-cost n>|<round>=<n | The cost of not removing a primitive during inlining (default 3, higher numbers more costly) | help |
-inline-indirect-cost n>|<round>=<n | The cost of not removing an indirect call during inlining (default 4, higher numbers more costly) | help |
-inline-lifting-benefit n>|<round>=<n | The benefit of lifting definitions to toplevel during inlining (default 1300, higher numbers more beneficial) | help |
-inlining-report | Emit .inlining files (one per round of optimisation) showing all of the inliner's decisions. | help + man |
-insn-sched | Enables the instruction scheduling pass in the compiler backend. | help + man |
-intf file | Compile the file filename as an interface file, even if its extension is not .mli. | help + man |
-intf-suffix string | Recognize file names ending with string as interface files (instead of the default .mli). | help + man |
-keep-docs | Keep documentation strings in generated .cmi files. | help + man |
-no-keep-docs | Do not keep documentation strings in .cmi files (default) | help |
-keep-locs | Keep locations in generated .cmi files. | help + man |
-no-keep-locs | Do not keep locations in .cmi files | help |
-keywords version+list | set keywords following the <version+list> spec: | help |
-labels | Labels are not ignored in types, labels may be used in applications, and labelled parameters can be given in any order. | help + man |
-linkall | Force all modules contained in libraries to be linked in. | help + man |
-inline-max-depth n>|<round>=<n | Maximum depth of search for inlining opportunities inside inlined functions (default 1) | help |
-alias-deps | Do record dependencies for module aliases | help |
-no-alias-deps | Do not record dependencies for module aliases. | help + man |
-linscan | Use the linear scan register allocator | help + man |
-app-funct | Activate applicative functors | help |
-no-app-funct | Deactivates the applicative behaviour of functors. | help + man |
-no-float-const-prop | Deactivate constant propagation for floating-point operations | help |
-noassert | Do not compile assertion checks. | help + man |
-noautolink | When linking .cmxa libraries, ignore -cclib and -ccopt options potentially contained in the libraries (if these options were given when building the libraries). | help + man |
-nodynlink | Allow the compiler to use some optimizations that are valid only for code that is never dynlinked. | help + man |
-no-insn-sched | Disables the instruction scheduling pass in the compiler backend. | help + man |
-nolabels | Ignore non-optional labels in types. | help + man |
-nostdlib | Do not automatically add the standard library directory to the list of directories searched for compiled interface files (.cmi), compiled object code files (.cmx), and libraries (.cmxa). | help + man |
-nocwd | Do not implicitly add the current directory to the load path | help |
-nopervasives | (undocumented) | help |
-no-unbox-free-vars-of-closures | Do not unbox variables that will appear inside function closures | help |
-no-unbox-specialised-args | Do not unbox arguments to which functions have been specialised | help |
-o file | Specify the name of the final output file, whether it is an executable, a compiled object (-c option), a library (-a option), a packed object (-pack option), a dynlinkable plugin (-shared option) or… | help + man |
-O2 | Apply increased optimization for speed | help + man |
-O3 | Apply aggressive optimization for speed (may significantly increase code size and compilation time) | help + man |
-opaque | When compiling a .mli interface file, this has the same effect as the -opaque option of the bytecode compiler. | help + man |
-open module | Opens the given module before processing the interface or implementation files. | help + man |
-output-obj | Cause the linker to produce a C object file instead of an executable file. | help + man |
-output-complete-obj | Same as -output-obj except the object file produced includes the runtime and autolink libraries. | help + man |
-p | (no longer supported) | help |
-pack | Build an object file (.cmx and .o files) and its associated compiled interface (.cmi) that combines the .cmx object files given on the command line, making them appear as sub-modules of the output… | help + man |
-plugin plugin | (no longer supported) | help |
-pp command | Cause the compiler to call the given command as a preprocessor for each source file. | help + man |
-ppx command | After parsing, pipe the abstract syntax tree through the preprocessor command. | help + man |
-principal | Check information path during type-checking, to make sure that all types are derived in a principal way. | help + man |
-no-principal | Do not check principality of type inference (default) | help + man |
-rectypes | Allow arbitrary recursive types during type-checking. | help + man |
-no-rectypes | Do no allow arbitrary recursive types during type-checking. | help + man |
-remove-unused-arguments | Remove unused function arguments | help |
-rounds n | Repeat tree optimization and inlining phases this many times (default 1). | help |
-runtime-variant str | Add suffix to the name of the runtime library that will be used by the program. | help + man |
-S | Keep the assembly code produced during the compilation. | help + man |
-safe-string | Enforce the separation between types string and bytes, thereby making strings read-only. | help + man |
-safer-matching | Do not use type information to optimize pattern-matching. | help + man |
-set-runtime-default param>=<value | Set the default for runtime parameter <param> to <value> (see the manual for further details) | help + man |
-shared | Build a plugin (usually .cmxs) that can be dynamically loaded with the Dynlink module. | help + man |
-short-paths | When a type is visible under several module-paths, use the shortest one when printing the type's name in inferred interfaces and error and warning messages. | help + man |
-strict-sequence | The left-hand part of a sequence must have type unit. | help + man |
-no-strict-sequence | Left-hand part of a sequence need not have type unit (default) | help + man |
-strict-formats | Reject invalid formats accepted by legacy implementations (default) (Warning: Invalid formats may behave differently from previous OCaml versions, and will become always-rejected in future OCaml… | help |
-no-strict-formats | Accept invalid formats accepted by legacy implementations (Warning: Invalid formats may behave differently from previous OCaml versions, and will become always-rejected in future OCaml versions. | help |
-thread | (deprecated) same as -I +threads | help |
-unbox-closures | Pass free variables via specialised arguments rather than closures | help |
-unbox-closures-factor n | Scale the size threshold above which unbox-closures will slow down indirect calls rather than duplicating a function (default 10) | help |
-inline-max-unroll n>|<round>=<n | Unroll recursive functions at most this many times (default 0) | help |
-unboxed-types | When a type is unboxable (i.e. a record with a single argument or a concrete datatype with a single constructor of one argument) it will be unboxed unless annotated with [@@ocaml.boxed]. | help + man |
-no-unboxed-types | When a type is unboxable it will be boxed unless annotated with [@@ocaml.unboxed]. | help + man |
-unsafe | Turn bound checking off for array and string accesses (the v.(i) and s.[i] constructs). | help + man |
-unsafe-string | Identify the types string and bytes, thereby making strings writable. | help + man |
-v | Print the version number of the compiler and the location of the standard library directory, then exit. | help + man |
-verbose | Print all external commands before they are executed, in particular invocations of the assembler, C compiler, and linker. | help + man |
-version | Print the version number of the compiler in short form (e.g. "3.11.0"), then exit. | help + man |
--version | Print version and exit | help |
-vnum | Print version number and exit | help |
-w list | Enable, disable, or mark as fatal the warnings specified by the argument warning-list. | help + man |
-warn-error list | Mark as fatal the warnings specified in the argument warning-list. | help + man |
-warn-help | Show the description of all available warning numbers. | help + man |
-where | Print the location of the standard library, then exit. | help + man |
-match-context-rows n | Set number of rows of context used during pattern matching compilation. | help + man |
-dno-unique-ids | (undocumented) | help |
-dunique-ids | (undocumented) | help |
-dno-canonical-ids | (undocumented) | help |
-dcanonical-ids | (undocumented) | help |
-dno-locations | (undocumented) | help |
-dlocations | (undocumented) | help |
-dsource | (undocumented) | help |
-dparsetree | (undocumented) | help |
-dparsetree-loc-ghost-invariants | (undocumented) | help |
-dtypedtree | (undocumented) | help |
-dshape | (undocumented) | help |
-dmatchcomp | (undocumented) | help |
-drawlambda | (undocumented) | help |
-dlambda | (undocumented) | help |
-drawclambda | (undocumented) | help |
-dclambda | (undocumented) | help |
-dcmm-invariants | Extra sanity checks on Cmm | help |
-dflambda | Print Flambda terms | help |
-drawflambda | Print Flambda terms after closure conversion | help |
-dflambda-invariants | Check Flambda invariants around each pass | help |
-dflambda-no-invariants | Do not Check Flambda invariants around each pass | help |
-dflambda-let stamp | Print when the given Flambda [Let] is created | help |
-dflambda-verbose | Print Flambda terms including around each pass | help |
-dcmm | (undocumented) | help |
-dsel | (undocumented) | help |
-dcombine | (undocumented) | help |
-dcse | (undocumented) | help |
-dlive | (undocumented) | help |
-dspill | (undocumented) | help |
-dsplit | (undocumented) | help |
-dinterf | (undocumented) | help |
-dprefer | (undocumented) | help |
-dalloc | (undocumented) | help |
-dreload | (undocumented) | help |
-dscheduling | (undocumented) | help |
-dlinear | (undocumented) | help |
-dinterval | (undocumented) | help |
-dstartup | (undocumented) | help |
-dtimings | Print timings information for each pass | help |
-dprofile | Print performance information for each pass The columns are: time alloc top-heap absolute-top-heap. | help |
-dump-into-file | dump output like -dlambda into <target>.dump | help |
-dump-pass | Record transformations performed by these passes: unbox-closures unbox-specialised-args unbox-free-vars-of-closures remove-free-vars-equal-to-args remove-unused-arguments unused-arguments | help |
-help | Display a short usage summary and exit. | help + man |
--help | Display this list of options | help |
-depend ocamldep-args | Compute dependencies, as ocamldep would do. (in the manual page but not in --help) | man |
-save-ir-after pass | Save intermediate representation after the given compilation pass. (in the manual page but not in --help) | man |
-stop-after pass | Stop compilation after the given compilation pass. (in the manual page but not in --help) | man |
-with-runtime | Include the runtime system in the generated program. (in the manual page but not in --help) | man |
-without-runtime | The compiler does not include the runtime system (nor a reference to it) in the generated program; (in the manual page but not in --help) | man |