-a | Build a library (.cma file) with the object files (.cmo 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 |
-c | Compile only (do not link) | help + man |
-cc command | Use ccomp as the C linker when linking in "custom runtime" mode (see the -custom option) 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, when linking in "custom runtime" mode (see the -custom option). | 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 |
-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 |
-compat-32 | Check that the generated bytecode executable can run on 32-bit platforms and signal an error if it cannot. | help + man |
-config | Print the version number of ocamlc(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 |
-custom | Link in "custom runtime" mode. | help + man |
-dllib lib | Use the dynamically-loaded library <lib> | help |
-dllib-suffixed lib | Use the dynamically-loaded library <lib>, with the runtime suffix appended to the name | help |
-dllpath dir | Add the directory dir to the run-time search path for shared C libraries. | help + man |
-dtypes | (deprecated) same as -annot | help |
-for-pack ident | Generate an object file (.cmo file) 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 |
-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 (.cmo), libraries (.cma), and C libraries specified with -cclib -lxxx. | 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 |
-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 |
-intf_suffix string | (deprecated) same as -intf-suffix | help |
-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 according to the version+list specification. | help + man |
-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 |
-make-runtime | Build a custom runtime system (in the file specified by option -o) incorporating the C object files and libraries given on the command line. | help + man |
-make_runtime | (deprecated) same as -make-runtime | help |
-modern | (deprecated) same as -labels | help |
-alias-deps | Do record dependencies for module aliases | help |
-no-alias-deps | Do not record dependencies for module aliases. | help + man |
-app-funct | Activate applicative functors | help |
-no-app-funct | Deactivates the applicative behaviour of functors. | help + man |
-no-check-prims | Do not check runtime for primitives | help |
-noassert | Do not compile assertion checks. | help + man |
-noautolink | When linking .cma libraries, ignore -custom, -cclib and -ccopt options potentially contained in the libraries (if these options were given when building the libraries). | 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 (.cmo), libraries (.cma), and C libraries… | help + man |
-nocwd | Do not implicitly add the current directory to the load path | help |
-nopervasives | (undocumented) | 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), or a C source or object file (-output-obj… | help + man |
-opaque | Interface file compiled with this option are marked so that other compilation units depending on it will not rely on any implementation details of the compiled implementation. | 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 a bytecode executable file. | help + man |
-output-complete-obj | Same as -output-obj except when creating an object file where it includes the runtime and autolink libraries. | help + man |
-output-complete-exe | Output a self-contained executable, including runtime and C stubs | help |
-pack | Build a bytecode object file (.cmo file) and its associated compiled interface (.cmi) that combines the object files given on the command line, making them appear as sub-modules of the output .cmo… | help + man |
-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 |
-plugin plugin | (no longer supported) | help |
-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 |
-runtime-variant str | Add suffix to the name of the runtime library that will be used by the program. | 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 |
-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 | Force the left-hand part of each sequence to 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 |
-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 |
-use-runtime file | Generate a bytecode executable file that can be executed on the custom runtime system runtime-name, built earlier with ocamlc -make-runtime runtime-name. | help + man |
-use_runtime file | (deprecated) same as -use-runtime | help |
-launch-method method | Specify the mechanism for the bytecode launcher: exe - use the executable launcher in runtime-launch-info sh - use a #!, using sh if the interpreter path cannot be used /path/interpreter - use #!, or… | help + man |
-runtime-search disable|fallback|enable | Control the way the bytecode header searches for the interpreter The following settings are supported: disable use a fixed absolute path to the interpreter fallback search for interpreter only if not… | 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 C compiler and linker in -custom mode. | help + man |
-version | Print version and exit | help |
--version | Print version and exit | help |
-vmthread | (no longer supported) | help |
-vnum | Print the version number of the compiler in short form (e.g. "3.11.0"), then exit. | help + man |
-w list | Enable, disable, or mark as fatal the warnings specified by the argument warning-list. | help + man |
-warn-error list | Mark as errors 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 |
-use-prims file | (undocumented) | help |
-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 |
-dinstr | (undocumented) | help |
-dcamlprimc | (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 |
-help | Display a short usage summary and exit. | help + man |
--help | Display this list of options | help |
-depend ocamldep-args | Compute dependencies, as ocamldep(1) would do. (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 |
-name | Disable warning name. (in the manual page but not in --help) | man |
-num | Disable warning number num. (in the manual page but not in --help) | man |
-num1..num2 | Disable all warnings between num1 and num2 (inclusive). (in the manual page but not in --help) | man |
-letter | Disable the set of warnings corresponding to letter. (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 |