-----

Installing Scheme 48

-----

Emacs init file

To run scheme48 or envision, you will need something like the following in your emacs init file (.emacs in your home directory).

    (setq load-path 
      (append load-path '("/group/scheme/scheme48/scheme48-0.46-hp/src/emacs")))
    (setq scheme-program-name 
  	"/space/mfleck/envision-script")
    (autoload 'run-scheme "cmuscheme48" "Run an inferior Scheme process." t)

Edit the two file names to the locations of (a) your emacs installation and (b) your home directory.

If you use this init file under several different operating systems, you will need something like the following in your emacs init file. You can find the current value of the system-type variable by invoking M-x eval-expression, then typing system-type at the prompt, inside emacs.

(cond 
  ((eq system-type 'hpux)
     (setq load-path 
       (append load-path '("/group/scheme/scheme48/scheme48-0.46-hp/src/emacs")))
     (setq scheme-program-name 
  	"/space/mfleck/envision-script-hp"))
   ((eq system-type 'aix)
     (setq load-path 
      (append load-path '("/group/scheme/scheme48/scheme48-0.46-ibm/src/emacs")))
     (setq scheme-program-name "/space/mfleck/envision-script-ibm")))

Envision init file

Now create a file named envision-script in your home directory. Mine looks like:

#!/bin/sh

lib=/group/scheme/scheme48/scheme48-0.46-hp/lib/scheme48
exec $lib/scheme48vm -o $lib/scheme48vm -i /group/scheme/envision/bin/hp/envision.image -h 6000000 -s 2500"$@"
#exec $lib/scheme48vm -o $lib/scheme48vm -i $lib/scheme48.image -h 6000000 -s 2500"$@"

Edit the filenames to reflect the details of your installation. Your version should include exactly one of the lines starting with exec. I keep both in my script file, with one commented out, so that I can switch between the two without restarting emacs. You will need separate (but very similar) versions of envision-script for each operating system, pointing to the appropriate binaries.

The first version of the exec line is what you use after envision is properly installed. The second version (commented out in the above example) loads the raw scheme48 image. You will need this when making the dumped envision image during installation, and if you wish to build new dumped images containing your own code or for debugging.

Coprocessor init file

Finally, you must make an init file for the coprocessor in your home directory. (Again, make two separate files if you run two different operating systems from the same home directory.) Ask whoever installed your system for the appropriate name. This will probably be .envision-init if your installation supports only one architecture. For multiple architectures, it might be something like .envision-init-XXX where XXX is the operating system name (e.g. .envision-init-hp).

The coprocessor init file should contain exactly one line, which which is the full (not relative) pathname of the icp binary to run. For example:

   /group/scheme/envision/bin/hp/icp

Starting Envision

Now, restart emacs. The command "M-x run-scheme" should now start envision or scheme48, depending on which exec line you included.

Private Coprocessor Directory

The above init files will allow you to run Envision and create new coprocessor functions (using bulk-define). However, these functions will be interpreted by the coprocessor's stack machine. At some point, you will want to fully compile your new functions into C, and link them directly into the coprocessor. This will make them run much faster. (Preliminary timing numbers suggest the difference is more than an order of magnitude.)

To compile your functions into C, you must create your own private copy of the coprocessor source code. In your home directory, create a new subdirectory called "envision-private/coprocessor-code". Copy into it the co-processor source code from your local Envision installation. You may also want to create subdirectories for holding your new binaries and digests. On our system, you would do something like:

  cd
  mkdir envision-private
  cd envision-private
  mkdir coprocessor-code
  mkdir bin
  mkdir digest
  cd coprocessor-code
  cp /group/scheme/envision/co-processor/c/* .

Your private coprocessor directories can be given different names. This particular choice of name is convenient because it allows you to omit the optional directory name from the dump commands.

Now, compile your new copy of the coprocessor:

  cd ~/envision-private-coprocessor-code
  [make distclean]
  [./configure]
  [make clean]
  make

The two commands in brackets will only be necessary the first time you compile the coprocessor in your new directory. And, depending on your system configuration, they may not even be necessary the first time. However, you can't do any harm by issuing them.

This will create a new binary coprocessor file in this directory called "icp". Move this file to your bin directory (e.g. envision-private/bin). Now modify your coprocessor init file to point to this new icp binary rather the system binary. Restart Scheme and the coprocessor. The command start-coprocessor should now report that it is starting your new coprocessor binary rather than the system default one.

A single private coprocessor directory can be used to generate code for multiple architectures. In this case, you must move or rename your binary icp images after you have created them. You must also issue "make distclean" to remove old binaries and then "./configure" each time you start compiling for a new architecture.

-----

Ownership, Maintenance and Disclaimers

Manual Top Page

Last modified