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

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...