GF Logo

Grammatical Framework Download and Installation

GF 3.7 was released on 25 June 2015.

What's new? See the Release notes.

Binary packages

Platform Download Features How to install
Mac OS X gf-3.7.pkg GF+S+C Double-click on the package icon
Mac OS X gf-3.7-bin-intel-mac.tar.gz GF+S+C+P sudo tar -C /usr/local -zxf gf-3.7-bin-intel-mac.tar.gz
Ubuntu (32-bit) gf_3.7-1_i386.deb GF+S+C+P sudo dpkg -i gf_3.7-1_i386.deb
Ubuntu (64-bit) gf_3.7-1_amd64.deb GF+S+C+P sudo dpkg -i gf_3.7-1_amd64.deb
Windows GF unzip

Features: GF = GF shell and grammar compiler and the Resource Grammar Library, S = gf -server mode, C = C run-time system, P = Python binding to the C run-time system


The Windows package is installed by just unpacking it anywhere. You will probably need to set the PATH and GF_LIB_PATH environment variables, see Inari's notes on Installing GF on Windows.

The .deb packages work on Ubuntu 12.04, 14.04 and 15.04.

The packages for Mac OS work on 10.9 (Mavericks) and on 10.10 (Yosemite).

The Mac OS and Linux .tar.gz packages are designed to be installed in /usr/local. You can install them in other locations, but then you need to set the GF_LIB_PATH environment variable:

    export GF_LIB_PATH=/usr/local/share/gf-3.7/lib

where /usr/local should be replaced with the path to the location where you unpacked the package.

Installing the latest release from source

GF is on Hackage, so under normal circumstances the prodedure is fairly simple:

  1. Install the Haskell Platform version 2013.2.0.0 or 2012.4.0.0 (see notes 2&3 below)
  2. cabal update
  3. On Linux: install some C libraries from your Linux distribution (see note 1 below)
  4. cabal install gf

You can also download the full source package from here: gf-3.7.tar.gz.


The above steps installs GF for a single user. The executables are put in $HOME/.cabal/bin (or, with recent versions of the Haskell platform on Mac OS X, in $HOME/Library/Haskell/bin), so it is a good idea to put a line in your .bash_profile or .profile to add that directory to you path:




Note 1. GF uses haskeline, which on Linux depends on some non-Haskell libraries that won't be installed automatically by cabal, and therefore need to be installed manually. Here is one way to do this:

Note 2. We recommend using GHC 7.8 (which is part of the Haskell Platform 2014.2.0.0) or GHC 7.6 (which is part of the Haskell Platform 2013.2.0.0). Using GHC 7.4 (Haskell Platform 2012.4.0.0) still works too.

The GF source code has been updated to be compilable with GHC 7.10.1, but we have seen cases where GF stops with the message gf: <<loop>> when running with multiple threads (-j +RTS -N -RTS), so it's probably better to stick with GHC 7.8, at least until GHC 7.10.2 is out.

Note 3. The Haskell Platform for Mac OS X page states that on OS X 10.6 you need Xcode 3.2 or later, but in fact it appears you need Xcode 3.2.3 or later. If you have Xcode 3.2.2, you can get an error from the linker: ld: unknown option: -no_pie.

Known problems

There seems to be a bug in some versions of Cabal that can cause

    Distribution/Simple/PackageIndex.hs:124:8-13: Assertion failed

if the same version of GF is already installed. If you encounter this, you can use ghc-pkg unregister gf to remove the installed version of GF and ghc-pkg list gf to verify that it is gone.

Installing from the latest developer source code

The first time:

    darcs get --lazy GF
    cd GF
    cabal install


    cd GF
    darcs pull -a
    cabal install

Alternatively, you can get the code from the GF GitHub mirror, which is updated nightly.

The above notes for installing from source apply also in these cases. For more info on working with the GF source code, see the GF Developers Guide.

Older releases