OS X上的Ruby GSL

前端之家收集整理的这篇文章主要介绍了OS X上的Ruby GSL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图在OS X 10.9上安装 Ruby GSL.我使用RVM安装Ruby 2.0.0.根据它的 site,我需要先安装GSL.有了这个,我用Homebrew安装了GSL(brew install gsl).接下来,我做了gem install gsl,但是给出了以下错误消息:
compiling fft.c
fft.c:270:60: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
  for (i = 0; i < table->nf; i++) gsl_vector_int_set(v,i,table->factor[i]);
                              ~~~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~
fft.c:614:18: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
  shape[0] = n;
           ~ ^
fft.c:706:18: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
  shape[0] = n;
           ~ ^
fft.c:773:18: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
  shape[0] = n;
           ~ ^
fft.c:910:48: error: use of undeclared identifier 'forward'
  rb_define_const(mgsl_fft,"Forward",INT2FIX(forward));
                                           ^
/Users/yihangho/.rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                        ^
fft.c:911:48: error: use of undeclared identifier 'forward'
  rb_define_const(mgsl_fft,"FORWARD",INT2FIX(forward));
                                           ^
/Users/yihangho/.rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                        ^
fft.c:912:49: error: use of undeclared identifier 'backward'
  rb_define_const(mgsl_fft,"Backward",INT2FIX(backward));
                                            ^
/Users/yihangho/.rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                        ^
fft.c:913:49: error: use of undeclared identifier 'backward'
  rb_define_const(mgsl_fft,"BACKWARD",INT2FIX(backward));
                                            ^
/Users/yihangho/.rvm/rubies/ruby-2.0.0-p353/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                        ^
4 warnings and 4 errors generated.
make: *** [fft.o] Error 1

知道如何解决这个问题吗?

解决方法

最新版本的GSL不再包括向前和向前的枚举,用gsl_fft_forward和gsl_fft_backward以及gsl_wavelet_forward和gsl_wavelet_backward替换它们.

尝试应用此修补程序,它将旧的枚举替换为新的:https://github.com/mvz/rb-gsl-nmatrix/commit/fe7643cd3026690f7de527b2a220c24330a85018

猜你在找的Ruby相关文章