Installing from binary distributions is easiest, and recommended!
(Why binaries? Because GHC is a Haskell compiler written in Haskell,
so you've got to ``bootstrap'' it, somehow. We provide
machine-generated C-files-from-Haskell for this purpose, but it's
really quite a pain to use them. If you must build GHC from its
sources, using a binary-distributed GHC to do so is a sensible way to
proceed. For the other
fptools programs, many are written in Haskell,
so binary distributions allow you to install them without having a Haskell compiler.)
Binary distributions come in ``bundles,'' one bundle per file called
<bundle>-<platform>.tar.gz. (See Section
Porting Information for what a platform
is.) Suppose that you untar a binary-distribution bundle, thus:
% cd /your/scratch/space % gunzip < ghc-x.xx-sun-sparc-solaris2.tar.gz | tar xvf -
Then you should find a single directory,
fptools, with the following
the raw material from which the
will be made (Section
the configuration script (Section Installing).
Contains this file summary.
Contains this description of how to install the bundle.
The announcement message for the bundle.
release notes for the bundle -- a longer version
ANNOUNCE. For GHC, the release notes are contained in the User
Guide and this file isn't present.
contains platform-specific executable files to be invoked directly by the user. These are the files that must end up in your path.
contains platform-specific support
files for the installation. Typically there is a subdirectory for
fptools project, whose name is the name of the project with its
version number. For example, for GHC there would be a sub-directory
x.xx is the version number of GHC in the bundle.
These sub-directories have the following general structure:
supporting library archives.
Interface files (
.hi) for the prelude.
A few C
contains platform-independent support files
for the installation. Again, there is a sub-directory for each
contains Emacs info documentation files (one sub-directory per project).
contains HTML documentation files (one sub-directory per project).
contains Unix manual pages.
This structure is designed so that you can unpack multiple bundles
(including ones from different releases or platforms) into a single
this doesn't work at the moment:
% cd /your/scratch/space % gunzip < ghc-x.xx-sun-sparc-solaris2.tar.gz | tar xvf - % gunzip < happy-x.xx-sun-sparc-sunos4.tar.gz | tar xvf -
When you do multiple unpacks like this, the top level
INSTALL get overwritten each time.
That's fine -- they should be the same. Likewise, the
files will be duplicated across multiple platforms, so they will be
harmlessly overwritten when you do multiple unpacks. Finally, the
share/ stuff will get harmlessly overwritten when you do
multiple unpacks for one bundle on different platforms.
OK, so let's assume that you have unpacked your chosen bundles into a
fptools. What next? Well, you will at least need
to run the
script by changing your
fptools and typing
./configure. That should convert
You can now either start using the tools in-situ without going
through any installation process, just type
make in-place to set the
tools up for this. You'll also want to add the path which
now echo to your
PATH environment variable. This option is useful if
you simply want to try out the package and/or you don't have the
necessary priviledges (or inclination) to properly install the tools
locally. Note that if you do decide to install the package `properly'
at a later date, you have to go through the installation steps that
To install an
fptools package, you'll have to do the following:
Makefileand check the settings of the following variables:
the platform you are going to install for.
the directory in which to install user-invokable binaries.
the directory in which to install platform-dependent support files.
the directory in which to install platform-independent support files.
the directory in which to install Emacs info files.
the directory in which to install HTML documentation.
the directory in which to install DVI documentation.
configurescript that comes with the distribution, but doing an optical diff to see if the values match your expectations is always a Good Idea. Instead of running
configure, it is perfectly OK to copy
Makefileand set all these variables directly yourself. But do it right!
make install. This should work with ordinary Unix
make-- no need for fancy stuff like GNU
rehash(t?csh or zsh users), so your shell will see the new stuff in your bin directory.
-voption, so you can see exactly what pathnames it's using. If things don't work as expected, check the list of know pitfalls in Section Building Pitfalls.
When installing the user-invokable binaries, this installation
procedure will install GHC as
x.xx is the version
number of GHC. It will also make a link (in the binary installation
ghc-x.xx. If you install multiple versions
of GHC then the last one ``wins'', and ``
ghc'' will invoke the last
one installed. You can change this manually if you want. But
ghc-x.xx should always invoke GHC version
There are plenty of ``non-basic'' GHC bundles. The files for them are
<platform> is as above, and
<bundle> is one
Profiling with cost-centres. You probably want this.
Concurrent Haskell features. You may want this.
Parallel Haskell features (sits on top of PVM). You'll want this if you're into that kind of thing.
The ``GranSim'' parallel-Haskell simulator (hmm... mainly for implementors).
``Ticky-ticky'' profiling; very detailed information about ``what happened when I ran this program''---really for implementors.
Cost-centre profiling for Concurrent Haskell.
Ticky-ticky profiling for Concurrent Haskell.
One likely scenario is that you will grab three binary bundles---basic, profiling, and concurrent. We don't usually make the rest, although you can build them yourself from a source distribution.
The way to do this is, of course, to compile and run this program
(in a file
main = putStr "Hello, world!\n"
Compile the program, using the
-v (verbose) flag to verify that
libraries, etc., are being found properly:
% ghc -v -o hello Main.hs
Now run it:
% ./hello Hello, world!
Some simple-but-profitable tests are to compile and run the notorious
program, using different numeric types. Start with
nfib :: Int -> Int, and then try
Rational and perhaps the overloaded version. Code for this is
ghc/misc/examples/nfib/ in a source distribution.
For more information on how to ``drive'' GHC, either do
ghc -help or
consult the User's Guide (distributed in several pre-compiled formats
with a binary distribution, or in source form in
ghc/docs/users_guide in a source distribution).