Building and Installing

The module builds and tests pass with Python 2.3, 2.4, and 2.5. Earlier versions of Python will not work. I have developed this on both OS X and Linux. I do not know if it will work on Windows; this may be easy with appropriate simple modifications to the build process, but I am unable to confirm this.

Here are the brief instructions for installing.

Build the module using make . (Pay attention to warnings!)

Run make test to execute the test suite. You want these tests to succeed with an OK.

Build the module using make install to install the module in your Python build's site-packages directory. On a typical system, you will need to run this as the superuser (probably sudo make install).

In the ideal case, this will just work.

Troubleshooting

This contains a guide for if you are having trouble building or testing.

If You're Having Trouble Building

Below are some suggestions to try or avenues to pursue if you're having trouble building. This is not an exhaustive list, just "the most likely suspects."

The build process assumes that the default Python (i.e., the Python you would get if you tried executing python within sh) is the one for which you want to build graphcut. If this is untrue, modify the Makefile file to change the assignment PYTHON:=python to something like PYTHON:=/path/to/other/python.

Perhaps the Python shared library or headers were not included along with the Python interpreter with whatever installation of Python is on your system. Package management systems using binary distributions often cripple their users by omitting header files or even shared libraries in an attempt to install clever bare-bones "non-developer" versions of packages to save their users a few whopping thousandths of a cent or so in the disk storage it would take to store a few header files. If your package manager has something resembling python-dev or python-shlibs (or something similar) that was not installed with your Python distribution, make sure you install it, and retry the build.

If You're Having Trouble Testing

Once you have built the module successfully and there is a graphcut.so symbolic link to the build directory's shared library, you should run the principle test suite through make test. The tests should succeed with an OK. If the tests do not succeed, email me a bug report with a copied-and-pasted transcript and description of the failure, as well as relevant information related to your system and Python installation (e.g., "I am using OS X 10.4 with the Fink installed version of Python 2.5.1" or "I am using Ubunto with the default package manager's Python 2.4").

If You're Having Trouble Installing

If it says permission denied when running make install, perhaps you need to run the command as the superuser, e.g., sudo make install on OS X and most modern Linux distributions.