Installing Software Prerequisites on Linux

This page assumes that you have a standard terminal window open. Commands to run will be indicated as below:
 $ echo hello
hello
" $ " indicates a shell prompt. As demonstrated above, if you type "echo hello", then you should see the same output obtained above on the next line: "hello"

The process for installing software/libraries differs from linux distribution to distribution. In Gentoo (http://www.gentoo.org/)

 $ emerge python
would install python. Look at your linux distribution's documentation to find how to install packages on your system (i.e. yum, apt-get, up2date, or another). You may need to "su -" or use sudo to become root before installing.

Python

First, check if python is already installed
 $ python -V
Python 2.4.4
Make sure that the version is 2.3 or greater. If you get
bash: python: command not found
or have a version older than 2.3, you will need to upgrade/install python. Note that you will also need the python development libraries which some distributions might separate into into python-devel or some such. The existence of the python development package can be tested by checking the output of
 $ ls /usr/include/python2.X/Python.h
/usr/include/python2.X/Python.h
where X is replaced with the major version of python that you have (i.e. For python 2.4.4 above, X would be 4). If this returned
ls: cannot access /usr/include/python2.X/Python.h: No such file or directory
then you do not have the python development libraries installed.

Boost

First, check if boost is already installed
 $ grep BOOST_LIB_VERSION /usr/include/boost/version.hpp
//  BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
#define BOOST_LIB_VERSION "1_34_1"
Make sure that the version is 1_32_0 or newer. If you get
grep: /usr/include/boost/version.hpp: No such file or directory
then boost is not installed. You can upgrade/install boost with your distribution's package manager. You may need to install the boost-static package to get the static libraries needed by HOOMD.

If your distribution doesn't have a new enough version of boost, you can build it by hand. Go to http://www.boost.org , download the latest source code and unpack it. cd to the source directory and run

 $ mkdir /home/user/software
 $ ./configure --with-python-version=2.5 --prefix=/home/user/software/

By default, only shared libraries are built. HOOMD expects static libraries by default, so open up Makefile in your favorite text editor and make the following change (for building boost 1.35 or newer):

BJAM_CONFIG=variant=release threading=multi link=shared,static

Then you can build and install boost with the following commands.

 $ make
 $ make install
Be prepared to wait a while: boost takes a long time to compile.

Before running ccmake or cmake-gui, set the following environment variables to the location where you installed boost:

 $ export BOOST_ROOT=/home/joaander/software
 $ ccmake ../src  # or run cmake-gui
 ... continue with build instructions ...

Compiler

These instructions test for the installation of gcc. Other C++ compilers can be used if you wish, though compilations with CUDA enabled are only supported with gcc.

Test if g++ is installed.

 $ g++ --version
 $ g++ (GCC) 4.1.2 (Gentoo 4.1.2)
Any version should do. If you get
bash: g++: command not found
then you will need to install gcc using your distributions package management system.

CMake

It is not very likely that your linux distribution includes CMake by default, but check anyways.
 $ cmake --version
cmake version 2.6-patch 1
Make sure the version is 2.6 or later. If you have an old version or get
bash: cmake: command not found
then you will need to upgrade/install CMake. Try your distributions package manager first. I.e. in Gentoo
 $ emerge cmake

If your distribution does not have a cmake package, then you can install it into your home directory by hand. First, download cmake-2.6.1-Linux-i386.tar.gz from the Downloads section at http://www.cmake.org. Unpack the tarball to any location you prefer: this example assumes you are installing it to the ${HOME}/software

 $ mkdir ~/software
 $ mv cmake-2.6.1-Linux-i386.tar.gz ~/software/
 $ cd ~/software
 $ tar -xvzf cmake-2.6.1-Linux-i386.tar.gz
Then you need to put the bin directory for cmake into your path. If you use bash for a shell you can do this by editing ~/.bashrc. Look for a line with PATH=... and add the cmake directory to the end separated by a colon. If you can't find the line, create it like so.
PATH=$PATH:$HOME/software/cmake-2.6.1-Linux-i386/bin
export PATH
Restart your bash shell (or open a new one) and try the version check above to test your installation.

CUDA

Even if you do not have the needed graphics hardware to run, you can still install the CUDA toolkit and run executables in emulation mode. The emulation is slow, but will allow you to develop and test any changes you make that affect any of the *GPU classes.

CUDA is quite new and it is not likely that there is a package available through your linux distribution. Gentoo is the only distribution currently offering a package:

 $ emerge nvidia-cuda-toolkit
will install the latest version of the CUDA toolkit and set all environment variables for you.

If your distribution doesn't come with a package, go to http://developer.nvidia.com/object/cuda.html and download the latest CUDA toolkit for you architecture and linux distribution. If your distribution isn't listed, pick one that looks close, it will likely work. To install, simply go to the directory where you downloaded the toolkit and run:

 $ bash NVIDIA_CUDA_Toolkit_2.0_rhel5_x86_64.run
Note, this example lists a specific file: change the command to match the file that you downloaded. The file is a self-unpacking and installing script. Just accept the default location if you have root access to install, or install to ~/CUDA or anywhere else you please. Open up ~/.bashrc in your favorite text editor and add the following line:
export LD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
export PATH=$PATH:/usr/local/cuda/bin
Change the paths on these lines if you did not install to the default location.

If you have a CUDA capable graphics card, you will also need the proper graphics driver version. See the CUDA webpage linked to above for more information.

If you wish, you can download the CUDA SDK from the same website and compile the example files to test your CUDA installation. The CUDA SDK is not required to compile or run HOOMD, however.

Subversion

Subversion is used for version control. You need to install it if you have commit access and are going to work on active development of HOOMD, or if you just want to download and compile the latest and greatest version.

First, see if you already have subversion installed.

 $ svn --version
svn, version 1.4.4 (r25188)
If you get
-bash: svn: command not found
then you will need to install it with your distribution's package manager.

Generated on Tue Mar 24 17:40:34 2009 for HOOMD by doxygen 1.5.7.1