[gambit-list] Compiling syntax-case.scm

Bradley Lucier lucier at math.purdue.edu
Wed Jan 25 14:16:59 EST 2006

On Jan 24, 2006, at 6:51 PM, Joel Reymont wrote:

> I have Gambit 4b17 and I cannot compile syntax-case.scm with gcc  
> 4.0 for some reason. It sits there forever doing something and gcc  
> eats up 700Mb+ of memory. I'm on Mac OSX 10.4.4.

On my machine (dual 2GHz G5 with 8GB of RAM running Mac OS X 10.4.4):

[lindv2:~/Desktop] lucier% time gsc -dynamic syntax-case.scm
309.737u 47.772s 7:22.84 80.7%  0+0k 1+59io 0pf+0w
[lindv2:~/Desktop] lucier% wc syntax-case.c
   204300  204865 8182241 syntax-case.c
[lindv2:~/Desktop] lucier% ll syntax-case.*
-rw-r--r--   1 lucier  lucier  8182241 Jan 25 12:49 syntax-case.c
-rwxr-xr-x   1 lucier  lucier  3596922 Jan 25 12:56 syntax-case.o1*
-rw-r--r--   1 lucier  lucier  6584413 Jan 25 12:47 syntax-case.scm

So, yes, it will take a long time to compile, it's an 8MB C source  
file consisting of one C function (and even if --enable-single-host  
is not specified, the largest part of syntax-case.c is still one C  

If you want to save a bit of time or space during the compile, you  
could add -D___OPTIMIZE_SPACE to the command line in gsc-cc-o  
wherever you installed gsc and gsi.  Or, you could copy gambit.h to  
the local directory where you're trying to compile syntax-case.scm  
and add the define there:

[lindv2:~/Desktop] lucier% cp /usr/local/Gambit-C/include/gambit.h .
[lindv2:~/Desktop] lucier% vi gambit.h
[lindv2:~/Desktop] lucier% diff -p  /usr/local/Gambit-C/include/ 
gambit.h gambit.h
*** /usr/local/Gambit-C/include/gambit.h        Thu Jan 19 15:17:50 2006
--- gambit.h    Wed Jan 25 13:03:48 2006
*** 1192,1197 ****
--- 1192,1198 ----
    * Determine optimization goal.

+ #define ___OPTIMIZE_SPACE
   #ifdef ___OPTIMIZE_TIME
   #ifdef ___OPTIMIZE_SPACE
   @error "Define either ___OPTIMIZE_TIME or ___OPTIMIZE_SPACE"
[lindv2:~/Desktop] lucier% time gsc -dynamic syntax-case.scm
265.037u 41.735s 6:14.30 81.9%  0+0k 1+49io 0pf+0w

Even then, I noticed that cc1 temporarily required 1.25GB of memory  
near the end of the compilation (just by monitoring top as cc1 ran).


More information about the Gambit-list mailing list