OCaml 5.5.2
Installation Instructions
The base compiler can be installed as an opam switch with the following commands:
opam update
opam switch create 5.5.2
The source code for OCaml 5.5.2 is also directly available on:
Configuration Options
The configuration of the installed opam switch can be tuned with the following options:
ocaml-option-afl: Set OCaml to be compiled withafl-fuzzinstrumentationocaml-option-bytecode-only: Compile OCaml without the native-code compilerocaml-option-flambda: Set OCaml to be compiled withflambdaactivatedocaml-option-musl: Set OCaml to be compiled withmusl-gccocaml-option-no-flat-float-array: Set OCaml to be compiled with--disable-flat-float-arrayocaml-option-static: Set OCaml to be compiled withmusl-gcc -staticocaml-option-tsan: Set OCaml to be compiled with thread sanitiser supportocaml-option-address-sanitizer: Set OCaml to be compiled with address sanitiserocaml-option-leak-sanitizer: Set OCaml to be compiled with leak sanitiserocaml-option-fp: Set OCaml to be compiled with frame pointers
For instance, one can install a switch with both flambda and the --disable-flat-float-array option with
opam switch create 5.5.2+flambda+nffa ocaml-variants.5.5.2+options ocaml-option-flambda ocaml-option-no-flat-float-array
Source Distribution
- Source
tarball
(
.tar.gz) for compilation under Unix (including Linux and macOS X) and Microsoft Windows (including Cygwin) - Also available in
.zipformat - Opam is a source-based distribution of OCaml and many companion libraries and tools. Compilation and installation are automated by powerful package managers.
- The official development repo is hosted on GitHub.
The INSTALL file of the distribution provides detailed compilation and installation instructions. See also the Windows release notes for instructions on how to build under Windows.
Alternative Compilers
Additionally, the following projects allow you to compile OCaml code to targets traditionally associated with other languages:
- Js_of_ocaml is a stable OCaml to JavaScript compiler.
- wasm_of_ocaml is a stable OCaml to WebAssembly compiler.
User Manual
The user manual for OCaml can be:
- Browsed online
- Downloaded as a single PDF or plain text document
- Downloaded as a single TAR or ZIP archive of HTML files
- Downloaded as a single tarball of Emacs info files
Changes
Bug fixes
-
#15045: Atomic loads whose results are unused should not be removed during dead-code elimination. (Xavier Clerc, review by Steven Dolan and KC Sivaramakrishnan)
-
#15067, #15071: Fix detection of functions available in the future on macOS. (Antonin Décimo, review by Nicolás Ojeda Bär and Damien Doligez)
-
#15112, OSEC-2026-22:
Unix.map_file: protect against overflow when computing the data size. (Xavier Leroy and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and Edwin Török) -
#15113, OSEC-2026-21:
Str.string_partial_match: make sure captured groups are valid. (Xavier Leroy, review by Nicolás Ojeda Bär and Edwin Török) -
#15115, OSEC-2026-23: Fix multiple issues in demarshaling (
Marshal.from_{channel,string,bytes}) (Xavier Leroy, review by Nicolás Ojeda Bär) -
#15133, OSEC 2026-24: Multiple issues in command quoting on Windows (Xavier Leroy and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär)
-
#15119, OSEC-2026-25: Harden decoding of runtime events messages from ring buffers. (Sadiq Jaffer, report by Hannes Mehnert, review by Olivier Nicole and Edwin Török)
-
#15177, OSEC-2026-26: Maintain custom events cache integrity. (Sadiq Jaffer, report by Hannes Mehnert, review by Edwin Török)
-
#15043, #15076: runtime events library, fix an infinite loop when a user event is larger than half the ring buffer. (Tim McGilchrist, review by Sadiq Jaffer)
-
#15185, #15187: fix a pattern-matching miscompilation on certain combinations of immediate ranges and redundant patterns (Gabriel Scherer, report by Alperer Keleş, review by Vincent Laviron and Florian Angeletti)