2014-10-31 70 views
3

我試圖獲得相當於編譯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

+0

你有沒有嘗試過而沒有圍繞'-N4'引號? [這個問題](http://stackoverflow.com/questions/6505648/building-with-runtime-flags-using-cabal-and-ghc)與你非常相似。 – bheklilr 2014-10-31 16:50:39

回答

3

對於多個選項,把整場引號:

「-with-rtsopts = -N4 -s」

或者,您可以添加seperately每個選項:

-with-rtsopts = -N4

-with-rtsopts = -s

+0

但是'-N4 -s'不起作用。我如何添加'-s'? – 2014-10-31 17:21:36

+0

對不起,我忽略了-s標誌。我認爲增加另一條線可以解決問題,但我很樂意聽到單線解決方案。 – ftl 2014-10-31 20:10:15

+0

把整個東西放在引號中 - 「-with-rtsopts = -N4 -s」 – user2407038 2014-11-02 05:03:33