Tuesday, April 22, 2008

Getting to grips with Scientific Computing Tools on a MAC-osX


For somebody who spent time (and I am not proud of it) on a win32 machine and was quite happy even from a 64bit machine to keep programming 32bit, and sending off code to the big UNIX machines, its a bit of a mixed bag to be sitting at a Mac OS X terminal. MacBookPro. For one it needs a lot of beer.
Then it needs Octave - for which there is a binary installer available. But to plot anything you need gnuplot- anybody with Linux or Cygwin will tell you that- how on Mac I pray- well get the gnuplot precompiled file. Set the .profile files to set the path to the applications:

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

Oh, and as you might discover you have bash shell (mac OS X 10.5.*) but no .profile or .bash_profile file, then make it and add those lines to it. Kippis! Shanti.

Well. The Octave user list was VERY useful in fixing that. Here is the fix:

//------------------------
The alias command sets up a variable that applies only in your shell.
It won't help octave find gnuplot. You probably need to set up a symbolic
link to gnuplot in some directory on your path. Try:

ln -s /Applications/gnuplot/Gnuplot.app/Contents/Resources/bin/gnuplot \
/usr/local/bin/gnuplot

If this complains about permission precede this with a sudo and enter your
password when prompted.
//------------------------
"Mein f******, I can plot again", to rephrase Dr. Stragelove or Doktor Merkwuerdigliebe from Dr. Strangelove.

No comments: