如何构建使用文本库进行分析的程序?

发布于 2024-10-09 15:41:58 字数 867 浏览 0 评论 0原文

我正在构建一个链接到 text 库的程序。当我在没有分析的情况下构建它时,一切正常:

ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp
<No output>

当我使用分析构建它时,我收到以下错误:

ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp -prof
ld: library not found for -lHStext-0.10.0.0_p
collect2: ld returned 1 exit status

我通过 cabal 安装了 text-0.11.0.1 的分析版本,但它没有似乎正在找到它。我猜测 text-0.10.0.0 是随 Haskell Platform 安装的。 ghc-pkg 列表文本为我提供了以下内容:

/usr/local/Cellar/ghc/6.12.3/lib/ghc/package.conf.d
/Users/jason/.ghc/i386-darwin-6.12.3/package.conf.d
   text-0.10.0.0
   text-0.11.0.1

如何使用 text-0.11.0.1 的分析版本来编译此程序?

I'm building a program that links to the text library. When I build it without profiling, everything works fine:

ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp
<No output>

When I build it with profiling, I get the following error:

ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp -prof
ld: library not found for -lHStext-0.10.0.0_p
collect2: ld returned 1 exit status

I installed a profiling version of text-0.11.0.1 through cabal, but it doesn't seem to be finding it. I'm guessing that text-0.10.0.0 was installed with Haskell Platform. A ghc-pkg list text gives me the following:

/usr/local/Cellar/ghc/6.12.3/lib/ghc/package.conf.d
/Users/jason/.ghc/i386-darwin-6.12.3/package.conf.d
   text-0.10.0.0
   text-0.11.0.1

How can I compile this program using the profiling version of text-0.11.0.1?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜无邪 2024-10-16 15:41:58

可能发生的情况是,您引入的其他依赖项之一依赖于旧版本的文本,这就是它被首选的原因。不过,这很难确定,因为你似乎没有使用 Cabal。

一个简单的权宜之计是通过分析在本地重新安装 text-0.10.0.0。

cabal install --reinstall text-0.10.0.0

(假设您已正确设置 .cabal 配置;否则,请添加适当的标志。)

What's likely happening is that one of the other dependencies you are pulling in depends on an old version of text, which is why it is being preferred. It's hard to say for certain, though, because you don't appear to be using Cabal.

An easy stop-gap is to reinstall text-0.10.0.0 locally with profiling.

cabal install --reinstall text-0.10.0.0

(assuming you've frobbed your .cabal configuration correctly; otherwise, add appropriate flags.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文