Ubuntu 9.10, Maxima, and wxMaxima

2009 November 2
by bmccosar

Continuing on the topic I presented in a previous article:

I’ve encountered my first aggravating problem with Ubuntu 9.10.  It took over a week, so that’s heartening.

The Ubuntu 9.10 version of Maxima (5.17.1, built with GCL 2.6.7 [ . .  somehow! see below]) doesn’t work.  It crashes with a bizarre error whenever it is asked to “solve” anything:

mccosar (1) -> ~
$ /usr/bin/maxima

Maxima 5.17.1 http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) solve(x^2 = 4,x);
Universal error handler called recursively (:ERROR NIL
    CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER
    ""
    "Couldn't protect")
Universal error handler called recursively (:ERROR NIL
    CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER
    "" "Couldn't protect")
Maxima encountered a Lisp error:

 Error in CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER [or a callee]:
 Caught fatal error [memory may be damaged]

Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.

Whoops!  OK, so something’s wrong.  That’s alright, my recent install of Sage includes Maxima 5.19.1 (compiled with an inbuilt ECL 9.8.4) — it works fine on its own, with no errors.

However, when I tried using it with wxMaxima, it wouldn’t work.

I’ll prove this later, but wxMaxima is really worth taking the time to get working right.

Search and Research

Research time.  I compiled my own version of Maxima 5.19.2, the latest and greatest, using SBCL (1.0.29.11.debian).  It worked fine, and was quite speedy!  But still didn’t work with wxMaxima.

OK.  The Ubuntu / Debian version of Maxima was compiled with GCL . . . I set out to do the same.  Problem: the GCL included with Ubuntu 9.10 [somehow!] wasn’t configured with --enable-ansi.  So in turn I tried to compile a new version of GCL . . . .

What a nightmare!  Gnu Common Lisp hasn’t been released since 2005.  I spent an hour trying to configure, reconfigure, update from CVS, and so on.

In the end, phooey.  GCL seems to be a defunct project (and don’t hand me that “there’s a lot of activity in CVS”, because there’s 0, zero, none, nil in terms of actual releases).

So as I mentioned above — how Debian compiled Maxima with GCL in the first place is a total mystery.  They must have a patch file as big as a hard drive partition.

Rethinking the Problem

Up until this point, it hadn’t occurred to me the problem might be in the Ubuntu version of wxMaxima.  In the modern era of computing, it’s relatively rare for a program to have a severe bug, and a program that uses that program to have an equally severe bug.  With tens of thousands of packages out there, the odds of two striking in the same chain are pretty low.

I guess I’m looking at some pretty compelling evidence it can still happen, however ;-)

I compiled wxMaxima 0.8.3a from source, and installed into /usr/local.

It worked FINE with the new version of Maxima (the one compiled with SBCL).

wxMaxima

If you haven’t had time to check out the combination of Maxima and wxMaxima — and if you’re even remotely interested in computer algebra systems — this system is a must-see.

Overall, the system reminds me of the Sage notebook (see previous article).  The pages you construct are interactive with the underlying Maxima system, and produce some nicely formatted mathematics.  The website itself has tutorials, which — get this — are downloadable as wxMaxima pages, making them totally interactive.

That alone is a win!  And the system itself is quite intuitive and easy to use.

Enough talk.  Time for a screenshot.  Below, I’m asking Maxima to evaluate a double integral (one of the problems from Tom Apostol’s Calculus, Volume II).  wxMaxima solves the problem exactly — notice it even outputs the answer as a fraction, not a decimal approximation.  However, it doesn’t do too well with formatting the double integral itself, which should read:

\int_0^1 dx \int_0^1 xy(x+y)\,dy

Screenshot

wxMaxima demo screenshot.

wxMaxima demo screenshot. Click image to enlarge.

3 Responses leave one →
  1. 2009 December 15

    Blahota István has kindly provided more up-to-date packages of (wx-)Maxima on his webpage, I’ve downloaded that and it seems to work nicely.
    However, my math output is far from as cute as yours – How do you get it to render so beautifully?

  2. 2009 December 15

    On the Edit -> Configure dialog, there is a tab called ‘Style’. Mine has a checkbox that says ‘use jsMath fonts.’ This box is checked on mine, and I also have the jsMath fonts installed.

    That’s about all I can tell you. It’s usually worked for me out of the box, but then I also have a number of math packages installed on this system — it could be one of them brought in a prerequisite that has somehow helped the entire thing to work. It happens from time to time.

    BTW, I see from your blog you’re studying astrophysics … which area interests you? From what I can see of your Wolfram Alpha post it looks like some sort of (I’d guess) neutron star calculation?

  3. 2009 December 16

    Hi;

    Yeah I played around with it a bit and it was indeed the JSMath fonts I needed to install. It renders nicely now – now I just need to know how I get TeXMacs to play with a version of Maxima that actually works on Ubuntu 9.10. I still think that combination is superior to anything else.

    YesI am an astrophysics student, and well spotted, the Wolfram Alpha post indeed used some examples of neutron star calculations from a class I had this spring/summer. It is a very interestig topic, but not many around here are doing it, so my main focus for the next year is going to be galactic astronomy, concentrated on the Dark Ages before formation of recent galaxies.

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS