Find file History
Latest commit 7e9fbe0 Jul 9, 2015 Le Zhang Improve README for issue #4


Python extension (binding) of the C++ Maximum Entropy Modeling Toolkit
This directory contains source codes for building python extension of the C++
library. More detail instructions can be found in the PDF manual:

The python binding code is now generated with SWIG (, and
is in fact more likely to work than the previously Boost.Python solution.
(Getting Boost.Python to work is not a trivial task itself). The wrapping code
is tuned by hand in order to be as efficient as possible. There are some loss
in using the new wrapping approach, however, there is no pickle support any

Building maxent python extension module
First, make sure you have successfully built the C++ maxent lib and installed
python header files:
    sudo apt-get install python-dev
Then proceed with the following command to build the maxent module:

$ python build

If no error occurs then proceed with:

$ sudo python install

to install the python extension to your python site-package directory.

Optionally, you may want to run some test routines to see if it works:
enter ../test/ directory and run:

$ python

If all unit tests passed, the python binding is read for use.

Important note for Win32 platform!
Please read this carefully before building on win32 platform.
Currently the only supported tool-chain for building maxent extension under
win32 platform is MSVC7 (tested on msvc71 + intel fortran 8 + stlport 4.6).

1. First build the maxent lib with msvc compiler (use intel fortran and
    stlport if available) in ..\src. 
2. Then go to this directory and do "python build" to build the
   extension model.
4. Type "python install" to install the module. 

If you still have problem in building the extension on win32, don't worry. You
can obtain a pre-built extension module that is available from the toolkit's
homepage.  Just download then run a GUI setup program.

Have fun!