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โTrueif 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-libdirthen 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, orNoneotherwise.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 usingConfig.standard_library_relativeif necessary.Since 5.5โจval standard_library : stringโ the effective directory containing the standard libraries, takingCAMLLIBandOCAMLLIBinto 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_VERfollows and optionallyclang-ifclang-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 eithergcc-orclang-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 flagsocamlcshould pass to the C compiler.val bytecode_cppflags : stringโ the flagsocamlcshould pass to the C preprocessor.val native_cflags : stringโ the flagsocamloptshould pass to the C compiler.val native_cppflags : stringโ the flagsocamloptshould 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 beforeConfig.native_c_librariesin 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 byocamlmklib).val mksharedlibrpath : stringโ option to add a directory to be searched for shared libraries at runtime (used byocamlmklib).val ar : stringโ name of thearcommand, 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 asObj.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, seeruntime/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โTrueiftarget_os_type = "Unix".Since 5.5โจval target_win32 : boolโTrueiftarget_os_type = "Win32".Since 5.5โจval target_cygwin : boolโTrueiftarget_os_type = "Cygwin".Since 5.5โจval asm : stringโ the assembler (and flags) to use for assemblingocamlopt-generated code.val asm_cfi_supported : boolโ whether assembler understands CFI directives.val asm_size_type_directives : boolโ whether the.sizeand.typeassembler directives can be used.Since 5.4โจval asm_dwarf_version : int optionโ the DWARF Version emitted by theConfig.asmcommand. At present this is only implemented for the clang internal assembler, all other assemblers haveNone.Since 5.5โจval with_frame_pointers : boolโ whether assembler should maintain frame pointers.val ext_obj : stringโ extension for object files, e.g..ounder Unix.val ext_asm : stringโ extension for assembler files, e.g..sunder Unix.val ext_lib : stringโ extension for library files, e.g..aunder Unix.val ext_dll : stringโ extension for dynamically-loaded libraries, e.g..sounder Unix.val ext_exe : stringโ extension for executable programs, e.g..exeunder Windows.Since 4.12โจval default_executable_name : stringโ name of executable produced by linking if none is given with-o, e.g.a.outunder 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. Iffalse, afloatarrayvalue 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โ whetherarsupports@FILEarguments.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 thatlaunch_methodtype. ๐
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 fromsearch_methodonward? Keep the option wrappers in mind โNoneis 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