OS Manuals

/usr/bin/ocamlcp-4

The core OCaml 4 system: compilers, runtime system, base libraries

From ocaml-4 4.14.5-r0 (enterprise-packages), captured 2026-11-08 by running ocamlcp-4 --help (exit 0). permalink

Usage: ocamlcp <options> <files>
options are:
  -P [afilmt]  Profile constructs specified by argument (default fm):
      a  Everything
      f  Function calls and method calls
      i  if ... then ... else
      l  while and for loops
      m  match ... with
      t  try ... with
  -p [afilmt]  Same as option -P
  -a  Build a library
  -alert <list>  Enable or disable alerts according to <list>:
        +<alertname>  enable alert <alertname>
        -<alertname>  disable alert <alertname>
        ++<alertname> treat <alertname> as fatal error
        --<alertname> treat <alertname> as non-fatal
        @<alertname>  enable <alertname> and treat it as fatal error
    <alertname> can be 'all' to refer to all alert names
  -absname  Show absolute filenames in error messages
  -annot  (deprecated) Save information in <filename>.annot
  -bin-annot  Save typedtree in <filename>.cmt
  -c  Compile only (do not link)
  -cc <command>  Use <command> as the C compiler and linker
  -cclib <opt>  Pass option <opt> to the C linker
  -ccopt <opt>  Pass option <opt> to the C compiler and linker
  -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 setting is 'auto', and the current heuristic
    checks that the TERM environment variable exists and is
    not empty or "dumb", and that isatty(stderr) holds.
  If the option is not specified, these setting can alternatively
  be set through the OCAML_COLOR environment variable.
  -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
                  snippet corresponding to the location of the error
    The default setting is 'contextual'.
  If the option is not specified, these setting can alternatively
  be set through the OCAML_ERROR_STYLE environment variable.
  -compat-32  Check that generated bytecode can run on 32-bit platforms
  -config  Print configuration values and exit
  -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)
  -custom  Link in custom mode
  -dllib <lib>  Use the dynamically-loaded library <lib>
  -dllpath <dir>  Add <dir> to the run-time search path for shared libraries
  -dtypes  (deprecated) same as -annot
  -for-pack <ident>  Generate code that can later be `packed' with
     ocamlc -pack -o <ident>.cmo
  -g  Save debugging information
  -stop-after {parsing|typing} Stop after the given compilation pass.
  -i  Print inferred interface
  -I <dir>  Add <dir> to the list of include directories
  -impl <file>  Compile <file> as a .ml file
  -intf <file>  Compile <file> as a .mli file
  -intf-suffix <string>  Suffix for interface files (default: .mli)
  -intf_suffix <string>  (deprecated) same as -intf-suffix
  -keep-docs  Keep documentation strings in .cmi files
  -no-keep-docs  Do not keep documentation strings in .cmi files (default)
  -keep-locs  Keep locations in .cmi files (default)
  -no-keep-locs  Do not keep locations in .cmi files
  -labels  Use commuting label mode
  -linkall  Link all modules, even unused ones
  -make-runtime  Build a runtime system with given C objects and libraries
  -make_runtime  (deprecated) same as -make-runtime
  -modern  (deprecated) same as -labels
  -alias-deps  Do record dependencies for module aliases
  -no-alias-deps  Do not record dependencies for module aliases
  -app-funct  Activate applicative functors
  -no-app-funct  Deactivate applicative functors
  -no-check-prims  Do not check runtime for primitives
  -noassert  Do not compile assertion checks
  -noautolink  Do not automatically link C libraries specified in .cma files
  -nolabels  Ignore non-optional labels in types
  -nostdlib  Do not add default directory to the list of include directories
  -nopervasives  (undocumented)
  -o <file>  Set output file name to <file>
  -opaque  Does not generate cross-module optimization information
     (reduces necessary recompilation on module change)
  -open <module>  Opens the module <module> before typing
  -output-obj  Output an object file instead of an executable
  -output-complete-obj  Output an object file, including runtime, instead of an executable
  -output-complete-exe  Output a self-contained executable, including runtime and C stubs
  -pack  Package the given .cmo files into one .cmo
  -pp <command>  Pipe sources through preprocessor <command>
  -ppx <command>  Pipe abstract syntax trees through preprocessor <command>
  -plugin <plugin>  (no longer supported)
  -principal  Check principality of type inference
  -no-principal  Do not check principality of type inference (default)
  -rectypes  Allow arbitrary recursive types
  -no-rectypes  Do not allow arbitrary recursive types (default)
  -runtime-variant <str>  Use the <str> variant of the run-time system
  -with-runtime Include the runtime system in the generated program (default)
  -without-runtime Do not include the runtime system in the generated program.
  -safe-string  (was set when configuring the compiler)
  -short-paths  Shorten paths in types
  -strict-sequence  Left-hand part of a sequence must have type unit
  -no-strict-sequence  Left-hand part of a sequence need not have type unit (default)
  -strict-formats  Reject 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. You should always use this flag
      to detect invalid formats so you can fix them.)
  -no-strict-formats  Accept 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 versions. You should never use this flag
      and instead fix invalid formats.)
  -thread  (deprecated) same as -I +threads
  -unboxed-types  unannotated unboxable types will be unboxed
  -no-unboxed-types  unannotated unboxable types will not be unboxed (default)
  -unsafe  Do not compile bounds checking on array and string access
  -unsafe-string  (option not available)
  -use-runtime <file>  Generate bytecode for the given runtime system
  -use_runtime <file>  (deprecated) same as -use-runtime
  -v  Print compiler version and location of standard library and exit
  -verbose  Print calls to external commands
  -version  Print version and exit
  --version  Print version and exit
  -vmthread   (no longer supported)
  -vnum  Print version number and exit
  -w <list>  Enable or disable warnings according to <list>:
        +<spec>   enable warnings in <spec>
        -<spec>   disable warnings in <spec>
        @<spec>   enable warnings in <spec> and treat them as errors
     <spec> can be:
        <num>             a single warning number
        <num1>..<num2>    a range of consecutive warning numbers
        <letter>          a predefined set
     default setting is "+a-4-7-9-27-29-30-32..42-44-45-48-50-60-66..70"
  -warn-error <list>  Enable or disable error status for warnings according
     to <list>.  See option -w for the syntax of <list>.
     Default setting is "-a+31"
  -warn-help  Show description of warning numbers
  -where  Print location of standard library and exit
  - <file>  Treat <file> as a file name (even if it starts with `-')
  -match-context-rows <n>  (advanced, see manual section 11.2.)
  -use-prims <file>  (undocumented)
  -dno-unique-ids  (undocumented)
  -dunique-ids  (undocumented)
  -dno-locations  (undocumented)
  -dlocations  (undocumented)
  -dsource  (undocumented)
  -dparsetree  (undocumented)
  -dtypedtree  (undocumented)
  -dshape  (undocumented)
  -drawlambda  (undocumented)
  -dlambda  (undocumented)
  -dinstr  (undocumented)
  -dcamlprimc  (undocumented)
  -dtimings  Print timings information for each pass
  -dprofile  Print performance information for each pass
    The columns are: time alloc top-heap absolute-top-heap.
  -dump-into-file  dump output like -dlambda into <target>.dump
  -dump-dir <dir> dump output like -dlambda into <dir>/<target>.dump
  -args <file> Read additional newline-terminated command line arguments
      from <file>
  -args0 <file> Read additional null character terminated command line arguments
