ruby - Ubuntu Saucy (13.10) 上的 Gsl gem

标签 ruby ubuntu gsl ubuntu-13.10

我正在尝试在 Ubuntu Saucy 上安装 gsl gem

我安装了相关的gsl包

sudo apt-get install gsl-bin libgsl0-dev

但是安装 gem 失败了

In file included from /usr/include/ruby-1.9.1/ruby.h:32:0,
                 from ../include/rb_gsl_array.h:34,
                 from wavelet.c:13:
wavelet.c: In function ‘rb_gsl_wavelet_define_const’:
wavelet.c:155:45: error: ‘forward’ undeclared (first use in this function)
   rb_define_const(klass, "FORWARD", INT2FIX(forward));
                                             ^
/usr/include/ruby-1.9.1/ruby/ruby.h:225:45: note: in definition of macro ‘INT2FIX’
 #define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                             ^
wavelet.c:155:45: note: each undeclared identifier is reported only once for each function it appears in
   rb_define_const(klass, "FORWARD", INT2FIX(forward));
                                             ^
/usr/include/ruby-1.9.1/ruby/ruby.h:225:45: note: in definition of macro ‘INT2FIX’
 #define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                             ^
wavelet.c:157:46: error: ‘backward’ undeclared (first use in this function)
   rb_define_const(klass, "BACKWARD", INT2FIX(backward));
                                              ^
/usr/include/ruby-1.9.1/ruby/ruby.h:225:45: note: in definition of macro ‘INT2FIX’
 #define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                             ^
wavelet.c: In function ‘rb_gsl_wavelet_transform0’:
wavelet.c:194:31: error: ‘forward’ undeclared (first use in this function)
   gsl_wavelet_direction dir = forward;
                               ^
wavelet.c: In function ‘rb_gsl_wavelet2d’:
wavelet.c:534:31: error: ‘forward’ undeclared (first use in this function)
   gsl_wavelet_direction dir = forward;
                               ^
make: *** [wavelet.o] Error 1

问题类似于这个问题:Problems installing gsl gem

虽然该线程的顶级解决方案不起作用 - gsl 1.14 的源包在该地址不再可用。我想这对许多使用 Saucy 的用户会有用。

最佳答案

接受的答案在 linked问题在 13.10 中为我解决了这个问题,并做了一些小改动。

curl -O  ftp.unicamp.br/pub/gnu/gsl/gsl-1.14.tar.gz 
tar xvzf gsl-1.14.tar.gz
cd gsl-1.14
./configure
make
sudo make install
sudo gem install --conservative --no-ri --no-rdoc gsl

显然,从“任何 FTP 服务器”安装包时应该小心 :)

关于ruby - Ubuntu Saucy (13.10) 上的 Gsl gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19808027/

相关文章:

ruby - 如何在 Ruby 中生成一个包含 n 个唯一随机数的列表?

mysql - rails : Why is 'rake secret' giving me an error?

linux - pm2 log-rotate with ansible

math - GSL/BLAS : Multiply a matrix with an inverse matrix

ruby-on-rails - 在 Rails 中显示未读帖子

ruby - 使用 MacPorts 在 Mac OS X 上安装 RMagick

ios - 无法将用户从 iOS 客户端注册到 Ejabberd 服务器 - XMPP

ubuntu - 从 nginx 的源代码编译时,http_ssl_module 安装失败

Ubuntu 上的 R BayesVarSel 安装

c - 使用 GSL 的 ODE 求解器相当于 "MaxSteps"是什么?