4. Installing pre-supposed utilities

Here are the gory details about some utility programs you may need; perl, gcc and happy are the only important ones. (PVM is important if you're going for Parallel Haskell.) The configure script will tell you if you are missing something.


GHC is required to build many of the tools, including GHC itself. If you need to port GHC to your platform because there isn't a binary distribution of GHC available, then see Section 10, “Porting GHC”.

Which version of GHC you need will depend on the packages you intend to build. GHC itself will normally build using one of several older versions of itself - check the announcement or release notes for details.


You have to have Perl to proceed! Perl version 5 at least is required. GHC has been known to tickle bugs in Perl, so if you find that Perl crashes when running GHC try updating (or downgrading) your Perl installation. Versions of Perl before 5.6 have been known to have various bugs tickled by GHC, so the configure script will look for version 5.6 or later.

For Win32 platforms, you should use the binary supplied in the InstallShield (copy it to /bin). The Cygwin-supplied Perl seems not to work.

Perl should be put somewhere so that it can be invoked by the #! script-invoking mechanism. The full pathname may need to be less than 32 characters long on some systems.

GNU C (gcc)

Most GCC versions should work with the most recent GHC sources. Expect trouble if you use a recent GCC with an older GHC, though (trouble in the form of mis-compiled code, link errors, and errors from the ghc-asm script).

If your GCC dies with “internal error” on some GHC source file, please let us know, so we can report it and get things improved. (Exception: on x86 boxes—you may need to fiddle with GHC's -monly-N-regs option; see the User's Guide)

GNU Make

The fptools build system makes heavy use of features specific to GNU make, so you must have this installed in order to build any of the fptools suite.

NB. it has been reported that version 3.79 no longer works to build GHC, and 3.80 is required.


Happy is a parser generator tool for Haskell, and is used to generate GHC's parsers.

If you start from a source tarball of GHC (i.e. not a darcs checkout), then you don't need Happy, because we supply the pre-processed versions of the Happy parsers. If you intend to modify the compiler and/or you're using a darcs checkout, then you need Happy.

Happy version 1.15 is currently required to build GHC.

Happy is written in Haskell, and is a project in the CVS repository (fptools/happy). It can be built from source, but bear in mind that you'll need GHC installed in order to build it. To avoid the chicken/egg problem, install a binary distribution of either Happy or GHC to get started. Happy distributions are available from Happy's Web Page.


Alex is a lexical-analyser generator for Haskell, which GHC uses to generate its lexer.

Like Happy, you don't need Alex if you're building GHC from a source tarball, but you do need it if you're modifying GHC and/or building a darcs checkout.

Alex is written in Haskell and is a project in the darcs repository. Alex distributions are available from Alex's Web Page.


GNU autoconf is needed if you intend to build from the darcs sources, it is not needed if you just intend to build a standard source distribution.

Version 2.52 or later of the autoconf package is required. NB. version 2.13 will no longer work, as of GHC version 6.1.

autoreconf (from the autoconf package) recursively builds configure scripts from the corresponding configure.ac and aclocal.m4 files. If you modify one of the latter files, you'll need autoreconf to rebuild the corresponding configure.


You need a working sed if you are going to build from sources. The build-configuration stuff needs it. GNU sed version 2.0.4 is no good! It has a bug in it that is tickled by the build-configuration. 2.0.5 is OK. Others are probably OK too (assuming we don't create too elaborate configure scripts.)

One fptools project is worth a quick note at this point, because it is useful for all the others: glafp-utils contains several utilities which aren't particularly Glasgow-ish, but Occasionally Indispensable. Like lndir for creating symbolic link trees.

4.1. Tools for building parallel GHC (GPH)

PVM version 3:

PVM is the Parallel Virtual Machine on which Parallel Haskell programs run. (You only need this if you plan to run Parallel Haskell. Concurrent Haskell, which runs concurrent threads on a uniprocessor doesn't need it.) Underneath PVM, you can have (for example) a network of workstations (slow) or a multiprocessor box (faster).

The current version of PVM is 3.3.11; we use 3.3.7. It is readily available on the net; I think I got it from research.att.com, in netlib.

A PVM installation is slightly quirky, but easy to do. Just follow the Readme instructions.


Sadly, the gr2ps script, used to convert “parallelism profiles” to PostScript, is written in Bash (GNU's Bourne Again shell). This bug will be fixed (someday).

4.2. Other useful tools


This is a quite-a-bit-better-than-Lex lexer. Used to build a couple of utilities in glafp-utils. Depending on your operating system, the supplied lex may or may not work; you should get the GNU version.

More tools are required if you want to format the documentation that comes with GHC and other fptools projects. See Section 9, “Building the documentation”.