ConnectionFailure 用户错误(RTS 不支持多个 OS 线程(链接时使用 ghc -threaded))

ConnectionFailure user error ( RTS doesn't support multiple OS threads ( use ghc -threaded when linking ) )

我 运行 在 运行 使用 stack build 构建的可执行文件时出现以下错误:

 ( ConnectionFailure user error ( RTS doesn't support multiple OS threads ( use ghc -threaded when linking ) ) )

令人惊讶的是,这个可执行文件在我的机器上运行,但在另一台机器上却不行...

这个错误的原因是什么?为什么它在两台机器上有不同的行为?

它工作的机器使用 AMD CPU,而另一台不工作的机器使用 Intel CPU。


在我的 ~/stack/config.yaml 中,由于 https://github.com/commercialhaskell/stack/issues/2712,我有:ghc-build: nopie。我刚刚删除了它并再次尝试 stack build...

  ghc-options: -threaded

将以上内容添加到 cabal 文件以启用此选项。