
Installation
************

Unix
====

   We will use as an example the installation for HP 9000 series 400
computers.  The installation for other Unix systems is similar.  If you
are installing for an HP 9000 series 700 or 800, see also *Note HP-PA
Installation::.

   MIT Scheme is distributed as a compressed `tar' file.  The tar file
contains a single directory, called `dist-7.3', and that directory
contains subdirectories `bin', `etc', and `lib'.  The `bin'
subdirectory contains two executable files, `scheme' and `bchscheme'. 
The `etc' subdirectory contains several files that are used during the
installation process.  The `lib' subdirectory contains several files
and subdirectories that Scheme uses while it is executing.

   The goal of the installation is to put the executable files in a
directory where they will be executed as commands, and to put the
library files in some convenient place where Scheme can find them.

   * First unpack the distribution:

          gzip -cd hp400.tar.gz | tar xvf -

     If you do not have the `gzip' program: we have built executables of
     this program for each of the machines that we support.  Either use
     the executable that we have already built, or else get the gzip
     sources (from us or from numerous other sources) and build it
     yourself.

   * Next, go to the directory that you just unpacked:

          cd dist-7.3

     The easiest way to install the files is to use the "install.sh"
     shell script that we've provided in the distribution.  You will
     need to edit that script to tell it where and how you want Scheme
     installed.  If you want to do something more complicated, or if
     the script can't easily be made to work for your system, use the
     script as a guide to installation.

   * The script assumes there is no pre-existing installation of MIT
     Scheme on your system.  If there is, you may need to edit the
     script, or delete the existing version (particularly the contents
     of `/usr/local/lib/mit-scheme', see the later note on editing
     `libdir').  If you have trouble deleting the binary because it is
     in use, try renaming it to `scheme.busy' and deleting it later.

   * The installation script normally uses the command `cp -pr' to copy
     the files from the distribution directory to their final
     locations.  You can change this by editing the definition of the
     `install' variable in the `install.sh' shell script.  Some
     versions of `cp' do not support the `p' option; using simply `cp
     -r' in this case is acceptable.  Note that most versions of `mv'
     require the source and destination to be on the same physical
     device.

   * The installation script may try to make some symbolic links during
     the installation.  This is normally done using the command `ln -s'.
     If your system doesn't support symbolic links, or if you prefer to
     copy or hard-link files, change the definition of the `link'
     variable in the shell script.

   * For many systems, a standard place to put executable files is the
     directory `/usr/local/bin'.  If this is true for your system, we
     suggest installing the executables there.  Otherwise, you probably
     have some other directory that serves the same purpose; edit
     `install.sh' and change the definition of the shell variable
     `bindir' to be this other directory.

   * Normally, MIT Scheme's auxiliary files are stored in the directory
     `/usr/local/lib/mit-scheme/'.  If you can, we suggest that you
     create such a directory and install these files there.  Otherwise,
     create a directory somewhere else and edit the installation script
     to change the value of the variable `libdir' to be this directory.

   * If you have GNU Emacs installed on your system, uncomment the
     definitions of the variables `infodir', `emacslisp', and
     `movemail' in the installation script.  You will also need to edit
     these definitions so that they correctly indicate where the GNU
     Emacs files are located.

   * Once you are satisfied that the `install.sh' script is correct,
     execute it:

          ./install.sh

   * After `install.sh' finishes, you can delete the `dist-7.3'
     directory that you unpacked earlier.

     You should now be able to run MIT Scheme by typing

          scheme

     at the command line (if you use the C shell, you may have to type
     `rehash' before `scheme' will be recognized).


HP-PA Installation
------------------

   If you are using an HP 9000 series 700/800 computer (often called an
HP Precision Architecture machine, or HP-PA for short), read this
section.

   Scheme has built-in code that flushes the instruction and data caches
of your machine in certain circumstances.  This code is sensitive to
your computer's model, because each model has different cache hardware.

   This distribution contains a database, called `hppacach.mod', that
describes the cache structure for each model of computer.  As of this
writing, that database contains entries for the following models:

     705, 710, 715, 720, 730, 735, 750, 755, 834, 835, 850, 867

If you have a model that is not in the database, Scheme will not run --
instead it will print an error message informing you of this fact, and
stop.  If this happens, you must add an entry to the database. This
must be done once, at installation, for each new model.

   Here is the procedure for updating the database:

   * Run the program `hppacache' that is included in the distribution.
     You must give this program the filename of the database file as an
     argument.  Normally the database file name is
     `/usr/local/lib/mit-scheme/hppacach.mod', but if you install Scheme
     in a non-standard place it will be different.  For example, if you
     install Scheme as `/usr/foo/mit-scheme/', the database file is
     called `/usr/foo/mit-scheme/hppacach.mod'.

   * Assuming that Scheme is installed in the normal place, update the
     database by becoming the super-user and executing the following
     commands on your machine:

          cd /usr/local/lib/mit-scheme
          ./hppacache -update hppacach.mod

     The reason that you must be super-user is that `hppacache' needs to
     read the device `/dev/kmem' to get the information that it needs.
     Normally, `/dev/kmem' is readable only by the super-user, or by
     users in group `sys'.  Thus, becoming super-user is the easiest way
     to read this information.  An alternative method for doing this is
     to change the permissions of the `hppacache' program so that it is
     in group `sys', and to turn on its "set group ID on exec"
     permission bit, but since this also requires you to be super-user,
     you might as well just execute the program as the super-user.

     Please note that you must execute this program on the computer
     whose model you wish to add to the database.  Also, if you wish to
     add several models to the database, you must execute the program
     once on each model. If you have several computers that are all of
     the same model, you need only update the database once from one of
     the computers; thereafter all of the other computers of that model
     will work.

   * If you add a new model to the database, we'd appreciate it if you
     would send us the model information, so that we can update the
     copy of the database that we distribute to others.  This can be
     done using the `hppacache' program, as follows:

          cd /usr/local/lib/mit-scheme
          ./hppacache -print hppacach.mod > model-7xx

     (If you have previously updated the database, you do not need to be
     super-user to execute this command.)  The resulting file,
     `model-7xx' in this example, is the model information for the
     machine that you executed the command on; it is C code that we can
     use to update our copy of the database.  Send the model
     information for each new model to us by electronic mail at
     `bug-cscheme@zurich.ai.mit.edu'.  Thanks!


PC Operating Systems
====================

   This section describes how to install MIT Scheme on DOS, Windows
3.1, and Windows NT.  We would prefer that the Windows version be used,
rather than the DOS version, because we intend to maintain the DOS
version only so long as it is convenient.  For the most part the
installation on any of these platforms uses the same files, and the
procedure is similar.  It is possible to install MIT Scheme so that it
will run under all three operating systems on one computer, but this
does require some care with the configuration of the system.

   Note that we have only tested the DOS version on Microsoft DOS 5.0.

   Note 2: For Microsoft Windows 95, follow the instructions for WIndows NT.


System Requirements
-------------------

   MIT Scheme requires at least a 386SX with 8Mb RAM. The bare minimum
disk space required is 5.5Mb, which gives you a command line interface
for Scheme.  We strongly recommend a more advanced environment.  To
build the Edwin editor band requires an additional 4.3Mb.  The whole
installation without source code occupies 36Mb of disk.


Manifest
--------

   The installation is split into several files according to functional
units and the size constraints of a 1.4M high density 3.5" floppy disk.
The following files are distributed:

     BIN.ZIP         Scheme binaries for Windows 3.1/Windows NT
     DOSBIN.ZIP      Scheme binaries for DOS
     LIB.ZIP         Smaller files from Scheme library
     RUNTIME.ZIP     `runtime.com' band
     RUNNOFLO.ZIP    `runtime.com' band for DOS machines with no FP hardware
     EDDEL.ZIP       `eddel.com': a kit to build `edwin.com' band
     COMPDEL.ZIP     `compdel.com': a kit to build `compiler.com' band
     
     HELP.ZIP        WinHelp User and Reference Manuals
     BCIRUN1.ZIP     Debugging information for runtime system
     BCIRUN2.ZIP         "          "       "     "      "
     BCIRUN3.ZIP         "          "       "     "      "
     BCIED1.ZIP      Debugging information for Edwin
     BCIED2.ZIP          "          "       "    "
     BCIED3.ZIP          "          "       "    "
     BCINOFLO.ZIP    Extra debugging information for machines with no FP hardware
     
     SRCRUN.ZIP      Source code for the runtime system
     SRCUC.ZIP       Source code for the microcode (C)
     SRCED.ZIP       Source code for Edwin
     SRCCOMP.ZIP     Source code for i386 compiler
     
     WIN32S.ZIP      Win32s installation floppy from Microsoft
     INSTALL.TXT     These instructions
     UNZIP.EXE       Program to unpack the `.zip' files

   Minimal installation on Windows NT requires: `BIN.ZIP', `LIB.ZIP'
and `RUNTIME.ZIP'.

   For the Edwin editor and the native code compiler add `EDDEL.ZIP'
and `COMPDEL.ZIP' repectively.

   Any configuration for Windows 3.1 is the same as for Windows NT
except that Win32S also needs to be installed.

   For DOS the minimal installation comprises `DOSBIN.ZIP', `LIB.ZIP'
and one of `RUNTIME.ZIP' or `RUNNOFLO.ZIP'.


PC Installation
---------------

   These installation instructions describe how to install MIT Scheme on
one or more of DOS, Windows 3.1, and Windows NT.  If you are installing
for DOS and another operating system, you should do the bulk of the
installation using the windowing environment.

   In each of the following steps the amount of disk space consumed is
indicated in square brackets.  These sizes do not include the `.zip'
files which are required only during installation.

  1. MIT Scheme under Windows 3.1 requires the Win32s system (version
     1.1) to be installed.  If you have not previously installed the
     Win32s system then you should create a floppy disk containing the
     contents of the `win32s.zip' file, e.g:

          a:
          unzip WHEREVER\win32s.zip

     Run the `setup' command on the floppy disk.

     If you are not sure whether you have Win32s installed, or what
     version you have installed, try to install it anyway.  If you have
     version 1.0 then the Win32s installation disk will upgrade your
     Win32s system to version 1.1.

          a:setup

  2. Decide on where to install MIT Scheme. We suggest the default:
     `C:\SCHEME'. Create the root directory which we from now on refer
     to as SCHEME. If for example, you choose the default:

          mkdir c:\scheme
          cd \scheme

     SCHEME is the string ``C:\scheme''.

  3. In the SCHEME directory unzip the following essential files:
     `bin.zip', `lib.zip' and `runtime.zip' [5.5Mb].

          unzip WHEREVER\bin.zip
          unzip WHEREVER\lib.zip
          unzip WHEREVER\runtime.zip

     This will create the directory structures `SCHEME\bin',
     `SCHEME\lib' and `SCHEME\etc', and unpack the essential files.
     (WHEREVER stands for the place that you have put the `.zip' files,
     which might be another directory or a floppy disk.)

     If you have a computer without floating-point hardware (e.g. a 386
     machine or a 486SX) and you wish to run the DOS version then you
     must install the runtime with special floating point support
     instead of `runtime.zip':

          unzip WHEREVER\runnoflo.zip

  4. To install the DOS binaries, unzip the `dosbin.zip' file.

          unzip WHEREVER\dosbin.zip

     This creates a `SCHEME\dos-bin' directory containing the DOS
     versions of the `.exe' files.  These files are different from the
     Windows versions, so they are placed in a different directory to
     allow both versions to co-exist on your computer.  It is only the
     `.exe' files that differ between DOS and Windows.  The other parts
     of the MIT Scheme system are shared.  The DOS version will run
     under Windows 3.1 but not under NT.  Either running on DOS or
     Windows 3.1, the DOS version has *no* graphics support

  5. If you are installing for Windows 3.1 only, do *one* of the
     following:

        * Put the following line in the `autoexec.bat' file to ensure
          that the `SCHEME\bin\win31' directory is on the path:

               path %PATH%;SCHEME\bin\win31

          This command must be in a `.bat' file to work

        * Copy the files from `SCHEME\bin\win31' into `SCHEME\bin'.

  6. If you are installing for Windows NT only, do *one* of the
     following:

        * As system administrator add `SCHEME\bin\nt' to the `PATH' in
          the system environment (using the Registry Editor, `regedt32'

        * As an individual place `PATH='SCHEME`\bin\nt' in your
          environment (use the control panel's system option

        * Copy the files from `SCHEME\bin\nt' into `SCHEME\bin'.

  7. If you are installing for both Windows 3.1 and Windows NT then you
     must use use environment variables and the `PATH' rather than
     copying files, i.e. you must arrange for Windows 3.1 to be run with
     `SCHEME\bin\win31' on the path and for Windows NT to be run with
     `SCHEME\bin\nt' on the path. This can be done by putting

          path %PATH%;SCHEME\bin\win31

     in the `autoexec.bat' file and adding `SCHEME\bin\nt' to the
     Windows NT system environment path.

  8. If you are installing for DOS there is no need to add things to the
     `PATH'.

  9. If you did not choose the default installation directory, make
     sure that the environment variable `MITSCHEME_LIBRARY_PATH' is
     defined:

          set MITSCHEME_LIBRARY_PATH=SCHEME\lib

 10. Now test the installation so far. Under either Windows system, you
     should be able to get a Scheme system running in its terminal
     window by running the following from the Program Manager or the
     File Manager

          SCHEME\bin\scheme

     From DOS you should be able to get Scheme running by typing the
     following at the DOS prompt:

          SCHEME\dos-bin\scheme

     If there are any problems at this stage, review the installation
     so far. Remember that you might have to restart your machine to
     get the effect of any changes that you made in `autoexec.bat' or
     the NT registry.

 11. Windows versions only. Now you should create a Program Manager
     group for MIT Scheme. This can be done by running a Scheme program
     from the Program Manager using the `File|Run' option:

          SCHEME\bin\scheme -load SCHEME\etc\pmgrp

     This program creates a program group called `MIT Scheme' which
     contains

        * Icons for running scheme in several configurations

        * Windows Help versions of the Scheme Reference Manual and the
          MIT Scheme User's Manual.

        * `Mincer' icons for building the rest of the system

     At this point only the Scheme icon called `Runtime' will execute.
     Test it.  The other Scheme icons (`Edwin', `Compiler' and `MIT
     Scheme' shield) should report that they cannot find their bands.

 12. Windows versions only. To install the help files, unpack
     `help.zip':

          unzip WHEREVER\help.zip

     This installs two windows help files, `user.hlp' and `scheme.hlp',
     in `SCHEME\bin'.

 13. To install the Edwin editor you need to build the `edwin.com' band.
     First unpack the delta file `eddel.com' [1.6Mb]:

          cd SCHEME
          unzip WHEREVER\eddel.zip

     To build `edwin.com' start the `build EDWIN.COM band' icon, or run
     the following command:

          SCHEME\bin\scheme -large -load SCHEME\etc\build -eval (edwin.com)

     This will load in `eddel.com' and create the new band [4.3Mb].
     After a successful build the program will exit. The `edwin.com'
     band can be used by both the DOS and Windows versions, so you only
     need to do this step once, even if you are installing for more
     than one of DOS, Windows 3.1, and Windows NT.

     If you are installing only for DOS you will have to build
     `edwin.com' from the command line.  Be sure to run the DOS
     `scheme.exe' rather than the Windows version:

          SCHEME\dos-bin\scheme -large -load SCHEME\etc\build -eval (edwin.com)

 14. To install the compiler you need to build the `compiler.com' band.
     First unpack the `compdel.com' delta file [2.5Mb]:

          cd SCHEME
          unzip WHEREVER\compdel.zip

     To build `compiler.com' start the `build COMPILER.COM band' icon,
     or run the following command:

          SCHEME\bin\scheme -large -load SCHEME\etc\build -eval (compiler.com)

     This will load in `compdel.com' and create the new `compiler.com'
     band [4.8Mb].  After a successful build the program will exit. As
     for Edwin, this step needs to be done only once.

     If you choose to build this band using the DOS version be sure to
     run the DOS `scheme.exe' rather than the Windows version:

          SCHEME\dos-bin\scheme -large -load SCHEME\etc\build -eval (compiler.com)

 15. If you want both Edwin and the compiler in one band you should
     build the `all.com' band.  First unpack the delta files [4.1Mb
     unless already unpacked in previous steps]:

          cd SCHEME
          unzip WHEREVER\eddel.zip
          unzip WHEREVER\compdel.zip

     To build `all.com' start the `build ALL.COM band' icon, or run the
     following command:

          SCHEME\bin\scheme -large -load SCHEME\etc\build -eval (all.com)

     This will load in both `eddel.com' and `compdel.com' into the
     runtime band and create the new band [6.7Mb].  After a successful
     build the program will exit.

     If you choose to build this band under DOS, be sure to run the DOS
     `scheme.exe' rather than the Windows version:

          SCHEME\dos-bin\scheme -large -load SCHEME\etc\build -eval (all.com)

 16. Any combination of `edwin.com', `compiler.com' and `all.com' may
     be used.  They may be built in any order: it is not necessary to
     build either of `edwin.com' and `compiler.com' before building and
     using `all.com'. The bands are shared by all of the supported
     operating systems so you only have to build the bands once, even
     if you want to use them from, say, both DOS and Windows 3.1.

     After building the bands you may tidy the MIT Scheme group by
     removing the mincer icons and recover disk space by deleting the
     delta files [4.1Mb] and the `runtime.com' band [2.3Mb] if you do
     not need it.

     To create icons that use `bchscheme' instead of `scheme' copy the
     icons and edit the command lines to change `scheme' to `bchschem'
     (that is right: no tailing `e').

 17. Debugging information can be installed by uncompressing the
     `bci*.zip' files in the Scheme root directory SCHEME.  The total
     space required for all of the debugging information is 7.5Mb. The
     most useful is the runtime debugging info which is in
     `bcirun1.zip' through `bcirun3.zip' [3.6Mb installed].

     If you have installed the DOS version for machines without hardware
     floating point support then `bcinoflo.zip' should be uncompressed
     also.  This must be done *after* the `bcirun*.zip' files.

     Debugging information files can be installed in the Scheme root
     directory or in another directory.  If another directory is chosen
     then set the `MITSCHEME_INF_DIRECTORY' environment variable to this
     directory.  `bcied1.zip' through `bcied3.zip' [3.8Mb installed]
     hold the debugging information files for Edwin.
