Summary of useful GHC options

The last part of this chapter collects options for GHC and the Runtime System into a concise reference. Let's start off with GHC.

Basic usage

These are some of the most often used general flags related to compilation with GHC:

  • --make: Compile a multi-module program
  • -j<n>: Parallel compilation
  • -i, -e, runghc: Interactive and evaluation modes
  • -fforce-recomp: Force recompilation
  • -Wall: Turn on all code-level warnings
  • -Werror: Turn all warnings into errors
  • -freverse-errors: Print top-most error last

The LLVM backend

The LLVM route is the preferred compilation path for numeric code. It requires the LLVM libraries and a compatible system. The flags used to enable LLVM are:

  • -fllvm: Compile via LLVM
  • -optlo-O3: Enable optimizations in ...

Get Haskell High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.