Revision 1b57c8e01a682145f576e101c868ba84ea38ec1b authored by ah744 on 06 August 2016, 01:41:28 UTC, committed by ah744 on 06 August 2016, 01:41:28 UTC
1 parent 2eae3de
Raw File
                Scaffold Compiler Working Group

                  Software README Document


Intro - About this software
Getting ScaffCC - How to get access and download from the repo
Building ScaffCC - How to build the compiler
Running the Compiler - How to compile Scaffold programs


ScaffCC is a compiler and scheduler for the Scaffold programing language. It is written using the LLVM open-source infrastructure.
It is for the purpose of writing and analyzing code for quantum computing applications.

Different parts of this software have been published in the following papers:

To cite this software, please use the following:
A. JavadiAbhari et al. "ScaffCC: A Framework for Compilation and Analysis of Quantum Computing Programs," Computing Frontiers, 2014

Getting ScaffCC:

1. Go to
2. Download the repository:
   % git clone [dir]

Building ScaffCC:
First you need to install the following dependencies. For each one, you can either install by building from source,
or use the package manager of your system ("yum" on Red Hat or "apt-get" on Ubuntu).  

1. Static libraries for libstdc++ and glibc
    Install GNU gold linker
    You can check if you have this now by doing `ld -v' and if it says 'GNU gold' you have it
    % sudo apt-get install binutils-gold

    "Red Hat"
    % sudo yum install libstdc++-static 
    % sudo yum install glibc-static

2. GCC 4.5 or higher
    NOTE: if you need to preserve an older build, consider using `update-alternatives' as system-wide method
    for preserving and maintaining these.

3. Boost 1.48
    "Source Build"
    Boost installation instructions are here:
    % wget
    % tar zxf boost_1_48_0.tar.gz && cd boost_1_48_0/
    % sudo ./
    % sudo ./b2 install --prefix=/usr/local

4. The GNU Multiple Precision Arithmetic Library (gmp and gmpxx)
    Use tab-completion to verify the correct packages (e.g. libgmp<tab><tab>)
    % sudo apt-get install libgmp-dev libgmpxx4ldbl

    "Source Build"
    % wget
    % sudo ./configure --disable-shared --enable-static --enable-cxx
    % sudo make && sudo make check && sudo make install

5. The GNU MPFR Library (mpfr)
    % sudo apt-get install libmpfr-dev

    "Source Build"
    % wget
    % sudo ./configure --disable-shared --enable-static
    % sudo make && sudo make check && sudo make install
6. Python 2.7 (or later)

Once you have all of the required libraries, simply run `make' or `make 
USE_GCC=1' at the root of the repository. The USE_GCC flag will force the 
Makefile to use GCC to compile instead, and this has been seen to be faster 
on some systems.

Running the Compiler:

Run the '' command with the path and name of the scaffold file to

% ./ Algorithms/Binary Welded Tree/Binary_Welded_Tree.scaffold

A number of example scripts have been provided in the ./scripts/ directory.
You can use these to do understand how to do a number of common things with the compiler,
such as generating intermediary .ll files, finding critical path lengths, and scheduling for architectures.
The README.txt file in that directory contains further instructions.
back to top