wxMaxima on Mac OS X Yosemite 10.10 with MacPorts

How I got wxMaxima to work on Yosemite.

I recently switched from fink to MacPorts on one of my computers – an ageing 17″ MacBook Pro, because it seemed MacPorts would allow me easier access to GNU Radio.

One of the softwares I occasionally use is wxMaxima (a GUI shell around maxima). MacPorts can provide wxMaxima, and in theory all you need to do is

sudo port install wxmaxima

to get wxMaxima installed. However, that did not work: the GUI would not connect to the command-line program maxima.

From there things got bad, worse, disastrous as I got caught in MacPorts update loops and other problems as I tried to fix things.

Now, the machine carried a lot of history and crud, so I decided to start from scratch: clean install of Mac OS X 10.10.

After a few days of reinstalling, I finally came back to the same point: installing wxMaxima. Dismay: it did the same.

Maxima process terminated” in the status line, and “Not connected to Maxima!” when I tried to evaluate an expression.

So, I dug in. First I made sure wxMaxima was referring to the proper command line maxima.

I changed the wxMaxima preferences so it referred to /opt/local/bin/maxima (rather than the default maxima). No go.

Nothing in the various logs that could shed any light on the issue.

So I created a command line script called maxima in my personal bin folder, which resides in ~/bin. 

Then I changed the preferences in wxMaxima to refer to /Users/kris/bin/maxima instead of /opt/local/bin/maxima. 

(P.S. ‘kris’ is the name of my home directory. wxMaxima does not like the use of the tilde ~ as a shorthand for the home directory, so I had to spell it out: /Users/kris/bin/maxima instead of ~/bin/maxima).

In my script I had the following temporary hack:

/opt/local/bin/maxima "[email protected]" > /tmp/t.1 2>&1

This in an attempt to get a bit more info.

The contents of /tmp/t.1 gave me the necessary clue: maxima could not find sbcl.

sbcl is installed in /opt/local/bin by MacPorts, so it looked like a simple path problem.

My workaround: I now use a script /Users/kris/bin/maxima that contains

PATH=$PATH:/opt/local/bin; export PATH
/opt/local/bin/maxima "[email protected]"

(Don’t forget to chmod +x ~/bin/maxima or something similar).

Then I changed the wxMaxima preferences to refer to /Users/kris/bin/maxima instead of to /opt/local/bin/maxima

That made it work!