The Mozart Programming System is an open source implementation of Oz 3. This repository contains the upcoming version 2 of the system. The Website currently refers to the last stable version, which is 1.4.0.
This is a meta-repository that aggregates all the repositories of Mozart as submodules:
The purpose of this meta-repository is to link together commits of these subprojects that are globally coherent, and provide a unified, automated build process.
The Downloads page on GitHub features binary packages of the current state of development of Mozart 2.
These downloads must be considered as having alpha quality. They are certainly not ready for production, and only remotely ready for experimentation.
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 and Linux; or clang >= 3.1 on Mac OS
- cmake >= 2.8.6
- development version of Boost >= 1.49.0
- emacs
On Linux and Mac OS, use your favorite package manager to grab these tools.
On Windows, we recommend that you use the MinGW distro of nuwen.net, which is enabled for C++11 and Boost.
We suggest that you use the following directory layout, starting from a
directory <projects>
where you store your projects:
<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.
Mozart2 uses GTest and LLVM as subprojects. 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.
However, if you intend to have at least 2 builds of Mozart (which is likely: the debug build and the release build), it is better to compile them yourself once, and then use this only installation in all your builds of Mozart.
To build yourself, simply follow the steps below.
First download all the sources. Both projects use Subversion. If you use Windows, use the trunk version of LLVM instead.
projects$ cd externals
externals$ svn co http://googletest.googlecode.com/svn/trunk gtest
[...]
externals$ svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_31/final llvm
[...]
externals$ cd llvm/tools/
tools$ svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final clang
[...]
tools$ cd ../../..
projects$
Next, build the projects:
projects$ cd builds
builds$ mkdir gtest-debug
builds$ cd gtest-debug
gtest-debug$ cmake -DCMAKE_BUILD_TYPE=Debug ../../externals/gtest
[...]
gtest-debug$ make -j7 # adapt to your number of CPUs
[...]
gtest-debug$ cd ..
builds$ mkdir llvm-release
builds$ cd llvm-release
llvm-release$ cmake -DCMAKE_BUILD_TYPE=Release ../../externals/llvm
[...]
llvm-release$ make -j7
[...]
llvm-release$
As the Mozart repository contains submodules, you should clone recursively:
projects$ git clone --recursive git://github.com/mozart/mozart2.git
You can also fetch the submodules separately using:
mozart2$ git submodule update --init
The build process of Mozart is ruled by cmake. You must first configure your build environment:
builds$ mkdir mozart2-debug
builds$ cd mozart2-debug
mozart2-debug$ cmake -DCMAKE_BUILD_TYPE=Debug [OtherOptions...] ../../mozart2
The options must be given with the form -DOPTION=Value
. The table below
lists the options you need.
Option | Value | Required if |
---|---|---|
CMAKE_BUILD_TYPE | Debug or Release | Always |
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 |
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 effectively build Mozart, use make
:
mozart2-debug$ make -j7