Mac OSX Installation

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:22, 25 June 2011
Pyl (Talk | contribs)
(Installing Gerris from tarball)
← Previous diff
Revision as of 17:24, 26 June 2011
Pyl (Talk | contribs)
(Installing Gerris from tarball)
Next diff →
Line 110: Line 110:
go to gerris go to gerris
-take the tarball and compile gts+take all the three tarball in the Download directory, unzip them and start:
- cd ../gts-snapshot-110121 + cd ../gts-snapshot-*
./configure ./configure
make make
Line 120: Line 120:
Take gerris on the website then Take gerris on the website then
- cd ../gerris-snapshot-110527/+ cd ../gerris-snapshot-*
./configure ./configure
make make
Line 127: Line 127:
It works! More difficult, take gfsview then It works! More difficult, take gfsview then
- cd ../gfsview-snapshot-110528 + cd ../gfsview-snapshot-*
Now, open the file "" Now, open the file ""

Revision as of 17:24, 26 June 2011


Mac OS X 10.6 Snow Leopard (Intel) Installation with MacPorts

Gerris installs and works fine on Snow Leopard. In you're using gfortran AND if you migrated your old data (from Leopard or Tiger), take care to update your gfortran installation. As of Apr 16, 2011, the standard way to install is using MacPorts. If you had fink previously installed and wish to use MacPorts you should uninstall the fink stuff, remove the /sw library and modify the environment variables accordingly.

Be careful that the ACLOCAL path is set like:

export ACLOCAL_FLAGS="-I/opt/local/share/aclocal $ACLOCAL_FLAGS"

You should also take care to avoid conflicts with libraries that may have been installed elsewhere. One way to avoid the conflicts is to set the MacPorts library first in the PKG_CONFIG_PATH variable.

export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig":"/opt/gerris/lib/pkgconfig":"/usr/lib/pkgconfig":"/usr/local/lib/pkgconfig"

The Gerris configure will read this variable and get the right MacPort libraries. There is in fact a whole lot of other environment variables that should be set to use with MacPorts to paths starting with /opt/local, read the MacPorts documentation.

The packages must installed as in

sudo port install pkgconfig glib2 gtkglext startup-notification gawk ffmpeg

If you get an error like

libtool: Version mismatch error.  This is libtool 2.2.4, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.4
libtool: and run autoconf again.

uninstall the libtool port:

sudo port uninstall libtool

and rerun the installation starting with

sh --prefix=/opt/gerris

This should take you through gerris installation. The gfsview installation proceeds in a similar way.

There were difficulties in the past with gfsview installation because of conflicts with gtk2 and gtkglext packages, but as of Apr 16, 2011 the MacPorts packages are working fine. See the discussion page for a record of these problems and how they were solved.

Mac OS X 10.6 Snow Leopard (Intel) Installation with "brew"

This is only a recipe, first install brew and the packages, then gerris from source.

Install "brew"

Start by the installation of homebrew ( see the exact procedure on the web page, it changes)

ruby -e "$(curl -fsSL"
sudo mkdir -p /usr/local
sudo chown -R $USER:staff /usr/local
curl -Lsf | tar xz --strip 1 -C/usr/local
brew install git
git clone /tmp/homebrew
mv /tmp/homebrew/.git /usr/local/
rm -rf /tmp/homebrew

Now that brew is installed, we can add packages, such as gnuplot, gawk and other usefull packages

brew search gnuplot
brew info gnuplot
brew install gnuplot
brew install gawk
brew install ffmpeg
brew install imagemagick 
brew install GtkGlExt
brew install gsl
brew install coreutils

Open the hiddend file ".bashrc" in your "home", with "vi" or emacs or ...

vi ~/.bashrc

if you use vi, press "i" to be in insert mode (see -- INSERT-- at the bottom), paste the following

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

go out the file with "ESC" and ":wq" then do, to update your path

source ~/.bashrc

You have to download "startup-notification" on the web

Caution: the -0.10 works, the -0.12 don not due to a XCB bug fixed in the -0.10 compile and install (put the good User Name)

cd /Users/pyl/Downloads/startup-notification-0.10 
sudo make install

Installing Gerris from tarball

go to gerris

take all the three tarball in the Download directory, unzip them and start:

cd ../gts-snapshot-* 
sudo make install

Be careful that the ACLOCAL path is set like:

export ACLOCAL_FLAGS="-I/usr/local/share/aclocal"

Take gerris on the website then

 cd ../gerris-snapshot-*
 sudo make install
 gerris2D -V

It works! More difficult, take gfsview then

cd ../gfsview-snapshot-* 

