Files
gf-core/download/index-3.11.md
2020-12-16 17:38:13 +01:00

5.4 KiB

Installing from a binary package

Binary packages are available for Debian/Ubuntu, macOS, and Windows and include:

  • GF shell and grammar compiler
  • gf -server mode
  • C run-time system
  • Java & Python bindings to the C run-time system

Unlike in previous versions, the binaries do not include the RGL.

Binary packages on GitHub

Debian/Ubuntu

To install the package use:

sudo dpkg -i gf_3.11.deb

The Ubuntu .deb packages should work on Ubuntu 16.04, 18.04 and similar Linux distributions.

macOS

To install the package, just double-click it and follow the installer instructions.

The packages should work on at least 10.13 (High Sierra) and 10.14 (Mojave).

Windows

To install the package, unpack it anywhere.

You will probably need to update the PATH environment variable to include your chosen install location.

For more information, see Using GF on Windows (latest updated for Windows 10).

Installing the latest release from source

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

  1. Install a recent version of the Haskell Platform (see note below)
  2. cabal update
  3. On Linux: install some C libraries from your Linux distribution (see note below)
  4. cabal install gf

You can also download the source code release from GitHub, and follow the instructions below under Installing from the latest developer source code.

Notes

Installation location

The above steps installs GF for a single user. The executables are put in $HOME/.cabal/bin (or on macOS in $HOME/Library/Haskell/bin), so you might want to add this directory to your path (in .bash_profile or similar):

PATH=$HOME/.cabal/bin:$PATH

Build tools

In order to compile GF you need the build tools Alex and Happy. These can be installed via Cabal, e.g.:

cabal install alex happy

or obtained by other means, depending on your OS.

Haskeline

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:

  • On Ubuntu: sudo apt-get install libghc-haskeline-dev
  • On Fedora: sudo dnf install ghc-haskeline-devel

GHC version

The GF source code has been updated to compile with GHC versions 7.10 through to 8.8.

Installing from the latest developer source code

If you haven't already, clone the repository with:

git clone https://github.com/GrammaticalFramework/gf-core.git

If you've already cloned the repository previously, update with:

git pull

Then install with:

cabal install

or, if you're a Stack user:

stack install

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.

Installing the Python bindings from PyPI

The Python library is available on PyPI as pgf, so it can be installed using:

pip install pgf

We provide binary wheels for Linux and macOS, which include the C runtime and are ready-to-go. If there is no binary distribution for your platform, this will install the source tarball, which will attempt to build the binding during installation, and requires the GF C runtime to be installed on your system.


Installing the RGL from a binary release

Binary releases of the RGL are made available on GitHub. In general the steps to follow are:

  1. Download a binary release and extract it somewhere on your system.
  2. Set the environment variable GF_LIB_PATH to point to wherever you extracted the RGL.

Installing the RGL from source

To compile the RGL, you will need to have GF already installed and in your path.

  1. Obtain the RGL source code, either by:
  • cloning with git clone https://github.com/GrammaticalFramework/gf-rgl.git
  • downloading a source archive here
  1. Run make in the source code folder.

For more options, see the RGL README.


Older releases