ruby-fann
ruby-fann copied to clipboard
1.4.1 gem fails to build
gem install ruby-fann Fetching ruby-fann-1.4.1.gem Building native extensions. This could take a while... ERROR: Error installing ruby-fann: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib64/ruby/gems/3.1.0/gems/ruby-fann-1.4.1/ext/ruby_fann
/usr/bin/ruby31 -I /usr/lib64/ruby/site_ruby/3.1.0 extconf.rb checking for doublefann.h... yes creating Makefile
current directory: /usr/local/lib64/ruby/gems/3.1.0/gems/ruby-fann-1.4.1/ext/ruby_fann make DESTDIR= sitearchdir=./.gem.20240104-9581-49ow02 sitelibdir=./.gem.20240104-9581-49ow02 clean rm -f rm -fr ruby_fann.so false *.o .bak mkmf.log ..time
current directory: /usr/local/lib64/ruby/gems/3.1.0/gems/ruby-fann-1.4.1/ext/ruby_fann
make DESTDIR= sitearchdir=./.gem.20240104-9581-49ow02 sitelibdir=./.gem.20240104-9581-49ow02
clang -I. -I/usr/include/ruby-3.1.0/x86_64-linux -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -DHAVE_DOUBLEFANN_H -fPIC -O2 -pipe -fno-strict-aliasing -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fPIC -o ruby_fann.o -c ruby_fann.c
In file included from ruby_fann.c:3:
In file included from ./doublefann.h:31:
./fann.h:116:6: warning: '_MSC_VER' is not defined, evaluates to 0 [-Wundef]
#if (_MSC_VER > 1300)
^
ruby_fann.c:307:33: error: incompatible integer to pointer conversion passing 'VALUE' (aka 'unsigned long') to parameter of type 'void ' [-Wint-conversion]
fann_set_user_data(ann, self);
^~~~
./fann.h:544:72: note: passing argument to parameter 'user_data' here
FANN_EXTERNAL void FANN_API fann_set_user_data(struct fann ann, void user_data);
^
ruby_fann.c:759:33: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32]
for (i = neuron_it->first_con; i < neuron_it->last_con; i++) {
~ ~~~~~~~~~~~^~~~~~~~~
ruby_fann.c:760:73: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
rb_ary_push(connection_array, INT2NUM(f->connections[i] - f->first_layer->first_neuron));
~~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ruby_fann.c:1581:5: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE ()(VALUE)' (aka 'unsigned long ()(unsigned long)') [-Wincompatible-function-pointer-types]
rb_define_method(m_rb_fann_standard_class, "get_neurons", get_neurons, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
#define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
^~~~~~
/usr/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char )
^
/usr/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(VA_ARGS, VALUE()(VALUE), int);
^
ruby_fann.c:1681:5: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE ()(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
rb_define_method(m_rb_fann_shortcut_class, "get_neurons", get_neurons, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
#define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
^~~~~~
/usr/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char )
^
/usr/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(VA_ARGS, VALUE()(VALUE), int);
^
3 warnings and 3 errors generated.
make: *** [Makefile:247: ruby_fann.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib64/ruby/gems/3.1.0/gems/ruby-fann-1.4.1 for inspection. Results logged to /usr/local/lib64/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0/ruby-fann-1.4.1/gem_make.out
after rebuilding dev-lang/ruby-3.1.4-r3::gentoo with gcc gem installs ruby-fann
See fix in last comment. Closing.