Installing from source

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:00, 17 September 2007
Popinet (Talk | contribs)
(Installing the glib development files)
← Previous diff
Revision as of 03:15, 17 September 2007
Popinet (Talk | contribs)
(Gerris installation from source)
Next diff →
Line 28: Line 28:
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. 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 [[:w:Autotools|GNU build system]] which by default installs the packages it builds in the <code>/usr/local</code> 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 =
 +
 +I will assume that you either downloaded and unpacked a [[Download|source tarball]] or [[darcs installation|used darcs]] to get a directory called <code>gts</code>. 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:
 +
 +<ol>
 +<li>If installing in <code>/usr/local</code>:</li>
 +
 +<ol>
 +<li>check that the file <code>/etc/ld.so.conf</code> exists and contains the line <code>/usr/local/lib</code> (if not, add it)</li>
 +<li>then run
 +<pre>% sudo /sbin/ldconfig</pre>
 +</li>
 +</ol>
 +
 +<li>If installing locally do (assuming you use bash as shell):
 +<pre>
 +% 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
 +</pre>
 +</li>
 +
 +</ol>
 +
 += 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 [http://www-unix.mcs.anl.gov/mpi/ 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 <code>mpicc</code> command (i.e. as provided by the <code>openmpi-bin</code> package above).
 +
 +Otherwise the process is almost identical to the GTS installation. Again assuming you either downloaded and unpacked a [[Download|source tarball]] or [[darcs installation|used darcs]] to get a directory called <code>gerris</code>, do:
 +
 + % 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.

Revision as of 03:15, 17 September 2007

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.

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

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/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).

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

If everything went well you should be able to run the following:

% gerris2D -V

and get the version number of your Gerris installation.

Personal tools
communication