Installing nhc13


System Requirements

Users of Windows 95 or NT, please see these special instructions first.

For the binary release, we assume you have a good C compiler (usually gcc), and a sh compatible with the Bourne shell. If you want to use the trace browser, you will need Java.

For the C source release, in addition you need the usual C compilation management tools (ar, GNU make, etc.). To build nhc13 from C you need 8Mb of memory (although you could probably manage with less), and about 17Mb of disk space (40Mb if you build for profiling and tracing as well).

For the Haskell source release, you also need another Haskell compiler. We assume hbc, which means that building nhc13 requires at least 32Mb of memory, and 50Mb of free disk space. If you cannot obtain hbc for your machine, then don't worry, just build nhc13 using a C compiler. (It is faster and needs much less memory, but the resulting compiler will be slower.)

Download it

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

The current distribution packages (and their release status) can be found at

    http://www.cs.york.ac.uk/fp/nhc13/status.html
Using tar and gunzip, unpack your chosen package in a fresh directory. (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.)

Configuration

An automatic configuration utility is supplied, called nhc13config. In brief, the default behaviour is to build under the current directory, in targets, and to install various components under /usr/local, in the subdirectories bin, lib/nhc13, include/nhc13, 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.

Installing from a binary distribution

Simply run

    ./nhc13config -rts --install
to install nhc13. The default location is under /usr/local, but you may alter the installation location using other configuration options. (The use of the -rts flag indicates that nhc13comp (the compiler proper) was built with hbc, rather than bootstrapped with nhc13 itself.) If your O/S version does not exactly match that of the package (e.g. you might be running Linux kernel 2.0.33 rather than 2.0.29), you may use the --useversion=num flag to fix it up. For instance,
    ./nhc13config --useversion=2.0.29
tells a Linux machine to use the 2.0.29 binaries, regardless of the running kernel version. Likewise, you can pretend you have a different processor (e.g. i386/i586) with the --useprocessor=id option.

Building and installing from any sources

Note that from the 0.9.2 release (incorporating the tracer beta release), all object files are now created in a separate directory tree from the sources. This means it is now possible to build concurrently for different machines from the same shared source tree. You can also build the heap profiling, time profiling, and tracing versions of the prelude and runtime system concurrently if you wish.

Building and installing from C sources

The current C 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.

To build nhc13 using just a C compiler, follow these instructions:

  • Run ./nhc13config with any options you require. (You should supply installation directory options at this stage.)
  • From the top directory, type make fromC. This will build components in the following order:
    the runtime system built with gcc,
    the standard prelude and libraries (including Binary) built with gcc,
    the nhc13comp compiler built with gcc,
    the GreenCard preprocessor built with gcc,
    the hp2graph profiling visualisation tool built with gcc,
    the hmake compilation tool built with gcc.
    It takes 10 minutes for a complete build on a 150Mhz Pentium.
  • If you wish to use the extensive heap profiling abilities of nhc13, you now need to recompile for heap profiling (with the fresh nhc13) the runtime system, standard prelude, and libraries, by typing make profile. Please note that this stage will be by far the slowest of the entire build sequence - there are at least 600 Haskell modules to compile.
  • Also, if you wish to use the nhc13 tracer or time profiling, you now need to recompile various components for tracing by typing make tracer and/or make timeprof. These stages are slow too.
  • Finally, when you have built all the components you require, type make install. If you wish to keep your disk usage down, use make clean, make realclean, or simply delete the entire directory tree.

Building and installing from Haskell sources

The compiler will build by default for a machine with 32-bit words. It is possible to build for a 64-bit machine (e.g. the DEC Alpha), but this is not yet handled automatically by the configuration script.

To build from scratch, you will need another Haskell compiler e.g. hbc. The Makefiles assume you have hbc on your PATH - if you are using something else (ghc, Hugs, or gofer) then you will have to alter the Makefiles by hand.

From the top directory, first run ./nhc13config -rts with any other configuration options you require. Then type make fromSrc. This will build components in the following order:

the hmake compilation tool built with hbc,
the nhc13 compiler built with hmake and hbc,
the runtime system built with gcc,
the standard prelude and libraries built with the fresh nhc13,
the GreenCard preprocessor built with nhc13,
the York binary libraries built with nhc13 and GreenCard,
the hp2graph profiling visualisation tool built with gcc.

If you wish to use the extensive heap profiling abilities of nhc13, you now need to recompile for heap profiling (with the fresh nhc13) the runtime system, standard prelude, and libraries, by typing make profile.

Also, if you wish to use the nhc13 tracer or time profiling, you now need to recompile various components for tracing by typing make tracerb (note spelling!) and/or make timeprof.

The whole sequence (including the profiling and tracing versions) takes a long time - sample times are from 3.5 hours on a 150MHz Pentium under Linux 2.0.29, to 15 hours on a 50MHz microSparc under SunOS 4.1.3_U1.

Finally type make install, and if you worry about disk usage, make clean, make realclean, or simply delete the entire source tree.

Problems?

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

Can you help us?

If you have built nhc13 for a machine not currently listed on the release status 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 by ftp to

    ftp://ftp.cs.york.ac.uk/pub/haskell/incoming/
and send me an email to let me know it's there.

Keeping up-to-date

If you use nhc13 regularly, please let us know! We will add you to a low-volume mailing-list of users, so we can keep you informed of new releases, bugfixes, and so on.


The latest updates to these pages are available on the WWW from http://www.cs.york.ac.uk/fp/nhc13/

1998.06.22
York Functional Programming Group
Malcolm.Wallace@cs.york.ac.uk