本文介绍了安装gsl gem时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以成功地将gsl库安装到我的主目录中,但是当我尝试安装gsl gem时,我收到了一大堆我不明白的错误。我想知道如果有人能给我一些想法,为什么我可以得到这些错误。我可以说我有:

安装gsl成功;至少这是它的样子。
我将路径指向gsl-config



这就是错误日志的样子:

 构建原生扩展。这可能需要一段时间... 
错误:安装gsl时出错:
错误:无法构建gem本机扩展。

/home/ted/ruby-1.9.1/bin/ruby extconf.rb安装gsl
检查gsl版本... 1.15
检查gsl cflags ... -I /home/ted/gsl-1.15/include
检查main()in -lcblas ... no
检查gsl库... -L / home / ted / gsl-1.15 / lib -lgsl -lgslcblas -lm
检查round()... no
检查rngextra / rngextra.h ... no
检查qrngextra / qrngextra.h ... no
检查ool / ool_version.h ...否
检查tensor / tensor.h ...否
检查jacobi.h ...否
检查gsl / gsl_cqp。 h ... no
检查gsl / gsl_multimin_fsdf.h ... no
在-lgsl中检查gsl_poly_solve_quartic()... no
在-lgsl中检查gsl_eigen_francis() no
检查ndlinear / gsl_multifit_ndlinear.h ...否
检查alf / alf.h ...否
检查rb-gsl版本... 1.14.7
检查ruby版本... 1.9.1
检查图形... no
检查narray.h ...是
检查tamu_a nova / tamu_anova.h ... no
检查main()in -ltamuanova ... no
创建Makefile

