Hat Logo

Building/installing hat

The Brief Version

If you are in a hurry to get started, here's the brief version of the install procedure:

    $ ./configure  [ --prefix=/usr/local ]
    $ make
    [ perhaps become root ]
    $ make install

System Requirements

Download it

The current distribution packages can be found at

Using tar and gunzip, unpack your chosen package, and cd to the base directory (called hat-x.xx, where the x's are the version number). Note that all the documentation available on the web is also included in the package, although the web versions will of course be more up-to-date. Your local copy of the release notes is in status.html.


An automatic configuration utility is supplied, called configure. The configure script searches your system for Haskell compilers and sets up some scripts and options before you build. In brief, the default behaviour is to build under targets in the current directory, and to install various components under /usr/local, in the subdirectories bin, lib/hat, include/hat, and man/man1. Some components will also be installed eventually in the system directories for ghc or nhc98, whichever compiler is available. Nothing is actually installed at configuration time, only at installation time. The config script has several useful options to override the default build and installation behaviours. Use the --help option for brief details, and see the page about configuration options for full details.

Building and installing from sources

All object files are created in a separate directory tree from the sources (targets/$MACHINE/obj). This means in theory it is possible to build concurrently for different machines from the same shared source tree. (But we haven't tested that recently.)

Run ./configure with any options you require. (You should supply installation directory options at this stage.) This will attempt to detect any existing Haskell compilers and guess which one to build hat with. If you have more than one available, we will choose, in order of preference, ghc, then nhc98. You cannot currently build or use hat with hugs, hbc, or Helium.

Then just run make to build all the components. (The target make help gives a list of individual targets, if you really want to build components individually.)

The time taken to build Hat depends on your machine and which compiler you are using. Here are some sample build times in minutes:

time (mins)
i686 (500Mhz)
i686 (1Ghz)
i686 (2.4Ghz)
ghc 22 17 5
nhc98 48 25 8

Finally, when you have built all the components you require, type make install to copy the components to their final location. (You may need to become root for this step, depending on the final location you selected at configure time. You must certainly have permission to write package files into the system directories of the compiler that was found at configuration time.)


Ok, so now you should have all the components of hat. If you have any problems, mail hat@haskell.org with a description (and a bugfix if you have one!).

Keeping up-to-date

If you use hat regularly, or if you would like to use hat but for some reason cannot, please join the hat mailing list for discussion of features, bugfixes, and so on.

The latest updates to these pages are available on the WWW from http://www.haskell.org/hat/

This page last modified: 27th July 2004
York Functional Programming Group