19

I am trying reinstall my Haskell libraries with profiling enabled by following the instructions listed here

However, whenever cabal attempts to reinstall one of the libraries I get the following message:

LibraryNameHere.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.

When I try to reinstall base with profiling enabled I get the following messages:

me@machine:~/.cabal/$ cabal install -p base
Resolving dependencies...
All the requested packages are already installed:
base-4.5.0.0
Use --reinstall if you want to reinstall anyway.
me@machine:~/.cabal/$ cabal install --reinstall -p base
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: base (user goal)
rejecting: base-4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0,
4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0 (only already
installed instances can be used)
rejecting: base-3.0.3.2 (conflict: base => base>=4.0 && <4.3)
rejecting: base-3.0.3.1 (conflict: base => base>=4.0 && <4.2)

How do I reinstall base with profiling enabled?

Community
  • 1
  • 1
recursion.ninja
  • 5,377
  • 7
  • 46
  • 78
  • 4
    In general, reinstalling `base` is not recommended. A profiling library for `base` should have come with GHC. Perhaps you didn't install `-prof` packages? – Mikhail Glushenkov May 03 '14 at 23:38
  • 9
    @MikhailGlushenkov [Facepalm](http://upload.wikimedia.org/wikipedia/commons/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg), `sudo apt-get install ghc-prof`. Problem solved! – recursion.ninja May 03 '14 at 23:43

2 Answers2

18

If the base profiling libraries were not included in the your Haskell/GHC installation by default, they will be included through your OS's package manager in a separate package.

Debian Linux Systems:

sudo apt-get install ghc-prof

recursion.ninja
  • 5,377
  • 7
  • 46
  • 78
-3

Try

cabal update
cabal install ghc-prof
Jeremy
  • 2,826
  • 7
  • 29
  • 25
  • 1
    The [`ghc-prof` Cabal package](http://hackage.haskell.org/package/ghc-prof) is a parsing library and has nothing to do with this question. – sjakobi Oct 19 '19 at 17:54