There are several ways to compile and distribute OCaml on Windows. This installer will:

  • install OCaml, findlib, camlp4, flexdll and batteries
  • (optional) launch the cygwin setup with the right packages pre-configured so that you have a working OCaml development environment.

The full story

See my entry on the Gagallium blog for the full details. Long story short: this is a 32-bit build with the gcc compiler from the mingw-w64 project.

  • The compiler binaries (ocamlc, ocamlopt, etc.) are compiled with mingw-w64: they are native windows programs.
  • ocamlopt generates native windows programs: ocamlopt depends on mingw-w64.
  • Cygwin is used as a development environment, because it packages mingw-w64 (needed for ocamlopt to work properly), as (needed for ocamlopt) and other Unix tools required by ocamlbuild and others.
  • However, the mingw-w64 compilers are native windows programs. Cygwin is only used because it has all the unix utilities and a package management system.

If you already have Cygwin installed, just make sure the following packages are present: curl, make, mingw64-i686-gcc-g++, mingw64-i686-gcc, patch, rlwrap, libreadline6, diffutils. Some of these are required for odb to work properly.


The installer has been tested on Windows XP, Windows 7, Windows 8.

Other versions


  • No longer package Emacs and ActiveTCL (too much work, unsure that actually benefited anyone). Let me know if that broke things for you.
  • Don't override the PATH variable anymore
  • Switch to the latest i686-mingw32-w64 toolchain (the 32-bit compiler from the mingw-w64 project)
  • findlib is now packaged and properly configured
  • Make it possible to install OCaml as a non-privileged user
  • Better cleanups when uninstalling

Known issues

  • Most antivirus software will flag the OCaml installer as being a virus, because OCaml is using NSIS (see the NSIS website). There is a discussion in issue 17 on the bugtracker; the last comment provides indications for reporting the installer as a false positive. Please do.


The installer picture is from Flick © Neil and Kathy Carey. The installer uses NSIS which a its own license. The installer also uses NSISunz which was originally written by Saivert.

Bugs, patches

The project lives on GitHub. Please file any bug in the "Issues" section there.

The README there should contain enough information to get you (roughly) started if you want to repackage the installer yourself.