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.
http://paste.opensuse.org/view/raw/59263837And just for clarity here are the instructions they provided (not sure if you can see the images, you might need to be logged in, they are not important either way):
**Linux
**
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:
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_install_tk-dv_1.png
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_install_tk-dv_2.png
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_install_tk-dv_3.png
sudo apt-get install emacs
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_install_emacs_1.png
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_install_emacs_2.png
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_install_emacs_3.png
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:
export PATH=YOUR_PATH_TO_THE_MOZART_FOLDER/mozart/bin:$PATH
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_bashrc_1.png
https://studio.edx.org/c4x/LouvainX/Louv1.01x/asset/linux_bashrc_2.png
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)
emacs
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:
cd ~
mkdir mozart2
cd mozart2
mkdir externals
cd externals
svn co http://googletest.googlecode.com/svn/trunk gtest
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_34/final llvm
cd llvm/tools/
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_34/final clang
cd …/…/…
mkdir builds
cd builds
mkdir gtest-debug
cd gtest-debug
cmake -DCMAKE_BUILD_TYPE=Debug …/…/externals/gtest
make
cd …
mkdir llvm-release
cd llvm-release
cmake -DCMAKE_BUILD_TYPE=Release …/…/externals/llvm
make
cd …/…/
git clone --recursive git://github.com/mozart/mozart2.git
cd builds
mkdir mozart2-release
cd mozart2-release
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/
make
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.
Thanks a lot for this post but I really think thats too much to do, I will just stick with Mozart in an Ubuntu VM I’m sure it will help someone else though.