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:
sudo aptitude remove --purge python-setuptools python-virtualenv
wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.8.tar.gz
tar xfz distribute-0.6.8.tar.gz
cd distribute-0.6.8
sudo python setup.py install
sudo easy_install virtualenv
See DistributeVsSetuptools for why this is necessary.
If you are on Maverick (10.10) or later, do this instead:
- sudo aptitude install python-setuptools python-virtualenv
Then, proceed to install hedge itself:
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 commandJaunty
1.37
Karmic
1.40
Lucid
1.40
Natty
1.42
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.
git clone http://git.tiker.net/trees/repotool.git src
src ./repotool clone http://git.tiker.net/trees/ .git
Place this text in $HOME/.aksetup-defaults.py:
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.)git clone http://git.tiker.net/trees/boost-numeric-bindings.git
boost-numeric-bindings ./configure --prefix=$HOME/pool
boost-numeric-bindings make install
Create a text file excluded-subprojects in src and insert
pycuda pyrticle pyublasext pyopencl
src ./repotool start-over
If you'd like to use MPI, do this here, too:
eval `~/where/ever/src/repotool env`
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:
eval `~/where/ever/src/repotool env`
This may also be something you want to put in your startup file.
- === Ubuntu 11.04 - Natty ===
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.
