Readme file for Gambit-C 2.5.1 distribution (April 1, 1997) ------------------------------------------- The Gambit-C Scheme system version 2.5.1 is available by FTP at the following location: ftp://ftp.iro.umontreal.ca/pub/parallele/gambit/gambit-2.5/ The sources for UNIX, PC and Macintosh are distributed in that directory in the archive file: gambc251.tar.gz Gambit-C also comes prebuilt for PC and Macintosh. Since the Gambit-C compiler works in conjunction with the C compiler installed on your computer, you need to get the archive that was built with the C compiler available. The choices are: ARCHIVE OS C COMPILER gc251-msc.zip Windows-NT/95 Microsoft Visual C++ 4.0 compiler gc251-bor.zip Windows-NT/95 Borland C++ 5.0 compiler gc251-wat.zip Windows-NT/95 Watcom C/C++ 11.0 compiler gc251-dj.zip MSDOS DJGPP system v2.0 (see http://www.delorie.com) gc251-cw.hqx MACOS system 7 Macintosh CodeWarrior C/C++ 11.0 compiler (native 68K and PowerPC versions are included) Under Windows-NT/95 you can pick any version if you plan to only use the interpreter but the version built with the Watcom C/C++ compiler is suggested because it is the most efficient, roughly twice the speed of the one built with the Microsoft Visual C++ 4.0 compiler. More information on Gambit-C can be found at http://www.iro.umontreal.ca/~gambit. Copyright and distribution information -------------------------------------- The Gambit system (including the Gambit-C version) is Copyright (c) 1994-1997 by Marc Feeley, all rights reserved. The Gambit system and programs developed with it may be distributed only under the following conditions: they must not be sold or transferred for compensation and they must include this copyright and distribution notice. In particular, this allows Gambit to be used freely for academic research and education. For a commercial license please contact gambit@iro.umontreal.ca. Prebuilt archives content ------------------------- ==> These files are common to all prebuilt archives: readme this file gambit-c.txt user manual in plain ASCII (for Postscript see Gambit web page) gambit.h header file needed to compile programs generated by Gambit-C _gambc.c Gambit runtime library link file ==> gc251-msc.zip and gc251-bor.zip: gsi.exe Gambit-C interpreter (dynamically linked to gambc.dll) gsc.exe Gambit-C compiler (dynamically linked to gambc.dll) libgambc.lib Gambit runtime library needed to statically link standalone prgms gambc.dll Gambit runtime library needed to run dynamically linked prgms gambc.lib import library for gambc.dll ==> gc251-wat.zip: gsi.exe Gambit-C interpreter (statically linked) gsc.exe Gambit-C compiler (statically linked) gsi-win.exe Gambit-C interpreter (statically linked windowed application) gsc-win.exe Gambit-C compiler (statically linked windowed application) libgambc.lib Gambit runtime library needed to statically link standalone prgms ==> gc251-dj.zip: gsi.exe Gambit-C interpreter (statically linked) gsc.exe Gambit-C compiler (statically linked) libgambc.a Gambit runtime library needed to statically link standalone prgms cwsdpmi.exe DPMI server for virtual memory support (check .doc files) cwsdpmi.doc cwsparam.exe cwsparam.doc ==> gc251-cw.hqx: ppc-gsi PowerPC native Gambit-C interpreter (statically linked) ppc-gsc PowerPC native Gambit-C compiler (statically linked) 68k-gsi 68K native Gambit-C interpreter (statically linked) 68k-gsc 68K native Gambit-C compiler (statically linked) compile-file.ppc project stationery file needed to dynamically compile Scheme files using ppc-gsc and CodeWarrior Installation ------------ Under Windows-NT/95 and MSDOS, create the directory "c:\gambc" and unpack the archive using PKUNZIP into that directory and add the directory to your PATH. For example: mkdir c:\gambc cd c:\gambc pkunzip c:\gc251-wat.zip set path=c:\gambc;%path% Under MACOS system 7, create the folder "Gambit-C" in the "Preferences" folder (which is in the System folder) and then create the folder "gambc" in the "Gambit-C" folder. After unpacking the archive place the files "compile-file.ppc" and "gambit.h" in the folder "gambc". Sample use of the Gambit-C compiler ----------------------------------- Here is a sample use of the Gambit-C compiler to compile and link the standalone program "hi" containing a C module and two Scheme modules. Assuming files "foo.c", "h.scm" and "w.scm" contain respectively: foo.c: #include void bonjour (int n) { while (n-- > 0) printf ("hello "); } h.scm: (c-declare "extern void bonjour (int);") (define bonjour (c-lambda (int) void "bonjour")) w.scm: (bonjour 2) (display "world") (newline) The program must first be compiled and linked at the Scheme level using the command: gsc h w This will produce the files "h.c", "w.c", and the link file "w_.c". The program must then be compiled and linked at the C level using the following commands on the specified platforms: - Microsoft Visual C++ 4.0 compiler as a statically linked application: cl -Ic:/gambc -MD -o hi foo.c h.c w.c w_.c c:/gambc/libgambc.lib - Microsoft Visual C++ 4.0 compiler as a dynamically linked application: cl -D___SHARED -Ic:/gambc -MD -o hi foo.c h.c w.c w_.c c:/gambc/gambc.lib - Borland C++ 5.0 compiler as a statically linked application: bcc32 -Ic:/gambc -tWM -ehi foo.c h.c w.c w_.c c:/gambc/libgambc.lib - Borland C++ 5.0 compiler as a dynamically linked application: bcc32 -D___SHARED -Ic:/gambc -tWM -ehi foo.c h.c w.c w_.c c:/gambc/gambc.lib - Watcom C/C++ 11.0 compiler as a statically linked application: wcl386 -i=c:\gambc -bm -bt=nt -fe=hi foo.c h.c w.c w_.c c:\gambc\libgambc.lib - DJGPP system v2.0 as a statically linked application: gcc -Ic:/gambc -o hi foo.c h.c w.c w_.c c:/gambc/libgambc.a -lm -lemu