Installing from source

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:59, 29 April 2012
Popinet (Talk | contribs)
(Dependent packages for Debian/Ubuntu - added hypre)
← Previous diff
Revision as of 22:23, 29 April 2012
Popinet (Talk | contribs)
(Added section on module dependencies)
Next diff →
Line 25: Line 25:
% sudo apt-get install libglib2.0-dev % 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.+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 [[Object_hierarchy#Modules|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 [[Installing_from_source#Module_dependencies|modules dependencies]].
== Dependent packages for Debian/Ubuntu == == Dependent packages for Debian/Ubuntu ==
Line 122: Line 122:
% make % make
% sudo make install % sudo make install
 +
 += Module dependencies =
 +
 +The [[Object_hierarchy#Modules|optional modules]] may require additional dependencies. If you are using a Debian/Ubuntu system these dependencies [[Installing_from_source#Dependent_packages_for_Debian/Ubuntu|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 <code>./configure</code> script and the corresponding modules will only be installed if they are present. A summary of which modules will be installed is given by <code>./configure</code>. To find out why a particular module is not going to be installed, you need to check further up in the <code>./configure</code> output which particular library failed to be detected.

Revision as of 22:23, 29 April 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.

Contents

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.

Dependent packages for Debian/Ubuntu

They can be installed by running the following command:

% sudo apt-get install libglib2.0-dev libnetpbm10-dev m4 libproj-dev \
libgsl0-dev libnetcdf-dev libode-dev libfftw3-dev libhypre-dev libgtkglext1-dev libstartup-notification0-dev ffmpeg

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:

% 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/ld.so.conf 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

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.

Personal tools
communication