wxMaxima

Maxima and wxMaxima on Mac OS X

This page describes how I compile Maxima (and gnuplot) so that I can use it with wxMaxima on Mac OS X.

Some information (but a bit outdated) is available here.

First you have to realise Maxima, wxMaxima and GNUPLOT are three completely separate standalone applications. wxMaxima depends on Maxima for its computations and plotting in Maxima is done by GNUPLOT. So for a 'usable' wxMaxima you will need at least a working Maxima, while GNUPLOT is required only if you want to do plotting (which you probably do).

There are 3 separate steps in getting wxMaxima + Maxima + GNUPLOT to work.

Compiling Maxima

Maxima is a program written in Common Lisp (which is a programming language like C, Python ...). So for compiling Maxima you will first need a 'Common Lisp implementation' - a kind of compiler for Common Lisp. There are several Lisps that work on Mac OS X. One popular implementation is SBCL, which is based on CMUCL (both work for Maxima). Other options include Clozure CL, ECL, ABCL, but they might be trickier to get to work so experiment with them on your own initiative.

So basicly you need a working SBCL or CMUCL on your machine. You can check if any of these two is already installed by opening Terminal (in Applications/Utilities) which gets you into a unix shell. To run SBCL execute the following line in terminal:

sbcl

To run CMUCL type

lisp

If any of these two commands gets you into a lisp prompt, you have a lisp alreay installed. You can try a lisp command and quit:

(+ 1 1)
(quit)

If you get "command not found" message, then there is no lisp installed (which is true for Mac OS X out of the box - i.e. if you haven't installed a lisp yourself).

Using CMUCL

wxMaxima can be used with maxima compiled with cmucl. To compile maxima using cmucl, do the following:

cd /usr/local
sudo tar xjf full-path-to-downloaded-binary
cd path-to-downloaded-file
tar xzf maxima-5.15.tar.gz
cd maxima-5.15
./configure --with-cmucl=/usr/local/bin/lisp
make
sudo make install
maxima
xmaxima

Using SBCL

wxMaxima can be used with maxima compiled with sbcl. Make sure that maxima is configured with

./configure --enable-sbcl --with-sbcl=<path to sbcl>

wxMaxima can also be used with maxima compiled with clisp and ecl.

Compiling wxMaxima.app

wxWidgets

To compile wxMaxima, you will first need wxWidgets, which is a GUI toolkit wxMaxima is using. Get the latest wxWidgets for Mac OS X (called wxMac) by either going to wxWidgets download page or try the direct link. Extract the archive either by using The Unarchiver and double clicking or by commandline application "tar":

cd ~/Desktop/
tar xzf wxMac-2.8.10.tar.gz

or

tar xf wxMac-2.8.10.tar

Again this works if you saved the archive onto your desktop (else you have to "cd path-to-archive"). "tar xzf" will extract archives with .tar.gz ending, while "tar xf" will extract archives with .tar ending. Now you should have a folder named "wxMac-2.8.10" (or something similar). Go to that folder in terminal:

cd ~/Desktop/wxMac-2.8.10/

(note that you can use TAB to autocomplete file and folder names) When you are in this folder, execute the following commands:

mkdir osx-build
cd osx-build
../configure --disable-shared --enable-unicode
make
sudo make install

When executing "sudo" command, you'll have to type in the password. If everything went allright, you should have wxWidgets installed now (which is cool). Now you can compile your own wxMaxima.app.

wxMaxima

Download source code of wxMaxima. You can use the link on the main page which will get you the latest *released* version of source code (note that at the time of writing this is wxMaxima 0.8.1 which won't work with Maxima 5.18.0 and newer) or you can download the newest code from SVN trunk here. Note however that the newest code might contain some bugs, since you're donwloading the source code developers are currently modifying. You can keep track of modifications on wxMaxima Trac.

When you have downloaded you .tar or .tar.gz archive of wxMaxima's source code, extract it with either The Unarchiver or with "tar" command in terminal. Go to the directory, that the archive extracted into, for instace:

cd ~/Desktop/trunk/

or

cd ~/Desktop/wxMaxima-0.8.1/

or something similar. Then execute commands:

./bootstrap
./configure --enable-printing --enable-unicode-glyphs
make
cd locales
make allmo
cd ..
make wxMaxima.app

Now you should have a brand new "wxMaxima.app" in that folder. Copy it to Applications or wherever you like with Finder. You can run it via double clicking, like other applications on Mac OS X.

You can delete folders with source code of wxMac and wxMaxima (there's no need to keep them around).

Run wxMaxima.app. It should run properly out of the box if your Maxima works from the Terminal.

If wxMaxima can't find Maxima: In Configuration you should modify the field "Maxima program" if your Maxima is installed somewhere else than in the usual location (/usr/local/bin/maxima), so wxMaxima can find Maxima executable. You can run in terminal:

which maxima

to get the path to your Maxima executable. Type that into "Maxima program" field.

Compiling gnuplot

For inline plotting wxMaxima requires gnuplot with support for the png terminal. First install AquaTerm. Now compile gnuplot 4.2 from source. Before gnuplot, the following libraries need to be compiled (in the order given below):

Each of these needs to be compiled from source. Download and unarchive the sources. In Terminal go to the source directory and enter

./configure
make
sudo make install

Now download the source for gnuplot 4.2 and compile and install it using above commands.

Configuration

I have the following in the file ~/.maxima/maxima-init.mac

gnuplot_command:"/usr/local/bin/gnuplot"$
set_plot_option([gnuplot_term, aqua])$

for plot2d, plot3d, draw2d and draw3d to work with AquaTerm. If your gnuplot is in some different location, put that instead of /usr/local/bin/gnuplot. You can also use X11 (which allows you to rotate plots) terminal if you set

set_plot_option([gnuplot_term, x11])$

and open X11.app (you have to have Apple Developer tools installed I think).

Powered by MediaWiki
Get wxMaxima at SourceForge.net. Fast, secure and Free Open Source software downloads
© 2006-2008 Andrej Vodopivec