GHC ignores RTS options

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

GHC ignores RTS options

Kolář Dušan
Hello,

  I wonder whether anybody could advise me how to pass
correctly RTS options to ghc? I've tried

  ghc +RTS -K4M --RTS -O program.hs -o aO.out
  ghc +RTS -K4M -RTS -O program.hs -o aO.out
  ghc -O program.hs -o aO.out +RTS -K4M
  ghc -O program.hs +RTS -K4M --RTS -o aO.out

and many others, with other sizes (10M, 12M), but program
always(!) stops with:

 Stack space overflow: current size 8388608 bytes.
 Use `+RTS -Ksize' to increase it.

Even time of execution is always the same and thus the
RTS option on stack size is ignored.

What can I do so that the option IS taken into account?
My GHC version says:
ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.4.1


  Thanks & regards

    Dusan

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: GHC ignores RTS options

Tomasz Zielonka
On Wed, Nov 16, 2005 at 08:53:18AM +0100, Dusan Kolar wrote:
>  I wonder whether anybody could advise me how to pass
> correctly RTS options to ghc? I've tried

You have to pass these options to the program, not
to GHC.

BTW - it would be nice if it was easier to override the default RTS
options when compiling the program. Perhaps a nice task for a newbie GHC
developer?

Best regards
Tomasz
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: GHC ignores RTS options

Simon Marlow
In reply to this post by Kolář Dušan
On 16 November 2005 08:12, Tomasz Zielonka wrote:

> On Wed, Nov 16, 2005 at 08:53:18AM +0100, Dusan Kolar wrote:
>>  I wonder whether anybody could advise me how to pass
>> correctly RTS options to ghc? I've tried
>
> You have to pass these options to the program, not
> to GHC.
>
> BTW - it would be nice if it was easier to override the default RTS
> options when compiling the program. Perhaps a nice task for a newbie
> GHC developer?

Already possible, see:

http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.
html#rts-hooks

Admittedly it's a bit more fiddly than a command-line flag to GHC,
though.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC ignores RTS options

Tomasz Zielonka
On Wed, Nov 16, 2005 at 01:09:07PM -0000, Simon Marlow wrote:
> > BTW - it would be nice if it was easier to override the default RTS
> > options when compiling the program. Perhaps a nice task for a newbie
> > GHC developer?
>
> Already possible, see:
>
> http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.
> html#rts-hooks

I was aware of this, and I should write about it.

> Admittedly it's a bit more fiddly than a command-line flag to GHC,
> though.

And because of this I wrote that it would be nice if it was easier :-)
I've bitten several times by the default values of RTS options,
especially the stack size limit (-K). But it was always easier to
set GHCRTS or use +RTS -RTS, so I never used the rts-hooks.

Do you think I could do this? I am not sure how difficult it would be.

Best regards
Tomasz
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: GHC ignores RTS options

Simon Marlow
In reply to this post by Kolář Dušan
On 16 November 2005 13:24, Tomasz Zielonka wrote:

> On Wed, Nov 16, 2005 at 01:09:07PM -0000, Simon Marlow wrote:
>>> BTW - it would be nice if it was easier to override the default RTS
>>> options when compiling the program. Perhaps a nice task for a newbie
>>> GHC developer?
>>
>> Already possible, see:
>>
>>
http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.
>> html#rts-hooks
>
> I was aware of this, and I should write about it.
>
>> Admittedly it's a bit more fiddly than a command-line flag to GHC,
>> though.
>
> And because of this I wrote that it would be nice if it was easier :-)

Sorry, I misread the message.

> I've bitten several times by the default values of RTS options,
> especially the stack size limit (-K). But it was always easier to
> set GHCRTS or use +RTS -RTS, so I never used the rts-hooks.
>
> Do you think I could do this? I am not sure how difficult it would be.

Sure, it shouldn't be too hard.  You need to generate a .c file
containing the ghc_rts_opts setting, and then compile & link it into the
final binary.  It's just a matter of plumbing the various bits together
in GHC's front end.

(it might be nicer to generate Cmm and then push this through the back
end, to avoid the dependence on the C compiler, though).

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users