Config(3)

๐ŸŒธ NAME ๐ŸŒธ

Config - System configuration

Okay bestie, this is the OCaml library manual page for Config(3) โ€” the system configuration module. Itโ€™s giving โ€œcompiler lore handoff,โ€ and weโ€™re gonna go through every single val together, no skipping. ๐Ÿซถ

๐Ÿงฉ MODULE ๐Ÿงฉ

Module Config
 : sig end

โœจ DOCUMENTATION โœจ

Module Config
 : sig end

System configuration.

โš ๏ธ Warning: this module is unstable and part of Compiler_libs.

Alright, now the actual vals, in order, with all the details intact:

  • val version : string โ€” the current version number of the system ๐Ÿ’–
  • val release_number : int โ€” the release number for the compiler. Since 5.5 โœจ
  • val is_official_release : bool โ€” True if the compiler is an unmodified official OCaml release. Since 5.5 โœจ
  • val bindir : string โ€” the directory containing the binary programs. If the compiler was configured with --with-relative-libdir then this will be the directory containing the currently executing runtime. ๐ŸŽ€
  • val standard_library_relative : string option โ€” the explicit relative path from the compiler binaries to the standard libraries directory if the compiler was configured with --with-relative-libdir, or None otherwise. Since 5.5 โœจ
  • val target_bindir : string โ€” the directory containing the runtime binaries on the target system. Since 5.5 โœจ
  • val standard_library_default : string โ€” the effective value for the default directory containing the standard libraries. This is always an absolute path, computed using Config.standard_library_relative if necessary. Since 5.5 โœจ
  • val standard_library : string โ€” the effective directory containing the standard libraries, taking CAMLLIB and OCAMLLIB into account. ๐Ÿฆ‹
  • val ccomp_type : string โ€” the โ€œkindโ€ of the C compiler, assembler and linker used: one of "cc" (for Unix-style C compilers) or "msvc" (for Microsoft Visual C++ and MASM). ๐Ÿ’…
  • val c_compiler : string โ€” the compiler to use for compiling C files.
  • val c_compiler_vendor : string โ€” Since 5.5 โœจ the vendor and version of the C compiler. Consists of hyphenated values where the first part indicates the C compilerโ€™s vendor and remaining parts indicate the version of the C compiler, as reported by that C compilerโ€™s preprocessor. Possible values are:
    • -msvc โ€” Windows, using Microsoft Visual Studio. _MSC_VER follows and optionally clang- if clang-cl, rather than Visual Studio itself, is in use.
    • -icc โ€” Intel C Compiler.
    • -mingw โ€” Windows, using the mingw-w64 project. The major and minor version of mingw-w64 itself follow and then either gcc- or clang- indicating which C compiler is in use.
    • -clang โ€” Clang LLVM C Compiler.
    • -gcc โ€” GNU Compiler Collection C Compiler.
    • -xlc โ€” IBM XL C Compiler.
    • -sunc โ€” Oracle Solaris Studio.
    • -unknown โ€” unknown compiler vendor. No additional version info.
  • val c_output_obj : string โ€” name of the option of the C compiler for specifying the output file.
  • val c_has_debug_prefix_map : bool โ€” whether the C compiler supports -fdebug-prefix-map.
  • val as_has_debug_prefix_map : bool โ€” whether the assembler supports --debug-prefix-map.
  • val as_is_cc : bool โ€” whether the assembler is actually an assembler, or whether we are really assembling files via the C compiler. Since 5.5 โœจ
  • val bytecode_cflags : string โ€” the flags ocamlc should pass to the C compiler.
  • val bytecode_cppflags : string โ€” the flags ocamlc should pass to the C preprocessor.
  • val native_cflags : string โ€” the flags ocamlopt should pass to the C compiler.
  • val native_cppflags : string โ€” the flags ocamlopt should pass to the C preprocessor.
  • val bytecomp_c_libraries : string โ€” the C libraries to link with custom runtimes.
  • val native_c_libraries : string โ€” the C libraries to link with native-code programs.
  • val compression_c_libraries : string โ€” the C libraries needed with -lcomprmarsh (should appear before Config.native_c_libraries in a call to the C compiler). Since 5.4 โœจ
  • val native_ldflags : string โ€” this oneโ€™s here with no extra description on the page, so Iโ€™m not inventing one ๐Ÿ’€
  • val with_nonexecstack_note : bool โ€” whether an explicit ".note.GNU-stack" section is to be added to indicate the stack should not be executable. Since 5.4 โœจ
  • val native_pack_linker : string โ€” the linker to use for packaging (ocamlopt -pack) and for partial links (ocamlopt -output-obj). ๐ŸŽ€
  • val mkdll : string โ€” the linker command line to build dynamic libraries.
  • val mkexe : string โ€” the linker command line to build executables.
  • val mkmaindll : string โ€” the linker command line to build main programs as dlls.
  • val default_rpath : string โ€” option to add a directory to be searched for libraries at runtime (used by ocamlmklib).
  • val mksharedlibrpath : string โ€” option to add a directory to be searched for shared libraries at runtime (used by ocamlmklib).
  • val ar : string โ€” name of the ar command, or "" if not needed (MSVC).
  • val interface_suffix : string ref โ€” suffix for interface file names.
  • val exec_magic_number : string โ€” magic number for bytecode executable files.
  • val cmi_magic_number : string โ€” magic number for compiled interface files.
  • val cmo_magic_number : string โ€” magic number for object bytecode files.
  • val cma_magic_number : string โ€” magic number for archive files.
  • val cmx_magic_number : string โ€” magic number for compilation unit descriptions.
  • val cmxa_magic_number : string โ€” magic number for libraries of compilation unit descriptions.
  • val ast_intf_magic_number : string โ€” magic number for file holding an interface syntax tree.
  • val ast_impl_magic_number : string โ€” magic number for file holding an implementation syntax tree.
  • val cmxs_magic_number : string โ€” magic number for dynamically-loadable plugins.
  • val cmt_magic_number : string โ€” magic number for compiled interface files.
  • val linear_magic_number : string โ€” magic number for Linear internal representation files.
  • val max_tag : int โ€” biggest tag that can be stored in the header of a regular block.
  • val lazy_tag : int โ€” normally the same as Obj.lazy_tag. Separate definition because of technical reasons for bootstrapping.
  • val max_young_wosize : int โ€” maximal size of arrays that are directly allocated in the minor heap.
  • val stack_threshold : int โ€” size in words of safe area at bottom of VM stack, see runtime/caml/config.h.
  • val stack_safety_margin : int โ€” size in words of the safety margin between the bottom of the stack and the stack pointer. This margin can be used by intermediate computations of some instructions, or the event handler. ๐Ÿซถ
  • val native_compiler : bool โ€” whether the native compiler is available or not. Since 5.1 โœจ
  • val architecture : string โ€” name of processor type for the native-code compiler.
  • val model : string โ€” name of processor submodel for the native-code compiler.
  • val system : string โ€” name of operating system for the native-code compiler.
  • val target_os_type : string โ€” operating system targeted by the native-code compiler. One of:
    • "Unix" โ€” for all Unix versions, including Linux and macOS.
    • "Win32" โ€” for MS-Windows, OCaml compiled with MSVC++ or MinGW-w64.
    • "Cygwin" โ€” for MS-Windows, OCaml compiled with Cygwin.

