From b78751d50aa8ea17c6a6046cbb4e1a2f0b862902 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 17 Jun 2014 14:17:59 +0000 Subject: [PATCH] doc/gf-developers.t2t: quick note on how to compile the C run-time system Also a few other minor updates. --- doc/gf-developers.html | 142 +++++++++++++++++++++++++++++++++++++---- doc/gf-developers.t2t | 34 ++++++++-- 2 files changed, 158 insertions(+), 18 deletions(-) diff --git a/doc/gf-developers.html b/doc/gf-developers.html index 0355c4ca0..e2ffa2329 100644 --- a/doc/gf-developers.html +++ b/doc/gf-developers.html @@ -9,7 +9,7 @@

GF Developers Guide

Authors: Björn Bringert, Krasimir Angelov and Thomas Hallgren
-Last update: 2013-01-30, 15:11 +Last update: 2014-06-17, 16:14

@@ -30,15 +30,23 @@
  • Read-write access
  • Further information about Darcs -
  • Compilation from source +
  • Compilation from source with Cabal -
  • Compilation with make -
  • Running the testsuite +
  • Compilation with make +
  • Compiling GF with C run-time system support +
  • Creating .deb packages for Ubuntu + +
  • Creating .rpm packages for Fedora +
  • Running the testsuite

    @@ -85,7 +93,7 @@ web sites, as described below.

    GF is written in Haskell, so first of all you need -the Haskell Platform, version 2012.4.0.0. Downloads +the Haskell Platform, version 2012.4.0.0 or 2013.2.0.0. Downloads and installation instructions are available from here:

    @@ -106,12 +114,13 @@ of the Haskell Platform was successful you should see a message like:

    -  The Glorious Glasgow Haskell Compilation System, version 7.4.2
    +  The Glorious Glasgow Haskell Compilation System, version 7.6.3
     

    Other required tools included in the Haskell Platform are -Cabal +Cabal, +Alex and Happy.

    @@ -123,7 +132,7 @@ and To get the GF source code, you also need Darcs, version 2 or later. Darcs is a distributed version control system, see http://darcs.net/ for more information. There are precompiled packages for many platforms -available at and source code if you want to compile it yourself. Darcs +available and source code if you want to compile it yourself. Darcs is also written in Haskell and so you can use GHC to compile it.

    @@ -138,7 +147,7 @@ are installed. Here is one way to do this:

    @@ -333,7 +342,7 @@ For more info about what you can do with darcs, see -

    Compilation from source

    +

    Compilation from source with Cabal

    The build system of GF is based on Cabal, which is part of the @@ -470,6 +479,33 @@ sources. Use the clean command for this purpose: +

    Known problems with Cabal

    + +

    +Some versions of Cabal (at least version 1.16) seem to have a bug that can +cause the following error: +

    + +
    +  Configuring gf-3.x...
    +  setup: Distribution/Simple/PackageIndex.hs:124:8-13: Assertion failed
    +
    + +

    +The exact cause of this problem is unclear, but it seems to happen +during the configure phase if the same version of GF is already installed, +so a workaround is to remove the existing installation with +

    + +
    +  ghc-pkg unregister gf
    +
    + +

    +You can check with ghc-pkg list gf that it is gone. +

    + +

    Compilation with make

    @@ -507,7 +543,91 @@ For cleaning: $ make clean - + +

    Compiling GF with C run-time system support

    + +

    +The C run-time system is separate implementation of the PGF run-time services +that makes it possible to work with very large, ambiguous grammars, using +probabilistic models to obtain probable parses. +

    +

    +Support for calling the C run-time library is available in the web API +provided by gf -server, if C run-time support is enabled. +

    +

    +To enable the C run-time system, first go to the src/runtime/c directory +and follow the instructions in the INSTALL file to install the C run-time +system. Once this is done, you can install GF with C run-time support by +doing +

    + +
    +  cabal install -fserver -fc-runtime
    +
    + +

    +from the top directory. +

    + + +

    Creating .deb packages for Ubuntu

    + +

    +This was tested on Ubuntu 14.04 for the release of GF 3.6, and the +resulting .deb packages appears to work on Ubuntu 12.04, 13.10 and 14.04. +

    +

    +Under Ubuntu, Haskell executables are statically linked against other Haskell +libraries, so the .deb packages are fairly self-contained. +

    + + +

    Preparations

    + +
    +  sudo apt-get install dpkg-dev debhelper
    +
    + + +

    Creating the package

    + +

    +Make sure the debian/changelog starts with an entry that describes the +version you are building. Then run +

    + +
    +  make deb
    +
    + + +

    Creating .rpm packages for Fedora

    + +

    +This is possible, but the procedure has not been automated. +It involves using the cabal-rpm tool, +

    + +
    +  sudo yum install cabal-rpm
    +
    + +

    +and following the Fedora guide +How to create an RPM package. +

    +

    +Under Fedora, Haskell executables are dynamically linked against other Haskell +libraries, so .rpm packages for all Haskell libraries that GF depends on +are required. Most of them are already available in the Fedora distribution, +but a few of them might have to be built and distributed along with +the GF .rpm package. +When building .rpm packages for GF 3.4, we also had to build .rpms for +fst and httpd-shed. +

    + +

    Running the testsuite

    diff --git a/doc/gf-developers.t2t b/doc/gf-developers.t2t index 3dba43508..82e02cb50 100644 --- a/doc/gf-developers.t2t +++ b/doc/gf-developers.t2t @@ -40,7 +40,7 @@ web sites, as described below. === The Haskell Platform === GF is written in Haskell, so first of all you need -the //Haskell Platform//, version 2012.4.0.0. Downloads +the //Haskell Platform//, version 2012.4.0.0 or 2013.2.0.0. Downloads and installation instructions are available from here: http://hackage.haskell.org/platform/ @@ -54,12 +54,12 @@ This command should show you which version of GHC you have. If the installation of the Haskell Platform was successful you should see a message like: ``` -The Glorious Glasgow Haskell Compilation System, version 7.4.2 +The Glorious Glasgow Haskell Compilation System, version 7.6.3 ``` Other required tools included in the Haskell Platform are -[Cabal http://www.haskell.org/cabal/] -%,[Alex http://www.haskell.org/alex/] +[Cabal http://www.haskell.org/cabal/], +[Alex http://www.haskell.org/alex/] and [Happy http://www.haskell.org/happy/]. @@ -79,7 +79,7 @@ This should work automatically on Mac OS and Windows, but on Linux one extra step is needed to make sure the C libraries required by //haskeline// are installed. Here is one way to do this: -- On Ubuntu: ``sudo apt-get install libghc6-haskeline-dev`` +- On Ubuntu: ``sudo apt-get install libghc-haskeline-dev`` - On Fedora: ``sudo yum install ghc-haskeline-devel`` @@ -401,10 +401,30 @@ $ make clean %$ make sdist %``` +== Compiling GF with C run-time system support == + +The C run-time system is separate implementation of the PGF run-time services +that makes it possible to work with very large, ambiguous grammars, using +probabilistic models to obtain probable parses. + +Support for calling the C run-time library is available in the web API +provided by ``gf -server``, if C run-time support is enabled. + +To enable the C run-time system, first go to the ``src/runtime/c`` directory +and follow the instructions in the ``INSTALL`` file to install the C run-time +system. Once this is done, you can install GF with C run-time support by +doing + +``` +cabal install -fserver -fc-runtime +``` +from the top directory. + + == Creating .deb packages for Ubuntu == -This has been tested on Ubuntu 12.04, and the resulting ``.deb`` packages -appears to work on Ubuntu 12.04, 12.10 and 13.04. +This was tested on Ubuntu 14.04 for the release of GF 3.6, and the +resulting ``.deb`` packages appears to work on Ubuntu 12.04, 13.10 and 14.04. Under Ubuntu, Haskell executables are statically linked against other Haskell libraries, so the .deb packages are fairly self-contained.