The following build dependancies are required:
- CMake 3.0 or higher
- Boost C++ library v1.48 or higher (http://www.boost.org)
- zlib library and headers
- A fortran compiler
- Python3 development files (optional, for building Python extension)
This toolkit should work on any platform with C++ and Fortran compilers installed. Even if your platform is not listed here, it will likely compile and run.
Install dependancies for your platform:
On Debian 9, 10, 11 and Ubuntu 16.04, 18.04, 20.04:
sudo apt install build-essential gfortran libboost-all-dev python3-dev zlib1g-dev
Replace <top-dir>
below with the directory you put the source tree in.
# Build the binary from source tree
$ mkdir <top-dir>/build
$ cd build
$ cmake ..
$ make
# Run some unit tests
$ cd <top-dir>/build/test
$ ctest
# If no error occurs, you can proceed to install the binary
$ cd ..
$ cmake install
Much of the power of this toolkit comes from its Python extension module. It combines the speed of C++ and the flexibility of Python in a Python3 extension module named maxent. The python wrapper code is based on the C++ interface generated by SWIG (http://www.swig.org/).
Make sure you have built the C++ binary and installed the Python development headers such as python3-dev.
# setup.py assumes cmake build directory is in <top-dir>/build
$ cd <top-dir>/python
$ python3 setup.py build
# Run unit test
$ cd <top-dir>/test
# Please adjust the build path 'lib.linux-x86_64-3.9' to be the pathname found on your machine
$ PYTHONPATH=../python/build/lib.linux-x86_64-3.9 python3 test_pyext.py
# If no error occurs, you can proceed to install the extension
$ cd <top-dir>/python
$ python3 setup.py install