Building/installing nhc98

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 [ all ]
    [ perhaps become root ]
    $ make install

System Requirements

Users of Windows 95/98/SE/Me/NT/2k/XP, please see these special Windows instructions first.

If you want to use the graphical debugging tool hood, you will need to have Java on your PATH.

For the binary release, we assume you have a good C compiler (usually gcc), and a sh compatible with the Bourne shell.

For the source release, you need the usual C compilation management tools (gcc, ar, GNU make, etc.). To build nhc98 without another Haskell compiler, you need 8Mb of memory (although you could probably manage with less), and about 50Mb of disk space (70Mb if you build for profiling as well). If you already have another Haskell compiler, hbc or ghc, then building nhc98 will require at least 32Mb of memory, and 100Mb of free disk space. If you don't have hbc or ghc for your machine, then don't worry, nhc98 will build quite happily using just a C compiler. (The basic build is much faster, but the resulting compiler will be slower.) You can also build nhc98 using an earlier version of nhc98 if you want, but we don't do that by default because the build time can be slow.

Download it

You have the option of building nhc98 from a source tree, or installing a binary-only distribution. You only need to collect the single package you require.

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


An automatic configuration utility is supplied, called configure. 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/nhc98, include/nhc98, and man/man1. 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.

Important: The config script searches your system for other Haskell compilers. If it guesses wrongly, you can edit the file script/hmake.config to fix things up, then re-run configure. Your changes will not be undone.

Installing from a binary distribution

Simply run

    make install
to install nhc98. The default location is under /usr/local, but you may alter the installation location using either of the --prefix= or --installdir= options to configure. There are various other configuration options also.

Building and installing from sources

All object files are created in a separate directory tree from the sources. This means it is possible to build concurrently for different machines from the same shared source tree. You can also build the heap profiling and time profiling versions of the prelude and runtime system concurrently if you wish.

The current distribution of the compiler will build for any machine with 32-bit words. All questions of machine endian-ness are handled automatically during configuration. If you are not using gcc as your C compiler, please ensure that your CC environment variable is set appropriately at the configuration stage. (The C compiler is used as a portable backend for nhc98, and is always required.)

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 nhc98 with. If you have more than one available, we will choose, in order of preference, ghc, then hbc. If neither of these is found, nhc98 will be built from the bootstrapping C sources included in the package. (You can build nhc98 using an earlier version of nhc98 if you want using the configure options, but it is not selected by default.)

Decide what profiling features you want to use - make help gives a list of useful individual targets, such as basic, heapprofile, and timeprofile.

Then run make with your chosen targets, or make all to build all the possible facilities. (A simple make without targets builds everything.)

The time taken to build nhc98 depends on your machine, which compiler you are using, and whether you have asked for just the basic system or some extra components. Here are some sample build times in minutes:

i686 (500Mhz) Linux
basic onlyall

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.) As an alternative to installing in a system-wide location, it is also possible to use all the nhc98 tools in-place in the build tree by adding the script directory to your PATH - if you wish to conserve disk space by removing temporary intermediate files from the build tree, use make clean.


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

Can you help us?

If you have built nhc98 for a machine not currently listed on the download page and would like to contribute it as a binary package for others to download, it is very easy to do. After building and installing, type `make binDist' before you tidy up with `make clean'. Then upload the resulting tarfile to somewhere we can access it, send an email to let us know about it, and we will copy it to our central download site.

Keeping up-to-date

If you use nhc98 regularly, please join the nhc-users mailing list for discussion of features, bugfixes, and so on.

The latest updates to these pages are available on the WWW from

This page last modified: 2002.06.12
York Functional Programming Group