Mac OSX Installation

From Gerris

Revision as of 13:34, 16 April 2011; view current revision
←Older revision | Newer revision→
Jump to: navigation, search


Mac OS X 10.4 (Intel) Installation

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

Mac OS X 10.5 (Intel) Installation

The instructions above 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.6 Snow Leopard (Intel) Installation

Gerris works fine on Snow Leopard. In you're using gfortran AND if you migrated your old data (from Leopard or Tiger), just take care to update your gfortran installation. The compilation of gfs and gerris should not be a problem. I had a little more trouble installing gfsview. Though the compilation went fine, gfsview kept crashing using GTK. For me, the workaround was to uninstall gtkglext and mesa (macports) packages. Then I had to recompile gtkglext from the sources:

tar zxvf gtkglext-1.0.6.tar.gz
cd gtkglext-1.0.6
./configure --prefix=the_path_you_want --with-gl-includedir=/usr/X11R6/include/ --with-gl-libdir=/usr/X11R6/lib
make && make install

and then proceed to gfsview installation.

See also the discussion page for alternatives.

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 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 outthese pretty gfsview images ... . There is no need to click on the trackpad.

Personal tools