Make jekyll fast again: Compile rb-gsl on Arch Linux

In order to make this blog, I use jekyll. It's a great little thing that takes simple text files (using Markdown syntax in my case, more is supported) and turns them into the HTML files your browser is showing you now.

It's great, but awfully slow by default. This blog doesn't have a lot of content, yet it takes, well, too long for me to have actually waited for it. As a note nicely indicates though, using rb-gsl will speed things up immensely. It mentions 10 times faster results, but I'm pretty sure it's (much) much more than that for me.

Unfortunately, things didn't work so well recently, as I upgraded to ruby 2.0 The cost of living bleeding edge and all that, or something. Anyhow, rb-gsl wouldn't compile no more, making me a sad panda.

Here's the error I would get :

rb-gsl-1.14.7/ext/extconf.rb:245:in `<main>': undefined method `searcher' for Gem:Module (NoMethodError)

After some research, I figured this would be because the searcher method, or the GemPathSearcher object behind it, have been removed from the latest ruby. I don't know anything about ruby, but luckily was able to find a fork where this issue has been fixed.

Another error then popped out of course, though it came from C compilation this time (maybe linked to the new gcc version?) :

ieee.c:64:31: error: lvalue required as unary ‘&’ operand

This was fixed with the following patch:

  1. --- ext/ieee.c.org      2010-11-10 05:41:02.000000000 +0100
  2. +++ ext/ieee.c  2013-04-20 14:36:09.983516799 +0200
  3. @@ -61,7 +61,8 @@
  4.      rb_raise(rb_eTypeError, "wrong argument type %s (Float expected)",
  5.              rb_class2name(CLASS_OF(vtmp)));
  6.  #ifdef RUBY_1_9_LATER
  7. -  gsl_ieee_fprintf_double(fp, &(RFLOAT_VALUE(vtmp)));
  8. +  double _dbl = RFLOAT_VALUE(vtmp);
  9. +  gsl_ieee_fprintf_double(fp, &_dbl);
  10.  #else
  11.    gsl_ieee_fprintf_double(fp, &(RFLOAT(vtmp)->value));
  12.  #endif

And with that, rb-gsl is back, and jekyll is fast again with a fully up-to-date system. (Well, almost, kramdown 1.0 isn't supported.)

Top of Page