How to fix Error 2 when trying to make haskell-platform?

How to fix Error 2 when trying to make haskell-platform?

I downloaded the Haskell-platform source from here:, installed ghc, and did /.configure. However when I do sudo make, I get the following error:
Preprocessing library HUnit-…

Could not find module `Prelude’
Perhaps you haven’t installed the profiling libraries for package `base’?
Use -v to see a list of the files searched for.

Building the HUnit- package failed
make: *** [build.stamp] Error 2

Does anyone knows how to fix this?
I’m trying to install on Ubuntu 12.04.1 LTS


Solution 1:

Instead of trying to install from the sources, simply install the Ubuntu packages, which will be much simpler, with:

  $ sudo apt-get install haskell-platform

If you need a local version of the documentation and the profiling libraries, install the additional packages with:

  $ sudo apt-get install haskell-platform-doc haskell-platform-prof

Solution 2:

Daniel Fisher’s comment led me to the solution. You have to install all the profiling libraries for each of the ghc packages you have installed.
Just write

sudo apt-get install ghc*-prof

That’s how it worked for me


Related:  How to specify in crontab by what user to run script?