On Sat, Jan 22, 2011 at 9:33 PM, Raymond Toy <span dir="ltr"><<a href="mailto:toy.raymond@gmail.com">toy.raymond@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div id=":17r">Since that page says the limits can be set from the command line, you<br>
can modify the maxima script to add those parameters to the command<br>
line.  Or even give those on the command line to maxima.  (I forgot how<br>
it's done, but maxima has the ability to supply command line arguments<br>
to be passed to the underlying lisp.<br>
</div></blockquote></div><br>I bet you meant --preload-lisp, for which I show an example below. I misunderstood Oliver. I though he is a Maxima developer interested in increasing the memory limits in Maxima, but now it seems it is related to independent jobs that happen to use Maxima built with ECL.<br>

<br>In this case I think Oliver does not realize that the executable that they are using is not ECL but Maxima: a standalone executable which is built by the Maxima scripts. In other words, Maxima is not run by launching ECL with a given image. Instead it is an independent program, a binary, built using ECL's facilities.<br>

<br>Hardcoding limits in ECL or modifying the sources (options which incidentally are in src/c/main.d) is not the answer. Will you build a separate executable for every limits you need? What about a situation in which those limits prove wrong? It is better to use an option which is configurable at run-time, as ECL's runtime allows you.<br>

<br>One option is to execute lisp code before running your Maxima scripts. This can be done using --preload-lisp, as shown below.<br><br>The other option would be to tweak the maxima build process to allow those limits to be enlarged in the executable (in the end it would add a couple of lisp statements to do the changes instead of --preload-lisp).<br>

<br>A final option would be to teach ECL to use environment variables for gathering the memory limits from the command line.<br><br>Out of these, I think the first one is the best option.<br><br>Juanjo<br><br>$ cat maxima.lisp<br>

(format t ";;; Frame stack limit ~D"<br>        (ext:set-limit 'ext:frame-stack (expt 2 14)))<br>(format t "~%;;; Binding stack limit ~D"<br>        (ext:set-limit 'ext:binding-stack (expt 2 17)))<br>

(format t "~%;;; C stack limit ~D"<br>        (ext:set-limit 'ext:c-stack (expt 2 22)))<br>(format t "~%;;; Heap size limit ~D"<br>        (ext:set-limit 'ext:heap-size (expt 2 30)))<br>(format t "~%;;; Lisp stack limit ~D~%;;;"<br>

        (ext:set-limit 'ext:lisp-stack (expt 2 18)))<br>$ maxima -p maxima.lisp<br>;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/sb-bsd-sockets.fas"<br>;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/sockets.fas"<br>

;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/defsystem.fas"<br>;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/cmp.fas"<br>;;; Frame stack limit 16640<br>;;; Binding stack limit 131072<br>;;; C stack limit 4227072<br>

;;; Heap size limit 1073741824<br>;;; Lisp stack limit 33849600<br>;;;<br>Maxima 5.23post <a href="http://maxima.sourceforge.net">http://maxima.sourceforge.net</a><br>using Lisp ECL 11.1.1<br>Distributed under the GNU Public License. See the file COPYING.<br>

Dedicated to the memory of William Schelter.<br>The function bug_report() provides bug reporting information.<br>(%i1) <br clear="all"><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br>

<a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>