SML/NJ Installation Notes

For Windows XP/Vista/7:

The easiest way to install SML/NJ on Windows machines is to use the self-installing executable:

smlnj.msi.
  1. Login as administrator (the setup must define system environment variables).
  2. Launch the self-installing executable.
  3. Follow the provided instructions.

After running the Windows installer, you can find the compiler under the Start menu in Windows 7 or earlier or Windows 10, as a program named "SML of New Jersey". In Windows 8 or 8.1, you will find it listed alphabetically as "SML of New Jersey" in the "Apps by name" window (in the tiles interface (formerly known as "Metro"), move your mouse under the lower-left corner of the left block of tiles until a circle with a down arrow appears, then click this circle to get to the Apps page).

Instructions for manually compiling SML/NJ on Windows using Visual C++ will be provided in an update of this page [dbm].

For Unix machines:

  1. Create an SMLROOT directory for the installation (e.g., SMLROOT=/usr/local/sml) in a place where it is appropriate to install software packages. On some machines administrator privileges may be required to create the new sml directory in a public directory like /usr/local or /opt, but if necessary you can always install sml in a subdirectory of your own home directory.
  2. Download the config.tgz tarball and unpack it in the $SMLROOT directory using the command
    $ tar xzvf config.tgz
    
  3. [Optional] If you wish to customize the installation to include more or fewer components than the default, edit the file config/targets, commenting out any targets that you do not want to install or removing comment characters from components that you want to add. However, editing config/targets is not required or recommended for first-time users.
  4. Execute the shell command:
    $ config/install.sh
    
The install.sh command will download the necessary sources and binaries for the current architecture and operating system, unpack them, compile the runtime system, build the sml compiler (bin/sml) and compile the SML/NJ libraries and tools. These are installed in the subdirectories bin and lib of $SMLROOT.

If you have multiple hardware/operating system platforms sharing the same file system, you can run config/install.sh on each platform. The various architecture/os specific versions of the executables and libraries can coexist in the same $SMLROOT directory. The installation process creates the following subdirectories in the installation directory:
config - the configuration tools
bin - shell scripts for running sml and the tools
bin/.run - contains the runtime systems
bin/.heap - contains the heap images
lib - compilation-manager sources files for the various libraries
src - the source code; installing libraries also leaves the precompiled library code in this subtree.

TROUBLESHOOTING

The most likely problems arise while compiling the runtime system. You may need to edit the architecture/operating system specific makefile. You can find these files in the directory SMLROOT/src/runtime/objs. They are named mk.- (e.g., mk.x86-unix, mk.ppc-unix). They are currently set up to use the gcc on Unix systems (including Mac OS X and Linux) and Visual C++ on Windows.

If you are installing on 64-bit Linux systems, you may have to install 32-bit compatibility libraries in order to compile the runtime system, which is 32-bit code. Some 64-bit Linux systems are not configured with 32-bit support by default. In such a case, you may get the message

	!!! SML/NJ requires support for 32-bit executables
when running config/install.sh. To fix this problem, you will need to acquire the 32-bit emulation libraries for your particular Linux distribution. For Debian and Ubuntu, you will need two packages: gcc-multilib, and ia32-libs. These can be installed using apt-get:
      apt-get install gcc-multilib ia32-libs
For Red Hat Fedora (e.g. Fedora 16), you will need to install glibc-devel(i686):
      yum install glibc-devel.i686
For Red Hat Enterprise Linux (or CentOS) 6.2, you may also have to install the rpm package libgcc-multilib, e.g.:
      rpm -ivh libgcc-multilib-4.4.2-5.x86_64.rpm
where the libgcc-multilib package can be downloaded from the rpmseek web site (yum does not appear to know about this package).

| SML/NJ Home Page |

Send your comments to .
Copyright © 2003, The Standard ML Fellowship.