I'm trying to profile a program windingnumber which has some few dependencies. Per Aleksander Dmitrov's answer in Profile Haskell without installing installing profiling libraries for all dependencies, I'm using cabal-dev to (attempt to) build all of the dependencies with profiling enabled. I have tried
cabal-dev install --config=./cabal-dev.config
, where cabal-dev.config islibrary-profiling: True executable-profiling: True package-db: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/packages-7.6.1.conf local-repo: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/packages user-install: False remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive remote-repo-cache: /home/christopher/.cabal/packages optimization: True build-summary: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/logs/build.log remote-build-reporting: anonymous optimization: True install-dirs user prefix: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/ install-dirs global
cabal-dev install --cabal-install-arg='--enable-library-profiling' --cabal-install-arg='--enable-executable-profiling'
(with rm -rf cabal-dev
in between, of course, to start from a pristine environment.) In each case, I get:
arch% cabal-dev/bin/windingnumber +RTS -p
cabal-dev/bin/windingnumber +RTS -p
windingnumber: the flag -p requires the program to be built with -prof
windingnumber:
windingnumber: Usage: <prog> <args> [+RTS <rtsopts> | -RTS <args>] ... --RTS <args>
<snip>
---i.e., profiling is not enabled. How can I enable it?
ETA Solution: add -prof
to ghc-options in the .cabal file for the project did it. Apparently setting `executable-profiling: True" in the cabal-dev config didn't do it. Thanks to Daniel Fischer.