Octave 3

Today I tried to run Octave on my Intel iMac at work and got this error message:

dyld: Library not loaded: /usr/local/lib/octave-2.9.9/liboctinterp.dylib
  Referenced from: /usr/local/bin/octave
  Reason: no suitable image found.  Did find:
  /usr/local/lib/octave-2.9.9/liboctinterp.dylib: stat() failed with errno=62
  /usr/local/lib/liboctinterp.dylib: stat() failed with errno=62

This was the first time I’ve run Octave since upgrading the iMac to Leopard, so I suspect there’s been some change in library handling. If I were smarter, or more persistent, I could have spent some time researching the error message and probably would have learned how to get it running again. But since there’s a newer version of Octave now available, I decided to install that instead.

A prebuilt binary of Octave 3.0.0 for the Macintosh can be found at Octave-Forge. It comes as a disk image (dmg) file, and there’s one for Intel Macs and one for PowerPC Macs. You open the disk image and drag Octave.app into your Applications folder, just like any normal Mac application. You can then double-click on it, or launch it via LaunchBar or Quicksilver, and it will open the Terminal and start an Octave session. Which is kind of interesting for a command-line program.

Generally, though, I prefer to start Octave from within an already-running Terminal session. Since the new Octave binary isn’t in my path, I can’t just type octave into the Terminal and get it to launch. So I added this line to my .zshrc file:

alias octave=/Applications/Octave.app/Contents/Resources/bin/octave

I could have added that bin directory to my $PATH, but I wanted to try using an alias instead. The zsh shell allows tab completion on aliases, so I don’t have to type out the full o-c-t-a-v-e. By default, the bash shell doesn’t allow tab completion on aliases, but there’s an extension that will add that feature.

I’m looking forward to trying out Octave’s new sparse matrix support. Last summer, I wrote several special-purpose finite element programs in Octave and might have had shorter runtimes if sparse matrices had been available.

Included in the Octave disk image is a disk image for installing Gnuplot 4.2.2, which is its latest version. This is installed the same way, by dragging Gnuplot.app into the Applications folder. And I added

alias gnuplot=/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot

to my .zshrc file so I could run it directly from the command line.

A bit of playing revealed an odd thing about the Octave/Gnuplot combination: If I start Gnuplot from the command line, the “terminal type” is set to “aqua,” and plots appear in an AquaTerm window. But if I issue a plotting command from within Octave, the plots appear in an xterm window under the X11 application. I have nothing against X11, but I prefer the look of AquaTerm. The solution was to add this line to .zshrc:

export GNUTERM=aqua

Now plot commands within Octave also use AquaTerm.

Although I’m quite happy with these versions of Octave and Gnuplot, I have to say they have the ugliest icons in my Applications folder.

Tags: