I am having a lot of trouble figuring out why my rb_define_singleton and rb_define_method calls are breaking when I run the command rake compile
.
Firstly, one problem might be that I am actuall not sure what the last integer argument actually represents in order to decide what value to use and I have not been able to find documentation which explains this, yet so I feel like I am just guessing there but the problem seems to be in the 3rd argument anyway so my concern is that
Secondly, my build fails with the following error on calling make
:
make compiling ../../../../ext/fftw/fftw.cpp ../../../../ext/fftw/fftw.cpp: In function 'void Init_fftw()': ../../../../ext/fftw/fftw.cpp:64:58: error: invalid conversion from 'VALUE ()(VALUE, VALUE) {aka long unsigned int ()(long unsigned int, long unsigned int)}' to 'VALUE ()(...) {aka long unsigned int ()(...)}' [-fpermissive] rb_define_singleton_method(cNMatrix, "r2c", fftw_r2c, 1); ^ In file included from /Users/private/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/ruby.h:1694:0, from /Users/private/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby.h:33, from ../../../../ext/fftw/fftw.cpp:1: /Users/private/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/intern.h:216:6: error: initializing argument 3 of 'void rb_define_singleton_method(VALUE, const char*, VALUE ()(...), int)' [-fpermissive] void rb_define_singleton_method(VALUE, const char, VALUE(*)(ANYARGS), int); ^ make: * [fftw.o] Error 1 rake aborted!
The error means I am not able to test the functions in ruby at all because I need to make this definition successful, first so I have stripped the file to the minimum to try and do that
So far I have tried casting with a variety of types, none of which seemed to work. I am beginning to suspect I am setting things up wrong in extconf with my flags and compiler choice, but I am not sure.
The source code for the failing file is on github
Any advice would be welcome! Thanks