OCaml for Windows (mingw-w64)

opam-repository-mingw provides an opam repository for Windows - and an experimental build of opam for Windows. It is work in progress, but it already works well enough to install packages with complex dependencies (like core_kernel) and packages with external dependencies (e.g lablgtk).

The repository is forked from the standard version. It contains Windows specific patches and build instructions. Especially build related tools (ocamlfind, omake, oasis, opam and OCaml itself, etc.) were modified, so that most unix-centric build instructions will also work with the native Windows/OCaml toolchain and I can sync the repository with the main version from time to time (without too much hassle).

The repository and opam itself are intended to be used from within cygwin. Although tools like opam or ocamlbuild are native Windows programs (no runtime dependency on cygwin1.dll), they rely on external tools that are provided by the cygwin distribution (rsync,git,patch,etc.) and won't work without a POSIX emulation layer. The cygwin distribution also ships a version of the GCC compiler (mingw-w64) that will be used internally by the OCaml compiler in order to create native executables and libraries (Cygwin's i686-w64-mingw32-gcc is a cross compiler. The compiler itself depends on cygwin1.dll and posix conventions, but the generated code is independent of cygwin).

Msys2, a dubious fork of cygwin, is not supported. The msvc toolchain might be supported in the future.

Instructions for the initial setup can be found on the Install page.




OCaml 4.03.0

OCaml version 4.03.0 is now officially supported. There are four different switches:

  • 4.03.0+mingw32
  • 4.03.0+mingw64
  • 4.03.0+flambda+mingw32
  • 4.03.0+flambda+mingw64

You can also install the pre-compiled binaries by adding a suffix-c to the switch, e.g opam switch 4.03.0+mingw64c. Bootstrapping is much faster this way, but the binaries might not work any longer, if the maintainers of the cygwin repository update their mingw64-gcc packages.

First beta of OCaml version 4.03.0

The release of OCaml version 4.03.0 is drawing near. A first beta version was released yesterday.

You can install it with opam switch 4.03.0+beta1+mingw32 or opam switch 4.03.0+beta1+mingw64.

Homepage created

I’ve just activated gh-pages for this repository. The confusing information inside the README.md have been moved to dedicated pages here.

Major changes to the opam builds or the repository will be announced here. Subscribe to the RSS-Feed to stay updated on the developments.