我有一个 cabal 项目,我正在尝试在打开分析的情况下编译它。我正在关注instructions here但是 cabal build
失败并出现以下错误:
app/WordMap.hs:5:1: error:
Could not find module ‘Data.HashMap.Strict’
Perhaps you haven't installed the profiling libraries for package ‘unordered-containers-0.2.19.1’?
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
5 | import qualified Data.HashMap.Strict as HashMap
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
导致此问题的唯一更改是将 -prof
和 -fprof-auto
添加到.cabal 文件。没有这些选项它编译得很好。
我使用的是 GHC 版本 9.2.4 和 cabal 版本 3.6.2.0。
我尝试运行cabal install unordered-containers --enable-profiling --lib --reinstall
(以及其各种衍生版本),但它似乎不起作用。该命令正常完成,但不会更改 cabal build
的输出。
我还尝试从 cabal 商店 rm'ing 软件包,然后通过分析再次安装该软件包。还是不行。
最佳答案
找到了前进的方向。
我需要删除 -prof
和-fprof-auto
从 .cabal ghc-options 中,然后运行 cabal v2-run <project> --enable-profiling -- +RTS -p
.
更多信息in the cabal docs .
关于haskell - 使用 cabal 安装 haskell 分析库时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74271633/