Required Dependencies
Optional Dependencies
$ sudo apt-get python-setuptools python-dev python-protobuf
For installing RSB and its dependencies from source on Darwin, we recommend to use Homebrew, an easy-to-use package manager for MacOS.
$ brew install cmake boost protobuf
Install Microsoft Visual Studio. If you are planning to use the Python implementation of RSB, only version 2008 currently works.
In order to install Spread a source-based installation is required. The visual studio solution for Spread 4.2 is currently broken. Hence only version 4.1 can be used.
In detail, perform the following steps:
Python can be installed using the binary installer. A 32 bit version is recommended.
Clone RSB and its immediate dependencies from the git repository
“0.11” branch of https://code.cor-lab.org/git/rsc.git
“0.11” branch of https://code.cor-lab.org/git/rsb.git.protocol
“0.11” branch of https://code.cor-lab.org/git/rsb.git.python
Install RSC and the RSB protocol definitions as described in the C++ installation instructions.
Create and edit setup.cfg
See also
Documentation of the format of the setup.cfg file
Setuptools does not use command line arguments to configure projects. Instead a file called setup.cfg in the project root is used.
Replace protocolroot in section [proto] with the path to the RSB protocol files (e.g. protocolroot=PREFIX/share/rsbprotocol). An exemplary setup.cfg file could look like this:
[proto]
protocolroot=/your/prefix/share/rsbprotocol
[test]
spread=/your/prefix/sbin/spread
[coverage]
spread=/your/prefix/sbin/spread
Note
The following RSB-specific options are recognized:
protoc in section [proto]
The Google protocol buffers protoc compiler used to generate code from the RSB protocol description. If not specified PATH is used.
format in section [doc]
Either html or pdf for the API documentation generation.
verbose in section [doc]
Bool flag to control verbose output of the generation tool epydoc.
spread in sections [coverage] and [test]
Path to the Spread daemon used for coverage generation and unit testing. PATH is used if not specified.
Start building and installation
$ export PYTHONPATH=PREFIX/lib/python2.VERSION/site-packages # if you are install to /usr or /usr/local it must be dist-packages $ python setup.py build $ python setup.py install --prefix=PREFIX
Install Spread as described in the C++ installation instructions.
Warning
The Spread Python version automatically installed by setuptools is not working.
Download sources from http://www.spread.org/files/SpreadModule-1.5spread4.tgz.
Extract the downloaded archive file and change to the SpreadModule-1.5spread4 directory
Edit setup.py and set SPREAD_DIR to your installation prefix (e.g., /usr, /your/prefix or c:\code\spread)
Note
On Windows it might also be necessary to change the following aspects of the setup.py:
include_dirs = [SPREAD_DIR + r"\include"],
library_dirs = [SPREAD_DIR + r"\lib\win32"],
libraries = ['libspread', 'wsock32'],
# comment out
#extra_link_args = ['/NODEFAULTLIB:libcmt'],
Build and install
$ python setup.py build_ext --rpath PREFIX/lib $ python setup.py install --prefix=PREFIX
Note
It might be that the --rpath option needs to be removed on Windows.
See also
The following statement should succeed in a python shell:
import rsb
Note
It may be necessary to set PYTHONPATH to PREFIX/lib/python2.X/site-packages as in the installation step above.