Mozart Programming System v2
Oz C++ Scala Emacs Lisp CMake HTML Other
Latest commit 0c143af Nov 7, 2016 @sjmackenzie sjmackenzie committed on GitHub Merge pull request #286 from layus/checkArity
Ensure field unicity for records

Mozart-Oz v2

Join the chat at

The Mozart Programming System is an open source implementation of Oz 3. This repository contains the upcoming version 2 of the system.

The status of Mozart 2 is currently alpha quality. It is not ready for production, but it can be used for experimenting, testing, and obviously, for contributing.


Binary packages for Linux, Mac OS and Windows are built from time to time and made available on SourceForge.

Mac support is provided for 10.8.x and recent versions (2.x) of Aquamacs.

The binary distribution requires that you have installed Tcl/Tk 8.5 on your system.

Build instructions

This main Readme is shamefully biased towards Linux. Side-along Readmes are available for Mac OS, Windows, and OpenBSD.


In order to build Mozart 2, you need the following tools on your computer:

  • git and Subversion to grab the source code
  • java >= 1.6.0
  • gcc >= 4.7.1 on Windows, Linux and Mac OS < 10.8; or clang >= 3.1 on Mac OS >= 10.8
  • cmake >= 2.8.6
  • Boost >= 1.53.0 (with development files)
  • Tcl/Tk 8.5 or 8.6 (with development files)
  • emacs

For building CLANG/LLVM:

  • LibXML2-dev (tested with version 2.9.3)
  • OCaml-findlib
  • libCTypes-OCaml-dev (>= 0.4 - available in Debian Unstable as of Jan. 2016)

On Linux, use your favorite package manager to grab these tools. Refer to the specialized Readmes for recommendations on Mac OS and Windows.

Suggested directory layout

We suggest that you use the following directory layout, starting from a directory <projects> where you store your projects:

  + mozart2              // cloned from this repo
  + externals
      + gtest            // source of GTest (see below)
      + llvm             // source of LLVM (see below)
  + builds               // root for your builds
      + gtest-debug      // debug build of GTest
      + llvm-release     // release build of LLVM
      + mozart2-debug    // debug build of Mozart
      + mozart2-release  // release build of Mozart

Throughout the following instructions, we will assume this layout.

Obtaining GTest and LLVM

Mozart2 uses GTest and LLVM as subprojects, which you have to download and build prior to building Mozart 2.

Not recommended. If you do not want to mess with these, you can choose to skip this section, and let the automatic build process fetch them and build them for you. Use this "feature" at your own risk, because none of us tests this anymore, and we may decide to remove support for it at some point. First download all the sources. GTest uses Git, whereas LLVM uses Subversion.

projects$ cd externals
externals$ git clone gtest
externals$ svn co llvm
externals$ cd llvm/tools/
tools$ svn co clang
tools$ cd ../../..

Next, build the projects. Except on Windows (where parallel make does not work, it seems), we suggest you use the -jN option of make, specifying how many tasks make can run in parallel. Building LLVM is quite long, and this can significantly speed up the process.

projects$ cd builds
builds$ mkdir gtest-debug
builds$ cd gtest-debug
gtest-debug$ cmake -DCMAKE_BUILD_TYPE=Debug ../../externals/gtest
gtest-debug$ make # (optionally with -jN for a given N)
gtest-debug$ cd ..
builds$ mkdir llvm-release
builds$ cd llvm-release
llvm-release$ cmake -DCMAKE_BUILD_TYPE=Release ../../externals/llvm
llvm-release$ make # (optionally with -jN for a given N)

Clone the Mozart repository

As the Mozart repository contains submodules, you should clone recursively:

projects$ git clone --recursive git://

You can also fetch the submodules separately using:

mozart2$ git submodule update --init

Build Mozart

The build process of Mozart is ruled by cmake. You must first configure your build environment:

builds$ mkdir mozart2-release
builds$ cd mozart2-release
mozart2-release$ cmake -DCMAKE_BUILD_TYPE=Release [OtherOptions...] ../../mozart2

On distros like Arch Linux and Nixos, Boost static libraries have been removed. Please add -DMOZART_BOOST_USE_STATIC_LIBS=OFF to your cmake command.

Here is a NixOS expression to install the Mozart2 binary: nix-env -i mozart-binary

The options must be given with the form -DOPTION=Value. The table below lists the options you need.

OptionValueRequired if
CMAKE_BUILD_TYPE Debug or Release Always
CMAKE_INSTALL_PREFIX Where `make install` should install -
CMAKE_CXX_COMPILER Path to your C++ compiler Mac OS: must be forced to clang++
CMAKE_MAKE_PROGRAM Path to your make program Windows: must be forced to MinGW make
GTEST_SRC_DIR and GTEST_BUILD_DIR Paths to the source and build directories of GTest If not present, GTest will be downloaded and built automatically
LLVM_SRC_DIR and LLVM_BUILD_DIR Paths to the source and build directories of LLVM If not present, LLVM will be downloaded and built automatically
CLANG_SRC_DIR Paths to the source directory of CLANG Use this if cmake cannot find the CLANG sources
EMACS Path to the Emacs executable Required on Windows (on Unix it can be found automatically, in principle)
CPACK_GENERATOR Comma-separated list of generators for CPack Optional, see CPack documentation

To actually build Mozart, use make.

The same recommandation about using -jN holds. Building Mozart 2 is very long (especially when done from scratch). But beware, each task can be very demanding in terms of RAM. If you run out of RAM, decrease N.

mozart2-release$ make # (optionally with -jN for a given N)

Of course you can install with

mozart2-release$ make install