RevKit can be downloaded from the www.revkit.org website.
RevKit has the following requirements:
libs/cmake-2.8.0/bin
to your PATH environment variable.Further requirements are boost 1.51.0, CUDD, cuddread, and PUMA. Their sources will be automatically downloaded and compiled during the bootstrap of the installation (see below). This process may take some time.
The following table lists the names of all directories and a short description.
Directory | Description |
build | Build directory which is created by the ./build.sh script |
doc | Source code documentation and user manual |
helpers | Helper scripts for code-stub generation |
scripts | Scripts for the bootstrap and build process |
src/algorithms | stable algorithms (e.g. for synthesis, optimization, ...) |
src/bindings | Code for the Python bindings |
src/core | Core library with basic data structures and functions |
src/examples | C++ First Steps examples from this documentation. |
src/unstable | Unstable algorithms (under development) |
libs | Third party dependencies |
tools | Small python scripts for stand-alone usage of the algorithms |
In order to install RevKit, go to the directory to where you checked out the sources (i.e. where you find directories like src, scripts, tools ...). Then, perform the following steps:
This will initialize the revkit directory with the depending libraries. So this step has to be performed once. In this process, compiling boost takes some time. If you already have installed boost using the distribution's package manager, the option -DBOOST_PATH can be used to specify its path, e.g. -DBOOST_PATH=/usr. Alternatively you can specify the boost include and libs path separately by using –boost, –boost-include-dir and –boost-lib-dir as arguements. If there are multiple versions of python installed on the system and boost is compiled to utilize all versions, there may be no libboost_python library (link) but several libboost_python-* libraries. In that case a symlink to libboost_python-2.* located at the lib or your revkit/libs directory will solve this problem. Afterwards the Revkit algorithms can be compiled. To do so, call:
This will compile the core, algorithms, examples, and the Python bindings. If for some reason the Python bindings cannot be compiled or if they are not required, they can be dactivated by adding the -DBUILD_BINDINGS=OFF option:
If you want to install the library to certain location (which is not necessary), you can use -DCMAKE_INSTALL_PREFIX, e.g.:
Of course, all the options can be combined and also changed after the initial building, e.g. with the cmake-gui:
If you added a new C++ based algorithm to RevKit or modified the existing ones, there is no need to run ./make.py build
again. But it's still possible. Instead, you can compile your extensions by simply entering:
Hint: The libraries and executables that were built are in the respective sub-directories, e.g. build/core, build/examples, ...
Internally, RevKit extensively uses the Boost libraries. Some of the concepts might also be useful for extensions. Thus, in the following two of the Boost libraries are motivated by means of small examples.
Boost.Assignment makes it easier to insert elements into containers. This is illustrated by the following example, where names are added to a vector
of std::string
.
This example also works e.g. with std::set
.
Boost.Foreach enables a foreach - style loop inside C++. This construct internally uses efficient C++ iterator techniques, so it is safe to use from this point of view. The following small example demonstrates how to use Boost.Foreach in order to loop through a vector of strings which was former created by Boost.Assign (see above). Note, that we defined a macro to call BOOST_FOREACH foreach in order to make it more readable.
Boost.Format gives you a C++ alternative to C's printf
. In the following example, first a string is printed out to the standard output and, afterwards, another string is generated. All known placeholders and format options of printf
can be used.