【问题标题】:Cabal config for compiler flags and runtime options编译器标志和运行时选项的 Cabal 配置
【发布时间】:2014-10-31 14:45:57
【问题描述】:

我正在尝试获得一个相当于使用 ghc -threaded -O2 编译然后使用 my.exe +RTS -N4 -s 运行的 cabal 配置。目前我有

executable my.exe
   ghc-options: 
        -O3
        -threaded
        -rtsopts
        -with-rtsopts="-N4"
   main-is: Main.hs

当我运行my.exe 时,它给了我unexpected RTS argument: -N4

【问题讨论】:

  • 你试过没有-N4周围的引号吗? This question 看起来和你的很相似。

标签: haskell cabal


【解决方案1】:

对于多个选项,请将整个字段放在引号中:

"-with-rtsopts=-N4 -s"

或者,您可以单独添加每个选项:

-with-rtsopts=-N4

-with-rtsopts=-s

【讨论】:

  • 但是-N4 -s 不行。如何添加-s
  • 抱歉,我忽略了 -s 标志。我认为添加另一行就可以解决问题,但我很高兴听到单行解决方案。
  • 将整个内容放在引号中 - "-with-rtsopts=-N4 -s"
  • 哦,太好了,没想到 :) 谢谢,我相应地更新了答案。
猜你喜欢
  • 1970-01-01
  • 2014-05-21
  • 1970-01-01
  • 1970-01-01
  • 2013-04-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-04-07
相关资源
最近更新 更多