Config(3) OCaml library Config(3)

# [NAME](#NAME)

Config - System configuration

# [Module](#Module)

Module Config

# [Documentation](#Documentation)

Module **Config**  
: **sig end**

System configuration

Warning: this module is unstable and part of **Compiler\_libs** .

*val version* : **string**

The current version number of the system

*val bindir* : **string**

The directory containing the binary programs

*val standard\_library* : **string**

The directory containing the standard libraries

*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\_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 ocamlc\_cflags* : **string**

The flags ocamlc should pass to the C compiler

*val ocamlc\_cppflags* : **string**

The flags ocamlc should pass to the C preprocessor

*val ocamlopt\_cflags* : **string**

**Deprecated.**

**Config.ocamlc\_cflags** should be used instead. The flags ocamlopt should pass to the C compiler

*val ocamlopt\_cppflags* : **string**

**Deprecated.**

**Config.ocamlc\_cppflags** should be used instead. 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 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 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 asm* : **string**

The assembler (and flags) to use for assembling ocamlopt-generated code.

*val asm\_cfi\_supported* : **bool**

Whether assembler understands CFI directives

*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.0

*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 profinfo* : **bool**

Whether the compiler was configured for profiling

*val profinfo\_width* : **int**

How many bits are to be used in values' headers for profiling information

*val safe\_string* : **bool**

Whether the compiler was configured with -force-safe-string; in that case, the -unsafe-string compile-time option is unavailable

**Since** 4.05.0

*val default\_safe\_string* : **bool**

Whether the compiler was configured to use the -safe-string or -unsafe-string compile-time option by default.

**Since** 4.06.0

*val flat\_float\_array* : **bool**

Whether the compiler and runtime automagically flatten float arrays

*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.0

*val supports\_shared\_libraries* : **bool**

Whether shared libraries are supported

**Since** 4.08.0

*val afl\_instrument* : **bool**

Whether afl-fuzz instrumentation is generated by default

*val ar\_supports\_response\_files* : **bool**

Whether ar supports @FILE arguments.

*val print\_config* : **out\_channel -&gt; unit**

Access to configuration values

*val config\_var* : **string -&gt; string option**

the configuration value of a variable, if it exists

2026-09-15 OCamldoc

---

Document: Config(3o) from ocaml-4 4.14.4-r3 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
