26

Why doesn't my GHC 7.6.3 work after upgrading to OSX Mavericks?

katychuang
  • 1,018
  • 8
  • 18
  • 11
    I think the usual thing is to turn this into a question that you answer yourself (instead of putting the answer in the question). You should do that, and then accept your own answer, so future visitors can find and use your hard work more easily! – Daniel Wagner Oct 25 '13 at 01:45
  • Note: The [Haskell platform](http://www.haskell.org/platform/mac.html) folks provide a wrapper script for clang now, so you don't need to install gcc 4.2. – mb21 Nov 14 '13 at 15:32

1 Answers1

19

It took a long time to figure out how to Work with both OSX 10.9 and GHC 7.6.3, and here are some tips to help you get back to building haskell code.

Summary: Download command line tools for mavericks and use gcc version 4.2 (link to the correct gcc path in your ghc settings file)

Steps:

  1. Download the command line tools for mavericks download
  2. Install gcc-4.2 using homebrew brew install apple-gcc42
  3. Edit your settings file, Line 2. Update the C compiler location to point to this newer gcc. Depending on how you installed GHC, it could be one of the following...

    • Platform Edition

      /Library/Frameworks/GHC.framework/Versions/Current/usr/lib/ghc-7.6.3/settings

    • Brew version of GHC

      /usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/settings

    • GHC Installed from Source

      /usr/local/lib/ghc-7.6.3/settings

It will look something like this:

("C compiler command", "/usr/local/bin/gcc-4.2"),

A more detailed version for each step written can be found here.

Alternate approach: Use the XCode5 wrapper. Instructions here

katychuang
  • 1,018
  • 8
  • 18
  • The GHC settings file is something like this: `/Library/Frameworks/GHC.framework/Versions/Current/usr/lib/ghc-7.6.3/settings` – mb21 Nov 14 '13 at 15:23
  • 1
    If you installed ghc with brew, you'll find the settings file at somewhere similar to `/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/settings`. – Tim Gilbert Jan 09 '14 at 19:04