Make jekyll fast again: Compile rb-gsl with Ruby 2.1

In order to make this blog, I use jekyll. It does the job quite well, but it's not the first time I find it's becoming a PITA to keep it updated and running.

Today it wasn't so much one of the many dependencies that caused issues though, but the very much required rb-gsl, if you don't want jekyll to take about 2 to 6 months to generate a small site like this one.

Arch Linux is now offering ruby 2.1, and rb-gsl doesn't compile anymore. Looking into it, I found a few reports of the errors I got, such as this one. Unfortunately, there was no solution.

So I kept looking, and found that recent changes in ruby caused this, and apparently one cannot set RBASIC(obj)->klass anymore, as it has been marked const.

From this I gather that a new macro - RBASIC_SET_CLASS - is apparently going to be added to fix such code, but even though the breaking was part of 2.1, the way to fix it wasn't. I'm sure there's a reason/excuse for that somewhere, but I didn't have time to look for it.

So instead, I just came up with some ugly hack to "fix" things so that it compiles again, adding the macro whenever it's needed, and using it. It could be done more properly, but I had spent enough time on this as this was. If you need it, here's the patch.

It should also be noted that while Arch Linux now has gsl 1.16, rb-gsl won't compile with it. I'm sure there's a way to fix it, but I just downgraded.

Top of Page