## 2 Installation

You will need OCaml release 3.08 or higher to build CIL. CIL has been tested on Linux and on Windows (where it can behave at either Microsoft Visual C or gcc).
If you want to use CIL on Windows then you must get a complete installation of `cygwin` and the source-code OCaml distribution and compile it yourself using the cygwin tools (as opposed to getting the Win32 native-code version of OCaml). If you have not done this before then take a look here. (Don't need to worry about `cvs` and `ssh` unless you will need to use the master CVS repository for CIL.)

1. Download the CIL distribution (latest version is `distrib/cil-1.3.3.tar.gz`). See the Section 21 for recent changes to the CIL distribution.
2. Unzip and untar the source distribution. This will create a directory called `cil` whose structure is explained below.
   `tar xvfz cil-1.3.3.tar.gz`
3. Enter the `cil` directory and run the `configure` script and then GNU make to build the distribution. If you are on Windows, at least the `configure` step must be run from within `bash`.
   `cd cil`
   `./configure`
   `make`
   `make quicktest`
4. You should now find `cilly.asm.exe` in a subdirectory of `obj`. The name of the subdirectory is either `x86_WIN32` if you are using `cygwin` on Windows or `x86_LINUX` if you are using Linux (although you should be using instead the Perl wrapper `bin/cilly`). Note that we do not have an `install` make target and you should use Cil from the development directory.
5. If you decide to use CIL, please send us a note. This will help recharge our batteries after more than a year of development. And of course, do send us your bug reports as well.

The `configure` script tries to find appropriate defaults for your system. You can control its actions by passing the following arguments:

- `CC=foo` Specifies the path for the `gcc` executable. By default whichever version is in the PATH is used. If `CC` specifies the Microsoft `cl` compiler, then that compiler will be set as the default one. Otherwise, the `gcc` compiler will be the default.

CIL requires an underlying C compiler and preprocessor. CIL depends on the underlying compiler and machine for the sizes and alignment of types.The installation procedure for CIL queries the underlying compiler for architecture and compiler dependent configuration parameters, such as the size of a pointer or the particular alignment rules for structure fields. (This means, of course, that you should re-run `./configure` when you move CIL to another machine.)

- On Windows, `cl` compiler version 12.00.8168 and 13.00.9466. Run `cl` with no arguments to get the compiler version.
- On Windows, using `cygwin` and `gcc` version 2.95.3, 3.0 and 3.2.
- On Linux, using `gcc` version 2.95.3, 3.0 and 3.2.