You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classifier-reborn is designed to work with or without
[GSL](https://www.gnu.org/software/gsl/) support.
https://github.com/jekyll/classifier-reborn/blob/99d13af5adf040ba40a6fe77dbe0b28756562fcc/docs/index.md?plain=1#L68
If GSL is installed, classifier-reborn will detect it and use it. If GSL
is not installed, classifier-reborn will fall back to a pure-ruby
implementation. The mechanism for doing so is in `lsi.rb`:
https://github.com/jekyll/classifier-reborn/blob/99d13af5adf040ba40a6fe77dbe0b28756562fcc/lib/classifier-reborn/lsi.rb#L7-L17
I think it's important to test the classifier-reborn gem with GSL
support in CI. One of my goals is to add similar support using `Numo`,
and I'd like that to be tested in CI as well, and I want to make sure I
don't do anything that could break existing GSL support. As far as I can
tell, GSL support was never tested in CI before now (though it was
previously discussed
[here](jekyll#46 (comment))).
I did find a comment about how to test with/without GSL enabled, but I
think this was only used for locally.
> to test the native vector class, try `rake test NATIVE_VECTOR=true`
So, in this PR, I'm expanding our text matrix to test with and without
GSL enabled by setting `NATIVE_VECTOR` to true or false. If
`NATIVE_VECTOR` is false, we need to install the `gsl` gem (which is not
included in our Gemfile since it's optional). Lucky for us, GitHub
already [includes libgsl as pre-installed
software](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#installed-apt-packages),
so we don't need to do anything special for the apt package.
Currently, GSL only works with Ruby 2.7. (One of the main reasons I want
to add support for Numo is because GSL is becoming difficult to
support.) As such, I've excluded other versions of ruby in our test
matrix for now.
While working on this, I noticed some tests in the LSI spec that return
early when `$GSL` is not enabled. It would be better for those tests to
report as skipped when GSL is not enabled (and this matches the pattern
of the redis tests, that report as skipped if redis isn't available).
0 commit comments