wiki:PyWaveletsOsxBuilding

Version 1 (modified by flip, 9 years ago) (diff)

--

Building Our PyWavelets for OS X Package

This page is technical documentation for Vespa developers who want to build our PyWavelets for OS X package.

The Package Contents

The package we provide is simple. It's basically the same stuff that PyWavelets creates during an installation, plus some packaging meta stuff from us.

More specifically, when one builds and installs PyWavelets from source, the result is a directory containing a bunch of .py files and one .so file. The .py files are the same for Python 2.5 - 2.7, only the binary differs. Therefore our package consists of one set of .py files and three .so binaries, one for each Python version we support. At install time, we decide which binary is the correct one and copy it to reside along with the .py files. After that, installation proceeds normally.

The Build Process

Our PyWavelets for OS X package lives in its own SVN repository.

If you need to build our package for a new version of PyWavelets (or Python), here's how to do it. You'll need gcc and Cython <= 0.13, plus of course the version of Python against which you want to build.

A side note about PyWavelets and Cython versions -- PyWavelets 0.2.0 is the most recent version and does not build with the most recent version of Cython (0.14). However, the author reports that the build problem will be fixed in the next PyWavelets release, so if you're building a version of PyWavelets > 0.2.0 then you can probably use Cython >= 0.14.

For each Python in (2.5, 2.6, 2.7):

  1. Set the Python you want to build against to be the default Python.
  2. If you haven't done so already, build and install Cython for that Python. This adds Cython to that Python's site-packages.
  3. Build and install PyWavelets and note the directory to which it installs.
  4. Go to that directory, grab the .py files, and copy them to our pywavelets-osx package in pywavelets-osx/pywt.
  5. From the same directory, grab the .so files, copy it to the pywavelets-osx/binaries directory and rename it appropriately (e.g. 32-py26.so for 32-bit Python 2.6).
  6. From the same directory, copy COPYING.txt to pywavelets-osx/pywt so that we're sure we are distributing the latest PyWavelets license.

Python 2.5 Considerations

When building Cython and PyWavelets (and I think any C-based Python extension) against Python 2.5 under OS X Snow Leopard, using the default gcc (4.2.1) gives this error ---

cc1: error: unrecognized command line option "-Wno-long-double"

An easy way to get around this is to build using gcc 4.0. To temporarily set the default compiler to gcc 4.0, enter this at the command line --

export CC=gcc-4.0
export CPP=gcc-4.0

Python >= 2.6 avoids this by forcing use of gcc-4.0.

Releasing a New Version

Unlike most of our packages, we don't track versions of this package. Since PyWavelets has its own version number, it'd be pretty confusing to have separate version numbers for this package too. So the version available on this page is always the most current, and it's the only one that we offer.

  1. Follow the steps in The Build Process.
  2. Commit the changes to SVN.
  3. Run build_tarball.py which will create files in the dist directory.
  4. Upload those files to this page, replacing the attachments of the same name.