SciRuby/nmatrix

Facing Installation error

shardulparab97 opened this issue · 7 comments

When I try to install nmatrix on ubuntu 14.04, this is the error which I am receiving .
Could someone help me out.

gem install nmatrix
Building native extensions. This could take a while...
/usr/local/lib/site_ruby/2.1.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
ERROR: Error installing nmatrix:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.1.0/gems/nmatrix-0.2.3/ext/nmatrix

/usr/bin/ruby2.1 -r ./siteconf20170203-16014-uam014.rb extconf.rb
/var/lib/gems/2.1.0/gems/nmatrix-0.2.3/lib/nmatrix/mkmf.rb:45: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
using C++ standard... c++11
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby2.1
/var/lib/gems/2.1.0/gems/nmatrix-0.2.3/lib/nmatrix/mkmf.rb:91:in <top (required)>': undefined method +' for nil:NilClass (NoMethodError)
from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require'
from extconf.rb:28:in `

'
g++ reports version... 4.9.2-10ubuntu13)

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/nmatrix-0.2.3 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/nmatrix-0.2.3/gem_make.out

Can you please tell me some more about your Ruby installation? e.g., are you using rbenv/ruby-build, or did you install via apt, or what?

Can you please also do a gem install nmatrix --verbose and give the output from that?

just had this issue so i'll put my info in:

osx el capitan, ruby 2.3.3 via rvm

~/Code/hampton (recommendations) > gem install nmatrix --verbose
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=nmatrix
200 OK
Getting SRV record failed: DNS result has no information for _rubygems._tcp.api.rubygems.org
GET https://api.rubygems.org/quick/Marshal.4.8/nmatrix-0.2.3.gemspec.rz
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=packable
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=backports
200 OK
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/binary_format.txt
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/data/complex.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/data/data.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/data/data.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/data/meta.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/data/ruby_object.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/extconf.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/asum.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/cblas_enums.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/cblas_templates_core.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/gemm.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/gemv.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/getrf.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/getrs.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/imax.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/laswp.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/long_dtype.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/magnitude.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/math.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/nrm2.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/rot.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/rotg.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/scal.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/trsm.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/math/util.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/nm_memory.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/nmatrix.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/nmatrix.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/ruby_constants.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/ruby_constants.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/ruby_nmatrix.c
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/common.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/common.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/dense/dense.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/dense/dense.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/list/list.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/list/list.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/storage.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/storage.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/class.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/iterators/base.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/iterators/iterator.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/iterators/row.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/iterators/row_stored.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/iterators/row_stored_nd.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/iterators/stored_diagonal.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/math/transpose.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/yale.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/storage/yale/yale.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/ttable_helper.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/types.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/util/io.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/util/io.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/util/sl_list.cpp
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/util/sl_list.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix/util/util.h
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/blas.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/enumerate.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/homogeneous.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/io/fortran_format.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/io/harwell_boeing.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/io/market.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/io/mat5_reader.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/io/mat_reader.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/io/point_cloud.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/lapack_core.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/lapack_plugin.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/math.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/mkmf.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/monkeys.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/nmatrix.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/rspec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/shortcuts.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/version.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/yale_functions.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/00_nmatrix_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/01_enum_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/02_slice_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/03_nmatrix_monkeys_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/2x2_dense_double.mat
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/4x4_sparse.mat
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/4x5_dense.mat
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/blas_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/elementwise_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/homogeneous_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/io/fortran_format_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/io/harwell_boeing_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/io/test.rua
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/io_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/lapack_core_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/leakcheck.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/math_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/nmatrix_yale_resize_test_associations.yaml
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/nmatrix_yale_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/rspec_monkeys.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/rspec_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/shortcuts_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/slice_set_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/spec_helper.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/stat_spec.rb
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/test.pcd
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/spec/utm5940.mtx
Building native extensions.  This could take a while...
current directory: /Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/ext/nmatrix
/Users/mkendall/.rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20170224-2562-pq9e3e.rb extconf.rb
checking for apparent GNU g++ binary with C++0x/C++11 support... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/mkendall/.rvm/rubies/ruby-2.3.3/bin/$(RUBY_BASE_NAME)
/Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3/lib/nmatrix/mkmf.rb:74:in `<top (required)>': You need a version of g++ which supports -std=c++0x or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-brew-gcc.sh to install a more recent g++. (RuntimeError)
	from /Users/mkendall/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/mkendall/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from extconf.rb:28:in `<main>'
ERROR:  Error installing nmatrix:
	ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.
extconf failed, exit code 1

Gem files will remain installed in /Users/mkendall/.rvm/gems/ruby-2.3.3/gems/nmatrix-0.2.3 for inspection.
Results logged to /Users/mkendall/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-15/2.3.0/nmatrix-0.2.3/gem_make.out

What version of Rake are you all using, out of curiosity?

I'm getting this error on Travis CI, with the default configuration:

$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ rake --version
rake, version 10.2.2

Upgrading to Rake 12.0.0 didn't help.

Works on Ruby 2.0.0, though.

Suspect to be same issue as #591.