Windows instructions

NOTE

We have discovered som inconsistencies in the functionality of the GUI (specifically with smltk) on windows systems. On 2000 and XP, we have had some success getting it to work, however, when it does not work we are not sure why. We are currently investigating, and to our knowledge smltk works in the basement Upson lab. Unfortunately, you will have to install manually though, we are still in the process of getting CIT to update the lab software).

If the graphics do not work, don't fret. You can still do the problem set by using the Text UI we have provided. We are working on this and will try to figure out what is wrong ASAP.

Things we assume you already have

Things you will need

All of the above can be gotten here (except for ActiveState ActiveTCL)

Instructions

  1. Download ActiveTCL 8.3.4.2 and install it on your system. Default directory is c:\tcl, will assume this from here on out
  2. create a directory c:\sml\smltk and unzip lib.tar.gz into that directory, preserving path names.
  3. download run.x86-win32.exe and put it in your c:\sml\bin\.run\ directory (replacing the old file) (probably a good idea to back up the file)
  4. download sml.x86-win32 and put it in your c:\sml\bin\.heap\ directory (replacing the old file) (probably a good idea to back up the file)
  5. set 2 enviroment variables, SMLTK_LIB=C:/sml/smltk/lib/ and SMLTK_TCL=C:/tcl/bin/wish83.exe. Note: there can be no spaces in the environment variable settings. If there are spaces in the path name, either use the "~" shortcut or move the lib and/or tcl install directory.
  6. Make sure that the slashes match in the environment variables and that there is a trailing slash on the LIB variable.
  7. download sml_tk.heap.x86-win32 to the c:\sml\bin\.heap.
  8. create a smltk.bat file in the c:\sml\bin\ directory that is an exact copy of the sml.bat file in the same directory, except that it should load "sml_tk.heap.x86-win32" instead of "sml.x86-win32".
  9. when running SML run it as "smltk" instead of sml
  10. to make Emacs load the correct sml edit your "C:\Program Files\Emacs\bin\runsml.bat" file to say "smltk" instead of "sml"

You should see something like this:

M:\>smltk
GenetiX hacked version


*** Warnings have occured, sml_tk malfunction likely.


sml_tk parameter settings:
--------------------------
wish (SMLTK_TCL)       : C:\tcl\bin\wish83.exe
library (SMLTK_LIB)    : C:\sml\smltk\lib
*** WARNING: environmnent variable DISPLAY not set.
logfile (SMLTK_LOGFILE): NONE
val it = () : unit
-

As a test to see whether this works or not, download the problem set and start sml in that directory. Type in the following:

- use "test-gui.sml";
[opening test-gui.sml]
structure TestGUI : sig val test : unit -> unit end
val it = () : unit

If you see a small window with a text box and a quit button all is well. You should be able to type in the text box and then have the window title change on you.

*nix instructions: (on x86)

(Alternatively if you want to compile sml tk yourself, please look at the OSX instructions)

Things we assume you already have

Things you will need

All of the above can be gotten here (except for ActiveState ActiveTCL)

Instructions

  1. Download ActiveTCL 8.3.4.2 and install it on your system. We expect wish8.3 to be located in /usr/bin. If not, change paths appropriately.
  2. create a directory /usr/share/smlnj/smltk and unzip lib.tar.gz into that directory, preserving path names.
  3. set 2 enviroment variables, SMLTK_LIB=/usr/share/smlnj/smltk/lib/ SMLTK_TCL=/usr/bin/wish8.3
  4. download sml_tk.heap.x86-linux to the /usr/share/smlnj/bin/.heap
  5. when running sml, instead of just typing "sml" type "sml @SMLload=/usr/share/smlnj/bin/.heap/sml_tk.heap.x86-linux" (or just alias it to "smltk" or something)
  6. to get Emacs SMLMode to load the heap file, you need to edit your .emacs file and change what the sml-program-name variable points to

You should see something like this:

$ smltk
SmlTk 3.0 for SML/NJ 110

sml_tk parameter settings:
--------------------------
wish (SMLTK_TCL)       : /usr/bin/wish8.3
library (SMLTK_LIB)    : /usr/share/smlnj/smltk/lib
logfile (SMLTK_LOGFILE): NONE

Note: INTR (Ctrl-C) disabled, use QUIT (Ctrl-\)  to terminate sml_tk.

val it = () : unit
-

As a test to see whether this works or not, download the problem set and start sml in that directory. Type in the following:

- use "test-gui.sml";
[opening test-gui.sml]
structure TestGUI : sig val test : unit -> unit end
val it = () : unit

If you see a small window with a text box and a quit button all is well. You should be able to type in the text box and then have the window title change on you.

OSX/non-x86 *nix

You will need to download the SML Tk source and compile it yourself. The source can be found at:
http://www.informatik.uni-bremen.de/~cxl/sml_tk/

and contains instructions for compilation.

In short, untar the source distribution and edit the Makefile in the top directory. Be sure to set the SMLTK_LIB and SMLTK_TCL paths to the appropriate values.

Enter a directory where the binaries will be put. Ensure that the directory exists before starting compilation. This is a frequent case for errors.

The Makefile defaults to SML/NJ. If you use any other distribution, like MoscowML, comment out the njml section and uncomment the appropriate section.

You are all set. At the command prompt, type "gmake" or "make" and pray.

If you need help creating a heap file for sml tk, please e-mail the course staff for help.