Installing from source
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.
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.
Installing the glib 1.2 series
On more exotic systems (e.g. Cray unicos etc...) it may prove difficult to install the glib 2.0 series (because of the multiple dependencies). The older glib 1.2 series is self-contained and should be easier to install instead. Both GTS and Gerris are written to be compatible with the older glib series.
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
% ./configure --prefix=/home/myaccount/mylocal
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
% 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:
- If installing in
- check that the file
/etc/ld.so.confexists and contains the line
/usr/local/lib(if not, add it)
- then run
% sudo /sbin/ldconfig
- If installing locally do (assuming you use bash as shell):
% export PATH=$PATH:/home/myaccount/mylocal/bin % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myaccount/mylocal/lib % export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/myaccount/mylocal/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 a 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).
% cd gerris % ./configure % make % sudo make install
If everything went well you should be able to run the following:
% gerris2D -V
and get the version number of your Gerris installation.