21

ホーム ディレクトリに gsl ライブラリを正常にインストールできますが、gsl gem をインストールしようとすると、理解できないエラーの大きなリストが表示されます。なぜこれらのエラーが発生するのか、誰かが私に何らかの考えを与えることができるかどうか疑問に思っています。私が持っていると言えます:

gsl が正常にインストールされました。少なくともそれはそれがどのように見えたかです。gsl-config へのパスを指定しました

エラーログは次のようになります。

  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
4

10 に答える 10

21

Ruby GSL をインストールします。

Ubuntu 11.10 には、 ruby​​/gsl と互換性のないlibgsl0 の新しいバージョン (1.15) が含まれています。

ruby/gsl を機能させるには、古いバージョン 1.14 をインストールする必要があります。

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 でテストします。

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
于 2012-08-19T20:02:51.600 に答える
7

あなたが持っている場合:

  • GSL 1.16 (で確認gsl-config --version) (例: Ubuntu 14.04の場合)、
  • ルビー2.1

次に、https://github.com/siefca/rb-gslを試してください。このような構成用に調整されています。
Ruby 1.9 および Ruby 2.0 でも動作するはずです。

プロジェクトで gem を管理するためにバンドラーを使用している場合は、次の行をGemfile.

gem 'gsl', :git => 'git://github.com/siefca/rb-gsl'

乾杯!

于 2014-06-29T00:28:00.120 に答える
5

ubuntu 13.04では、これで問題が解決します:

sudo apt-get install libgsl0-dev

古いバージョンを手動でインストールする必要はありません

于 2013-06-28T09:37:21.950 に答える
5

このgsl_matrix_complex_equal問題でこれをインストールするのにまだ苦労している人のために。

これを書いている時点で which will を実行brew install gslして 1.15 をインストールしてから ruby​​ バインディングをインストールしようとすると、この問題に遭遇する可能性があります。

このリポジトリを rb-gsl gem ソースとして使用すると、問題が解決します: https://github.com/30robots/rb-gsl

ただし、新しいバージョンの ruby​​gems を使用している場合、そのレポはGem#searcher非推奨で現在削除されているメソッドを呼び出します。

Gem::SpecificationAPIを使用するために呼び出す私のリポジトリの更新:

https://github.com/whistlerbrk/rb-gsl

要するに:

brew install gslOSX 上

そしてあなたのGemfileで:

gem 'gsl', :git => 'git://github.com/whistlerbrk/rb-gsl.git'

于 2013-02-26T19:31:03.237 に答える
1

ubuntu 13.10 の場合、次に ruby​​ 2.0.0 で問題なく動作します。

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

注意: アミ ナヴォンは次のように書いています。

ruby/gsl を機能させるには、古いバージョン 1.14 をインストールする必要があります

gsl-1.16/ruby-2.0.0 では現在非対応

于 2013-12-13T08:38:32.627 に答える