-
Notifications
You must be signed in to change notification settings - Fork 211
Build
This is an outdated document. We replaced automake/autoconf with cmake (cf. http://souffle-lang.github.io)
These are some build notes for developers only. If you are a user, please use the documentation.
Soufflé has pre-built packages for Debian and MAC OS X. You find the pre-built packages here.
To build and install Souffle, the following software must be installed:
- Make, Autoconf tools, Bison (from version 3.0.2), Flex, DoxyGen
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 libncurses5-dev libtool libsqlite3-dev make mcpp python sqlite zlib1g-dev libomp-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 enough such that G++ 5.0 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
For the testing, we use the ubuntu:latest
distribution running in docker. For running the test, the following packages must be installed:
apt-get doxygen clang-format autoconf automake bison build-essential clang doxygen flex g++ git libffi-dev libncurses5-dev libtool libsqlite3-dev make mcpp sqlite zlib1g-dev swig python3 python3-dev curl git default-jdk graphviz
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 mcpp
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
.
Soufflé is built by
cd souffle
sh ./bootstrap
./configure
make
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 -j8
which will compile with 8 jobs at a time, then run the testing framework with 8 jobs in parallel.
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.
Follow the steps below to compile and install Soufflé on a UNIX system:
- Install the needed dependencies. G++ 5.0 or greater is recommended to compile Soufflé.
apt-get install build-essential pkg-config
apt-get install autoconf automake bison doxygen flex g++ git graphviz libsqlite3-dev libtool libncurses5-dev lsb-release make git zlib1g-dev
-
Run
sh ./bootstrap
to generate configure files -
For Linux users, skip this point. MAC OS X does not have OpenMP 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 libffi libtool mcpp pkg-config
brew reinstall gcc
brew link bison --force
brew link libffi --force
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig/
-
Run
./configure
-
Run
make
to build the executable of Soufflé -
Test the executable with
make check
to check whether the compilation of Soufflé succeeded. -
Run
make install
This command will create the directories and install files in
${DESTDIR}${prefix}
for system-wide use in your system.
Souffle supports out-of-source builds, to enable multipe builds using e.g. different compilers or debug options based on the same source base.
The configure script uses the compiler specified by an CXX
environment variable as the compiler to be used. Furthermore, the environment variable BUILD_TYPE
may be set to "Debug" to create a debug build, instead of the default release build.
The following commands create a gcc 5 debug, a gcc 5 release, and a clang build:
# basic setup
git clone git://github.com/souffle-lang/souffle.git souffle
cd souffle
sh ./bootstrap
# create gcc debug build directory
mkdir build_gcc_debug
cd build_gcc_debug
CXX=g++-5 ../configure --enable-debug
make -j4
cd ..
# create gcc release build directory
mkdir build_gcc_release
cd build_gcc_debug
CXX=g++-5 ../configure
make -j4
cd ..
# create clang release build directory
mkdir build_clang_release
cd build_clang_release
CXX=clang++-4.0 ../configure
make -j4
cd ..
The unit tests in the source directory can be executed in parallel using the -j
option of make. For instance,
cd src
make -j4 check
will run the unit tests of the current build directory using 4 threads.
By exporting the following environment variable
export TESTSUITEFLAGS=-j4
the integration test script will also process tests in parallel.
To run an individual integration test, the script tests/testsuite
can be used. The command
testsuite -l
lists all the test cases, with their associated number. To run an individual test,
testsuite <case_nr>
can be used.
Alternatively, you can specify a test by name:
./testsuite -k <test-name>
For example: ./testsuite -k binary