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.1 --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.1 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.1/smlnj-<arch>-unix-2026.1.tgz
tar -xzf smlnj-<arch>-unix-2026.1.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 installers for macOS running on both AMD64 (x86-64) and Arm64 (AArch64).

Installing on macOS 15 Sequoia and Later

The installer packages work on macOS Sequoia, but they requires a more complicated process than for previous versions of macOS. Once you have downloaded the installer package, control-click on it and select "Open With" the Installer. Assuming that you are installing the AMD64 package, opening the package with the installer will cause a dialog window to pop up telling you that

"smlnj-amd64-2026.1.pkg" Not Opened
Apple could not verify "smlnj-amd64-2026.1.pkg" is free of
malware that that may harm your Mac or compromise your privacy.

Click the "Done" button, which will cause the popup window to disappear. Then open the "Settings" application and select the "Privacy & Security" tab. Scroll to the bottom and you should see a message that

"smlnj-amd64-2026.1.pkg" was blocked to protect your Mac.

Click the "Open Anyway" button, which should cause another popup window to open from the installer application. Click "Open Anyway" in that popup, which will then require you to authenticate. Once you have done so, the installer should run normally.