Previous Up Next

2  Installation

You need the following tools to build CIL:

  1. Get the source code.
  2. 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
        make quicktest
  3. 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.
  4. If you decide to use CIL, please send us a note. This will help recharge our batteries after a few years 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:

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.)

We have tested CIL on the following compilers:

Others have successfully used CIL on x86 processors with Mac OS X, FreeBSD and OpenBSD; on amd64 processors with FreeBSD; on SPARC processors with Solaris; and on PowerPC processors with Mac OS X. If you make any changes to the build system in order to run CIL on your platform, please send us a patch.

2.1  Building CIL on Windows with Microsoft Visual C

Some users might want to build a standalone CIL executable on Windows (an executable that does not require cygwin.dll to run). You will need cygwin for the build process only. Here is how we do it

  1. Start with a clean CIL directory
  2. Start a command-line window setup with the environment variables for Microsoft Visual Studio. You can do this by choosing Programs/Microsoft Visual Studio/Tools/Command Prompt. Check that you can run cl.
  3. Ensure that ocamlc refers to a Win32 version of ocaml. Run ocamlc -v and look at the path to the standard library. If you have several versions of ocaml, you must set the following variables:
          set OCAMLWIN=C:/Programs/ocaml-win
          set OCAMLLIB=%OCAMLWIN%/lib
          set PATH=%OCAMLWIN%/bin;%PATH%
          set INCLUDE=%INCLUDE%;%OCAMLWIN%/inc
          set LIB=%LIB%;%OCAMLWIN%/lib;obj/x86_WIN32
  4. Run bash -c "./configure CC=cl".
  5. Run bash -c "make WIN32=1 quickbuild"
  6. Run bash -c "make WIN32=1 NATIVECAML=1 cilly
  7. Run bash -c "make WIN32=1 doc
  8. Run bash -c "make WIN32=1 bindistrib-nocheck

The above steps do not build the CIL library, but just the executable. The last step will create a subdirectory TEMP_cil-bindistrib that contains everything that you need to run CIL on another machine. You will have to edit manually some of the files in the bin directory to replace CILHOME. The resulting CIL can be run with ActiveState Perl also.

Previous Up Next