依存関係がいくつかあるプログラムのwindingnumberのプロファイルを作成しようとしています。アレクサンダー・ドミトロフのProfile Haskell without installation installation profiling libraries for all dependenciesでの回答によると、プロファイリングを有効にしてすべての依存関係をビルドする (しようとする) ために cabal-dev を使用しています。私が試してみました
cabal-dev install --config=./cabal-dev.config
、ここで cabal-dev.config はlibrary-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'
(rm -rf cabal-dev
もちろん、元の環境から開始するための合間にあります。)それぞれのケースで、次の結果が得られます。
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>
---つまり、プロファイリングが有効になっていません。どうすれば有効にできますか?
ETA ソリューション:-prof
プロジェクトの .cabal ファイルの ghc-options に追加してください。どうやら cabal-dev 設定で「executable-profiling: True」を設定してもうまくいきませんでした。Daniel Fischer に感謝します。