Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
558 views
in Technique[技术] by (71.8m points)

ruby - Problems installing gsl gem

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 a€?inta€? in declaration of a€?gsl_complexa€?
  ../include/rb_gsl_common.h:322: error: expected a€?;a€?, a€?,a€? or a€?)a€? before a€?*a€? token
  ../include/rb_gsl_common.h:324: error: expected a€?=a€?, a€?,a€?, a€?;a€?, a€?asma€? or a€?__attribute__a€? before a€?*a€? token
  ../include/rb_gsl_common.h:325: error: expected a€?)a€? before a€?*a€? token
  ../include/rb_gsl_common.h:326: error: expected a€?=a€?, a€?,a€?, a€?;a€?, a€?asma€? or a€?__attribute__a€? before a€?*a€? token
  ../include/rb_gsl_common.h:328: error: expected a€?=a€?, a€?,a€?, a€?;a€?, a€?asma€? or a€?__attribute__a€? before a€?*a€? token
  ../include/rb_gsl_common.h:329: error: expected a€?)a€? before a€?*a€? token
  ../include/rb_gsl_common.h:330: error: expected a€?=a€?, a€?,a€?, a€?;a€?, a€?asma€? or a€?__attribute__a€? before a€?*a€? token
  ../include/rb_gsl_common.h:340: error: expected a€?=a€?, a€?,a€?, a€?;a€?, a€?asma€? or a€?__attribute__a€? before a€?ary2complexa€?
  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 a€?)a€? before a€?(a€? 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 a€?rb_gsl_sf_bessel_zero_J1_ea€?:
  sf_bessel.c:643: error: a€?gsl_sf_bessel_zero_J1_ea€? undeclared (first use in this function)
  sf_bessel.c: In function a€?rb_gsl_sf_bessel_zero_Jnua€?:
  sf_bessel.c:648: error: a€?gsl_sf_bessel_zero_Jnua€? undeclared (first use in this function)
  sf_bessel.c: In function a€?rb_gsl_sf_bessel_zero_Jnu_ea€?:
  sf_bessel.c:653: error: a€?gsl_sf_bessel_zero_Jnu_ea€? 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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...