| Version 1.9 Build 1574
|
|
Up: NOTE 259: appspython binding to AIPS++
Previous: Python specifics
appspython is part of the AIPS++ source tree and can be built as part of
the AIPS++ build. Work is underway to build it separately as a Python
egg.
To build it in AIPS++ the following has to be added to the local
makedefs:
- Definitions for PYTHON telling the Python locations.
- Definitions for BOOST telling the Boost.Python locations.
- AUXILIARY += appspython
When doing it this way, appspython is built with support for
numarray. In order to build it with support for numpy as well, the following
has to be added to the local makedefs:
PYTHONINCD += 'the path where numpy/arrayobject.h can be found'
PYTHONDEFS += -DAIPS_USENUMPY
If only numpy should be supported, the last line should be replaced by:
PYTHONDEFS := -DAIPS_USENUMPY
When building appspython, it is by default built as the shared library
libappspython.so
containing the various converters and associated AIPS++ code. It can
be built as a static library by adding the appropriate
LIBappspython line to the local makedefs. However, it is
strongly advised to build it as a shared library because:
- If multiple python packages are used, each of them registers the
converters in Boost.Python. If the same converter is multiply
registered, Boost.Python gives a warning. To avoid these warnings
appspython keeps a map of registered converters. It is clear that
this map is only useful (i.e. shared between python packages)
if appspython is built as a shared library.
- Multiple python packages share the converter code, thus reducing the
memory footprint.
A package pyxx is built as a shared library
_pyxx.so residing in directory
$AIPSPATH/python$PYTHONVERSION/pyxx. All .py files are also put in this
directory and compiled to .pyo and .pyc files.
On Mac OS-X Python libraries have to be built as bundles. For this the
local makedefs need to set some make variables:
PYLDSOPTS := -bundle
PYSFXSHAR := so
SFXSHAR := dylib
LDSOPTS := -dynamiclib -single_module
PYTHONLIBS := -framework Python
Up: NOTE 259: appspython binding to AIPS++
Previous: Python specifics
Contents
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2006-11-11