python-rdma relies on the standard Python distutils functionality for building and includes a setup.py script. The following will be required to build the module:
The build process is simply:
$ ./setup.py build
[..]
Once built the library can be tested without installation by setting PYTHONPATH:
$ export PYTHONPATH=`pwd`/build/lib.*/
$ ./ibtool help
To install into /usr/local/ use ./setup.py install.
Note
Due to how Python searches for libraries the PYTHONPATH environment variable is still required to run the executable scripts, such as the test suite, included in the package.
If your system has IB libraries installed outside the system path, you need to create a setup.cfg similar to the following:
[build_ext]
include-dirs=/opt/ofa64-1.5.1/include
library-dirs=/opt/ofa64-1.5.1/lib
rpath=/opt/ofa64-1.5.1/lib
Prior to running ./setup.py build.
Note
Python 2.6 packages are available for RHEL and related via the Fedora EPEL. These packages perform a parallel install of Python and do not replace the system version. Eg http://download.fedora.redhat.com/pub/epel/5/x86_64/repoview/python26.html
The module ships with a few pre-built things, to do development work the following will also be required:
To test the installation of the above tools do the following:
$ rm rdma/ibverbs.c
$ ./setup.py build docs
To ease development I recommend installing the following symlink:
$ (cd rdma ; ln -s ../build/lib.*/rdma/ibverbs.so .)
After which running Python programs from the top of the source tree will automatically have the correct PYTHONPATH and changes to the source itself will immediately be picked up without having to run ./setup.py build
However, be aware that changes to the Pyrex extension module will still require running ./setup.py build_ext to recompile.
The two required modules are easily configured in a private user directory as follows:
$ wget http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/Pyrex-0.9.9.tar.gz
$ wget http://pypi.python.org/packages/2.6/S/Sphinx/Sphinx-1.0.7-py2.6.egg#md5=a547658740040dd87ef71fbf723e7962
$ tar -xzf Pyrex-0.9.9.tar.gz
$ ln -s Pyrex-0.9.9/Pyrex .
$ unzip Sphinx-1.0.7-py2.6.egg
$ export PYTHONPATH=`pwd`
Other approaches are possible as well.
The library includes a test suite built with unittest. To run the test suite the end port returned by rdma.get_end_port() must be connected to a small fabric. Some ways of running the suite:
$ ./run-tests.py # Run everything
$ ./run-tests.py tests.verbs # Only run the verbs test.
Note
The test suite exercises functionality that is known to make OpenSM crash. As of this writing OpenSM GIT has been fixed but the latest release (3.3.9) does not include the fix.