Haskell Platform with Mac OS X 10.9 (Mavericks)

XCode 5.0 on Mac OS X 10.9 (Mavericks) no longer provides GCC, only clang. According to Haskell Platform for Mac OS X,

Xcode 5 supplies clang as the C compier, and with respect to pre-processing there are some “differences of interpretation” between it and gcc. These differences can affect some Haskell code that uses the CPP extension.

There are two alternatives to solve this problem

  1. Download ghc-clang-wrapper.  Copy this script to /usr/bin, and make sure it is exectuable. Run it sudo.

  2. Install a gcc and direct GHC at that.

I installed Haskell Platform using MacPorts and confirmed that the first method works well. If ghc-clang-wrapper does not find where ghc is installed, you can manually edit /opt/local/lib/ghc-7.6.3/settings by replacing the line

(“C compiler command”, “/opt/local/bin/gcc-mp-4.7”),

with

(“C compiler command”, “/usr/bin/ghc-clang-wrapper”),

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s