我正在尝试分析一个具有一些依赖项的程序 Windingnumber。根据 Aleksander Dmitrov 在Profile Haskell 中的回答,没有为所有依赖项安装安装分析库,我正在使用 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。