Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cabal config for compiler flags and runtime options

Tags:

haskell

cabal

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

like image 643
Dulguun Otgon Avatar asked Oct 31 '14 14:10

Dulguun Otgon


1 Answers

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

like image 140
ftl Avatar answered Oct 21 '22 12:10

ftl