Building

Note

Most users don’t need to build cclyzer++ from source: Pre-built Debian packages and Docker images are available. See Installation for more details.

Build Dependencies

Note

You can download a pre-built Docker image with all of the build dependencies rather than installing them on your host. See Docker for details.

cclyzer++ requires Soufflé version 2.3; see the Soufflé build documentation for information on how to download and install Soufflé.

The build also requires a few Boost C++ libraries. Here’s how to get them on Ubuntu 20.04:

apt-get install libboost-system-dev libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev

Configuring the Build

There are several CMake options to configure the build:

  • -DLLVM_MAJOR_VERSION=<MAJOR_VERSION_NUMBER>: Build against a specific version of LLVM; see LLVM Library Version for supported versions.

  • -DUBSAN=1: Build the FactGenerator with the undefined behavior sanitizer.

Building the Fact Generator

To build the fact generator, run

cmake -G Ninja -B build -S .
cmake --build build -j $(nproc) --target factgen-exe

You should now see an executable at build/factgen-exe.

See the architecture documentation for more information on the role of the fact generator, and the usage documentation for details on running it.

Building the C++ Interface

To synthesize C++ code, compile it to a shared library, and compile the C++ interface, run

cmake --build build -j $(nproc) --target PAPass

(You could also run CMake without specifying --target PAPass.) The pass can be run with opt, see the usage documentation.