This document explains how to install ghc-vis on a fresh installation of Mac OS X 10.8 on an x86_64 system.

Install XQuartz

Visit and install XQuartz. Reboot your system to apply the changes.

Install HomeBrew

Install the Command Line Tools for Xcode from .

Install HomeBrew as described on :

ruby -e "$(curl -fsSL"

Install GTK and GraphViz

brew install gtk graphviz

If you’re running a Hackintosh with an older CPU you have to set LLVM to compile for your CPU instead of the one advertised by your virtual machine (LLVM wrongly uses the CPU ID instead of its cap flags to determine which instructions it supports). To do this open /usr/local/Library/ENV/4.3/cc in a text editor and replace -march=native with -march=core2. See for more details.

Install the Haskell Platform

Visit and install the Haskell Platform.

Set Correct Paths

Set up the correct executable and library paths by adding them to your .profile:

cat <<EOT >> ~/.profile
export PATH=\$HOME/Library/Haskell/bin:/usr/local/bin:\$PATH
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
export LDFLAGS=-L/usr/local/lib
export CFLAGS=-I/usr/local/include
export LIBS=-L/usr/local/lib
source .profile

This is important as otherwise the linker will use the system’s cairo version instead of the one we just installed, leading to a segmentation fault. See for more details.

Install ghc-vis

cabal update
cabal install gtk2hs-buildtools
cabal install ghc-vis --disable-library-profiling

Follow the instructions in the output of cabal install ghc-vis to setup the ghci script.