Automatic installation

This guide describes an easy and automated way of installing all packages required for building HALMD. To find out more about the required packages, see Software prerequisites; details of the installation process are given in Manual installation.

Quick Start Guide

Create and change to a new directory (preferably on a local disk):

mkdir /tmp/halmd_prerequisites && cd /tmp/halmd_prerequisites

Download, compile (with 4 parallel processes), and install required packages to ~/opt:

nice make -f .../halmd/examples/packages.mk CONCURRENCY_LEVEL=4 install

Add packages to shell environment and set the CMAKE_PREFIX_PATH variable in particular:

make -f .../halmd/examples/packages.mk env >> ~/.bashrc

That was easy!

A more thorough look at packages.mk

The makefile packages.mk provides many more rules than just install:

make -f .../halmd/examples/packages.mk install-TAB TAB
install-boost     install-gcc       install-graphviz  install-lua       install-ninja
install-clang     install-gdb       install-halmd     install-luajit    install-nvcuda-tools
install-cmake     install-git       install-hdf5      install-luatrace  install-python-sphinx

Each install- rule depends on rules fetch-, extract-, configure-, and build-.

You may choose to install only selected dependencies:

make -f .../halmd/examples/packages.mk install-boost install-cmake

To compile and install to a path other than ~/opt:

make -f .../halmd/examples/packages.mk install PREFIX=~/pkg/debian6.0-x86_64

If you wish to first download all packages:

make -f .../halmd/examples/packages.mk fetch

To remove all package build directories:

make -f .../halmd/examples/packages.mk clean

Also remove downloaded tarballs and patches:

make -f .../halmd/examples/packages.mk distclean

To compile as a non-root user and install as root:

make -f .../halmd/examples/packages.mk PREFIX=/opt
sudo make -f .../halmd/examples/packages.mk install PREFIX=/opt

Troubleshooting

There are some requirements to ensure a smooth run of packages.mk:

  • a recent C++ compiler (e.g., GCC ≥ 4.7)
  • some standard tools: wget, tar, gzip, rm, cp, touch, patch
  • optionally, the bzip2 library for Boost.IOStreams

On a Debian system, install the following packages:

apt-get install build-essential zlib1g-dev libbz2-dev unzip libreadline6-dev

Boost C++ libraries

The compilation of Boost C++ requires GCC ≥ 4.7. If your distribution comes with GCC = 4.6 specify:

make -f .../halmd/examples/packages.mk BOOST_ABI=c++0x install-boost

Recent versions of non-GCC compilers may be used by setting BOOST_TOOLSET accordingly, e.g., clang for the Clang compiler, intel for Intel’s C++ Compiler, or pgi for PGI’s C++ compiler:

make -f .../halmd/examples/packages.mk BOOST_TOOLSET=clang install-boost

The bzip2 library is necessary to build Boost.IOStreams (files bzlib.h and libbz2.so). As HAL’s MD package does not make use of this library, you may opt to compile the Boost C++ libraries without bzip2 support by prepending NO_BZIP2=1 to the make command.