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

2

8

I downloaded the Haskell-platform source from here: http://www.haskell.org/platform/linux.html, installed ghc, and did /.configure. However when I do sudo make, I get the following error:

Preprocessing library HUnit-1.2.4.2...

Test/HUnit/Base.hs:1:1:
    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.

Error:
Building the HUnit-1.2.4.2 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

Caucus answered 24/10, 2012 at 20:32 Comment(1)
Install the profiling libraries, something like apt-get install ghc-prof (search first for how the package is actually called).Chasechaser
J
8

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
Jurkoic answered 24/10, 2012 at 21:38 Comment(4)
It doesn't really answer the question though.Knighton
@devin: it doesn't, but I thought that the OP was under the misapprehension that his only option was compiling from the sources and not aware of the option to install from the binary packages. The desired end result was achieved by the answer, and it is a much easier solution than installing all the required dependencies to be able to successfully compile from the sources.Jurkoic
Dones't help if you need the latest version (2012.4) and the available package is 2012.2Endomorphism
As already mentioned, this doesn't answer the question; the actual answer is below.Dardanus
E
5

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

Endomorphism answered 9/4, 2013 at 12:51 Comment(2)
Thank you! This solved my issue when upgrading Cabal/Haskell-Platform for Ubuntu 14.04.Buckskin
Hmm, I still got ghc-cabal: /usr/local/share/doc/ghc: does not exist after running that command. I'm using Lubuntu 3.13.0-24-generic.Begorra

© 2022 - 2024 — McMap. All rights reserved.