Frequently Asked Questions about SML/NJ on Windows Platforms

New! Self-installing .EXE for Windows 95 or NT
What versions of Windows does SML/NJ run on?
Windows 95
Windows NT (versions 3.51 and 4.0)

How is the Windows version of SML/NJ distributed?
A single set of binaries (sml, sml-cm, ml-lex, ml-yacc, ml-burg) compatible with both Windows 95 and NT is available from: ftp.research.bell-labs.com:/dist/smlnj/

The SML/NJ developers are currently working on the next release; the current Windows working version is in the file:
ftp.research.bell-labs.com:/dist/smlnj/working/110/110-win32-smlnj.tar.gz
The Windows version of the compiler is fully integrated with the source distrbution. Therefore, you may also want to fetch the SML/NJ library:
ftp.research.bell-labs.com:/dist/smlnj/working/110/110-smlnj-lib.tar.Z

What tools are required to install SML/NJ on Windows?
Windows versions of the "GNU unzip" (gunzip) and "tape archive" (tar) programs are required to uncompress and unbundle.

(tar and gunzip for win32 are freely available from ftp.cs.washington.edu:/pub/ntemacs/utilities.)

Alternately, you can uncompress and untar on a Unix platform and then move the resulting directory to Windows (via removable media, shared files, etc.).

Now that I have the binaries, gunzip and tar, how do I do the install?
Select and create a directory for the installation. Here we'll use
	c:\smlnj\ 
but any valid directory name of your choosing will do.

Create an environment variable called SMLNJ_HOME and set it to c:\smlnj\

In NT, environment variables are usually set via ControlPanel->System. In Windows 95, they may be set per session with the DOS set command from a shell prompt or, more persistently, by placing a set command in the autoexec.bat startup file:

		set SMLNJ_HOME=c:\smlnj\
		set PATH=c:\smlnj\bin\

Place the 110-win32-smlnj.tar.gz file in c:\smlnj\
Uncompress this file; i.e.:
	c:\smlnj\> gunzip 110-win32-smlnj.tar.gz

Then untar the resulting tar file; i.e.:
	c:\smlnj\> tar -xvf 110-win32-smlnj.tar

This will create the c:\smlnj\bin\ subdirectory. This directory is structured similarly to the Unix distributions of SML/NJ. That is, scripts to run the compiler (sml, sml-cm) and the tools (ml-lex, ml-yacc, ml-burg) are in c:\smlnj\bin\, runtime executables are in c:\smlnj\bin\.run\ and heap images are in c:\smlnj\bin\.heap\

You may now want to put %SMLNJ_HOME%\bin\ in your PATH.

To conserve space, you can remove heap images (in %SMLNJ_HOME%\bin\.heap\) corresponding to unneeded tools. You can also use sml-cm in lieu of sml (and remove sml); however, sml-cm uses a bit more space (disk and memory).

How do I run the compiler under Windows?
From an MS-DOS prompt (or other shell), invoke the sml.bat, sml-cm.bat, ml-lex.bat, ml-yacc.bat or ml-burg.bat scripts to run the compiler and tools respectively.

Note that if you did not place %SMLNJ_HOME%\bin\ in your PATH, you will need to give a full path to the scripts; e.g.:
	c:\smlnj\bin\sml-cm

How does this version interact with the SML/NJ library?
The Windows version of the compiler is fully integrated with the source distrbution. Therefore, you may also want to fetch the SML/NJ library:
ftp.research.bell-labs.com:/dist/smlnj/working/110/110-smlnj-lib.tar.Z
To install it, create a SML/NJ src directory (i.e. c:\smlnj\src) and decompress and untar the above smlnj-lib distribution file there.

How do I create a Windows icon for SML/NJ?
We currently do not have a custom icon for SML/NJ. However, SML/NJ can be installed as a Windows program item and Windows will assign a generic icon.

NT 4.0 and Windows 95: use Explorer to locate the file for which an icon is desired (e.g. sml-cm.bat in the c:\smlnj\bin\ directory), select it, and create a shortcut for it (File->CreateShortcut). You can then rename this shortcut icon and place it elsewhere. Drag it to the desktop to place it there; click the right mouse button on the task bar and select Properties to place the SML/NJ icon in the Start menu.

NT 3.51: using the program manager, select the program group where you would like to install SML/NJ as an icon. Then select File->New->ProgramItem. As a Description, choose a label for the icon (e.g. "SML/NJ"). For the Command Line field, give the path to sml.bat (or sml-cm.bat); e.g.:
	c:\smlnj\bin\sml-cm.bat
Set the Working Directory to the directory in which you want SML/NJ to start.

How do I compile the SML/NJ compiler under Win32?

If you desire to modify the compiler itself, you'll need some additional tools to build it. (The executables in the distribution suffice for compiling SML programs.)

Compiling the runtime system requires the following tools:

It should be straightforward to build with other compilers, assemblers, and "make" utilities (see src\runtime\objs\makefile.win32 and src\runtime\objs\mk.x86-win32).

Compiling the SML compiler source requires ksh and common Unix tools (sed, grep). We use MKS Toolkit for this, although other ksh based toolkits should work directly as well; e.g. UWIN.

Here we assume that you have the SML/NJ compiler sources. (The Win32 version uses the same source tree as the Unix versions.)

Ensure that the compiler, assembler, and "make" utility are in your path.

Compile the runtime by issuing
    nmake /f mk.x86-win32
in SML/NJ's src\runtime\objs directory. This will create run.x86-win32.exe which is usually placed in the smlnj\bin\.run directory.

Compiling the compiler proper requires a set of "bin" files retargeted for Windows. For the x86, this directory is called bin.x86-win32 and is distributed as:
ftp.research.bell-labs.com:/dist/smlnj/working/110/110-bin.x86-win32.tar.Z
(You can create this set of bin files by retargeting the compiler, with CM, to cross-compile, e.g. from a Unix platform, to the win32 OS.) Place bin.x86-win32 in src\sml-nj. Set the working directory to src\sml-nj and, from a ksh prompt, issue the command:
    xmakeml -boot bin.x86-win32
This will produce the image sml.x86-win32 which is usually placed in bin\.heap

SML/NJ tools are built analogously to the Unix versions. That is, the command
    build
is issued in the respective tool directory. Note that SML/NJ's bin directory must be in the path for the default build command to find the compiler and tools.

Send comments or questions to sml-nj@research.bell-labs.com.
Created by Lorenz Huelsbergen on Wednesday, 9 Apr 1997.
Last modified: Thu Dec 11 10:10:13 EST 1997
Copyright © 1997, Lucent Technologies; Bell Laboratories.