Build System and Package Management

OCaml Package Management

  • OPAM is the modern package manager for OCaml. If you want to publish a library in OCaml, OPAM is your best and only option, taking care of package dependency and invoking the build system as needed.
  • OPAM for Windows - opam repository and experimental native build for Windows.
  • makorel – Release OPAM packages easily. (edit: Is this maintained?)
  • topkg is a tool that allows you to easily release and maintain many OCaml packages at once. A little bit of extra metadata in your repo gives you the ability to use the topkg command line tools and manage your authored packages.

OCaml Build System

  • Dune (formerly jbuilder) is a fast, easy to use build system for OCaml projects, and is seen as the main choice for new projects in OCaml. Dune can handle both OCaml (.ml) and Reason (.re) files.
  • ocamlfind is a utility similar to pkg-config that allows local libraries to find each other on your system. You don't need to have much awareness of ocamlfind nowadays because Dune and OPAM (see below) will do all the work, but it's good to know about ocamlfind's existence.

ReasonML Build System/Package Management

  • Reason lives in the Javascript ecosystem, and as such, its build tool of choice is Bucklescript, and its package management solution is npm

Legacy OCaml build systems

You may find some other build systems used by various OCaml projects. The general recommendation though is to stick with Dune whenever possible.

  • ocamlbuild: the option most used as a build tool before Dune came about.
  • Oasis: An older tool to integrate a configure, build and install system in your OCaml project. Before OPAM and Dune, this was a relatively easy way to create your project.
  • oasis2opam: Tool to convert OASIS metadata to OPAM package descriptions.
  • jenga: A monadic build system from Jane Street. Much of the underlying system used by Dune is composed of code from Jenga.
  • ocaml-makefile: Easy to use Makefile for small to medium-sized OCaml-projects.
  • obuild: Simple package build system for ocaml.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License