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