Installing GHMM
Prerequisites
- Recent GCC, recent, working autoconf and automake. If you are running
a recent Linux distribution you should be fine. On the MacOS we recommend
using Fink to install all required
packages including Python.
- Libxml2
- Optional: The GHMM is self-contained, but can make use of the GSL. Note that the GSL is
GPL licensed and that will AFAIK force your code under the GPL. You
need to pass --enable-gsl option to configure to use the
GSL, in particular the nice collection of random number genetration.
- For the optional Python wrappers you need the following. If
building without Python wrapper use the --without-python
option for configure.
- Python version 2.6.x or 2.7.x. GHMM is not yet compatible with
Python 3.x releases nor with earlier releases. Note that on many Linux
distributions the default installs are missing header files. You need
to add the developer Python packages (which might be called
python27-dev for example) and shared libs.
- SWIG, the simplified wrapper
interface generator
- Optional: If you want to use the editor HMMEd you need X11 (or
equivalent), Tk and Tkinter and also the Gato package. Please use the
Gato out of svn. You can check it out with
svn checkout svn://svn.code.sf.net/p/gato/code/trunk/Gato Gato
The Gato 1.1.2
package from Sourceforge or the
Python Package Index
contain a bug only affecting HMMEd.
Download
Please use the version out of the
SVN. There are detailed instructions at http://sourceforge.net/svn/?group_id=67094.
For the most recent version you may do an anonymous checkout by calling
svn checkout svn://svn.code.sf.net/p/ghmm/code/trunk/ghmm ghmm
Installation
In the ideal case, installation is the same as for all GNU software from source:
In the ghmm directory issue the following commands.
> autogen.sh
> ./configure
> make
> make install
This will install the GHMM into whatever path prefix is default for
autoconf on your system. Note that the
same prefix is used
for installing the Python library, the path for the Python install is
not determined by the install location of the first python
found on your
PATH. That is, if for example
/usr/local is the default for autoconf, the
ghmm.py will end up in
/usr/local/lib/pythonX.Y/site-packages. This will cause an
import error if your python is not installed in
/usr/local
or
/usr/local/lib/pythonX.Y/site-packages is not added to
your
PYTHONPATH environment variable.
If your Python is in a non-standard location for autoconf, you
probably want to install into the appropriate
site-packages. That is, if the Python interpreter invoked
by typing python in your shell is /var/bin/python than most
likely its library will be /var/lib/pythonX.Y and all
site-specific installs should end up in
/var/lib/pythonX.Y/site-packages/ by default.
There is a simple work-around as follows.
> autogen.sh
> ./configure --without-python
> make
> make install
> cd ghmmwrapper
> python setup.py build
> python setup.py install
Sometimes a more fine-grained control is needed. Then you can
specify the prefixes used for installation and the python interpreter
to use explicitely.
> autogen.sh
> ./configure --without-python --prefix=/some/path
> make
> make install
> cd ghmmwrapper
> /some/otherpath/python setup.py build
> /some/otherpath/python setup.py install --prefix=/yetanotherpath/
This might require setting your
PYTHONPATH or
LD_LIBRARY_PATH environment variable appropriately.
The graphical editor can be installed after installing Gato (see above)
just like the Python bindings in ghmmwrapper
> cd ../HMMEd
> /some/otherpath/python setup.py build
> /some/otherpath/python setup.py install --prefix=/yetanotherpath/
Ubuntu installation walkthrough
First make sure you have the prerequisites
sudo apt-get update
sudo apt-get install build-essential automake autoconf libtool
sudo apt-get install python-dev
sudo apt-get install libxml++2.6-dev
sudo apt-get install swig
Then get the tarball and unpack or checkout from svn and run
cd ghmm
sh autogen.sh
sudo ./configure
sudo make
sudo make install
sudo ldconfig
OS-specific tips
- Mac OS X: 10.6 ships with a broken libtool which breaks the
installation (and it also ships with Python 2.5, so you need an update
for that). James Howard posted a solution on the mailing list: [Ghmm-list]
Compiling in OS X 10.6
- Windows: There is no Windows support. Installing Cygwin should
work. Check the mailing list; it seems that some people had success.
- Linux: various distributions are creative about install locations
and the scope of what actually is installed. You want the
developer/header whatever-they-are-called packages in addition to
that. Note that specific distributions also omit part of the Python
standard library (e.g., Ubuntu omits the Python profiler for licensing
reasons).
- C++: We used to have C++ bindings emulating the semantics of the
Python interface, but we lost interest after it became clear that
Python plus C is nicer and as fast.
Troubleshooting
If autogen.sh and configure run without
problems but during make you get the error libtool: Version
mismatch error. please run cautoreconf --force --install
followed by configure; make; make install ....
- There are more options to configure, check configure
--help. Note that --disable-obsolete is currently broken.
- There is anecdotal evidence that adding search paths to
ghmm/ghmmwrapper/setup.py is the easiest way to get around
install problems in really creative installations.
- If you don't have root access, installing somewhere in your home
directory by specifying the --prefix arguments seems to be
the path of least resistence. Then you need to set
PYTHONPATH, LD_LIBRARY_PATH and possibly
PATH accordingly in your .bashrc.