Has anyone had any success with running Mozart for OZ? I am taking a course on edX and it involves using Mozart but I cannot get it to work for me. I tried it in an Ubuntu VM (their instructions are for Ubuntu) and it works fine so I am guessing my issue comes from something to do with tk version in opensuse. Here is the error I get when I try to run code.
Needed: tcl/tk, emacs and Mozart 2.
The first command install tk-dev, more precisely the last stable version of tk-dev. We do not guarantee that another version of tk-dev will work with Mozart in the future. The command is:
sudo apt-get install tk-dev
If a newer version of the package is installed, and this newer version is not compatible with Mozart, you can try these two commands:
sudo apt-get uninstall tk-dev
sudo apt-get install tk8.5-dev
The installation procedure of tk-dev should be like this:
sudo apt-get install emacs
Get the last Mozart 2 build for your system: [Builds on SourceForge](http://sourceforge.net/projects/mozart-oz/files/v2.0.0-alpha.0/).
Note: If you run a 32 bits system, you have to look for the corresponding build in the list and not simply click on the first link.
Unzip the downloaded file, rename it "mozart" (this will simplify the other steps) and change the PATH variable to add the Mozart path.
In order to do that, open the file ~/.bashrc and add, at the end of the file, the line:
In nano, type ctrl+o ("ctrl" and "o" pressed at the same time) to save, and then ctrl+x to quit.
You can now run the mozart OPI using the simple command: $oz
I wasn’t able to get the binaries provided by the mozart project to work. The website mentioned that mozart was known to work with tk-8.5 but may not work with other versions. But the binaries still did not work after downgrading tk from 8.6 to 8.5. A lot of other things no longer worked as well.
I was finally able to get mozart and oz up and running by building them from the source code. However, the directions they provide don’t work, there are a couple of errors during compilation because some files are not where the configuration thinks they should be.
To build mozart2 on suse 13.1 you will need:
git and Subversion to grab the source code
java >= 1.6.0
gcc >= 4.7.1
cmake >= 2.8.6
Boost >= 1.49.0 (with development files)
Tcl/Tk 8.5 or 8.6 (with development files)
If you install everything through the package manager all of the files should end up in the correct locations: /usr/bin for executables, /usr/lib64 for libraries and /usr/include for the dev files. Then the following sequence of commands will fetch the source, compile it and install it:
svn co http://googletest.googlecode.com/svn/trunk gtest
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_34/final llvm
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_34/final clang
cmake -DCMAKE_BUILD_TYPE=Debug …/…/externals/gtest
cmake -DCMAKE_BUILD_TYPE=Release …/…/externals/llvm
git clone --recursive git://github.com/mozart/mozart2.git
mkdir -p externals/Build/llvm/
cp -r …/llvm-release/* externals/Build/llvm/
cmake -DCMAKE_BUILD_TYPE=Release -DMOZART_BOOST_USE_STATIC_LIBS=OFF -DBOOST_INCLUDEDIR=/usr/include -DBOOST_LIBRARYDIR=/usr/lib64 …/…/mozart2
mkdir -p externals/Source/llvm/
cp -r …/…/externals/llvm/* externals/Source/llvm/
sudo make install
The make process is rather lengthy, if desired you can use the -jN option to make which allows make to run up to N concurrent threads. On my laptop with 4GB ram -j3 works fine but any more threads would have required too much memory. For some reason when running make install -prefix=~/mozart, the prefix is ignored, so you will not be able to install it in your home directory, and you will need root access to do make install. There’s probably a way to get that last part to work, but I couldn’t figure that out.