Installing rb-gsl on Snow Leopard
Published on October 18, 2009 by Jesse Storimer
I wanted to try experimenting with SVD recommenders in Ruby (via this fantastic blog post http://www.igvita.com/2007/01/15/svd-recommendation-system-in-ruby/) and was having a hell of a time trying to install Ruby’s linalg. When I saw that there was also an example using rb-gsl, I was thrilled because rb-gsl is available from MacPorts. No problem, right? Wrong!
Currently if you try to install rb-gsl form MacPorts (on Snow Leopard) you will get a build error. If you download the latest release of rb-gsl (1.10.3 at the time of this writing) you will get the same build error. It appears to have some code that doesn’t work on Snow Leopard. Here is how I got it installed.
- If you haven’t already, install MacPorts for Snow Leopard (http://forums.macrumors.com/showthread.php?t=720035)
- Install the GSL library
$ sudo port install gsl plotutils
- Because of the incompatibility of the current rb-gsl and Snow Leopard, you will have to install from the latest svn checkout.
$ svn checkout svn://rubyforge.org/var/svn/rb-gsl
$ cd rb-gsl/trunk/rb-gsl
$ sudo ruby setup.rb config --prefix=/usr/local
- Then we need to edit two lines in the generated ext/Makefile
- Open up the file for editing and change these two lines to look like this:
DLDFLAGS = -L.
LDSHARED = $(CC) -pipe -bundle -undefined dynamic_lookup
- Then continue with the build and you should be on your way
$ sudo ruby setup.rb setup
$ sudo ruby setup.rb install