Skip to content

Instantly share code, notes, and snippets.

@massysett
Created January 19, 2015 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save massysett/9c493db836705578eef5 to your computer and use it in GitHub Desktop.
Save massysett/9c493db836705578eef5 to your computer and use it in GitHub Desktop.
Fixing Haddock with OS X
I have had problems getting Haddock to function properly on OSX.
See for example:
https://github.com/haskell/cabal/issues/1790
Apparently there is an issue with OS X because it uses Clang, and its
C preprocessor is doing something funny. Previously people reported fixes
by having Haddock pass "-optP-P" to the C compiler, but this has not worked
for me.
Confusing the whole thing is that on OS X /usr/bin/gcc is actually Clang.
Currently the easiest fix is just to make GHC use GCC rather than the
Apple-provided Clang. To do this, install gcc with Macports. Be sure
to use "port select" to actually activate GCC; otherwise the usual
names such as "/opt/local/bin/gcc" will not be present.
Then, follow the directions left by Carter Schonwald here:
http://stackoverflow.com/a/20352421/1017252
but when editing the file, also change the value for "Haskell CPP command" to
"/opt/local/bin/gcc".
As of 2015-01-19 that fixed things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment