Introduction
These instructions are for installing Standard ML of New Jersey (SML/NJ) on macOS.
Using the installer package
The most direct way to install SML/NJ is to use one of the provided installer packages:
-
smlnj-x86-110.99.6.pkg (32-bits)
-
smlnj-amd64-110.99.6.pkg (64-bits)
These packages put the installation in /usr/local/smlnj
. If there is an
existing installation, then it will be updated. We recommend that you
add /usr/local/smlnj/bin
to your shell’s PATH
variable.
There is also a Homebrew cask that wraps the 64-bit installation package. If you have homebrew installed, then you can run the following command to install SML/NJ:
% brew cask install smlnj
If you have previously installed SML/NJ using Homebrew, then you will need to use the command
% brew cask upgrade smlnj
Installing from source
It is also possible to install SML/NJ from source code and the pre-compiled bin files. To do so, you will need a copy of Apple’s Xcode development environment. Furthermore, you will need to install the command-line tools, which you can do by running the command
% xcode-select --install
With the command-line tools installed, you can follow the standard instructions for installing on Unix/Linux systems.
Note
|
For macOS 10.13 High Sierra and earlier, the default install is 32-bits. Starting with macOS 10.14 Mojave, the default install is 64 bits. It is possible to install SML/NJ on Mojave, but it requires some extra steps (see the instructions below). |
Installing 32-bit SML/NJ on macOS 10.14 (Mojave)
Xcode 10.1 (and later) does not include the libraries needed to build 32-bit executables, such as the SML/NJ runtime.
To support building on Mojave, there is a special makefile (mk.x86-darwin18
)
for the runtime system and the config/install.sh
uses this makefile
when necessary. This makefile expects that the MacOSX10.13.sdk
directory
from Xcode 9 has been
copied into the Xcode 10 SDKs
directory. Note that updating Xcode
from the AppStore will remove the 10.13 SDK, so you should keep
a copy in a safe place.
The Xcode SDKs live in Platforms/MacOSX.platform/Developer/SDKs
under the Developer
directory. One can determine the path to the
current developer directory using the command
% xcode-select -p
Quarantine issues
Another issue that you may encounter when building from source on macOs 10.14 Mojave is an error message for a shell script of the form
/bin/sh: bad interpreter: Operation not permitted
This error arises because the shell script has the com.apple.quarantine
attribute set. To fix the problem, remove the attribute using the command
% xattr -d com.apple.quarantine shell-script
and resume the build.