Darcs installation

From Gerris

Revision as of 00:53, 5 April 2012; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

Contents


The preferred way to install Gerris if you intend to contribute to the code is using the darcs version control system. Using darcs is also an easy way to keep your source code up to date with the most recent version of Gerris, even if you do not modify the source code.

To install darcs on an Ubuntu/Debian system do:

% sudo apt-get install darcs

For other systems have a look at the darcs installation page.

To get the latest version of Gerris using darcs do:

% darcs get http://gerris.dalembert.upmc.fr/darcs/gerris-stable

This will create a darcs repository called gerris-stable in the current directory.

Similarly you can get the latest version of GTS using:

% darcs get http://gerris.dalembert.upmc.fr/darcs/gts-stable

And the latest GfsView version using:

% darcs get http://gerris.dalembert.upmc.fr/darcs/gfsview-stable

To be able to install GTS, gerris and GfsView you need to create the configure scripts using the standard GNU Autotools. Gerris depends on a version of automake greater than or equal to 1.6. To install automake on an Ubuntu/Debian system do:

% sudo apt-get install automake libtool

You can then create and run the configure scripts using for example:

% cd gts-stable
% sh autogen.sh
% cd ../gerris-stable
% sh autogen.sh
% cd ../gfsview-stable
% sh autogen.sh

Note that when running these commands, configure may complain about missing libraries etc... You can ignore these errors for now, they will go away after you have installed the various libraries. Follow the instructions on how to compile and install GTS, Gerris and GfsView from source.

Upgrading the sources using darcs

Upgrading a repository using darcs is very simple. Assuming you got the gts-stable repository using the instructions above, you can get any new patch from the repository using:

% cd gts-stable
% darcs pull

This command will check for new patches on the http://gerris.dalembert.upmc.fr/darcs/gts-stable repository and will ask if you want to merge them into your current repository.

You can then compile and install the new version using:

% make
% make install

In some cases (when there have been substantial changes to the Makefiles etc...) you may need to refresh the configure scripts manually using:

% sh autogen.sh

before starting the compilation.

Important note

Since GfsView depends on Gerris and Gerris depends on GTS, you must upgrade GTS, Gerris and GfsView in this order.

Script for automated upgrade of GTS, Gerris and GfsView

On complex systems such as clusters/supercomputers, installing and maintaining Gerris can require specific tuning which may not be covered by the pre-built packages (for example due to specific MPI requirements etc...). In that case it can be useful to maintain Gerris using recompilation from source using darcs. Since new versions of Gerris are released often, it is a good idea to automate this upgrading process.

I will assume that darcs repositories for GTS, Gerris and GfsView have been created in /usr/local/src/gts-stable, /usr/local/src/gerris-stable and /usr/local/src/gfsview-stable following the procedure described above. The prefix for installation proper is assumed to be /usr/local. Of course, this can be tuned according to your system.

After this initial installation phase, the following script can be run as a daily cron job. It will upgrade GTS, Gerris and GfsView, whenever new patches are available. It will also respect the dependencies between the different libraries.

You can pass arguments to autogen.sh, change CFLAGS and LDFLAGS etc... depending on your system requirements.

wdir=/usr/local
gts=gts-stable
darcs_gts=http://gerris.dalembert.upmc.fr/darcs/gts-stable
gerris=gerris-stable
darcs_gerris=http://gerris.dalembert.upmc.fr/darcs/gerris-stable
gfsview=gfsview-stable
darcs_gfsview=http://gerris.dalembert.upmc.fr/darcs/gfsview-stable
 
build_gts=false
build_gerris=false
build_gfsview=false
 
if ( cd $wdir/src/$gts && make -k clean && \
( darcs pull -a $darcs_gts | grep "No remote changes to pull in" ) ) > /dev/null 2>&1 ; then
gts_changed=false
else
gts_changed=true
build_gts=true
fi
 
if $build_gts ; then
if ( cd $wdir/src/$gts && sh autogen.sh --prefix=$wdir/local && make -k && make -k install ) \
> $wdir/build 2>&1 ; then :
else
echo
echo ============ $wdir/$gts: build failed ============
echo
cat $wdir/build
exit 1
fi
build_gerris=true
fi
 
if ( cd $wdir/src/$gerris && make -k clean && \
( darcs pull -a $darcs_gerris | grep "No remote changes to pull in" ) ) > /dev/null 2>&1 ; then
gerris_changed=false
else
gerris_changed=true
build_gerris=true
fi
 
if $build_gerris ; then
if ( cd $wdir/src/$gerris && sh autogen.sh --prefix=$wdir/local && make -k && make -k install ) \
> $wdir/build 2>&1 ; then :
else
echo
echo ============ $wdir/$gerris: build failed ============
echo
cat $wdir/build
exit 1
fi
build_gfsview=true
fi
 
if ( cd $wdir/src/$gfsview && make -k clean && \
( darcs pull -a $darcs_gfsview | grep "No remote changes to pull in" ) ) > /dev/null 2>&1 ; then
gfsview_changed=false
else
gfsview_changed=true
build_gfsview=true
fi
 
if $build_gfsview ; then
if ( cd $wdir/src/$gfsview && sh autogen.sh --prefix=$wdir/local && make -k && make -k install ) \
> $wdir/build 2>&1 ; then :
else
echo
echo ============ $wdir/$gfsview: build failed ============
echo
cat $wdir/build
exit 1
fi
fi
Personal tools
communication