Installation instructions for Gambit
------------------------------------


There are two things you might want to intall:

  1) the Gambit Scheme system (GSS)
  2) the Gambit Scheme compiler (GSC)

GSS is a set of tools that support Scheme programming.  An interpreter
and compiler are part of GSS.  At the present time, GSS only runs on
M680x0 based computers (including M68000 to M68040).  GSS has been
tested on SUN-3, HP300, NeXT and BBN GP1000 (Butterfly) computers.
A variant of GSS has also been ported to the Macintosh.

GSC is written in IEEE-Scheme and can run on top of any Scheme system that
supports IEEE-Scheme.  Note that you do not need a M680x0 based computer
to use GSC but you do need one to run the resulting compiled code.
GSC has been run on top of MIT-Scheme, T and GSS.

In the instructions that follow, parameters that depend on your installation
have been put in braces.  `<gambit_dir>' stands for the directory that
contains Gambit, e.g. /users/feeley/gambit.  `<bin_dir>' stands for a
directory that will hold the executable programs, e.g. /usr/local/bin.
`<bin_dir>' should be contained in your `PATH'.  `man_dir' stands for
the directory that contains the man pages, e.g. /usr/local/man/man1.



1. Installing GSS
-----------------


GSS is composed of 5 tools:

  1) gsi, the interpreter
  2) gsc, the compiler
  3) glk, the linker/loader (used to build stand alone applications)
  4) gcv, a utility to convert compiled files to the .o files used by glk
  5) gsx, a tool to visualize system activity on a parallel machine

At the present time GSS is only available for M680x0 based computers.
The files needed for the M680x0 version of GSS are in the directory
`targets/m68000'.

GSS has been tested on the following platforms: SUN-3, HP300 series, NeXT
and BBN GP1000 (Butterfly).  If you want to port GSS to another M680x0 based
computer, you might have to change the file `LOADER/os.h' and
`LOADER/os.c'.  You might also have to change the assembly language
file `src/LIB/_kernel.s'.

The default distribution of GSS comes with precompiled object files for
making a working system.  To do this follow the instructions in section 2.
If you do not have these files, or you want to build a new compiler after
having modified it, follow the steps in section 3.



2. Building GSS from the precompiled object files
-------------------------------------------------


You can quickly get GSS working by using the precompiled library
supplied with the default distribution.  For this to work, you must
have one of the supported platforms mentioned above.

The commands to execute are:

  cd <gambit_dir>/targets/m68000
  make clean
  make
  cp BIN/g* <bin_dir>
  cp MAN/* <man_dir>
  rehash



3. Building GSS from scratch
----------------------------


The first step in building GSS is to install GSC.  You must have a
Scheme system to do this (a previously compiled version of GSS can
do), just follow the instructions in section 4.

Now, you should build a minimal GSS with the commands

  cd <gambit_dir>/targets/m68000
  make ultra-clean
  make
  cp BIN/g* <bin_dir>
  cp MAN/* <man_dir>
  rehash

The `make' takes anywhere from an hour to a day, depending on the host system.

At this point, you can use the commands `gsi', `gsc', `glk' and `gcv'
and bring up their respective man pages.  Note that you can only link
programs with the default runtime library.  To enable the full runtime
library, do

  cd <gambit_dir>/targets/m68000
  make lib

This will take about 2 hours.


Some demos can be found in the directory <gambit_dir>/targets/m68000/demos.



4. Installing GSC
-----------------


You must choose a Scheme system on top of which GSC will run.  GSC was
developped using MIT-Scheme but any other Scheme system that supports
IEEE-Scheme will do.  Call this system <host>, where <host>=mit for
MIT-Scheme, <host>=t for T and <host>=gambit for GSS.  (If you are
using some other system, create your own <host> name and modify the
files compiler/host.scm and BIN/SCHEME_COMP to account for your
system.)

The next step is deciding wether you want to run GSC interpreted or compiled.
In either case, the directory

  <gambit_dir>/GSC/<host>

will be used to hold the files required by GSC.

The shell script `gsc' contained in that directory is used to call up
GSC.  You must setup this shell script to fit your installation.  The
assignment to the variable HOST should be <host>.  EXT should be `.scm'
if you are running GSC interpreted.  If you are running GSC compiled,
EXT should be the extension of compiled files for the host system.  The
assignment to DIR should be <gambit_dir>.  The way in which the host
system is called also has to be adjusted.

Now, do the following:


  -- FOR INTERPRETED GSC --

     cd <gambit_dir>
     cp compiler/*.scm GSC/<host>
     cp GSC/<host>/gsc <bin_dir>/gsc
     rehash


  -- FOR COMPILED GSC --

     cd <gambit_dir>
     setenv HOST_SYSTEM <host>
     make clean
     make
     cp GSC/<host>/gsc <bin_dir>/gsc
     rehash

  The `make' takes anywhere from half an hour to half a day, depending
  on the host system.


At this point, you should be able to compile a file (e.g. `fib.scm') by
typing:

  gsc fib

You should read `doc/gsc.man' on how to use `gsc'.
