
I tried to compile my program with -prof, but GHC just whines at me that the packages I'm using haven't been compiled for profiling. Do I really need to go recompile every single package I'm using with profiling support before I can profile my program? How do I tell Cabal to install the necessary code? (I really hope this doesn't involve uninstalling and reinstalling everything...) Almost. You don't need to uninstall anything, just run cabal install <package> --reinstall -p for every relevant package.
Gergely -- http://www.fastmail.fm - mmm... Fastmail...

Patai Gergely wrote:
I tried to compile my program with -prof, but GHC just whines at me that the packages I'm using haven't been compiled for profiling. Do I really need to go recompile every single package I'm using with profiling support before I can profile my program? How do I tell Cabal to install the necessary code? (I really hope this doesn't involve uninstalling and reinstalling everything...)
Almost. You don't need to uninstall anything, just run cabal install <package> --reinstall -p for every relevant package.
Oh, right. So I actually need cabal.exe to do this then?

Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin:
Patai Gergely wrote:
I tried to compile my program with -prof, but GHC just whines at me that the packages I'm using haven't been compiled for profiling. Do I really need to go recompile every single package I'm using with profiling support before I can profile my program? How do I tell Cabal to install the necessary code? (I really hope this doesn't involve uninstalling and reinstalling everything...)
Almost. You don't need to uninstall anything, just run cabal install <package> --reinstall -p for every relevant package.
Oh, right. So I actually need cabal.exe to do this then?
No, you can also $ ./runghc ./Setup.[l]hs configure --enable-library-profiling --user -- prefix=$HOME/.cabal $ ./runghc ./Setup.[l]hs build $ ./runghc ./Setup.[l]hs haddock --hyperlink-source $ ./runghc ./Setup.[l]hs install It's just more typing [protip: create a batch file (that is the Windows analogue of a shell-script, isn't it?)].

Daniel Fischer wrote:
Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin:
Oh, right. So I actually need cabal.exe to do this then?
No, you can also
$ ./runghc ./Setup.[l]hs configure --enable-library-profiling --user -- prefix=$HOME/.cabal $ ./runghc ./Setup.[l]hs build $ ./runghc ./Setup.[l]hs haddock --hyperlink-source $ ./runghc ./Setup.[l]hs install
It's just more typing.
What does the --hyperlink-source bit do? For that matter, what do --user and --prefix do?
a batch file (that is the Windows analogue of a shell-script, isn't it?)].
If by "analogue" you mean "thing that's similar but with approximately 1/100th the expressive power", then yes. :-D

Hi Andrew
It needs installing. Its well worth it though, an invaluable tool.
Thanks Malcolm and Bjorn!
On 21 February 2010 21:27, Andrew Coppin
I'm presuming this only works if hs-colour is installed first though? Or is it statically linked into the Haddock binary?

Am Sonntag 21 Februar 2010 21:44:57 schrieb Andrew Coppin:
Daniel Fischer wrote:
Am Sonntag 21 Februar 2010 18:22:07 schrieb Andrew Coppin:
Oh, right. So I actually need cabal.exe to do this then?
No, you can also
$ ./runghc ./Setup.[l]hs configure --enable-library-profiling --user -- prefix=$HOME/.cabal $ ./runghc ./Setup.[l]hs build $ ./runghc ./Setup.[l]hs haddock --hyperlink-source $ ./runghc ./Setup.[l]hs install
It's just more typing.
What does the --hyperlink-source bit do?
Stephen already answered that one.
For that matter, what do --user and --prefix do?
The flag --user allows dependencies to be satisfied from the user package database, --prefix says where to put stuff. Of course all these options are optional, you can omit them (except --enable-library-profiling, because that's your target) and use only the global package database. One thing, though: if you do it manually, you have to reinstall the packages in the correct order (if x depends on y, you can't build x for profiling unless y is already built for profiling), cabal takes care of all that for you, so the clever method is indeed using cabal.
a batch file (that is the Windows analogue of a shell-script, isn't it?)].
If by "analogue" you mean "thing that's similar but with approximately 1/100th the expressive power", then yes. :-D
1/100th is enough for this.
participants (4)
-
Andrew Coppin
-
Daniel Fischer
-
Patai Gergely
-
Stephen Tetley