
  These are some mails giving advises from Meroon-V3 users in various
situations. I sometimes edit them to add some notes between [QNC and
QNC].

From: Brad Lucier <lucier@MATH.Purdue.EDU>
Date: Fri, 7 Feb 1997 11:55:10 -0500
To: Christian.Queinnec@inria.fr
Subject: Building Meroon with Gambit.

Christian:

I've included below a note I wrote to a student who wanted to try
to build gsc with compiled meroon on his linux machine.  I concatenated
all the meroon source files into _meroon.scm. 

        [QNC, you must concatenate these files in the right
        order. This ordered list may be computed by the following
        expression:

        (let ((*files* '()))
          (define native-load load)
          (define (new-load filename)
            (set! *files* (cons filename *files*))
            filename )
          (set! load new-load)
          (native-load "meroon.scm")
          (set! load native-load)
          (reverse *files*) )

        QNC]

To load meroon:

Define:

(define (old-load filename)
  (call-with-input-file
    filename
    (lambda (port)
      (##read-expressions-from-port
        port
        (lambda (script? exprs)
          (for-each eval exprs))))))

then

(old-load "_meroon.scm")

To compile meroon:

(old-load "_meroon.scm")

(compile-file "_meroon.scm")

Note:  _meroon.scm is set up with rather aggressive inlining for a file
of this size and with this many macros---(inlining-limit 400).
Fortunately, the linux setup in gambit.h has -O0 as the compiler
optimization option when compile-file calls gcc.  If your machine barfs
on compiling _meroon.scm, you can reduce the inlining-limit to 300 (the
default) or even less.  If you really want to be aggressive, you can
add -O1 to the linux gcc lines in gambit.h (you have to reconfigure
after changing gambit.h in this way).  gcc -O1 with inlining-limit 400
resulted in a job that took 344 megs of swap on my ultra.  I don't know
what the correct performance trade-off of inlining-limit and gcc
optimization is.
        
You should add the following declarations at the top of the
_meroon.scm file:

(declare (block) (standard-bindings) (extended-bindings) (fixnum))
(declare (not safe) (not interrupts-enabled))
(declare (inline) (inlining-limit 400))

Without the first two lines, it will run much more slowly. The
third line is optional, the default is

(declare (inline) (inlining-limit 300))

and you can turn off inlining altogether with

(declare (not inline) (inlining-limit 0))

Brad

