8

I'm trying to get a cabal config equivalent to compiling with ghc -threaded -O2 then running with my.exe +RTS -N4 -s. Currently I have

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

When I run my.exe it gives me unexpected RTS argument: -N4

Dulguun Otgon
  • 1,925
  • 1
  • 19
  • 38
  • Have you tried it without the quotes around the `-N4`? [This question](http://stackoverflow.com/questions/6505648/building-with-runtime-flags-using-cabal-and-ghc) seems very similar to yours. – bheklilr Oct 31 '14 at 16:50

1 Answers1

7

For multiple options, put the entire field in quotes:

"-with-rtsopts=-N4 -s"

Alternatively, you can add each option seperately:

-with-rtsopts=-N4

-with-rtsopts=-s

Community
  • 1
  • 1
ftl
  • 647
  • 3
  • 13