Tuesday, September 1, 2009

Running Haskell GHC on Snow Leopard

***UPDATE 2009/03/23***

There's a new version of the Haskell platform that works with Snow Leopard. If you install that then you shouldn't need to use the tip explained here. Please comment if it works for you

http://hackage.haskell.org/platform/mac.html

***UPDATE 2009/03/23***

After so much time spent trying to get a working GHC in my Mac with Snow Leopard I could arrive to the solution. Here it is, pretty simple:

1 - Download Haskell Platform for Mac: http://hackage.haskell.org/platform/
2 - Install GHC and the Haskell Platform that are inside the .dmg.
3 - Patch your ghc compiler to produce 32 bits code adding the following options:
-optc-m32 -opta-m32 -optl-m32
The ghc script that you have to patch is located here: /usr/bin/ghc
Open it with your favorite text editor and add those options. This at least will let you install new packages and compile your code with no problems until the Haskell team release a new version of GHC for mac.
Most of the tricks for this I got them from here: http://www.nabble.com/Snow-Leopard-Breaks-GHC-td25198347.html