Previous Contents Next


Installing Objective CAML requires about 10MB of free space on one's hard disk drive. The software can easily be uninstalled without corrupting the system.

Installation under Windows

The file containing the binary distribution is called:, indicating the version number (here 2.04) and the operating system.


Objective CAML only works under recent versions of Windows : Windows 95, 98 and NT. Don't try to install it under Windows 3.x or OS2/Warp.

  1. The file is in compressed (.zip) format; the first thing to do is decompress it. Use your favorite decompression software for this. You obtain in this way a file hierarchy whose root is named ocaml. You can place this directory at any location on your hard disk. It is denoted by <caml-dir> in what follows.
  2. This directory includes:

  3. If you have chosen a directory other than c:\ocaml as the root of your file hierarchy, then it is necessary to indicate this in the configuration file. Edit it with Wordpad and change the line defining CmdLine which is of the form:
    CmdLine=ocamlrun c:\ocaml\bin\ocaml.exe -I c:\ocaml\lib
    CmdLine=ocamlrun <caml-dir>\bin\ocaml.exe -I <caml-dir>\lib
    You have to replace the names of the search paths for binaries and libraries with the name of the Objective CAML root directory. If we have chosen C:\Lang\ocaml as the root directory (<caml-dir>), the modification becomes:
    CmdLine=ocamlrun C:\Lang\ocaml\bin\ocaml.exe -I C:\Lang\ocaml\lib
  4. Copy the file OCamlWin.ini to the main system directory, that is, C:\windows or C:\win95 or C:\winnt according to the installation of your system.
Now it's time to test the OCamlWin application by double-clicking on it. You'll get the window in figure 1.1.

Figure 1.1: Objective CAML window under Windows.

The configuration of command-line executables, launched from a DOS window, is done by modifying the PATH variable and the Objective CAML library search path variable (CAMLLIB), as follows:
set CAMLLIB=<caml-dir>\lib
where <caml-dir> is replaced by the path where Objective CAML is installed.

These two commands can be included in the autoexec.bat file which every good DOS has. To test the command-line executables, type the command ocaml in a DOS window. This executes the file:
corresponding to the Objective CAML. text mode toplevel. To exit from this command, type #quit;;.

To install Objective CAML from source under Windows is not so easy, because it requires the use of commercial software, in particular the Microsoft C compiler. Refer to the file of the binary distribution to get the details.

Installation under Linux

The Linux installation also has an easy-to-install binary distribution in the form of an rpm. package. Installation from source is described in section 1. The file to download is: ocaml-2.04-2.i386.rpm which will be used as follows with root privileges:
rpm -i ocaml-2.04-2.i386.rpm
which installs the executables in the /usr/bin directory and the libraries in the /usr/lib/ocaml directory.

To test the installation, type: ocamlc -v which prints the version of Objective CAML installed on the machine.
ocamlc -v
The Objective Caml compiler, version 2.04
Standard library directory: /usr/lib/ocaml
You can also execute the command ocaml which prints the header of the interactive toplevel.
        Objective Caml version 2.04

The # character is the prompt in the interactive toplevel. This interactive toplevel can be exited by the #quit;; directive, or by typing CTRL-D. The two semi-colons indicate the end of an Objective CAML phrase.

Installation under MacOS

The MacOS distribution is also in the form of a self-extracting binary. The file to download is: ocaml-2.04-mac.sea.bin which is compressed. Use your favorite software to decompress it. Then all you have to do to install it is launch the self-extracting archive and follow the instructions printed in the dialog box to choose the location of the distribution. For the MacOS X server distribution, follow the installation from source under Unix.

Installation from source under Unix

Objective CAML can be installed on systems in the Unix family from the source distribution. Indeed it will be necessary to compile the Objective CAML system. To do this, one must either have a C compiler on one's Unix, machine, which is generally the case, or download one such as gcc which works on most Unix. systems. The Objective CAML distribution file containing the source is: ocaml-2.04.tar.gz. The file INSTALL describes, in a very clear way, the various stages of configuring, making, and then installing the binaries.

Installation of the HTML documentation

Objective CAML's English documentation is present also in the form of a hierarchy of HTML files which can be found in the docs directory of the CD-ROM.

This documentation is a reference manual. It is not easy reading for the beginner. Nevertheless it is quite useful as a description of the language, its tools, and its libraries. It will soon become indispensable for anyone who hopes to write a program of more than ten lines.

Previous Contents Next