[Haskell] ghc as a library and profiling

Sönke Hahn shahn at cs.tu-berlin.de
Tue Aug 28 21:15:17 EDT 2007


Hi!

I am working on a program that uses ghc as a library to typecheck code. I want 
to profile the program (compiling with '-prof -auto-all' and running 
with '+RTS -p'). Trying to compile, results in the following message:

Could not find module `GHC':
      Perhaps you haven't installed the profiling libraries for package 
ghc-6.6.1?

I built ghc-6.6.1 from source without changing any configuration files. The 
building guide (http://hackage.haskell.org/trac/ghc/wiki/Building/QuickStart) 
says, this would install the compiler WITH profiling libraries. As i 
understand it, this somehow excludes the ghc package. (Maybe because it is 
not widely used?) Is this understanding right? Is it possible (and if, how) 
to compile ghc with a profiling version of the ghc package?
I tried to add 
	GhcStage2HcOpts     = -Rghc-timing  -prof -auto-all
	GhcStage2LibHcOpts  = -prof -auto-all
to mk/build.mk, but i am getting the following build error in stage 2:

ghc-6.6.1: combination not supported: Threaded/Profiling

Do i need to disable thread support? How would i do that?


A second idea that comes to my mind is this:
The ghc package is hidden in the standard installation, so i unhided (unhid?) 
it via 'ghc-pkg expose ghc'. Maybe it just exposed the non-profiling version 
and kept the profiling version hidden? How would i expose both?

Any help appreciated...

Sönke


More information about the Haskell mailing list