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
The process for installing software/libraries differs from linux distribution to distribution. In Gentoo (http://www.gentoo.org/)
$ emerge python
Python
First, check if python is already installed$ python -V Python 2.4.4
bash: python: command not found
$ ls /usr/include/python2.X/Python.h /usr/include/python2.X/Python.h
ls: cannot access /usr/include/python2.X/Python.h: No such file or directory
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"
grep: /usr/include/boost/version.hpp: No such file or directory
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
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)
bash: g++: command not found
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
bash: cmake: command not found
$ 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
PATH=$PATH:$HOME/software/cmake-2.6.1-Linux-i386/bin export PATH
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
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
export LD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH export PATH=$PATH:/usr/local/cuda/bin
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)
-bash: svn: command not found
Generated on Tue Mar 24 17:40:34 2009 for HOOMD by
1.5.7.1


