For Windows XP/Vista/7:
The easiest way to install SML/NJ on Windows machines is to use the self-installing executable:smlnj.msi.
- Login as administrator (the setup must define system environment variables).
- Launch the self-installing executable.
- 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:
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.
- 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.
- Download the config.tgz tarball and unpack it in the $SMLROOT directory using the command$ tar xzvf config.tgz
- [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.
- Execute the shell command:$ config/install.sh
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.
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 executableswhen 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-libsFor Red Hat Fedora (e.g. Fedora 16), you will need to install glibc-devel(i686):yum install glibc-devel.i686For 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.rpmwhere the libgcc-multilib package can be downloaded from the rpmseek web site (yum does not appear to know about this package).