Getting Octave & GNUPlot to work on OSX Mavericks

I recently embarked on Coursera’s incredibly good machine learning course for which I needed to install Octave and GNUPlot on my MacBook Pro running OSX Mavericks (alas, my student MatLab license is soon to expire). This has been single handedly the most difficult install job I’ve ever gone through. I’m documenting what I did here more for myself. If you find it useful, great.

For the most part, Neil Traft’s blog post worked for me. If you haven’t yet tried out his advice, I recommend pausing here and trying it. It got me 80% the way there. However, while installing Octave’s many dependencies via homebrew, I stumbled across a persistent obstacle I haven’t seen documented anywhere else on the web.

EPS Tool wouldn’t install with homebrew. Even following a brew update and brew install -f epstool. I was still getting the same error about inconsistent SHA1 checksums. Taking a peak into '/Library/Caches/Homebrew' I saw that the downloaded .tar file was 1kB. Something was up. I tried to curl the URL myself (curl -O http://mirror.cs.wisc.edu/pub/mirrors/ghost/ghostgum/epstool-3.07.tar.gz) and still got the 1kb tarball. Plonking the URL in a browser as a last resort, I learnt the mirror was down.

This is what I saw when I chucked the tarball's url into my browser
This is what I saw when I chucked the tarball’s url into my browser

This set me on a quest to find that bloody tarball. In the process I learnt the links on the tool’s official site are also duds!. Finally I found a working link. So, if you want to install EPS Tool with home brew here’s how I did it:

# cd to Homebrew's cache dir
cd /Library/Caches/Homebrew
# download the tarball with a working link
curl -0 http://fossies.org/linux/misc/ghost/ghostgum/epstool-3.08.tar.gz
# install it
brew install epstool

From here onwards, things were pretty plain sailing. Two other gotchas worth noting are:

  1. When installing GNUPlot make sure you include the –with-x command line option (brew install gnuplot --with-x) (hat tip to Jatin Ganhotra’s very good blog post on this topic)
  2. make sure to reboot your machine after you think you’ve got everything in order. We have Neil Traft to thank once again for this nugget of wisdom.

Want to check your install, try plot(sombrero).

Woo Sombrero!
Woo Sombrero!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s