I've just installed haskell-platform
from the Ubuntu repositories (it comes with GHC
version 8.6.5
) as instructed by the website.
Now, upon trying to compile a program for profiling, using ghc -O2 -prof myCode.hs
, I'm met with the following error message:
myCode.hs:1:1: error:
Could not find module ‘Prelude’
Perhaps you haven't installed the profiling libraries for package ‘base-4.12.0.0’?
and similarly for the System.IO
module.
Should they not come with the default Haskell instalation? How can I proceed?
Perhaps I should purge it all and get Haskell form another source (Stack
, Ghcup
, etc? Should it matter?)
I'm fairly new to this, so any help is appreciated.
CodePudding user response:
On Ubuntu, essentially all of the Haskell packages come in bland and -prof
flavors. You need the latter for profiling.
ghcup is also fine. There's no need to purge it all -- ghcup and the package manager can coexist cleanly.