ruby-numo / numo-narray

Ruby/Numo::NArray - New NArray class library
http://ruby-numo.github.io/narray/
BSD 3-Clause "New" or "Revised" License
418 stars 42 forks source link

"undefined symbol: rb_get_kwargs" crash for ruby 2.1 and numo-narray >= 0.9.0.5 #67

Closed lorosanu closed 7 years ago

lorosanu commented 7 years ago

Is ruby 2.1 still supported?

Crash on ruby 2.1 with numo-narray version >= 0.9.0.5

Using docker with ruby 2.1

FROM debian:jessie

RUN apt-get update \
 && apt-get install -y ruby ruby-dev make gcc \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

RUN gem install numo-narray

Simple code example

ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

irb
require 'numo/narray'
=> true

Numo::NArray::VERSION
=> "0.9.0.8"

a = Numo::DFloat[1, 2, 3]
=> Numo::DFloat#shape=[3]
[1, 2, 3]

a.sum

Crashes with the following message

irb: symbol lookup error: /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/numo-narray-0.9.0.8/numo/narray.so: undefined symbol: rb_get_kwargs

Works fine on ruby 2.1 with numo-narray version=0.9.0.4

Using docker with ruby 2.1

FROM debian:jessie

RUN apt-get update \
 && apt-get install -y ruby ruby-dev make gcc \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

RUN gem install numo-narray --version=0.9.0.4

Same code example

ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

irb
require 'numo/narray'
=> true

Numo::NArray::VERSION
=> "0.9.0.4"

a = Numo::DFloat[1, 2, 3]
=> Numo::DFloat#shape=[3]
[1, 2, 3]

a.sum
=> 6.0

Works fine on ruby 2.3 with latest numo-narray version

Using docker with ruby 2.3

FROM debian:stretch

RUN apt-get update \
 && apt-get install -y ruby ruby-dev make gcc \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

RUN gem install numo-narray

Same code example

ruby -v
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]

irb
require 'numo/narray'
=> true

Numo::NArray::VERSION
=> "0.9.0.8"

a = Numo::DFloat[1, 2, 3]
=> Numo::DFloat#shape=[3]
[1, 2, 3]

a.sum
=> 6.0
masa16 commented 7 years ago

rb_get_kwargs() exists since Ruby 2.1.0, but it is public since Ruby 2.2.0. Hmm...

masa16 commented 7 years ago

https://github.com/ruby-numo/narray/commit/8235aab55a170de88047a33cc16c34485bbfb79c This commit solves the problem.

lorosanu commented 7 years ago

That works, thanks a lot! Will there be a new release soon?

masa16 commented 7 years ago

Released. https://rubygems.org/gems/numo-narray/versions/0.9.0.9

lorosanu commented 7 years ago

thank you for your quick reply and fix!