The Glasgow Haskell Compiler User's Guide, Version 6.2
Prev | Chapter 4. Using GHC | Next

# 4.5. Help and verbosity options

`––help`, `-?`

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

`-v`

  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.

`-v` `n`

  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:

  `-v0`

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

  `-v1`

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

  `-v2`

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

  `-v3`

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

  `-v4`

    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.

`––numeric-version`

  Print GHC's numeric version number only.

`––print-libdir`

  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 `$libdir`in the package configuration file (see Section 4.8).

Prev | Home | Next
Modes of operation | Up | Filenames and separate compilation