Since 5.4 โœจ

  • val target_unix : bool โ€” True if target_os_type = "Unix". Since 5.5 โœจ
  • val target_win32 : bool โ€” True if target_os_type = "Win32". Since 5.5 โœจ
  • val target_cygwin : bool โ€” True if target_os_type = "Cygwin". Since 5.5 โœจ
  • val asm : string โ€” the assembler (and flags) to use for assembling ocamlopt-generated code.
  • val asm_cfi_supported : bool โ€” whether assembler understands CFI directives.
  • val asm_size_type_directives : bool โ€” whether the .size and .type assembler directives can be used. Since 5.4 โœจ
  • val asm_dwarf_version : int option โ€” the DWARF Version emitted by the Config.asm command. At present this is only implemented for the clang internal assembler, all other assemblers have None. Since 5.5 โœจ
  • val with_frame_pointers : bool โ€” whether assembler should maintain frame pointers.
  • val ext_obj : string โ€” extension for object files, e.g. .o under Unix.
  • val ext_asm : string โ€” extension for assembler files, e.g. .s under Unix.
  • val ext_lib : string โ€” extension for library files, e.g. .a under Unix.
  • val ext_dll : string โ€” extension for dynamically-loaded libraries, e.g. .so under Unix.
  • val ext_exe : string โ€” extension for executable programs, e.g. .exe under Windows. Since 4.12 โœจ
  • val default_executable_name : string โ€” name of executable produced by linking if none is given with -o, e.g. a.out under Unix.
  • val systhread_supported : bool โ€” whether the system thread library is implemented.
  • val flexdll_dirs : string list โ€” directories needed for the FlexDLL objects.
  • val host : string โ€” whether the compiler is a cross-compiler.
  • val target : string โ€” whether the compiler is a cross-compiler.
  • val flambda : bool โ€” whether the compiler was configured for flambda.
  • val with_flambda_invariants : bool โ€” whether the invariants checks for flambda are enabled.
  • val with_cmm_invariants : bool โ€” whether the invariants checks for Cmm are enabled.
  • val with_codegen_invariants : bool โ€” whether the invariant checks for native code generation are enabled.
  • val reserved_header_bits : int โ€” how many bits of a blockโ€™s header are reserved.
  • val flat_float_array : bool โ€” whether the compiler and runtime automagically flatten float arrays.
  • val align_double : bool โ€” whether the compiler and runtime need to align double values. If false, a floatarray value can be cast to a C array of doubles.
  • val align_int64 : bool โ€” whether the compiler and runtime need to align int64 values.
  • val function_sections : bool โ€” whether the compiler was configured to generate each function in a separate section.
  • val windows_unicode : bool โ€” whether Windows Unicode runtime is enabled.
  • val naked_pointers : bool โ€” whether the runtime supports naked pointers. Since 4.14 โœจ
  • val supports_shared_libraries : bool โ€” whether shared libraries are supported. Since 4.08 โœจ
  • val native_dynlink : bool โ€” whether native shared libraries are supported. Since 5.1 โœจ
  • val afl_instrument : bool โ€” whether afl-fuzz instrumentation is generated by default.
  • val ar_supports_response_files : bool โ€” whether ar supports @FILE arguments.
  • val tsan : bool โ€” whether ThreadSanitizer instrumentation is enabled.