make
gcc -I。 -I / home / ted / ruby​​-1.9.1 / include / ruby​​-1.9.1 / ruby​​ / backward -I / home / ted / ruby​​-1.9.1 / x86_64-linux -I / home / ted / ruby​​-1.9.1 /home/ted/ruby-1.9.1/include/ruby-1.9.1 -I。 -DHAVE_NARRAY_H -I / home / ted / ruby​​-1.9.1 / lib / ruby​​ / gems / 1.9.1 / gems / narray-0.6.0.1 /。 -I / home / ted / ruby​​-1.9.1 / lib / ruby​​ / site_ruby / 1.9.1 / x86_64-linux -fPIC -Wall -I ../ include -I / home / ted / gsl-1.15 / include -o sf_bessel.o -c sf_bessel.c
从sf_bessel.c包含的文件中:13:
../include/rb_gsl_sf.h:15:24:error:gsl / gsl_sf.h:没有这样的文件或目录
../include/rb_gsl_sf.h:16:27:错误:gsl / gsl_errno.h:没有这样的文件或目录
../include/rb_gsl_sf.h:17:28:错误:gsl / gsl_vector.h:没有这样的文件或目录
从../include/rb_gsl_sf.h:18包含的文件中,从sf_bessel.c获得
:13:
/ home / ted /gsl-1.15/include/gsl/gsl_math.h:23:25:错误:gsl / gsl_sys.h:没有这样的文件或目录
在sf_bessel.c包含的文件中:13:
.. /include/rb_gsl_sf.h:19:29:error:gsl / gsl_complex.h:没有这样的文件或目录
在../include/rb_gsl.h:20包含的文件中,
from .. /include/rb_gsl_sf.h:21,从sf_bessel.c获得
:13:
../include/rb_gsl_common.h:23:28:error:gsl / gsl_matrix.h:没有这样的文件或目录
../include/rb_gsl_common.h:24:33:error:gsl / gsl_permutation.h:没有这样的文件或目录
../include/rb_gsl_common。 h:25:32:error:gsl / gsl_ieee_utils.h:没有这样的文件或目录
在../include/rb_gsl.h:20包含的文件中,$ ..b $来自../include/rb_gsl_sf。 h:21,来自sf_bessel.c的
:13:
../include/rb_gsl_common.h:322:警告:在'gsl_complex'声明中键入默认值为'intint'
../include/rb_gsl_common.h:322:错误:期望在'*'令牌之前的',','或')
../include/rb_gsl_common.h:324:错误:期望的,,,,asm或者†€~_attribute__在'*'令牌
../include/rb_gsl_common.h:325之前:错误:预期的')''之前'*'令牌
../include/rb_gsl_common.h:326:错误:期望在'*'令牌$ b $之前,'','','','asm'或'_attribute__' b ../include/rb_gsl_common.h:328:错误:期望的,,,,asm或_attribute__ €™之前'*'令牌
../include/rb_gsl_common.h:329:错误:预期的')''之前的'*令牌
。 ./include/rb_gsl_common.h:330:错误:期望的,,,,asm或_attribute__在'*'令牌
../include/rb_gsl_common.h:340之前:错误:预期的',',',';' ,asm或_attribute__在binary2complex之前
在../include/rb_gsl.h:21包含的文件中,
来自../include/ rb_gsl_sf.h:21,来自sf_bessel.c的
:13:
../include/rb_gsl_math.h: (错误:预期)'之前'('令牌
在../include/rb_gsl.h:22包含的文件中,
来自../include/ rb_gsl_sf.h:21,来自sf_bessel.c的
:13:
../include/rb_gsl_complex.h:19:34:错误:gsl / gsl_complex_math.h:没有这样的文件或目录

...

  sf_bessel.c:643:错误:'gsl_sf_bessel_zero_J1_e'未声明(首次在此函数中使用)
sf_bessel.c:在函数'rb_gsl_sf_bessel_zero_Jnu'中:
sf_bessel.c:648:错误:'gsl_sf_bessel_zero_Jnu'未声明(在此函数中首次使用)
sf_bessel.c:在函数中--rb_gsl_sf_bessel_zero_Jnu_e†™:
sf_bessel.c:653:错误:'gsl_sf_bessel_zero_Jnu_e'未声明(首次在此函数中使用)
make:*** [sf_bessel.o]错误1


Gem fil es将保持安装在/home/ted/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/gsl-1.14.7进行检查。
结果记录到/home/ted/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/gsl-1.14.7/ext/gem_make.out
安装ruby GSL:

安装ruby GSL: 11.10包含libgsl0的更新版本(1.15),它与ruby / gsl不兼容:
$ b

必须安装旧版本1.14 for ruby​​ / gsl work:

  curl -O http://mirror.veriportal.com/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

安装工程确定并在Ubuntu和Debian Squeeze上测试:

 获取:narray-0.6.0.1.gem(100%)
构建原生扩展。这可能需要一段时间...
获取:gsl-1.14.7.gem(100%)
构建本机扩展。这可能需要一段时间...
成功安装了narray-0.6.0.1
成功安装了gsl-1.14.7
安装了两块宝石


I can succesfully install the gsl library in my home directory, but when I try to install the gsl gem I get a big list of errors that I do not understand. I am wondering if someone could give me some idea why I could be getting those errors. I can say I have:

Installed gsl succesfully; at least that is what it looked like.I pointed the path to gsl-config

This is what the error log looks like:

  Building native extensions.  This could take a while...
  ERROR:  Error installing gsl:
    ERROR: Failed to build gem native extension.

  /home/ted/ruby-1.9.1/bin/ruby extconf.rb install gsl
  checking gsl version... 1.15
  checking gsl cflags... -I/home/ted/gsl-1.15/include
  checking for main() in -lcblas... no
  checking gsl libs... -L/home/ted/gsl-1.15/lib -lgsl -lgslcblas -lm
  checking for round()... no
  checking for rngextra/rngextra.h... no
  checking for qrngextra/qrngextra.h... no
  checking for ool/ool_version.h... no
  checking for tensor/tensor.h... no
  checking for jacobi.h... no
  checking for gsl/gsl_cqp.h... no
  checking for gsl/gsl_multimin_fsdf.h... no
  checking for gsl_poly_solve_quartic() in -lgsl... no
  checking for gsl_eigen_francis() in -lgsl... no
  checking for ndlinear/gsl_multifit_ndlinear.h... no
  checking for alf/alf.h... no
  checking rb-gsl version...1.14.7
  checking ruby version... 1.9.1
  checking for graph... no
  checking for narray.h... yes
  checking for tamu_anova/tamu_anova.h... no
  checking for main() in -ltamuanova... no
  creating Makefile

  make
  gcc -I. -I/home/ted/ruby-1.9.1/include/ruby-1.9.1/x86_64-linux -I/home/ted/ruby-1.9.1/include/ruby-1.9.1/ruby/backward -I/home/ted/ruby-1.9.1/include/ruby-1.9.1 -I. -DHAVE_NARRAY_H  -I/home/ted/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/narray-0.6.0.1/. -I/home/ted/ruby-1.9.1/lib/ruby/site_ruby/1.9.1/x86_64-linux    -fPIC  -Wall -I../include  -I/home/ted/gsl-1.15/include  -o sf_bessel.o -c sf_bessel.c
  In file included from sf_bessel.c:13:
  ../include/rb_gsl_sf.h:15:24: error: gsl/gsl_sf.h: No such file or directory
  ../include/rb_gsl_sf.h:16:27: error: gsl/gsl_errno.h: No such file or directory
  ../include/rb_gsl_sf.h:17:28: error: gsl/gsl_vector.h: No such file or directory
  In file included from ../include/rb_gsl_sf.h:18,
                   from sf_bessel.c:13:
  /home/ted/gsl-1.15/include/gsl/gsl_math.h:23:25: error: gsl/gsl_sys.h: No such file or directory
  In file included from sf_bessel.c:13:
  ../include/rb_gsl_sf.h:19:29: error: gsl/gsl_complex.h: No such file or directory
  In file included from ../include/rb_gsl.h:20,
                   from ../include/rb_gsl_sf.h:21,
                   from sf_bessel.c:13:
  ../include/rb_gsl_common.h:23:28: error: gsl/gsl_matrix.h: No such file or directory
  ../include/rb_gsl_common.h:24:33: error: gsl/gsl_permutation.h: No such file or directory
  ../include/rb_gsl_common.h:25:32: error: gsl/gsl_ieee_utils.h: No such file or directory
  In file included from ../include/rb_gsl.h:20,
                   from ../include/rb_gsl_sf.h:21,
                   from sf_bessel.c:13:
  ../include/rb_gsl_common.h:322: warning: type defaults to ‘int’ in declaration of ‘gsl_complex’
  ../include/rb_gsl_common.h:322: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
  ../include/rb_gsl_common.h:324: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  ../include/rb_gsl_common.h:325: error: expected ‘)’ before ‘*’ token
  ../include/rb_gsl_common.h:326: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  ../include/rb_gsl_common.h:328: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  ../include/rb_gsl_common.h:329: error: expected ‘)’ before ‘*’ token
  ../include/rb_gsl_common.h:330: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  ../include/rb_gsl_common.h:340: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ary2complex’
  In file included from ../include/rb_gsl.h:21,
                   from ../include/rb_gsl_sf.h:21,
                   from sf_bessel.c:13:
  ../include/rb_gsl_math.h:24: error: expected ‘)’ before ‘(’ token
  In file included from ../include/rb_gsl.h:22,
                   from ../include/rb_gsl_sf.h:21,
                   from sf_bessel.c:13:
  ../include/rb_gsl_complex.h:19:34: error: gsl/gsl_complex_math.h: No such file or directory

...

  sf_bessel.c: In function ‘rb_gsl_sf_bessel_zero_J1_e’:
  sf_bessel.c:643: error: ‘gsl_sf_bessel_zero_J1_e’ undeclared (first use in this function)
  sf_bessel.c: In function ‘rb_gsl_sf_bessel_zero_Jnu’:
  sf_bessel.c:648: error: ‘gsl_sf_bessel_zero_Jnu’ undeclared (first use in this function)
  sf_bessel.c: In function ‘rb_gsl_sf_bessel_zero_Jnu_e’:
  sf_bessel.c:653: error: ‘gsl_sf_bessel_zero_Jnu_e’ undeclared (first use in this function)
  make: *** [sf_bessel.o] Error 1


  Gem files will remain installed in /home/ted/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/gsl-1.14.7 for inspection.
  Results logged to /home/ted/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/gsl-1.14.7/ext/gem_make.out
解决方案

Install ruby GSL:

Ubuntu 11.10 includes a newer version (1.15) of libgsl0 that is not compatible with ruby/gsl :

Must install older version 1.14 for ruby/gsl to work:

curl -O http://mirror.veriportal.com/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

Installation works OK and test on Ubuntu and Debian Squeeze:

Fetching: narray-0.6.0.1.gem (100%)
Building native extensions.  This could take a while...
Fetching: gsl-1.14.7.gem (100%)
Building native extensions.  This could take a while...
Successfully installed narray-0.6.0.1
Successfully installed gsl-1.14.7
2 gems installed

这篇关于安装gsl gem时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:30