Why Mozart Oz

Aim of This Article

  • Build an Oz development enviroment

  • For Emacs heavy users: invoke Mozart Oz within Emacs (by M-x run-oz)

Download Mozart Oz

  • Windows: https://sourceforge.net/projects/mozart-oz/files/v1/1.4.0-2008-07-04-windows/

  • Linux: https://sourceforge.net/projects/mozart-oz/files/v1/1.4.0-2008-07-03-GENERIC-i386/

  • Mac OS: https://sourceforge.net/projects/mozart-oz/files/v1/1.4.0-2012-02-01-macosx/

Download Emacs

  • Windows: http://gnu.uberglobalmirror.com/emacs/windows/

  • Linux: http://gnu.uberglobalmirror.com/emacs/

  • Mac OS: https://emacsformacosx.com/emacs-builds/Emacs-25.3-universal.dmg

Installation

  • Windows, Mac OS:

Simply double-click and install it as usual.

  • Linux :
  1. Install dependencies:
sudo apt-get install flex bison tcl8.5 tcl8.5-developing lzip

# Install GNU MP

wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz

lzip -d gmp-6.1.2.tar.lz

tar -xvf gmp-6.1.2.tar

cd gmp-6.1.2

./configure

make

sudo make install
  1. Install Mozart For Linux x86 users, Mozart can be installed by:
sudo rpm -ivh mozart-1.4.0.20080704-16189.i386.rpm

or (for Debian based OS)

sudo alien -iv mozart-1.4.0.20080704-16189.i386.rpm

For Debian amd64 based System users:

# Convert x86 .rpm to .deb
sudo alien -g mozart-1.4.0.20080704-16189.i386.rpm

cd mozart-1.4.0.20080704

vi debian/control

# Add "amd64" in the Architecture field. The file may look like:
Architecture: i386, amd64

# Make .deb package
sudo debian/rules binary

# Install binary files:
sudo dpkg -i mozart-1.4.0.20080704-16189.i386.deb

Troubleshooting

Graphics Engine (tk.exe) crashed or could not be started

sudo apt-get install libx11-6:i386 libgmp10:i386

If this don’t work as well, then:

cd /usr/lib/mozart/platform/unknown-unknown
linux32 ./tk.exe

And you will get some error messages.

Libraries not found: lib32stdc++, tk8.4, tcl8.4

If the terminal shows:

./tk.exe: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

Then:

# Mozart is 32-bit application. Generally a 64-bit version libstdc++6 is installed in your computer.
sudo apt-get install lib32stdc++6

If the terminal shows:

w Tcl_AppInit failed: Can't find a usable init.tcl in the following directories: 
    /tmp/build-1.4.0/packages/linux-i486/lib/tcl8.4 /usr/lib/mozart/platform/lib/tcl8.4 /usr/lib/mozart/lib/tcl8.4 /usr/lib/mozart/platform/library /usr/lib/mozart/library /usr/lib/mozart/tcl8.4.19/library /usr/lib/tcl8.4.19/library /tmp/build-1.4.0/packages/linux-i486/lib/tcl8.4



This probably means that Tcl wasn't installed properly.

.
w invalid command name "wm"
.

This may cause by system version. Installing platform is recognized by “unknown-unknown”.

sudo ln -s /usr/lib/mozart/platform/unknown-unknown/wish/tcl /usr/lib/mozart/platform/lib/tcl8.4

sudo ln -s /usr/lib/mozart/platform/unknown-unknown/wish/tk /usr/lib/mozart/platform/lib/tk8.4

Cofigure Emacs

In your Emacs configuration files, i.e. .emacs or .emacs.d/init.el, add code below:

(or (getenv "OZHOME")
    (setenv "OZHOME" 
            "/usr/local/oz"))   ; or wherever Mozart is installed
(setenv "PATH" (concat (getenv "OZHOME") "/bin:" (getenv "PATH")))
 
(setq load-path (cons (concat (getenv "OZHOME") "/share/elisp")
                      load-path))
 
(setq auto-mode-alist 
      (append '(("\\.oz\\'" . oz-mode)
                ("\\.ozg\\'" . oz-gump-mode))
              auto-mode-alist))
 
(autoload 'run-oz "oz" "" t)
(autoload 'oz-mode "oz" "" t)
(autoload 'oz-gump-mode "oz" "" t)
(autoload 'oz-new-buffer "oz" "" t)

Attention, you need to change the path to the location Oz is exactly installed in your computer.

Oz Development Enviroment

;; Awake Oz by:
M-x run-oz

;; Or apply oz-mode on current buffer
M-x oz-mode
Run Mozart Oz within Emacs.
Run Mozart Oz within Emacs.

Have fun!