Then thereโ€™s the launch_method type โ€” launch mechanisms for bytecode executables, Since 5.5 โœจ โ€” and it looks exactly like this:

type launch_method =
 | Executable  (* Use the executable launcher stub
 *)
 | Shebang of string option
  (* Use a shebang-style launcher. Whenever possible, the interpreter
will be the runtime itself, but if the path to the runtime is not valid
for a shebang line, then a shell script is generated. When this is
necessary, the parameter in Shebang (Some sh) is the full path to sh ;
if the parameter is None , then the linker searches PATH for sh .
  *)
  • val launch_method : launch_method โ€” the launch method value, matching that launch_method type. ๐Ÿ‘‘

Default launch mechanism for bytecode executables โ€” Since 5.5

(okay so that bit belongs to the item right above this one, we're just picking up mid-thread like a group chat at 2am ๐Ÿ˜ญ carry on)


๐Ÿงญ type search_method

type search_method =
 | Disable  (* Interpreter searching disabled - check fixed absolute
location only
 *)
 | Fallback  (* Check fixed absolute location first, but fall back to a
search if that fails
 *)
 | Enable  (* Always search for the interpreter
 *)

Breaking down the three moods of this type, because you will be asked:

  • Disable โ€” interpreter searching is fully off ๐Ÿ”’ it checks the fixed absolute location and that's it. No wandering, no searching, no main character exploration energy.
  • Fallback โ€” checks the fixed absolute location first, and if that fails it falls back to a search. Backup-plan bestie behaviour ๐Ÿซถ
  • Enable โ€” always searches for the interpreter. Always. It's giving unhinged dedication ๐Ÿ”โœจ

Mechanisms used by tendered bytecode executables to locate the interpreter โ€” Since 5.5


๐Ÿ”Ž val search_method : search_method

Default search mechanism for bytecode executables ๐Ÿ”ฅ

Since 5.5

Like, the actual one your build ships with. The default. The vibe check every executable passes through. ๐Ÿ’…


๐ŸŽ€ val shebangscripts : bool

Whether the target supports shebang scripts ๐Ÿš

Since 5.5

#!-style scripts: supported or not? That's the whole bool. Simple, clean, iconic. ๐ŸŒธ


โœจ val suffixing : bool

Whether the runtime executable and shared library filenames and C stub library filenames are being mangled with Runtime IDs and the Config.target .

Since 5.5

So this bool tells you if the filenames are getting the full makeover โ€” runtime executable โœ… shared libraries โœ… C stub libraries โœ… โ€” all of them decorated with Runtime IDs and Config.target. Mangled, but make it fashion ๐Ÿ’…๐ŸŽ€


๐Ÿฆ‹ val bytecode_runtime_id : string

The Runtime ID for this build of the bytecode runtime system ๐Ÿงš

Since 5.5

The Runtime ID, but specifically for this build of the bytecode runtime system. Don't mix it up with the next one, bestie, they're different and I'm obsessed with the distinction. ๐Ÿ‘‘


๐ŸŒˆ val native_runtime_id : string

The Runtime ID for this build of the native runtime system โญ

Since 5.5

Same deal, but for the native runtime system. Two runtime IDs, two totally separate lanes, no cap. ๐Ÿ”ฅ


๐Ÿ–จ๏ธ val print_config : out_channel -> unit

Access to configuration values ๐Ÿ“ฌ

Give it an out_channel and it prints the config out for you โ€” that's your window into all these values. Dump the whole thing straight into your channel of choice. ๐Ÿ’–


๐Ÿ’œ val config_var : string -> string option

the configuration value of a variable, if it exists ๐Ÿ”ฎ

Hand it a variable name, get back string option โ€” Some of the value if the variable exists, None if it doesn't. Polite, honest, no drama. ๐Ÿ™ˆ


Quick reminder bestie: everything from search_method onward? Keep the option wrappers in mind โ€” None is a valid answer and not a bug, fr fr ๐Ÿ˜ญ

That's the whole page, babes ๐Ÿ’– This one was generated by OCamldoc, dated 2026-06-22, and it's the Config(3) manual page โ€” so if anyone asks where you got all this, tell them the manpage said it, because it did ๐Ÿซถโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from
  • arch rolling: ocaml 5.5.0-1 ยท LGPL2.1 AND custom: QPL-1.0
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms