These instructions are for installing the development version of Standard ML of New Jersey (SML/NJ) on Unix and Unix-like operating systems (including Linux and macOS).

Install from Sources

Dependencies

To build the system from sources, you must have several common software systems installed on your machine.

  • C++17 — You need a C++ compiler, such as clang or gcc, that can handle C++17.

  • CMake — You need Version 3.23 or later of CMake.

  • Autoconf — Parts of the documentation and the ASDL tool require the GNU autoconf tool (version 2.71 or later).

Installation Steps

Assuming that you have the necessary tools installed, you can either clone the repository or download and unpack one of the source tarballs. In either case, the process for building the system is the same once you have acquired the source code.

Cloning the Repository

To clone the repository, use the following command:

git clone --depth 1 --branch v2026.2 --recurse-submodules https://github.com/smlnj/smlnj.git

The --depth option limits the download to just one commit (i.e., no history), the --branch option specifies the version of the source code that you are requesting, and the --recurse-submodules option is necessary to fetch the customized version of the LLVM library that we use.

Note that you can also clone the entire repository and then switch to the v2026.2 tag.

Also note that the repository does not contain the boot files that are necessary to bootstrap the compiler. These files are downloaded as part of running the build.sh script below (when they are not present). If you need a distribution that you can build without network access, then download one of the source distributions.

Downloading a Source Tarball

You can either click on the appropriate link on the distribution-files page or use a shell command (e.g., curl or wget) to download the file.

For example, the commands

curl -O https://smlnj.org/dist/working/2026.2/smlnj-<arch>-unix-2026.2.tgz
tar -xzf smlnj-<arch>-unix-2026.2.tgz

will download and unpack the sources for <arch> (which should be either amd64 or arm64).

Build the System

Once you have either cloned the repository or unpacked the source distribution, we can build the system with the following commands:

cd smlnj
./build.sh

Use build.sh -h to see the list of options accepted by the build script.

As before, you can modify the config/targets file to add/remove components from the build.

After successful running of the build.sh script, bin/sml will be the interactive system.

macOS Installation Packages

We provide notarized installers for macOS running on both AMD64 (x86-64) and Arm64 (AArch64) systems.