July 3, 2012

Installing Haskell ThreadScope on Ubuntu 12.04 precise

ThreadScope is a tool for performance profiling of parallel Haskell programs.

When I tried to install ThreadScope on Ubuntu 12.04 I ran into some problems. The following are the steps that allowed me to complete the installation.

Note that the haskell-platform package is already installed on the system.

First install the required GTK libraries.

sudo apt-get install libgtk2.0-dev libpango1.0-dev
sudo apt-get install libglib2.0-dev libcairo2-dev

Next install the gtk2hs-buildtools Haskell package.

sudo cabal update
sudo cabal install gtk2hs-buildtools

The following steps require running the gtk2hs tools. Although the ~/.cabal/bin directory is specified in my PATH variable, the setup process fails with the following message:

Cannot find gtk2hsC2hs Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).

You can fix this error by creating links to the gtk2hs tools in the /usr/bin directory.

sudo ln ~/.cabal/bin/gtk2hsC2hs /usr/bin/gtk2hsC2hs
sudo ln ~/.cabal/bin/gtk2hsHookGenerator /usr/bin/gtk2hsHookGenerator
sudo ln ~/.cabal/bin/gtk2hsTypeGen /usr/bin/gtk2hsTypeGen

Once the links are created you can install the other required packages.

sudo cabal install gtk
sudo cabal install cairo

Finally you can install the threadscope package.

sudo cabal install threadscope