Building and Installing

Building this module requires that the user have installed the GLPK 4.4 or later, and GMP libraries if building with GLPK 4.13 or later. The module builds and appears to work on my simple test files in 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, but I doubt it.

Here are the brief instructions for installing.

In the ideal case (that is, you have GLPK and GMP libraries, headers, executables and the like installed in default search paths), this will just work.


A few details just in case things don't go that easily:

How PyGLPK builds depends on which version of GLPK is installed. GLPK is an evolving library, and some functionality has been added only since older versions.

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."

If You're Having Trouble Testing

Once you have built the module successfully and there is a symbolic link defined to the shared library, you should run the principle test suite through make test.

If you're running the test suite through make test and it throws some sort of exception, what the problem is depends on what type of error you see.

ImportError: No module named glpk
Ensure that the module actually built.
ImportError: (stuff) Symbol not found
Most likely, it cannot find a required library. Run ldd (on Linux) or otool -L (on OS X) to see which libraries it cannot find. Use this information to ensure that you environment variable LD_LIBRARY_PATH points to directories containing appropriate libraries. (Note that merely finding all libraries is not necessarily sufficient in the case where there are multiple GLPK libraries floating around. Ensure you're not building with one, but running with the other.)
AssertionError (or other error)
The good news is that the module appears to load and run and it's throwing normal Python exceptions. The bad news is one of my tests failed. This should not happen, but if it does, send me a bug report.

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 .

Thomas Finley, 2007, 2008