Failed to install nmatrix due to unavailable old gcc

34 views
Skip to first unread message

Jorge Bonafé

unread,
May 3, 2023, 3:01:28 PM5/3/23
to SciRuby Development
Hello

I'm having trouble installing nmatrix. When I try to install using this command I get this error:
gem install nmatrix --source 'https://rubygems.org/'

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

    current directory: /home/jorgebonafe/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/nmatrix-0.2.4/ext/nmatrix
/home/jorgebonafe/.rbenv/versions/2.4.5/bin/ruby -r ./siteconf20230503-38294-hcauiy.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
--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=/home/jorgebonafe/.rbenv/versions/2.4.5/bin/$(RUBY_BASE_NAME)

/home/jorgebonafe/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/nmatrix-0.2.4/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 /home/jorgebonafe/.rbenv/versions/2.4.5/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/jorgebonafe/.rbenv/versions/2.4.5/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from extconf.rb:28:in `<main>'

extconf failed, exit code 1


From what I've investigated, it seems the compiler needed to build the library is GCC 4.3, I seen mention of 4.6 as well. I was unable to find a way to install these gcc versions. The earliest I could find was 4.8, but it didn't work either, I imagine whatever changed after 4.6 already made it incompatible.

Does anyone know if there is a way to compile this library with a newer GCC version? Or maybe if there is a way to install GCC 4.3 on Ubuntu 22.04 that I didn't find? And if thats a negative for both, does any other libraries exists that I could use as an alternative to nmatrix and nmatrix-lapacke?

Thanks
Reply all
Reply to author
Forward
0 new messages