Download and installation

This page contains the old versions of OCamlDuce based on OCaml 3.10.2 and CDuce 0.4.2. It is distributed under the same terms as these two projects. (See the file LICENSE in the distribution for more information.) For latest releases check this page

The following describes the installation procedure for the 3.09.2 release. OCamlDuce is installed on top of an existing OCaml installation (whose version number must match) and it requires a recent version of findlib. The build procedure is: make all && make opt && make install. The configuration is taken from OCaml's Makefile.config.

The tools are named ocamlduce, ocamlducec, ocamlduceopt, ocamlducedep, ocamlducemktop, ocamlducemktop, ocamlducefind. They are installed in the same directory as the ocaml compiler itself.

In addition, a library called ocamlduce.cma/.cmxa is built. It depends on the nums library. A findlib package named ocamlduce is created by the make install target. Normally, you don't need to care about the package except if you insist to link your modules with the regular OCaml compilers (not OCamlDuce), but there is no good reason to do so.

To generate the ocamldoc documentation for the Ocamlduce module: make htdoc.

Compiling, linking, calling the toplevel

Starting from OCamlDuce 3.09.2, you don't need to struggle with extra command-line options. You must simply use the OCamlDuce tools:

Call the toplevel: ocamlduce
Compile:           ocamlducec -c
Link:              ocamlducec -o x x.cmo
Use ocamlfind:     ocamlducefind ocamlc -o -linkpkg -package pcre 

Building from the CVS

The following commands will extract the current development version of OCamlDuce (from OCaml CVS repository and CDuce SVN repository) and compile it:

  cvs -f -d "" co -r cducetrunk ocaml
  svn co cduce
  cd ocaml
  (cd cduce && make link)
  make all
  make opt

Ports and packages


There is a godi-ocamlduce package available in GODI (sections 3.08, 3.09 and 3.10).

DarwinPorts and OpenBSD

Anil Madhavapeddy contributed two ports of OCamlDuce for DarwinPorts (in dports/lang/ocamlduce) and for OpenBSD (in ports/lang/ocamlduce).


Jaap Boender maintains a port of OCamlDuce for,