c02 JWBK378-Fletcher May 1, 2009 19:51 Printer: Yet to come
8 Financial Modelling in Python
and installing the Boost C++ libraries can be found at http://www.boost.org and
instructions for Blitz++ can be found at http://www.oonumerics.org. Naturally, an
installation of Python is also required. On Windows, the authors favour the freely available
ActiveState Python distribution, see http://www.activestate.com for download and
installation details. Also required on the Python side for ppf is an installation of the NumPy
package, see http://www.scipy.org for download and installation details.
2.3.2 Building the C++ Extension Modules
The ppf C++ extension modules are most conveniently built using the Boost.Build system
copy of which is included with the ppf sources. Also provided with the ppf sources for the
convenience of Windows users is a pre-built executable ‘bjam.exe’. Although these notes will
become a little Windows-centric at this point, the basic principles will hold for *NIX users also.
On Windows, the ppf package has been successfully built and tested with the Microsoft Visual
Studio C++ compiler versions 7.1, 8.0 (express edition), 9.0 (express edition), mingw/gcc-
mingw/gcc-4.3.0 with Python versions 2.4 and 2.5, Boost versions 1.33.1, 1.34.0,
1.35, 1.36, 1.37 and Blitz++ version 0.9. The ppf package has also been built and tested on
the popular Linux-based operating system, Ubuntu-8.04.1 with Boost version 1.36.0, Blitz++
version 0.9 and gcc-4.2.3.
In the remainder of this section, without loss of generality, we will assume a Windows
operating system, Blitz++ version 0.9, the ActiveState distribution of Python version 2.5 and
Boost version 1.36.
- Copy c:/path/to/ppf/ext/bjam.exe to somewhere in your %PATH%
o ActiveState Python 2.5
o NumPy for Python 2.5 (version 1.0.4 or 1.1.0)
- Edit as appropriate for your site
- c:/path/to/ppf>cd ext&&bjam [debug|release]
This will create:
time/ppf date time.pyd
Minimalist GNU for Windows – see http://www.mingw.org.