This is the main development repository for SML/NJ. We are currently reworking many components of the system, so it is not very stable. For most uses, we recommend the legacy version of the system.
As of the 2025.1 release, this version is known to work on AMD64 (a.k.a. x86-64) hardware running Linux or macOS, and on Arm64 (a.k.a. AArch64) hardware running macOS.
To build the system from sources, you must have several common software systems installed on your machine.1
-
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).
The process for building the system from source code has changed from the legacy system.
-
Set
VERSION
to the version of SML/NJ that you want to build; for exampleVERSION=2025.1
-
Clone the repository
git clone --depth 1 --branch v$VERSION --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. -
build the installation
cd smlnj ./build.sh
Use
build.sh -h
to see the list of options accepted by the build script.As of version 2025.1, the
build.sh
script will download the pre-compiled boot files is they are not present.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.
The process of recompiling the system from source code is fairly similar to before.
-
Switch to the
system
directory and run thecmb-make
command:cd system ./cmb-make ../bin/sml
The "
../bin/sml
" argument is optional; if omitted, then thesml
command in the user'sPATH
will be used. Once can also specify a different path to ansml
command, when appropriate. -
Bootstrap the system
./makeml
-
Install the system
./installml -clean -boot
The
-boot
option is new (and optional); it causes the existing boot files in the root directory (e.g.,boot.amd64-unix.tgz
) to be replaced by the files generated by thecmb-make
command. -
Rebuild the libraries and tools
cd .. ./build.sh
Footnotes
-
We provide installer packages for macOS that avoid these dependencies. ↩