Revision as of 15:51, 5 July 2012

Before installing from source, you should consider using the pre-built packages, which facilitates both installation and maintenance of Gerris and GfsView.

The Gerris environment consists of two main parts: the Gerris solver itself and the visualisation application GfsView. The Gerris solver does not need interactive display and can run purely in terminal mode. This is useful when running applications on supercomputing systems which are often used in "batch mode".

The Gerris solver depends on the GTS library for geometrical operations and object-oriented programming. The GTS library in turns depends on the Glib library, a set of useful extensions for C programming. Glib is installed as part of the standard installation on many Linux systems, however the corresponding development files (library header files etc...) usually need to be installed explicitly.

Installing the glib development files

Depending on your system, you have the choice between two installation procedures.

Using pkg-config

Linux systems use an utility called pkg-config to find out about development libraries installed on the system. Other versions of UNIX may also have pkg-config installed but your luck may vary.

To check whether you already have the development files for glib on your system do:

% pkg-config glib-2.0 --modversion

If the development files are installed you will get something like:

2.12.11

i.e. the installed version number of glib. Otherwise, you will need to install the development files first. It is most easily done by using the packaging system of your linux distribution. For example on a debian-based distribution just type:

% sudo apt-get install libglib2.0-dev

RPM-based distributions (Red Hat, Fedora, Suse etc...) will have similar tools but the package name may be different. Note also that the some of the optional modules have added dependencies. If you are using a Debian/Ubuntu system, the next section provides an easy way to also install these dependencies. For other systems, you may want to read the section below on modules dependencies.

If you need MPI, you might need to install OpenMPI or another variant of MPI. No need to compile the MPI library:

% sudo apt-get install openmpi

Choosing where to install the libraries

GTS, Gerris and GfsView use the standard GNU build system which by default installs the packages it builds in the /usr/local directory. You will normally need administrator privileges (i.e. root password) to install packages there.

You can choose another installation directory using e.g.

% ./configure --prefix=$HOME/local

if you want to install the packages somewhere else (e.g. somewhere in your user home directory).

Note that in both cases you need to somehow tell the system that you installed new executables and libraries there. See the instructions below for details.

Compiling and installing GTS

I will assume that you either downloaded and unpacked a source tarball or used darcs to get a directory called gts. Compilation and installation should then be as simple as:

Compiling and installing Gerris

Before compiling Gerris you need to decide whether you want to run Gerris in parallel. The parallel version of Gerris depends on an implementation of the MPI (Message Passing Interface) standard. If you do, you will need to install the MPI libraries first. On an Ubuntu/Debian system just do:

% sudo apt-get install openmpi-bin openmpi-dev

Note that the compilation of the parallel version of Gerris requires a working mpicc command (i.e. as provided by the openmpi-bin package above).

Otherwise the process is almost identical to the GTS installation. Again assuming you either downloaded and unpacked a source tarball or used darcs to get a directory called gerris, do:

% cd gerris
% ./configure
% make
% sudo make install

When installing in /usr/local do not forget to update the dynamic linker database:

% sudo /sbin/ldconfig

If everything went well you should be able to run the following (if using a csh based shell, remember to rehash first):

Compiling and installing GfsView

GfsView is a graphical application using OpenGL and the GTK Toolkit. The GTK toolkit is the basis of the GNOME desktop environment and of many graphical applications running on most Linux distributions. Compiling GfsView requires the installation of the development files for the OpenGL, GTK and GtkGlExt libraries. If you also want support for OpenGL text fonts within GfsView (used to display labels, color scale etc...) you will also need the FTGL library. On an Ubuntu/Debian system do:

GfsView also provides a non-graphical version (command gfsview-batch) which can run without any graphical display.
Off-screen OpenGL rendering is done using the OSMesa library (which is part of the Mesa OpenGL implementation).

The batch command is useful for generating on-the-fly animations on systems without a graphical terminal, by using the Gfsview module with GfsOutputView.
This is designed to require a minimal set of libraries: an OpenGL library (typically software-rendering such as implemented in Mesa), OSMesa and optionally FTGL. GTK, GtkGLExt are not required when installing only gfsview-batch. This should allow a reasonably straightforward installation on most UNIX systems (supercomputers in particular).

Module dependencies

The optional modules may require additional dependencies. If you are using a Debian/Ubuntu system these dependencies are easy to install. Other systems may have similar pre-packaged libraries, however they are usually not as complete as Debian and some libraries may not be packaged.

The dependencies will be checked by the ./configure script and the corresponding modules will only be installed if they are present. A summary of which modules will be installed is given by ./configure. To find out why a particular module is not going to be installed, you need to check further up in the ./configure output which particular library failed to be detected.

Hypre installation from source

If Hypre is installed from source, some manipulations are needed so that Gerris can find it during compilation.
If Hypre is installed in the folder /usr/local/hypre, the environment to run Gerris can be modified as: