Skip to content
Henri edited this page Jul 9, 2014 · 25 revisions

Quick build instructions

$ ./configure
$ make
$ sudo make install

should get you there. ./configure should report any missing dependencies and point you to the packages you may install to fix them (although those may depend on your distribution). make needs to be GNU make.

Installing with dependencies

The main dependencies of Opa is OCaml 4.00 and Node.js >= 0.8. We suggest you to use opam to manage OCaml dependencies:

For instance, to set up a fresh Mac OSX system with homebrew, run:

# Dependencies
# also install XQuartz as prompted by homebrew
# and open XCode to accept its license
brew install gnu-sed coreutils ocaml opam nodejs
opam init
eval `opam config env`
opam install ulex camlzip ocamlgraph
sudo ln -s /sbin/md5 /usr/local/bin/md5sum

# Install Opa
git clone https://github.com/MLstate/opalang
cd opalang
./configure -ocamlfind `which ocamlfind`
make
make install

On a fresh Debian/Ubuntu system, run:

# Dependencies
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:avsm/ppa
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install ocaml camlp4 camlp4-extra opam nodejs make openjdk-7-jre m4 zlib1g-dev unzip git ocaml-findlib

# Install packages with opam
opam init
eval `opam config env`
opam install ulex camlzip ocamlgraph libzip-ocaml-dev ocaml-ulex

# Or directly with apt
# sudo apt-get install libocamlgraph-ocaml-dev 

# Install Opa
git clone https://github.com/MLstate/opalang
cd opalang
./configure -ocamlfind `which ocamlfind`
# workaround a bug in ocamlfind
make && make
sudo make install

Alternative

In case you want to build everything manually, you can use the installation_helper.sh script, which automates the download and installation of Opa dependencies. Try

$ tools/dependencies/installation_helper.sh --help

Building Opa in details

Should you wish to work on an unsupported platform, or to contribute to Opa, you will need to build Opa from sources. This requires a bit more work than the installation, but you should have no major difficulties. You will need:

  • git (to download the source)
  • ocaml 3.12.0-5 or later
  • libgif 4.1 or later (dev version)
  • libjpeg 8b-1 or later (dev version)
  • libpng 1.2.44 or later (dev version)
  • libssl 0.9.8 or later (dev version)
  • libxft 2.2.0 or later (dev version)
  • m4
  • dblatex
  • java 1.5 or later
  • libx11 1.4.2 or later (dev version)
  • zlib 1.2.3.4 or later (dev version)

In addition, if you are using Mac OS X, you will need:

  • GNU coreutils, wget, md5sha1sum and gsed (or gnu-sed) available via MacPorts or Homebrew
  • The Xcode suite, provided by Apple with your copy of Mac OS X (prior to Mac OS X 10.7 Lion).
  • If you do not have Xcode, you can either download Xcode 4 or Xcode 3 (registration required). In addition to general development utilities, this package provides some of the low-level, Mac-specific, tools used by Opa to produce server-side executables.

WARNING:

Starting with Xcode 4.3, Apple does not install command line tools by default anymore, so after Xcode installation, go to Preferences > Downloads > Components > Command Line Tools and click Install. You can also directly download Command Line Tools for Xcode without getting Xcode.

Once these dependencies are satisfied, take the following steps:

  • Grab the sources from GitHub by entering in a terminal:

git clone https://github.com/MLstate/opalang.git

  • In the same terminal, enter
cd opalang
./configure -prefix SOME_DIRECTORY
make all install

(You may need root privileges). This will install Opa in directory SOME_DIRECTORY

Do not forget to change your PATH variable if needed after that.

TIP:

We also provide a script that will help you install all dependencies needed for building Opa. In this case, the only dependencies should be (tested on clean Ubuntu 11.10) :

  • git (to download the source)
  • m4
  • libssl 0.9.8 or later (dev version)
  • zlib 1.2.3.4 or later (dev version)

In your opalang directory, run: tools/dependencies/installation_helper.sh --prefix SOME_DIRECTORY.

You will need to update your PATH variable after that.