有人可以帮助我理解吗?
$ stack exec -- mvm4x4_amf +RTS -sstderr
mvm4x4_amf: Most RTS options are disabled. Link with -rtsopts to enable them.
$ stack exec --profile -- mvm4x4_amf +RTS -sstderr
Executable named mvm4x4_amf not found on path: [{snip}]
我在Debugging部分中找到了在here上方尝试过的第二条命令的建议。(搜索字词“ rts”在13个匹配项中的10个)
用以下代码重建我的Stack项目后:stack build --profile
,我得到:
$ stack exec --profile -- mvm4x4_amf +RTS -sstderr
mvm4x4_amf: Most RTS options are disabled. Link with -rtsopts to enable them.
如果我改用它:
$ stack exec --profile mvm4x4_amf +RTS -sstderr
它们运行我的程序,但是没有输出任何性能分析信息。
如果我“进入” .stack-work/
目录并“手动执行”(正如我在与此问题相关的其他一些帖子中所建议的那样:]]
$ .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/mvm4x4_amf/mvm4x4_amf +RTS -sstderr mvm4x4_amf: Most RTS options are disabled. Link with -rtsopts to enable them.
然后,看来我的可执行文件实际上不是为分析而构建的。但是,尝试显式重建它以进行概要分析不会产生任何操作:
$ stack build --profile :mvm4x4_amf $
哦,这有帮助吗?:
$ stack exec mvm4x4_amf --rts-options --info [("GHC RTS", "YES") ,("GHC version", "8.6.5") ,("RTS way", "rts_v") ,("Build platform", "x86_64-apple-darwin") ,("Build architecture", "x86_64") ,("Build OS", "darwin") ,("Build vendor", "apple") ,("Host platform", "x86_64-apple-darwin") ,("Host architecture", "x86_64") ,("Host OS", "darwin") ,("Host vendor", "apple") ,("Target platform", "x86_64-apple-darwin") ,("Target architecture", "x86_64") ,("Target OS", "darwin") ,("Target vendor", "apple") ,("Word size", "64") ,("Compiler unregisterised", "NO") ,("Tables next to code", "YES") ]
嗯,在更改阴谋文件选项并重建时,我发现了一些奇怪的地方:
$ stack build --profile :mvm4x4_amf luminous-0.5.0.0: unregistering (local file changes: luminous.cabal) luminous> configure (lib + exe) Configuring luminous-0.5.0.0... luminous> build (lib + exe) Preprocessing library for luminous-0.5.0.0.. Building library for luminous-0.5.0.0.. Preprocessing executable 'mvm4x4_amf' for luminous-0.5.0.0.. Building executable 'mvm4x4_amf' for luminous-0.5.0.0.. luminous> copy/register Installing library in .../.stack-work/install/x86_64-osx/2428dc603454d346facf6484280fa92531e4d7789d3 3c4dd56c39cf70d79bd7e/8.6.5/lib/x86_64-osx-ghc-8.6.5/luminous-0.5.0.0-9ABiH0AyDmV25JxAv1cFEI {snip} Installing executable mvm4x4_amf in .../.stack-work/install/x86_64-osx/2428dc603454d346facf6484280fa 92531e4d7789d33c4dd56c39cf70d79bd7e/8.6.5/bin {snip} Registering library for luminous-0.5.0.0.. $ stack exec which mvm4x4_amf .../.stack-work/install/x86_64-osx/9af8b70f7f84a02189b610f95c8d289ab7d743df5c23a5d5d43b30afe0c02b7c/ 8.6.5/bin/mvm4x4_amf
堆栈似乎在与安装它的目录不同的目录中找到我的
mvm4x4_amf
可执行文件!我阅读正确吗?我应该担心吗?
哦,供参考:
$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
有人可以帮助我理解吗? $ stack exec-mvm4x4_amf + RTS -sstderr mvm4x4_amf:禁用了大多数RTS选项。与-rtsopts链接以启用它们。 $ stack exec --profile-mvm4x4_amf + RTS -...
啊哈!您必须这样做: