4.5. Help and verbosity options

––help , -?

Cause GHC to spew a long usage message to standard output and then exit.


Does a dry-run, i.e. GHC goes through all the motions of compiling as normal, but does not actually run any external commands.


The -v option makes GHC verbose: it reports its version number and shows (on stderr) exactly how it invokes each phase of the compilation system. Moreover, it passes the -v flag to most phases; each reports its version number (and possibly some other information).

Please, oh please, use the -v option when reporting bugs! Knowing that you ran the right bits in the right order is always the first thing we want to verify.


To provide more control over the compiler's verbosity, the -v flag takes an optional numeric argument. Specifying -v on its own is equivalent to -v3, and the other levels have the following meanings:


Disable all non-essential messages (this is the default).


Minimal verbosity: print one line per compilation (this is the default when ––make or ––interactive is on).


Print the name of each compilation phase as it is executed. (equivalent to -dshow-passes).


The same as -v2, except that in addition the full command line (if appropriate) for each compilation phase is also printed.


The same as -v3 except that the intermediate program representation after each compilation phase is also printed (excluding preprocessed and C/assembly files).

-V , ––version

Print a one-line string including GHC's version number.


Print GHC's numeric version number only.


Print the path to GHC's library directory. This is the top of the directory tree containing GHC's libraries, interfaces, and include files (usually something like /usr/local/lib/ghc-5.04 on Unix). This is the value of $libdirin the package configuration file (see Section 4.8, “ Packages ”).


Causes GHC to emit the full source span of the syntactic entity relating to an error message. Normally, GHC emits the source location of the start of the syntactic entity only.

For example:

test.hs:3:6: parse error on input `where'


test296.hs:3:6-10: parse error on input `where'

And multi-line spans are possible too:

    Conflicting definitions for `a'
    Bound at: test.hs:5:4
    In the binding group for: a, b, a

Note that line numbers start counting at one, but column numbers start at zero. This choice was made to follow existing convention (i.e. this is how Emacs does it).


Set the minimum size of the heap to size. This option is equivalent to +RTS -Hsize, see Section 4.14.3, “RTS options to control the garbage collector”.


Prints a one-line summary of timing statistics for the GHC run. This option is equivalent to +RTS -tstderr, see Section 4.14.3, “RTS options to control the garbage collector”.