Haskell 如何在cabal dev安装中启用评测?
我正在尝试分析一个程序windingnumber,它有一些依赖项。根据Aleksander Dmitrov在中的回答,我正在使用cabal dev(尝试)构建所有启用了评测的依赖项。我试过了Haskell 如何在cabal dev安装中启用评测?,haskell,profiling,cabal,Haskell,Profiling,Cabal,我正在尝试分析一个程序windingnumber,它有一些依赖项。根据Aleksander Dmitrov在中的回答,我正在使用cabal dev(尝试)构建所有启用了评测的依赖项。我试过了 cabal-dev-install--config=。/cabal-dev.config,其中cabal-dev.config library-profiling: True executable-profiling: True package-db: /home/christopher/school/s
,其中cabal-dev.configcabal-dev-install--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>
arch%cabal dev/bin/windingnumber+RTS-p
cabal dev/bin/windingnumber+RTS-p
windingnumber:标志-p要求程序使用-prof构建
缠绕编号:
缠绕编号:用法:[+RTS |-RTS]--实时战略
---i、 例如,未启用分析。我如何启用它
ETA解决方案:将
-prof
添加到.cabal文件中的ghc选项中,项目完成了。显然,在cabal dev配置中设置“executable profiling:True”并没有起到作用。多亏了Daniel Fischer。看起来cabal dev
每次运行时都会重写/cabal dev/cabal.config
。但是,您可以编辑~/.cabal/share/cabal dev-$VERSION/admin/cabal config。在
中设置默认值:
$vim~/.cabal/share/cabal-dev-0.9.1/admin/cabal-config.in
#将可执行配置文件和库配置文件设置为True
$cabal拆包ghc核心
$cd ghc-core-0.5.6
$cabal dev安装--仅限依赖项
$cabal dev configure-p
$cabal开发构建
美元/地区/建造/ghc核心/ghc核心+RTS-p
#大获成功
如果您不想为使用cabal dev
管理的所有项目启用评测,请使用--extra-config file
选项(--config
仅设置自动生成的配置文件的位置):
$cat cabal-dev.config
可执行文件分析:True
库分析:True
$cabal-dev--extra-config文件='。/cabal-dev.config'安装
$./cabal dev/bin/ghc core+RTS-p
#成功
不建议使用.cabal文件中的
ghc options
字段启用评测-您不希望从Hackage安装您的软件包的所有人都使用评测进行构建。请使用cabal dev configure-p--ghc options=“-fprof auto“
仅为当前生成启用评测。看起来您没有使用-prof
标志生成可执行文件。您是如何建立windingnumber
?啊哈。在my.cabal文件中将-prof添加到ghc选项修复了一些问题。谢谢您可能需要比默认配置更细粒度的分析,因此-fprof auto
可能是一个不错的补充。是的。这确实有用得多。这样调用cabal-dev会不会:cabal-dev-install——启用库评测——启用可执行评测
也有效?如果您想删除config文件.Ah。知道这一点很好,尽管这并不能解决我的问题(我正在用--config指定一个备用配置文件。)@ChristopherWhite显然--config
只是设置阴谋集团开发人员配置文件的位置,该文件在每次启动时自动生成。您需要使用--额外的配置文件
。我更新了我的答案。这就解释了问题;我应该更仔细地阅读文档。很抱歉,谢谢你。