SML# Document Version 4.0.0
5 Installing SML#

5.1 Prerequisites

The part II provides tutorials to get started writing SML# programs. Let us begin by installing the SML# compiler and setting up a programming environment.

The SML# version 4.0.0 works on one of the following platforms.

  • Linux (amd64 (x86_64))

  • macOS (10.15 or later is recommended)

  • Windows 10 (Windows Subsystem for Linux)

SML# compiler requires the following software.

  • MassiveThreads 1.00

  • GNU Multiple Precision Arithmetic (GMP) library

  • LLVM 3.9.1 or above (LLVM 11.1.0 is recommended; the latest one available is preferrable)

MassiveThreads is a free software distributed under a BSD-style license. GMP is a free software distributed under LGPL(GNU Lesser General Public License). Yajl is a free software distributed under a variant of ISC license. LLVM is a open-source software distributed under Apache license version 2 with some exceptions.

LLVM version must be in version 3.9.1 or above. The latest LLVM available in your system is preferable. We confirmed that SML# works with up to LLVM 11.1.0. Compliing SML# with LLVM 3.8 or below shall fail.

All of these libraries and commands are required not only to build SML# but also to run the SML# compiler command and SML# programs. Note the following:

  • These libraries and commands are used to build SML#. The MassiveThreads and GMP libraries are liniked into the SML# compiler command. Libraries of LLVM is not linked into the SML# compiler.

  • After installation, the SML# compiler command uses opt, llc, llvm-as, and llvm-dis command for code generation.

  • The executable file of any user program compiled by the SML# compiler is linked with the MassiveThreads and GMP library, even if the program does not use the features of these libraries at all. We plan to fix this in upcoming releases.

Since these libraries and commands are not included in the SML# distribution package, you need to install them before installing SML#. In most cases, these can be easily installed by the package management system you use.

Below, we show the details of SML# installation steps for each of the supported operating systems.