Config_main(3)
π Config_main(3) β System configuration π
okay bestie, this is the Config_main(3) page β the system-configuration module thatβs basically the compilerβs little ID card, and this is part 1 of the saga. No goodbye at the end, because more parts are coming. π
πΈ NAME πΈ
Config_main β System configuration
π§© Module π§©
Module Config_main
π Documentation π
Module Config_main : sig end
System configuration
β οΈ Warning: this module is unstable and part of Compiler_libs.
Here come all the vals in order, bestie β no skipping, no βoops I forgot one.β π«Ά
val version : stringβ the current version number of the system. β¨val release_number : intβ the release number for the compiler. Since 5.5val is_official_release : boolβTrueif the compiler is an unmodified official OCaml release. Since 5.5val 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.5val target_bindir : stringβ the directory containing the runtime binaries on the target system. Since 5.5val standard_library_default : stringβ the effective value for the default directory containing the standard libraries. This is always an absolute path, computed usingConfig_main.standard_library_relativeif necessary. Since 5.5val 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)"msvc"(for Microsoft Visual C++ and MASM). π οΈval c_compiler : stringβ the compiler to use for compiling C files.val c_compiler_vendor : stringβ 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.
Since 5.5
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.5val 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_main.native_c_librariesin a call to the C compiler). Since 5.4val native_ldflags : stringβ the page doesnβt give a description here, bestie; itβs just the type and the vibe. π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.4val 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.1val 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.5val target_win32 : boolβTrueiftarget_os_type = "Win32". Since 5.5val target_cygwin : boolβTrueiftarget_os_type = "Cygwin". Since 5.5val 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.4val asm_dwarf_version : int optionβ the DWARF Version emitted by theConfig_main.asmcommand. At present this is only implemented for the clang internal assembler, all other assemblers haveNone. Since 5.5val 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.12val 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. (Yep, thatβs the description on the page β same energy astarget.)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 alignint64values.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.14val supports_shared_libraries : boolβ whether shared libraries are supported. Since 4.08val native_dynlink : boolβ whether native shared libraries are supported. Since 5.1val 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.
And now the launch_method type era, bestie β itβs giving launch-mechanism main character energy. β¨
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 .
*)
Launch mechanisms for bytecode executables. Since 5.5
val launch_method : launch_method
π Default launch mechanism for bytecode executables
Okay so this one is Since 5.5 and it's all about how bytecode executables find their interpreter π
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
*)
Mechanisms used by tendered bytecode executables to locate the interpreter π
Here's the vibe check on each variant:
Disableβ interpreter searching is off, bestie. It'll only check the fixed absolute location, that's it, no hunting around πFallbackβ it peeks at the fixed absolute location first, but if that fails it falls back to a search π«ΆEnableβ always search for the interpreter, no notes, main character energy β¨
val search_method : search_methodβ the default search mechanism for bytecode executables π Since 5.5val shebangscripts : boolβ whether the target supports shebang scripts πΈ Since 5.5val suffixing : boolβ whether the runtime executable and shared library filenames and C stub library filenames are being mangled with Runtime IDs and theConfig_main.targetπ₯ Since 5.5val bytecode_runtime_id : stringβ the Runtime ID for this build of the bytecode runtime system π Since 5.5val native_runtime_id : stringβ the Runtime ID for this build of the native runtime system π Since 5.5val print_config : out_channel -> unitβ access to configuration values, literally hands you the whole config πval config_var : string -> string optionβ the configuration value of a variable, if it exists π (and if it doesn't, wellβ¦optionsaid what it said π)
ngl that's the whole thing bestie β every val, every variant, every Since 5.5, all accounted for π§
And that's a wrap on Config_main(3)! This lil doc was brought to you by OCamldoc, version/date stamped 2026-06-22 β go forth and configure, you gorgeous icon ππβ¨
π¦ 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