from <file>
  -help  Display this list of options
  --help  Display this list of options
Options (104)
OptionDescriptionSource
-P afilmtProfile constructs specified by argument (default fm): a Everything f Function calls and method calls i if ...help
-p afilmtSame as option -Phelp
-aBuild a libraryhelp
-alert listEnable or disable alerts according to <list>: +<alertname> enable alert <alertname>help
-absnameShow absolute filenames in error messageshelp
-annot(deprecated) Save information in <filename>.annothelp
-bin-annotSave typedtree in <filename>.cmthelp
-cCompile only (do not link)help
-cc commandUse <command> as the C compiler and linkerhelp
-cclib optPass option <opt> to the C linkerhelp
-ccopt optPass option <opt> to the C compiler and linkerhelp
-color auto|always|neverEnable 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
-error-style contextual|shortControl 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
-compat-32Check that generated bytecode can run on 32-bit platformshelp
-configPrint configuration values and exithelp
-config-varPrint 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
-customLink in custom modehelp
-dllib libUse the dynamically-loaded library <lib>help
-dllpath dirAdd <dir> to the run-time search path for shared librarieshelp
-dtypes(deprecated) same as -annothelp
-for-pack identGenerate code that can later be `packed' with ocamlc -pack -o <ident>.cmohelp
-gSave debugging informationhelp
-iPrint inferred interfacehelp
-I dirAdd <dir> to the list of include directorieshelp
-impl fileCompile <file> as a .ml filehelp
-intf fileCompile <file> as a .mli filehelp
-intf-suffix stringSuffix for interface files (default: .mli)help
-intf_suffix string(deprecated) same as -intf-suffixhelp
-keep-docsKeep documentation strings in .cmi fileshelp
-no-keep-docsDo not keep documentation strings in .cmi files (default)help
-keep-locsKeep locations in .cmi files (default)help
-no-keep-locsDo not keep locations in .cmi fileshelp
-labelsUse commuting label modehelp
-linkallLink all modules, even unused oneshelp
-make-runtimeBuild a runtime system with given C objects and librarieshelp
-make_runtime(deprecated) same as -make-runtimehelp
-modern(deprecated) same as -labelshelp
-alias-depsDo record dependencies for module aliaseshelp
-no-alias-depsDo not record dependencies for module aliaseshelp
-app-functActivate applicative functorshelp
-no-app-functDeactivate applicative functorshelp
-no-check-primsDo not check runtime for primitiveshelp
-noassertDo not compile assertion checkshelp
-noautolinkDo not automatically link C libraries specified in .cma fileshelp
-nolabelsIgnore non-optional labels in typeshelp
-nostdlibDo not add default directory to the list of include directorieshelp
-nopervasives(undocumented)help
-o fileSet output file name to <file>help
-opaqueDoes not generate cross-module optimization information (reduces necessary recompilation on module change)help
-open moduleOpens the module <module> before typinghelp
-output-objOutput an object file instead of an executablehelp
-output-complete-objOutput an object file, including runtime, instead of an executablehelp
-output-complete-exeOutput a self-contained executable, including runtime and C stubshelp
-packPackage the given .cmo files into one .cmohelp
-pp commandPipe sources through preprocessor <command>help
-ppx commandPipe abstract syntax trees through preprocessor <command>help
-plugin plugin(no longer supported)help
-principalCheck principality of type inferencehelp
-no-principalDo not check principality of type inference (default)help
-rectypesAllow arbitrary recursive typeshelp
-no-rectypesDo not allow arbitrary recursive types (default)help
-runtime-variant strUse the <str> variant of the run-time systemhelp
-safe-string(was set when configuring the compiler)help
-short-pathsShorten paths in typeshelp
-strict-sequenceLeft-hand part of a sequence must have type unithelp
-no-strict-sequenceLeft-hand part of a sequence need not have type unit (default)help
-strict-formatsReject 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
-no-strict-formatsAccept 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
-thread(deprecated) same as -I +threadshelp
-unboxed-typesunannotated unboxable types will be unboxedhelp
-no-unboxed-typesunannotated unboxable types will not be unboxed (default)help
-unsafeDo not compile bounds checking on array and string accesshelp
-unsafe-string(option not available)help
-use-runtime fileGenerate bytecode for the given runtime systemhelp
-use_runtime file(deprecated) same as -use-runtimehelp
-vPrint compiler version and location of standard library and exithelp
-verbosePrint calls to external commandshelp
-versionPrint version and exithelp
--versionPrint version and exithelp
-vmthread(no longer supported)help
-vnumPrint version number and exithelp
-w listEnable or disable warnings according to <list>: +<spec> enable warnings in <spec>help
-warn-error listEnable or disable error status for warnings according to <list>.help
-warn-helpShow description of warning numbershelp
-wherePrint location of standard library and exithelp
-match-context-rows n(advanced, see manual section 11.2.)help
-use-prims file(undocumented)help
-dno-unique-ids(undocumented)help
-dunique-ids(undocumented)help
-dno-locations(undocumented)help
-dlocations(undocumented)help
-dsource(undocumented)help
-dparsetree(undocumented)help
-dtypedtree(undocumented)help
-dshape(undocumented)help
-drawlambda(undocumented)help
-dlambda(undocumented)help
-dinstr(undocumented)help
-dcamlprimc(undocumented)help
-dtimingsPrint timings information for each passhelp
-dprofilePrint performance information for each pass The columns are: time alloc top-heap absolute-top-heap.help
-dump-into-filedump output like -dlambda into <target>.dumphelp
-helpDisplay this list of optionshelp
--helpDisplay this list of optionshelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.