Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
C Intermediate Language
OCaml C TeX Perl Other
Failed to load latest commit information.
bin Standalone App::Cilly::CilCompiler perl module
doc Execute ocamlbuild only once per make invocation
lib/perl5 Add package directive to App::Cilly::CilConfig
m4 Update ocaml-autoconf macro from upstream
src Added support for GCC builtin function __builtin_bswap16
test Fix over-quoting of compiler argument strings
.gitattributes Simplify makefile
.gitignore Update .gitignore
.merlin Add findlib to .merlin Build doc on travis
.travis.yml Travis CI build scripts
CHANGES Move changelog to file CHANGES
LICENSE Minor copyright update Verbose regtest output for Travis CI Update URL of CIL tutorial (closes #11)
_tags Move ocamlutil to src
aclocal.m4 Use ocaml-autoconf macros
cil.odocl Rename Features into Feature
config.guess Update config.sub, config.guess and Better automatic remaking Reintroduce bin/ directory and continue cleanup
config.sub Update config.sub, config.guess and
configure Regenerate configure. Log during configure whether native CIL libs will be installed.
install-sh Update install-sh Install cmi, cmx and mli for CIL features Better automatic remaking

C Intermediate Language (CIL)

CIL is a front-end for the C programming language that facilitates program analysis and transformation. CIL will parse and typecheck a program, and compile it into a simplified subset of C.

CIL supports ANSI C as well as most of the extensions of the GNU C and Microsoft C compilers. A Perl script acts as a drop in replacement for either gcc or Microsoft's cl, and allows merging of the source files in your project. Other features include support for control-flow and points-to analyses.

Quick start

Install the latest release of CIL with opam:

opam install cil

Read the excellent CIL tutorial by Zachary Anderson, and check out the accompanying project template.


To build and install CIL, you need the OCaml compiler, perl, and ocamlfind. (Of course, you also need some C compiler, preferably gcc.)

Run the following commands to build and install CIL:

make test       # regression test suite, optionnal
make install    # as root or using sudo

If you want to install to some other directory, you can tweak the prefix during the configure step. For instance, to install in your local opam directory:

./configure --prefix=`opam config var prefix`


You can use cilly (installed in /usr/local/bin by default) as a drop-in replacement for gcc to compile and link your programs.

You can also use CIL as a library to write your own programs. For instance in the OCaml toplevel using findlib:

$ ocaml
        Objective Caml version 4.00.1

# #use "topfind";;
# #require "cil";;
# Cil.cilVersion;;           
- : string = "1.7.3"

More documentation

The documentation is located in the doc/html/cil directory. The API documentation (generated by ocamldoc) is in the api subdirectory.

To (re)build the doc, you need Hevea and run:

make doc

You can also browse the documentation online.


CIL is maintained by Gabriel Kerneis

Something went wrong with that request. Please try again.