There are several ways to compile and distribute OCaml on Windows. This installer distributes the native, mingw-w64, 64-bit port of OCaml along with a native, 64-bit OPAM. The installer offers to install Cygwin so that you get 1) the proper compiler toolchain needed to use ocamlopt and 2) Unix tools such as make, bash and others, which most packages depend on.
Instructions!Getting everything to work right can be tricky. Please follow the instructions on the wiki before even downloading the installer!
The installer has been tested on Windows XP, Windows 7, Windows 8. Have you run the sanity checks from the instructions on the wiki? In that case you may proceed.Installer for 64-bit OCaml 4.02.3 + OPAM
- 32-bit OCaml 4.02.3 + Cygwin32 OPAM (Note: opam install merlin works with this one, but not depext-cygports. This is a stock OPAM.)
- 32-bit OCaml 4.02.3 + findlib + batteries
- other old (minor) versions
The full story
See my entry on the Gagallium blog for the (outdated) details.
- The compiler binaries (ocamlc, ocamlopt, etc.) are compiled with x86_64-mingw64: they are native windows programs.
- ocamlopt generates native windows programs: ocamlopt depends on x86_64-mingw64.
- Cygwin is used as a development environment, because it packages mingw (needed for ocamlopt to work properly), as (needed for ocamlopt) and other Unix tools required by ocamlbuild and others.
- opam for Windows comes from David Allsop's fork; it has been patched by yours truly in order to, among other things, point to Andreas Hauptmann's OPAM repository by default.
- Andreas' repository contains patched packages (so that more of them build on Windows); it also contains depext-cygwinports, an OPAM plugin that is capable of fetching system dependencies as cygwin packages for the x86_64-mingw64 toolchain. Concrete example: opam depext ssl will call into Cygwinports to make sure that openssl gets installed into your Cygwin setup for the right toolchain.
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.