Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (63 sloc) 3.32 KB

Recipes for your own OCaml brews

Most of these recipes do not require any manual downloads. Each curl command has an associated comment which shows how you would perform the equivalent task with a local copy of ocamlbrew.

Unless otherwise noted, each of the recipes below will install under $HOME/ocamlbrew.

Latest stable OCaml with all available goodies

# Equivalent to: ./ocamlbrew -a
# This is the default when using ocamlbrew-install, so it's not
# necessary to specify $OCAMLBREW_FLAGS.
curl -kL | bash

Latest OCaml trunk, findlib,

# Equivalent to: ./ocamlbrew -t -f
# Specify that we want to pull from Subversion trunk and we only want
# OCaml, findlib, and
export OCAMLBREW_FLAGS="-t -f"
curl -kL | bash

Latest OCaml 3.12.x development version, no other tools

# Equivalent to: ./ocamlbrew -s version/3.12 -o
# Specify an explicit Subversion path to pull from and we want OCaml only
export OCAMLBREW_FLAGS="-s version/3.12 -o"
curl -kL | bash

OCaml gadts-devel branch, findlib,

# Equivalent to: ./ocamlbrew -s branches/gadt-devel -f
# Specify an explicit Subversion path to pull from and we only want OCaml,
# findlib, and
export OCAMLBREW_FLAGS="-s branches/gadt-devel -f"
curl -kL | bash

Install to a custom brew root

# Build and install under /opt/ocamlbrew
export OCAMLBREW_BASE=/opt/ocamlbrew
# Equivalent to: ./ocamlbrew -a
curl -kL | bash

Install OCaml trunk to a full customized directory

# Build and install under /opt/ocamlbrew/
# Equivalent to: ./ocamlbrew -t -f -b /opt/ocamlbrew -n trunk
export OCAMLBREW_FLAGS="-t -f -b /opt/ocamlbrew -n trunk"
curl -kL | bash

Download ocamlbrew and run it locally

This method will prompt you before the brewing begins, asking if you want to install each available package.

# Download...
cd /tmp
curl -O
# ... and run, optionally configuring the environment first
bash ocamlbrew

You will be provided with several prompts asking which software to install. OCaml is always installed, with findlib, oasis, Batteries, utop, and ocamlscript optionally included as well. If they are requested, oasis, Batteries, utop, and ocamlscript are all installed using oasis-db via odb.

Jump to Line
Something went wrong with that request. Please try again.