Installing from source

From Gerris

Revision as of 17:36, 2 February 2011; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

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:


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.

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:

% cd gts
% ./configure (--prefix=... is optional)
% make
% sudo make install (or just 'make install' if installing locally)

In order for the system to know that a new dynamic library has been installed, you need to:

  1. If installing in /usr/local:
    1. check that the file /etc/ exists and contains the line /usr/local/lib (if not, add it)
    2. then run
      % sudo /sbin/ldconfig

  2. If installing locally do (assuming you use bash as shell):
    % export PATH=$PATH:$HOME/local/bin
    % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/lib
    % export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/local/lib/pkgconfig

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):

% gerris2D -V

and get the version number of your Gerris installation.

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:

% sudo apt-get install libgtk2.0-dev libgtkglext1-dev libstartup-notification0-dev libftgl-dev

GfsView also provides a non-graphical version (command gfsview-batch) which can run without any graphical display. This command is useful for generating on-the-fly animations on systems without a graphical terminal. Off-screen OpenGL rendering is done using the OSMesa library (which is part of the Mesa OpenGL implementation). Note that this library is not necessary when using GfsView interactively. To install OSMesa on an Ubuntu/Debian system do:

% sudo apt-get install libosmesa6-dev

Then as usual do:

% cd gfsview
% ./configure
% make
% sudo make install
Personal tools