gpt4 book ai didi

OS X 上的 Ruby GSL

转载 作者:数据小太阳 更新时间:2023-10-29 06:55:05 25 4
gpt4 key购买 nike

我正在尝试在 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 不再包含枚举 backwardforward,取而代之的是 gsl_fft_forwardgsl_fft_backwardgsl_wavelet_forwardgsl_wavelet_backward

尝试应用此补丁,用新枚举替换旧枚举:https://github.com/mvz/rb-gsl-nmatrix/commit/fe7643cd3026690f7de527b2a220c24330a85018

关于OS X 上的 Ruby GSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20387310/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com