Building and developing GHC
|  | Next

# Building and developing GHC

### The GHC Team

Abstract

This Guide is primarily aimed at those who want to build and/or hack on GHC. It describes how to get started with building GHC on your machine, and how to tweak the settings to get the kind of build you want. It also describes the inner workings of the build system, so you can extend it, modify it, and use it to build your code.

The bulk of this guide applies to building on Unix systems; see Section 12, “Instructions for building under Windows” for Windows notes.

## 1. Getting the sources

You can get your hands on the GHC sources in two ways:

Source distributions

  You have a supported platform, but (a) you like the warm fuzzy feeling of compiling things yourself; (b) you want to build something ``extra”—e.g., a set of libraries with strictness-analysis turned off; or (c) you want to hack on GHC yourself.

  A source distribution contains complete sources for GHC. Not only that, but the more awkward machine-independent steps are done for you. For example, if you don't have happy you'll find it convenient that the source distribution contains the result of running happy on the parser specifications. If you don't want to alter the parser then this saves you having to find and install happy. You will still need a working version of GHC (version 5.x or later) on your machine in order to compile (most of) the sources, however.

The darcs repository.

  We make releases infrequently. If you want more up-to-the minute (but less tested) source code then you need to get access to our darcs repository.

  Information on accessing the darcs repository is on the wiki: http://hackage.haskell.org/trac/ghc/wiki/GhcDarcs.

  The repository holds source code only. It holds no mechanically generated files at all. So if you check out a source tree from darcs you will need to install every utility so that you can build all the derived files from scratch.

|  | Next
|  | 2. Things to check before you start