Installation¶
Requirements and dependencies¶
The following software is required in order to build CirKit
- git (at least version 1.6.5)
- cmake (at least version 3.0.0)
- g++ (at least version 4.9.0) or clang++ (at least version 3.5.0)
- boost (at least version 1.56.0)
- GNU MP, and its C++ interface GMP++
- GNU readline
Installing dependencies in Ubuntu Linux¶
In Ubuntu the packages can be installed with:
sudo apt-get install build-essential git g++ cmake libboost-all-dev libgmp3-dev libxml2-dev zlib1g-dev lapack openblas
Installing dependencies in Arch Linux¶
In arch the packages can be installed with:
sudo pacman -S base-devel git g++ cmake boost boost-libs gmp libxml2 zlib lapack
Build and run CirKit¶
After extracting or cloning CirKit perform the following steps:
git clone --recursive https://github.com/msoeken/cirkit.git
cd cirkit
mkdir build
cd build
cmake ..
make external
make cirkit
CirKit can be executed with:
build/programs/cirkit
Build and run RevKit¶
After extracting or cloning CirKit perform the following steps:
git clone --recursive https://github.com/msoeken/cirkit.git
cd cirkit
mkdir build
cd build
cmake -Denable_cirkit-addon-reversible=ON -Denable_cirkit-addon-formal=ON ..
make external
make revkit
RevKit can be executed with:
build/programs/revkit
Python interface¶
The CLI from CirKit and RevKit can be invoked using a Python interface. The implementation is based on pybind11 and can be enabled and compiled as follows:
cd build
cmake -Dcirkit_ENABLE_PYTHON_API=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_EXECUTABLE=/path/to/python ..
make cirkit_python
Replace /path/to/python
to the path of a Python3 executable on the
system and replace cirkit_python
by revkit_python
to build the
RevKit CLI Python API.
Start Jupyter notebook¶
The Python CLI can conveniently be used through a Jupyter notebooks
and some notebooks are provided in the jupyter
directory. From
the main directory in CirKit, one can do the following:
cd jupyter
PYTHONPATH=`pwd`/../build/programs jupyter notebook
Troubleshooting¶
No recent cmake version¶
If for some reason only older versions of cmake
are available on
the system, you can install cmake using utils/tools.py install
cmake
directly from CirKit. Afterwards update the $PATH
variable
by typing export PATH=<path-to-cirkit>/ext/bin:$PATH
.
Libraries not found¶
It’s best to set the environment variable CIRKIT_HOME
to the
directory of CirKit using:
export CIRKIT_HOME=<full-path-to-cirkit>
or some other command depending on the user’s shell. Also, sometimes depending libraries are not found, then run:
export LD_LIBRARY_PATH=$CIRKIT_HOME/ext/lib:$LD_LIBRARY_PATH
in Linux or:
export DYLD_LIBRARY_PATH=$CIRKIT_HOME/ext/lib:$DYLD_LIBRARY_PATH
in Mac OS.
No recent Boost version¶
There is a manual way to install Boost and CirKit’s package manager can help. Before installing CirKit run:
mkdir build
./utils/tools.py install boost
cd build
cmake -DBoost_NO_SYSTEM_PATHS=TRUE -DBOOST_ROOT:PATHNAME=`pwd`/tools/boost_1_63_0/ ..
make external
make cirkit
Of course, one can add further options to the cmake
command in the
fourth line, e.g., to build RevKit.