InstallationPython » History » Version 13

J. Wienke, 10/19/2011 11:43 AM
add comment about dist and not site-packages for /usr and /usr/local

1 1 S. Wrede
h1. Installation of Python Implementation
2 1 S. Wrede
3 1 S. Wrede
h2. External Dependencies
4 1 S. Wrede
5 10 S. Wrede
h3. Basics
6 11 S. Wrede
7 12 S. Wrede
* install python-setuptools (macports: py27-distribute) and python-dev
8 9 S. Wrede
* install python-protobuf (via ubuntu package python-protobuf or protobuf sources)
9 1 S. Wrede
10 1 S. Wrede
h3. Spread Python
11 11 S. Wrede
12 11 S. Wrede
* spread-python (sources can be downloaded here: http://www.spread.org/files/SpreadModule-1.5spread4.tgz, *the version automatically installed by setuptools is NOT working!*)
13 9 S. Wrede
14 8 S. Wrede
* extract the downloaded archive file and change to the @SpreadModule-1.5spread4@ directory
15 7 S. Wrede
* edit setup.py and set @SPREAD_DIR@ to your installation prefix (e.g., /usr or /your/prefix)
16 7 S. Wrede
* build step
17 7 S. Wrede
<pre>
18 7 S. Wrede
python setup.py build_ext --rpath $(prefix)/lib
19 7 S. Wrede
</pre>
20 7 S. Wrede
* install step
21 7 S. Wrede
<pre>
22 7 S. Wrede
python setup.py install --prefix=$(prefix)
23 7 S. Wrede
</pre>
24 1 S. Wrede
25 1 S. Wrede
h2. Installation
26 1 S. Wrede
27 4 J. Wienke
# Install RSBProtocol as described [[InstallationC++|here]]
28 6 Anonymous
# get sources - https://code.cor-lab.org/svn/rsb/trunk/python/core
29 2 J. Wienke
# create and edit @setup.cfg@
30 2 J. Wienke
#* in contrast to cmake or partially ant, setuptools does not use command line arguments to configure projects. Instead a file called @setup.cfg@ in the project root is used: http://docs.python.org/distutils/configfile.html
31 2 J. Wienke
#* especially, replace @protocolroot@ in section @[proto]@ with the path to the RSBPRobotocol files (e.g. protocolroot=${prefix}/share/RSBProtocol)
32 2 J. Wienke
#* other available options (besides standard ones from python):
33 2 J. Wienke
#** @protoc@ in section @[proto]@: The protoc compiler used to generate the protocol. If not specified @PATH@ is used.
34 2 J. Wienke
#** @format@ in section @[doc]@: either "html" or "pdf" for the API documentation generation
35 2 J. Wienke
#** @verbose@ in section @[doc]@: bool flag to control verbose output of the generation tool epydoc
36 2 J. Wienke
#** @spread@ in sections @[coverage]@ and @[test]@: path to the spread executable used for coverage generation and unit testing. @PATH@ is used if not specified
37 2 J. Wienke
#* An exemplary @setup.cfg@ file could look like this:
38 1 S. Wrede
<pre>
39 2 J. Wienke
[proto]
40 2 J. Wienke
protocolroot=/your/prefix/share/RSBProtocol
41 2 J. Wienke
[test]
42 2 J. Wienke
spread=/your/prefix/sbin/spread
43 2 J. Wienke
[coverage]
44 2 J. Wienke
spread=/your/prefix/sbin/spread
45 2 J. Wienke
</pre>
46 2 J. Wienke
# start building and installation
47 2 J. Wienke
<pre>
48 13 J. Wienke
export PYTHONPATH=$prefix/lib/python2.X/site-packages # if you are install to /usr or /usr/local it must be dist-packages
49 1 S. Wrede
python setup.py build
50 1 S. Wrede
python setup.py install --prefix=$prefix
51 1 S. Wrede
</pre>
52 1 S. Wrede
53 1 S. Wrede
Afterwards, @import rsb@ should be possible in a python shell.