Instructions for downloading and installing hpGEM are given here. The installation was tested on Suse linux OS and Apple OS. To know more about hpGEM, please see the documentation page.


Source code of hpGEM is available here. Last updated on 2nd December 2008.


  1. Apple or Linux operating system.
  2. C++ and Fortran compilers.
  3. For Shallow water applications in hpGEM package, GSL library has to be installed.


1. Know your gcc version by using the command:

gcc -v

Version number is displayed in the last line of the output.

2. In the installation steps below, '*' must be replaced with the version number of the respective packages.

3. Installation of PETSc (step 5) in the steps below is an optional feature and not required for certain applications. Please see section "hpgem applications".

4. Ignore DEMO errors in UMFPACK installation (step 6) and continue with the next steps.

Auto Installation

1. Unpack the hpgem package:

tar -zxvf hpgem.v1.0.tar.gz

2. Change to the hpgem configuration directory

cd hpgemdev/config/

3. Install hpgem using any of the options below:


Note: If the auto-installation is unsuccessful then you can also try manual installation below.

Manual Installation

Note: We highly recommend to use auto installation.

1. Make a directory named "opt" or locate an existing "opt" directory. The absolute path (not relative path) to the "opt" directory, from now on, will be referred as $OPT_DIR.

2. Download the boost library version 1.43.0 from to your opt directory. Unpack and install the boost package as follows:

tar -zxvf boost_1_43_0.tar.gz
cd $OPT_DIR/boost_1_43_0
./ --prefix=$OPT_DIR/boost
./bjam install

3. Download the latest version of boost bindings from in your opt directory. Unpack and install the boost bindings as follows:

tar -zxvf boost-numeric-bindings-20081116.tar.gz
mv boost-numeric-bindings/boost/numeric/bindings/     boost/include/boost/numeric/

4. Apple OS user can skip this step. For Linux OS, a direct installation of lapack is available. Download the latest version of Lapack library from LAPACK Site to your opt directory. Unpack and install the Lapack package as follows:

tar -zxvf lapack.tgz
mv lapack-*.*.* lapack
cd lapack
if gcc version is 3.*.* then cp
else if gcc version is 4.*.* then cp INSTALL/
make blaslib
make lib
make all
make clean
cp lapack_LINUX.a liblapack.a
cp blas_LINUX.a libblas.a
cp tmglib_LINUX.a libtmglib.a

Note: a) If you have download Lapack 3.1.1 version then lapack-*.*.* is lapack-3.1.1
b) See notes to know your gcc version

5. Download the latest version of Petsc from "Petsc web page" to your opt directory. For a simple and direct installation use the following options (internet connection is needed):

tar -zxvf petsc-*.*.*-p**.tar.gz

Petsc could be installed in two versions: a) An optimized version for production runs and b) A debug version for debugging or developing codes.

------------------ Begin ---------------
a) Optimized version:
cp -r petsc-*.*.*-p** petsc-opt

(sh/bash shell:) export PETSC_DIR=$OPT_DIR/petsc-opt
(csh/tcsh shell:) setenv PETSC_DIR=$OPT_DIR/petsc-opt

cd petsc-opt

for gcc version 3.x.x
./config/ --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=1 --with-mpi=0 --with-cxx=g++ --with-clanguage=cxx --with-debugging=0 COPTFLAGS='-O3 -march=p4 -mtune=p4' FOPTFLAGS='-O3 -qarch=p4 -qtune=p4'
or for gcc version 4.x.x
./config/ --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack=1 --with-mpi=0 --with-cxx=g++ --with-clanguage=cxx --with-debugging=0 COPTFLAGS='-O3 -march=p4 -mtune=p4' FOPTFLAGS='-O3 -qarch=p4 -qtune=p4'
Follow the instructions given by the above configure script. It will ask to set a bash or csh variable $PETSC_ARCH.

make all
make test
------------------ End ---------------

------------------ Begin ---------------
b) Debug version:
cp -r petsc-*.*.*-p** petsc-debug

(sh/bash shell:) export PETSC_DIR=$OPT_DIR/petsc-debug
(csh/tcsh shell:) setenv PETSC_DIR=$OPT_DIR/petsc-debug

cd petsc-debug

for gcc version 3.x.x
./config/ --with-cc=gcc --with-fc=g77 --download-f-blas-lapack=1 --with-mpi=0 --with-cxx=g++ --with-clanguage=cxx
or for gcc version 4.x.x
./config/ --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack=1 --with-mpi=0 --with-cxx=g++ --with-clanguage=cxx
Follow the instructions given by the above configure script. It will ask to set a bash or csh variable $PETSC_ARCH.

make all
make test
------------------ End ---------------

Note: a) If you download petsc-2.3.3-p15.tar.gz then petsc-*.*.*-p** is petsc-2.3.3-p15
b) We recommend to install both optimized and debug version of Petsc.

6. Download UMFPACK, AMD, UFconfig, CAMD, CCOLAMD, CHOLMOD, COLAMD and METIS-4.0 and install as follows:

tar -zxvf AMD.tar.gz
tar -zxvf UFconfig.tar.gz
tar -zxvf UMFPACK.tar.gz
tar -zxvf CAMD-2.2.1.tar.gz
tar -zxvf CCOLAMD-2.7.2.tar.gz
tar -zxvf CHOLMOD-1.7.1.tar.gz
tar -zxvf COLAMD-2.7.2.tar.gz
tar -zxvf metis-4.0.tar.gz
make library
make clean
cp ../AMD/Include/amd.h Include/
cp ../AMD/Include/amd_internal.h Include/
cp ../UFconfig/UFconfig.h Include/

7. Download hpgem from here and also hpgem makefile. Now follow the instructions below:

Add the following command to your ".bashrc" file in your home directory:
export PETSC_DIR = $OPT_DIR/petsc-*.*.*-p**

Unpack hpgem package:
tar -zxvf hpgem.v1.0.tar.gz
Copy the downladed hpgem makefile into the following directory:
cp hpgem.make hpgemdev/tools/

Open and edit the "hpgem.make" file using your favourite editor and set the following variables:
OPT_DIR = full/path/to/your/opt/directory
G2C = gfortran for gcc version 4.x.x or
G2C = g2c for gcc version 3.x.x

cd ../samples/PF3D
If this works then hpgem is properly configured with petsc and umfpack included. Good Luck!


In case of any problems, please contact us.

Instructions are last updated on 2nd December 2008.