My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
BuildInstructions  
Building instructions for the pyrap converter library and pyrap python packages
Featured, Phase-Deploy
Updated May 26, 2010 by Malte.Marquarding

Introduction

It consists of to two parts:

  • libpyrap - casacore to python type converters, e.g. casa::Record from/to dict, casa::Array from/to numpy array
  • python bindings to casacore packages/modules

To build libpyrap you need to have the SCons build system installed, but this is required for casacore anyway.

The pyrap python modules on the trunk use python setuptools (the old version in the tarball uses distutils). You'll need to have setuptools installed (see http://peak.telecommunity.com/DevCenter/setuptools). That can be done easily by downlading http://peak.telecommunity.com/dist/ez_setup.py and running it.

When using, say, the python binding for the casacore tables, you can import the package like:

from pyrap.tables import *

Note that in the old version it has to be done as:

from pyrap_tables import *

Building the whole system

The current stable version in subversion is:

svn co http://pyrap.googlecode.com/svn/tags/pyrap-1.1.0

The development version can be retrieved via subversion:

svn co http://pyrap.googlecode.com/svn/trunk pyrap

Requirements

pyrap needs the following external packages:

Some users have had difficulties when using boost-1.37. It installs its header files in /somepath/include/boost-1.37/boost and its libraries in somepath/lib. To be sure that during the build the correct boost headers are used, it is advisable to create a symlink like:

  cd /somepath/include
  ln -s boost-1.37/boost boost

Furthermore building pyrap with boost-1.37 and gcc-4.3.2 gave an error due to a missing include. The following patch has to be applied to boost:

Index: boost/python/detail/translate_exception.hpp
===================================================================
--- boost/python/detail/translate_exception.hpp (revision 50228)
+++ boost/python/detail/translate_exception.hpp (working copy)
@@ -9,6 +9,7 @@
 
 # include <boost/call_traits.hpp>
 # include <boost/type_traits/add_const.hpp>
+# include <boost/type_traits/add_reference.hpp>
 
 # include <boost/function/function0.hpp>

Building libpyrap

If casacore has been installed in /usr/local and you want to install libpyrap into /usr/local and the python modules in the standard python location, then just run the following

For the stable version

./batchbuild.py

or the development version:

./batchbuild-trunk.py

Build options

see

./batchbuild.py --help

If this returns without an error, everything worked. Note Your LD_LIBRARY_PATH needs to point to the locations of libpyrap and the casacore libraries. (DYLD_LIBRARY_PATH on OS X)

Comment by TimStale...@gmail.com, Nov 10, 2011

FYI, I had weird issues with batchbuild-trunk.py, on Ubuntu 10.04. For some reason, it attempts to find pyrap.quanta version "0.3.1" for the dependencies of pyrap.measures (trunk version), when it should be looking for pyrap.quanta version "trunk". This broke the build. Installing the latest python-setuptools made the build complete, but its still referring to the wrong pyrap.quanta. From the build output:

Processing dependencies for pyrap.measures==trunk Searching for pyrap.quanta==0.3.1 Best match: pyrap.quanta 0.3.1 Processing pyrap.quanta-0.3.1-py2.6-linux-x86_64.egg Removing pyrap.quanta trunk from easy-install.pth file Adding pyrap.quanta 0.3.1 to easy-install.pth file

Very weird.


Sign in to add a comment
Powered by Google Project Hosting