Skip to content

sjrd/mozart2

 
 

Repository files navigation

Mozart-Oz v2

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.

Downloads

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 and for Windows.

Requirements

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

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:

<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. Both projects use Subversion.

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_34/final llvm
[...]
externals$ cd llvm/tools/
tools$ svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_34/final clang
[...]
tools$ cd ../../..
projects$

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)
[...]
llvm-release$

Clone the Mozart repository

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

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 complete Nixos example cmake command to build Mozart2: cmake -DCMAKE_BUILD_TYPE=Release -DGTEST_SRC_DIR=../../externals/gtest -DGTEST_BUILD_DIR=../gtest-debug -DLLVM_SRC_DIR=~/.nix-profile/include/llvm -DLLVM_BUILD_DIR=~/.nix-profile/ -DCLANG_BUILD_DIR=~/.nix-profile/include -DCLANG_SRC_DIR=~/.nix-profile/ -DMOZART_BOOST_USE_STATIC_LIBS=OFF -DBOOST_INCLUDEDIR=~/.nix-profile/include -DBOOST_LIBRARYDIR=~/.nix-profile/lib -DMOZART_GENERATOR_FLAGS="-I/home/stewart/.nix-profile/include/c++/4.7.3;-I/home/stewart/.nix-profile/include/c++/4.7.3/x86_64-unknown-linux-gnu;-I/home/stewart/.nix-profile/include" -DCMAKE_INSTALL_PREFIX=~/oz ../../mozart2

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
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.

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

About

Mozart Programming System v2 (not usable yet)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 76.6%
  • Scala 13.8%
  • Emacs Lisp 9.3%
  • Shell 0.3%