GoodDeeds
GoodDeeds

Reputation: 8537

How can I install profiling libraries in Haskell when using cabal, in Ubuntu 14.04.5?

I have a Haskell project for which I would like to obtain the stack trace when an exception is thrown. I am using GHC 8.0.2 and the module Graphics.UI.GLUT, where the version of GLUT is 2.7.0.11.

I have installed the module using cabal.

This page from the official website suggests that I compile using the -prof flag. However, I get the following error

 Failed to load interface for ‘Graphics.UI.GLUT’
 Perhaps you haven't installed the profiling libraries for package ‘GLUT-2.7.0.11’?
 Use -v to see a list of the files searched for.

I am using Ubuntu 14.04.5 LTS. Using this link, I decided to run

sudo apt-get install libghc-glut-prof

However, this did not solve the problem. How can I solve this?

Thank you.

Upvotes: 1

Views: 1847

Answers (1)

Joachim Breitner
Joachim Breitner

Reputation: 25782

Running

sudo apt-get install libghc-glut-prof

is the right thing to do if you indeed use the Debian package to get Graphics.UI.GLUT.

If you have installed the glut package with cabal yourself, e.g. with

cabal install glut

or some other package that pulls in glut, then you can run

cabal install --enable-library-profiling --force-reinstall glut

(or whatever other package you installed that pulled in glut) to rebuild with profiling enabled.

None of this is specific to glut.

Upvotes: 4

Related Questions