Now, open the file "" remove everything between "PKG_CHECK_MODULES(OSMESA,..." line 61? and "AM_CONDI.." add "have_osmesa=no" if using vi, erase line with "dd", and insert "i" the line

 have_osmesa=no in between.

e.g. in this file the lines are now :

PKG_CHECK_MODULES(OSMESA, [ osmesa ], [ have_osmesa=yes ], [ have_osmesa=no ])
AM_CONDITIONAL(HAVE_OSMESA, test "x$have_osmesa" = "xyes")

go out and save (esc :wq)

Prompt exactly

LDFLAGS="-L/usr/X11/lib" sh


sudo make install


X11 on MacBook: you need a three-button mouse or trackpad emulation

You need either to connect a three-button mouse to your Mac or have the middle and right-click functions of a mouse emulated on the trackpad. Go into the X11 application (it can be reached inside your Dock) then under the X11 menu go into "Preferences" and select "emulate a three button mouse".

Then press the "Command" (cmd) key and move ONE finger on the trackpad while clicking on the trackpad to emulate the right-click on the mouse and move around the gfs view. Press the "Command" (cmd) key and move TWO fingers on the trackpad to emulate the center-click on the mouse or the scrolling, to zoom in and out these pretty gfsview images ...

Mac OS X 10.5 (Intel) Installation with fink

The instructions below for 10.4 should work but there is an OpenGL bug in Xcode 3.0. Either upgrade to Xcode 3.1 or later, or use the following fix when configuring/compiling gfsview:

cd ../gfsview-stable
LDFLAGS="-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib sh --prefix=/opt/gerris
make && make install

Mac OS X 10.4 (Intel) Installation with fink

Below are steps that have worked for at least three people, installing Gerris under Mac OS X 10.4 (Intel).

  1. You will need the Apple development tools installed - this is a free download from
  2. Check that you have Apple's X11 and the X11 SDK installed. They are not installed by default on a new machine (at least as far as I could figure out). If X11 is not installed, in OS X 10.4 you need to reinstall your system from the DVD (See here). Reinstalling the system will not remove your user files. (For comparison, on my system, the versions were X11 1.1.3 - XFree86 4.4.0 .)
  3. Install Fink (
  4. Install various dependencies that Gerris requires.
    sudo fink install pkgconfig glib2 glib2-dev glib2-shlibs gtk+2 gtk+2-dev \
                      gtkglext1 startup-notification-dev \

    Other packages may also be necessary. Look at the error messages during the configuration steps below to see what packages may be missing. Then the best way to resolve the problem may be to install "fink commander". Then search for all the packages that have a name beginning with pango, gtk+, atk1 and install all of them. Trial and error should eventually lead you to a full installation of all the necessary packages.

  5. Install darcs (needed to obtain the latest version of Gerris, GTS, and GfsView - the packaged versions available on the web do not work). Darcs is not available in Fink either.
    1. Download the DMG from, and mount it.
    2. From the DMG, Drag GMP.Framework into /Library/Frameworks.
    3. From the DMG, put the 'darcs' executable wherever you wish (e.g. /usr/local/bin).

  6. From a suitable folder, obtain the latest versions of GTS, Gerris, and GfsView.
    darcs get
    darcs get
    darcs get
  7. We will install these in /opt/gerris to keep them isolated from the rest of the system. This requires /opt/gerris/lib/pkgconfig to be added to your PKG_CONFIG_PATH. This directory does not exist yet - it will be created in the next step.
    echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/gerris/lib/pkgconfig" >> ~/.profile
  8. Check your version of automake:
    % automake --version

    Currently (November 8, 2007) this installation procedure works with automake 1.6.3 which is on your system by default. Any later version should also work.

  9. Add the gerris directory to your path (so gts-config works properly), also add the fink directory.
    echo "export PATH=$PATH:/opt/gerris/bin:/sw/bin" >> ~/.profile
  10. Compile and install GTS, Gerris and GfsView.
    cd gts-mainline
    sh --prefix=/opt/gerris
    make && make install
    cd ../gerris-stable
    sh --prefix=/opt/gerris
    make && make install
    cd ../gfsview-stable
    sh --prefix=/opt/gerris
    make && make install
  11. Test your installation. Beware of end of line characters.
  12. You're done !

Optional tools

If we want to generate MPEG movies using ppm2mpeg we will need ffmpeg which is not available in Fink stable, so we must install it manually.

  1. Download the latest SVN snapshot from
  2. Unpack and install it.
    tar -xvjf ffmpeg-export-snapshot.tar.bz2
    cd ffmpeg-export-<insert date here>
    ./configure --prefix=/opt/gerris
    make && make install

Personal tools