Skip to content

Compilation error NMatrix-Lapacke plugin on Ubuntu 16.04 #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
prasunanand opened this issue Jun 12, 2016 · 4 comments
Closed

Compilation error NMatrix-Lapacke plugin on Ubuntu 16.04 #522

prasunanand opened this issue Jun 12, 2016 · 4 comments
Labels

Comments

@prasunanand
Copy link
Member

prasunanand commented Jun 12, 2016

bundle exec rake compile nmatrix_plugins=lapacke results in the following error:

prasun@ubuntudev:~/dev/nmatrix$ rake compile nmatrix_plugins=lapacke
install -c tmp/x86_64-linux/nmatrix/2.3.0/nmatrix.so lib//nmatrix.so
cp tmp/x86_64-linux/nmatrix/2.3.0/nmatrix.so tmp/x86_64-linux/stage/lib//nmatrix.so
cd tmp/x86_64-linux/nmatrix_lapacke/2.3.0
/usr/bin/make
compiling ../../../../ext/nmatrix_lapacke/nmatrix_lapacke.cpp
In file included from ../../../../ext/nmatrix_lapacke/nmatrix_lapacke.cpp:31:0:
../../../../ext/nmatrix_lapacke/../nmatrix/nmatrix.h: In function ‘const VALUE* rb_array_const_ptr(VALUE)’:
../../../../ext/nmatrix_lapacke/../nmatrix/nmatrix.h:95:1: error: redefinition of ‘const VALUE* rb_array_const_ptr(VALUE)’
 rb_array_const_ptr(VALUE a)
 ^
In file included from /home/prasun/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix_lapacke/nmatrix_lapacke.cpp:29:
/home/prasun/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/ruby.h:2018:1: note: ‘const VALUE* rb_array_const_ptr(VALUE)’ previously defined here
 rb_array_const_ptr(VALUE a)
 ^
Makefile:230: recipe for target 'nmatrix_lapacke.o' failed
make: *** [nmatrix_lapacke.o] Error 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/home/prasun/.rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:157:in `block (2 levels) in define_compile_tasks'
/home/prasun/.rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:156:in `block in define_compile_tasks'
/home/prasun/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/home/prasun/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => compile => compile:x86_64-linux => compile:nmatrix_lapacke:x86_64-linux => copy:nmatrix_lapacke:x86_64-linux:2.3.0 => tmp/x86_64-linux/nmatrix_lapacke/2.3.0/nmatrix_lapacke.so
(See full trace by running task with --trace)

After removing lines from ext/nmatrix/nmatrix.h

#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

compilations is successful.
ifndef should have ensured that rb_array_const_ptr is not defined again. Is this a bug?

@v0dro
Copy link
Member

v0dro commented Jun 12, 2016

I think the extconf is wrongly loading the HAVE_RB_ARRAY_CONST_PTR macro. Could you have a look at that?

@v0dro v0dro added the bug label Jun 12, 2016
@prasunanand
Copy link
Member Author

Yeah, I will do it 😄 .

@himkt
Copy link

himkt commented Jul 17, 2016

Hi, I got the same problem.

I also removed ```HAVE_RB_ARRAY_CONST_PTR''' macro and succeeded to install.

Are everything OK without this macro ?

@gtamba
Copy link

gtamba commented Aug 25, 2016

@prasunanand Hey Prasun does this error still occur with NMatrix 0.2.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants