On Mon, Oct 21, 2013 at 8:01 AM, Kees Bleijenberg <k.bleijenberg@lijbrandt.nl> wrote:

When I run my program, I get a stack overflow message (current stacksize is 8388608 bytes) and the advice to use +RTS –Ksize  -RTS

The Haskell code creates a Windows dll, so no command line. That’s why I want to change the stack size at compile time.


I think the default RTS options are only settable in a compile that produces an executable; otherwise there would have to be a chunk of code that retrieved all the rtsopts from every Haskell-compiled DLL and somehow reconciled any conflicts between them. Also note that if the main program is in C, you don't get -with-rtsopts processing at all; see http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#using-own-main for how you set RTS options in this case. (See at "To use +RTS flags with hs_init()".)

In this particular case you may be better off just using the %GHCRTS% environment variable.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net