Skip to content

Instantly share code, notes, and snippets.

@deepakjois
Forked from cartazio/gist:1655271
Created January 26, 2012 17:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deepakjois/1683922 to your computer and use it in GitHub Desktop.
Save deepakjois/1683922 to your computer and use it in GitHub Desktop.
Installing GHC 7.2.2 and diagrams on OS X Lion

Installing GHC 7.2.2 and diagrams on OS X Lion

Install prerequisites

GHC 7.2.2 64-bit

Make sure you have the 64-bit version of GHC. If you installed GHC using brew install haskell-platform, you are using the 32-bit version which wont work with the instructions below. To install the 64-bit version

  • Follow instructions in this gist. However, note that the patch for cabal-install that they point to is not available anymore. There is a similar patch in this gist, which worked for me. Read this comment for more info on how to apply the patch.

  • You could try brew install --devel --64-bit haskell-platform, and report back here if it works for you. I have not tried it myself.

Install dependencies

  • cabal install gtk2hs-buildtools
  • brew install cairo gtk gettext fontconfig
  • brew link cairo gettext fontconfig
  • download libfreetype, unpack libfreetype, and then run ./configure ; make ; make install.
  • cabal install gtk

Install Diagrams

cabal install diagrams

Test installation

Create a file called example.hs

{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine

main = defaultMain (circle 1)

On the commandline run ghc --make example.hs, and verify that the build steps succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment