These instructions are provided for those that need to recompile the runtime system, the SML/NJ compiler, or the other tools provided with the SML/NJ distribution.
You will need to install the SML/NJ executables from the self-installing executable provided in the distribution. This is necessary to install some of the required batch files to invoke the compiler.To unpack the distribution, you will need the Windows versions of the "GNU unzip" (gunzip) and "tape archive" (tar). These are freely available from ftp.cs.washington.edu:/pub/ntemacs/utilities.
Compiling the runtime system requires the following tools:
- MS Visual C++, 2.0 or later
- MS Assembler (MASM), 6.11 or later
- MS NMAKE (part of VC++), 1.50 or later
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).
Some steps in compiling the SML compiler source require 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. We will explicitly indicate which steps should be executed in the ksh below; assume all other steps are executed in the DOS command prompt.
- Determine the root directory for the SML/NJ installation on your system, and make it your current directory. For the purpose of exposition, we will assume the default directory, C:\SML. If you have installed the sell-installing .exe, there should be a subdirectory C:\SML\SRC.
- Download the runtime system sources and the SML/NJ compiler sources into C:\SML\SRC:
You may also wish to fetch some of the following optional components of the SML/NJ distribution:
110-runtime.tar.Z 110-sml-nj.tar.Z
110-cm.tar.Z Compilation Manager 110-smlnj-lib.tar.Z Standard ML of New Jersey Library 110-ml-burg.tar.Z ML-Burg code-generator generator 110-ml-lex.tar.Z ML-Lex lexical analyzer generator 110-ml-yacc.tar.Z ML-Yacc parser generator Note: Some ftp programs or browsers may change the names of the files as they are downloaded. For instance, "110-runtime.tar.Z" may be changed to "110-runtime_tar.Z", and in general, all but the last period in the name may be changed to underscores. This is harmless, as long as you recognize that the names have been changed and adjust the following instructions accordingly.- Uncompress and unbundle each of the distribution files:
C:\SML\SRC> gunzip 110-runtime.tar.Z C:\SML\SRC> tar -xvf 110-runtime.tar- Change to the SRC\SML-NJ directory
C:\SML\> cd src\sml-nj- Download the SML/NJ compiler binaries into C:\SML\SRC\SML-NJ:
110-bin.x86-win32.tar.Z - Uncompress and unbundle the binaries:
C:\SML\SRC\SML-NJ\> gunzip 110-bin.x86-win32.tar.Z C:\SML\SRC\SML-NJ\> tar -xvf 110-bin.x86-win32.tar
- Ensure that the compiler, assembler, and "make" utility are in your path.
- Compile the runtime by issuing
nmake /f mk.x86-win32in SML/NJ's src\runtime\objs directory, under the DOS command prompt (it won't work in ksh). This will create run.x86-win32.exe which is usually placed in the smlnj\bin\.run directory.
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
\sml\bin\.heap
SML/NJ tools are built analogously to the Unix versions. That is,
the command
build
is issued, under ksh, 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.