Installing packages for ALPS on CentOS 6

This tutorial is an extension of Installing ALPS 2.0 from source on CentOS 5 The installation can apply on CentOS 6 as well. For this tutorial, we will be installing.

  1. python 2.6 and python 2.6-devel (Assumed installed already)
  2. python-setuptools and python-setuptools-devel (Assumed installed already)
  3. blas and lapack
  4. numpy and numpy-f2py and python-matplotlib
  5. h5py,
  6. scipy

I’m trying to refrain for installing as much by source compiling and rely on repository for this tutorial. As such the packages will be behind

Step 1: Install blas and lapack packages from CentOS Base Repositories

# yum install lapack* blas*
================================================================================
 Package               Arch            Version              Repository     Size
================================================================================
Installing:
 blas                  x86_64          3.2.1-4.el6          base          321 k
 blas-devel            x86_64          3.2.1-4.el6          base          133 k
 lapack                x86_64          3.2.1-4.el6          base          4.3 M
 lapack-devel          x86_64          3.2.1-4.el6          base          4.5 M
Transaction Summary
================================================================================
Install       4 Package(s)

Total download size: 9.2 M
Installed size: 26 M
Is this ok [y/N]: y

Step 2: Install numpy numpy-f2py python-matplotlib

# yum install numpy numpy-f2py python-matplotlib
================================================================================
 Package                  Arch          Version               Repository   Size
================================================================================
Installing:
 numpy                    x86_64        1.3.0-6.2.el6         base        1.6 M
 numpy-f2py               x86_64        1.3.0-6.2.el6         base        430 k
 python-matplotlib        x86_64        0.99.1.2-1.el6        base        3.2 M

Transaction Summary
================================================================================
Install       3 Package(s)

Total download size: 5.3 M
Installed size: 22 M
Is this ok [y/N]: y

Step 3: Install h5py

# yum install h5py
================================================================================
 Package            Arch          Version                     Repository   Size
================================================================================
Installing:
 h5py               x86_64        1.3.1-6.el6                 epel        650 k
Installing for dependencies:
 hdf5-mpich2        x86_64        1.8.5.patch1-7.el6          epel        1.4 M
 liblzf             x86_64        3.6-2.el6                   epel         20 k
 mpich2             x86_64        1.2.1-2.3.el6               base        3.7 M

Transaction Summary
================================================================================
Install       4 Package(s)

Total download size: 5.7 M
Installed size: 17 M
Is this ok [y/N]: y

Step 4: Install scipy

# yum install scipy
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
scipy x86_64 0.7.2-5.el6 epel 5.8 M
Installing for dependencies:
suitesparse x86_64 3.4.0-2.el6 epel 782 k

Transaction Summary
================================================================================
Install 2 Package(s)

Total download size: 6.5 M
Installed size: 29 M
Is this ok [y/N]: y

Installing ALPS 2.0 from source on CentOS 5

What is ALPS Project?

The ALPS project (Algorithms and Libraries for Physics Simulations) is an open source effort aiming at providing high-end simulation codes for strongly correlated quantum mechanical systems as well as C++ libraries for simplifying the development of such code. ALPS strives to increase software reuse in the physics community.

Good information on installing ALPS can be found on ALPS Wiki’s Download and install ALPS for Ubuntu 9.10, Ubuntu 10.04, Ubuntu 10.10, Debian and MacOS

Installing ALPS with Boost

# wget http://alps.comp-phys.org/static/software/releases/alps-2.0.2-r5790-src-with-boost.tar.gz

You will need either gfortran or Intel Fortran Compiler. If you are installing using gfortan

# yum install gcc-c++ gcc-gfortran

If you want to use the evaluation tools, you will need to install a newer version of Python than the provided 2.4. You can install from source or use an unofficial repository for binary RPMs. This is not required if you just want to run your compiled simulations (c++ applications), but make sure you still have python headers (specify -DALPS_BUILD_PYTHON=OFF when invoking cmake):

# yum install python-devel

BLAS/LAPACK is necessary. Make sure you have EPEL repository ready. For more information,Red Hat Enterprise Linux / CentOS Linux Enable EPEL (Extra Packages for Enterprise Linux) Repository

# yum install blas-devel lapack-devel

CMake 2.8.0 and HDF5 1.8 need to be installed. There is a wonderful scripts that comes with ALPS that help to compile CMAKE 2.8 and HDF5.1.8 with CentOS 5

$ $HOME/src/alps2/script/cmake.sh $HOME/opt $HOME/tmp
$ $HOME/src/alps2/script/hdf5.sh $HOME/opt $HOME/tmp

Build ALPS

Create a build directory (anywhere you have write access) and execute cmake giving the path to the alps and to the boost directory:

# cmake -D Boost_ROOT_DIR:PATH=/path/to/boost/directory /path/to/alps/directory

For example if the alps precompiled directory is in /root/alps-2.0.2

# cmake -D Boost_ROOT_DIR:PATH=/root/alps-2.0.2/boost /root/alps-2.0.2/alps

To install in another directory, set set the variable CMAKE_INSTALL_PREFIX

# cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/directory /path/to/alps/directory

For example:

# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/alps-2.0.2 /root/alps-2.0.2/alps

Build and test ALPS

$ make -j 8
$ make test
$ make install

* HDF5.1.8 binaries and  libraries are very useful not only for compiling ALPS but other applications require HDF5.1.8. You may want to consider to move its binaries and libraries to the /usr/local/ directories