Skip to content
mmcgr edited this page Aug 2, 2017 · 21 revisions

Building and Installation of Soufflé

Pre-Build Packages

Soufflé has pre-built packages for Debian and MAC OS X. You find the pre-built packages here.

Software Requirements

To build and install Souffle, the following software must be installed:

  • Make, Autoconf tools, GNU G++ supporting C++11 and OpenMP (from version 4.8), Bison (from version 3.0.2), Flex, DoxyGen, Java JDK

CLANG++ with OpenMP support can be used as an alternative for G++.

G++-7 in conjunction with OpenMP is known to compile Soufflé incorrectly. Use an earlier version of G++ or do not compile with OpenMP.

Ubuntu/Debian Build

On a Ubuntu/Debian system, following command installs the necessary developer tools to compile and build Soufflé:

sudo apt-get install autoconf automake bison build-essential doxygen flex g++ git libsqlite3-dev libtool make openjdk-8-jdk pkg-config python zlib1g-dev

If clang++ is used to build Soufflé, then the libomp-dev package may also be required if support of parallel execution is needed.

sudo apt-get install libomp-dev

Note that the Ubuntu/Debian version needs to be recent such that G++ 4.8 is part of the standard distribution.

The Soufflé project follows automake/autoconf conventions for configuring, installing and building software. To configure, build, test, and install the project, type:

 cd souffle
 sh ./bootstrap
 ./configure
 make

MAC OS X Build

MAC OS X does not have OpenMP/C++ nor a bison version 3.0.2 or higher installed. We recommend brew to install the required tools to build Soufflé. Run the following commands prior to executing ./configure:

brew update
brew install autoconf automake bison libtool pkg-config
brew reinstall gcc --without-multilib
brew link bison --force

Note: Be careful with the search path for bison, so it points to the correct one. By default, macOS includes bison 2.3 at /usr/bin/bison, however brew installs the newer version to /usr/local/bin/bison. This can be done by prepending this directory to the path, however, this can break other systems - PATH=/usr/local/bin:$PATH.

In addition, Java JDK is necessary for the Java Natural Interface (JNI) extension of Soufflé.

Soufflé is built by

cd souffle
export CXX=/usr/local/bin/g++-5
export CXXFLAGS=-fopenmp
export SOUFFLECPP=/usr/local/bin/cpp-5
sh ./bootstrap
./configure
make

Testing Soufflé

With

 make check

numerous unit tests and regression tests are performed. This may take up to 45min. However, this may be sped up with, for instance:

TESTSUITEFLAGS=-j8 make check

which will run 8 jobs at a time.

Installing Soufflé

If you would like to install Soufflé in your system, specify an installation directory with ./configure --prefix=<install-dir>. The executable, scripts, and header files will be stored in the directory <install-dir>. Use an absolute path for <install-dir>. Type

 make install

to install Soufflé. By setting the path variable

 PATH=$PATH:<install-dir>/bin

the Soufflé commands souffle and souffle-profile are available to the users.

Running a Simple Example

Create the following Datalog program and save it to reachable.dl.

// Type Node
.type Node

//
// Edge
//
.decl Edge        (n:Node, m:Node)

Edge("0","1").
Edge("1","2").
Edge("2","3").
Edge("1","4").

//
// Reachable 
//

.decl Reachable   (n:Node, m:Node)
.output Reachable

Reachable(x,y)  :- Edge(x,y).
Reachable(x,y)  :- Edge(x,z), Reachable(z,y).

This program computes a transitive closure of the input graph that is given by the set of edges (facts for relation Edge). The following command evaluates the program and prints the output via option -D-.

souffle -D- reachable.dl

The command-line options for the tool are shown via command:

souffle -h

More Datalog examples can be found in the directory tests/evaluation/ of the repository.

The next topic is how to compile/execute Datalog programs with Soufflé.