Open gtamba opened 8 years ago
Believe this is a duplicate of #522.
@gau27 Can you do the following, please?
rake clobber
rake compile
And look at the output, see if it finds rb_array_const_ptr()
(and let me know).
Then look in the nmatrix_config.h
file that gets generated (mine is in tmp/x86_64-darwin15/nmatrix/2.3.1
) and paste it here?
@mohawkjohn I'm unable to replicate the issue as in #522 , build works fine for just the NMatrix source. Only when I try to compile SpiceRub is this error showing up
Can confirm that this problem arises when trying to compile SpiceRub with NMatrix built from source as well as from Rubygems for Rubies 2.3.0, 2.3.1
. As Prasun said, removing the following lines from nmatrix.h
seems to solve the issue without breaking any tests of NMatrix
or SpiceRub
. I have no idea how this will impact previous versions though.
#ifndef HAVE_RB_ARRAY_CONST_PTR
static inline const VALUE *
rb_array_const_ptr(VALUE a)
{
return FIX_CONST_VALUE_PTR((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ?
RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr);
}
#endif
Bumping this since there's a proposed solution here, and it's relatively easy to test.
I was having this issue when I tried testing my gem on Ruby 2.3 and greater. The gem adds the
nmatrix.h
header to the native include path so that NMatrix objects can be created directly from C code. There is no problem with running NMatrix outside on a terminal or ruby scripts, it's just a macro clash that occurs whenSpiceRub
is buildingThis is the code from
extconf.rb
that locates the nmatrix header :-