
Hi, is there any way to specify the heap size (that is, to increase the default) of an executable at *compile time*? Cheers, Ralf

Hi Ralf,
is there any way to specify the heap size (that is, to increase the default) of an executable at *compile time*?
Sure, e.g. -H10m sets the heap size of an executable to 10 MB. (+RTS -H10m -RTS sets the heap size of the *compiler* to 10 MB). Olaf -- OLAF CHITIL, Dept. of Computer Science, University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767

Am Donnerstag, 1. November 2001 11:07 schrieb Olaf Chitil:
Hi Ralf,
is there any way to specify the heap size (that is, to increase the default) of an executable at *compile time*?
Sure, e.g. -H10m sets the heap size of an executable to 10 MB. (+RTS -H10m -RTS sets the heap size of the *compiler* to 10 MB).
Olaf
Thanks. This does not work with hmake, however, hmake -nhc98 -98 -H32M -ILib -PLib Main nhc98 +RTS -H32M -RTS -98 -ILib -PLib -c -o Lib/Prettier.o Lib/Prettier.lhs It encloses the -H32M option in RTS brackets. Is there a way around? Cheers, Ralf

Sure, e.g. -H10m sets the heap size of an executable to 10 MB.
Thanks. This does not work with hmake, however,
hmake -nhc98 -98 -H32M -ILib -PLib Main nhc98 +RTS -H32M -RTS -98 -ILib -PLib -c -o Lib/Prettier.o Lib/Prettier.lhs
It encloses the -H32M option in RTS brackets. Is there a way around?
Ok, the story is a little bit complicated here. hmake is itself a Haskell program, so if you wanted to tell it to give the compiler some extra heap, then +RTS -H32M -RTS would not work, because that would actually tell *hmake* to use 32M, not the compiler. Hence a plain -H32M as argument to hmake gives the behaviour you see, which is the most common requirement. However this leaves the problem of how to give the *final executable* a larger heap. Fortunately, the nhc98 compiler itself can accept either of the following forms: nhc98 -H32M nhc98 +CTS -H32M -CTS and so, from hmake, you must use the latter, e.g. hmake -nhc98 Main +CTS -H32M -CTS [ The +CTS -CTS brackets are named for `Compile-Time System', by analogy with the more common +RTS -RTS for `Run-Time System'. They can be used at any time to ensure that the enclosed arguments are definitely passed to the compiler proper. This is also useful for instance with the -lib argument, which might otherwise be interpreted as a linker flag. ] Regards, Malcolm
participants (3)
-
Malcolm Wallace
-
Olaf Chitil
-
Ralf Hinze