Skip to content
HelgeS edited this page Jan 2, 2016 · 10 revisions

Dependencies

Ubuntu / Debian

We list here the Ubuntu package names:

  • [required] libboost-dev >= 1.35 (including test, serialization, graph, program_options, filesystem); see http://www.boost.org;
  • [required] libboost-test-dev >= 1.35
  • [required] libboost-filesystem-dev >= 1.35
  • [required] libboost-program-options-dev >= 1.35
  • [required] libboost-graph-parallel-dev >= 1.35
  • [required] python >= 2.4;
  • [required] g++ >= 4.2 (this should work with icc and clang too);
  • [optional but highly recommended] libtbb-dev; see http://www.threadingbuildingblocks.org/
  • [optional but recommended] libeigen3-dev ; see http://eigen.tuxfamily.org/
  • [optional but recommended] python-simplejson;
  • [optional] libboost-mpi-dev , if you need the optional MPI support (Warning: the Ubuntu packages of boost are not compiled with MPI support; you will have to compile boost yourself to use MPI).
  • [optional] OpenMPI or another MPI implementation (tested with IBM MPI and OpenMPI)
  • [optional] libgoogle-perftools-dev.
sudo apt-get install libboost-dev libboost-test-dev libboost-filesystem-dev libboost-program-options-dev libboost-graph-parallel-dev python g++ libtbb-dev libeigen3-dev python-simplejson libgoogle-perftools-dev

OSX (brew)

To install MPI support with brew:

brew -v install  boost --with-mpi --without-single

Compilation

Simple compilation

Assuming that everything has been properly installed you should be able to compile sferes2 by typing (in the main sferes directory):

./waf configure
./waf build

You should then run the unit tests:

./waf check

If everything is green, sferes2 is working! If not, please send an e-mail to the authors with as many details as possible about your problem.

Configuration and details

Sferes2 employs the waf build system (http://code.google.com/p/waf/) instead of autoconf/automake and make. Waf employs files named wscript to describe the compilation process in python.

The main wscript of sferes2 accepts the following configuration options:

  • –boost-includes=BOOSTINCLUDES : path to the boost directory where the includes are e.g. /usr/local/include/boost-1\_35
  • –boost-libs=BOOSTLIBS: path to the directory where the boost libs are e.g. /usr/local/lib
  • –no-mpi: disable mpi (MPI is automatically disabled if no MPI implementation is found)
  • –mpi=MPI: path to MPI [e.g. /usr/lib/openmpi ]
  • –apple: enable Apple (mac OSX) support
  • –tbb=TBB: path to TBB if it’s not installed in the default directory
  • –64bits: compile for 64 bits architectures
  • –rpath: set an optional rpath (useful in case of link failure)
  • –cpp11: force c++-11

To use these options, pass them to the waf script during the configuration step. For example:

./waf configure --mpi /usr/lib/openmpi/

or, to disable MPI:

./waf configure --no-mpi

The configure options used during the last call of the “configure” command are in the file build/configure.options.

Modules

The previous compilation provided you with a minimal sferes install. Several modules are available in the “modules” directory of sferes. Before using any of these modules in your experiment, you must compile these modules using sferes.

To do so, create a file named “modules.conf” at the root of sferes install (where waf is). You should then list the modules you want to use in this file, with one module per line.

for example, if you want to use the modules cartpole and nn2, your modules.conf file should look like:

cartpole
nn2

You should then recompile sferes with the updated file :

./waf build

This should generate test files in the build/default/modules/nn2 and build/default/modules/cartpole

You can then run the tests by using waf check:

./waf check

WARNING Some tests, namely test_esn and test_hyper_nn may not work out of the box. But unless you use these specific modules, they should not impact the rest of the code.