Introduction

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

  • install OCaml, findlib and flexdll
  • (optional) install Emacs with the caml-mode setup and the right file associations in the Windows explorer,
  • (optional) install ActiveTCL so that OCamlBrowser and labltk can work properly
  • (optional) launch the cygwin setup with the right packages pre-configured so that you have a working OCaml development environment.
Working inside a MSys environment is no longer officially supported, so the installer now supports Cygwin. It is still possible to get OCaml to run inside a MSys/MinGW environment, but you're on your own. See this link for instructions.

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.

Download

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

Other versions

Changes

  • 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.

Credits

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.