How to install Hedge from Git on Ubuntu

Don't forget that this is a Wiki. If something in here doesn't work for you, either say so on the discussion page linked in the header, or, even better, improve this document if you can. Thanks! (You don't even need to create an account.)

To build, follow the instructions below: (Note that bold face indicates the directory for each command.)

First, if you are on Lucid (10.4 or earlier) remove setuptools and install distribute (a better, more recent replacement of setuptools) instead:

  1. sudo aptitude remove --purge python-setuptools python-virtualenv

  2. wget

  3. tar xfz distribute-0.6.8.tar.gz

  4. cd distribute-0.6.8

  5. sudo python install

  6. sudo easy_install virtualenv

See DistributeVsSetuptools for why this is necessary.

If you are on Maverick (10.10) or later, do this instead:

  1. sudo aptitude install python-setuptools python-virtualenv

Then, proceed to install hedge itself:

  1. BOOST_VER=N.NN; sudo aptitude install build-essential python-dev  libboost-serialization$BOOST_VER-dev libboost-python$BOOST_VER-dev libboost-thread$BOOST_VER-dev libboost-math$BOOST_VER-dev python-numpy libopenmpi-dev openmpi-bin git-core

    You have to adapt the N.NN version numbers for your distribution. Here are some data points:









    You may use the command
     apt-cache search libboost-python.*dev | sort

    to figure out possible version numbers. You should generally pick the newest one. If apt-cache search libboost is empty, which it may be if you very recently installed your OS, try sudo apt-get update and then apt-cache search again.

  2. git clone src

  3. src ./repotool clone .git

  4. Place this text in $HOME/

    BOOST_BINDINGS_INC_DIR = ['${HOME}/pool/include/boost-numeric-bindings/']
    BOOST_PYTHON_LIBNAME = ['boost_python-mt']
    BOOST_THREAD_LIBNAME = ['boost_thread-mt']
    (You may need to remove the '-mt' suffixes if you run into trouble.)
  5. git clone

  6. boost-numeric-bindings ./configure --prefix=$HOME/pool

  7. boost-numeric-bindings make install

  8. Create a text file excluded-subprojects in src and insert

  9. src ./repotool start-over

If you'd like to use MPI, do this here, too:

  1. eval `~/where/ever/src/repotool env`

  2. easy_install mpi4py (you need a version newer than 1.1.0 or recent svn)

To actually use the virtualenv created during installation, do this:

  1. eval `~/where/ever/src/repotool env`

This may also be something you want to put in your startup file.

I just tried this on Ubuntu 11.04, Natty Narwhal . Notes: 1) boost version 1.42. 2) I used apt-get instead of aptitude. 3) I did need to omit the '-mt' from step 5. 4) I did install mpi4py. 5) Have not run, but instructions were great! Got an 'INSTALL OK.' in no time at all. Thanks!

See the parent page for more information on possible extensions or troubleshooting.