2

I have gcc6.1 installed on OS X via brew, when I tried to install sciruby-full on my Mac, always got this Error:

>Fetching: nmatrix-0.1.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing sciruby-full:
    ERROR: Failed to build gem native extension.

    /usr/local/opt/ruby/bin/ruby -r ./siteconf20150627-98945-1pk3go6.rb extconf.rb
checking for apparent GNU g++ binary with C++0x/C++11 support... Exception `RuntimeError' at extconf.rb:144 - 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++.
*** 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=/usr/local/Cellar/ruby/2.2.2/bin/$(RUBY_BASE_NAME)
extconf.rb:144:in `<main>': 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)

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.2.0/gems/nmatrix-0.1.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/nmatrix-0.1.0/gem_make.out

My ruby and OS X is always the newest: Ruby 2.2.2 on updated Yosemite.

Kane Blueriver
  • 4,170
  • 4
  • 29
  • 48

2 Answers2

1

From your error message:

extconf.rb:144:in `': 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)

stoodfarback
  • 1,299
  • 9
  • 12
  • I have the newest gcc installed, is that enough? – Kane Blueriver Jun 27 '15 at 15:56
  • Probably not if it's just the system gcc. You most likely need a brewed gcc. – Translunar Jun 30 '15 at 20:12
  • @Dr.JohnnyMohawk Actually, it's brewed newest one. Seems it doesn't matter though it's not fully installed, the main part of IRuby Notebook just works. – Kane Blueriver Jul 10 '15 at 02:31
  • Do a `g++ --version` and a `gcc --version`. It's likely that you need to create a symlink from the brewed version to /usr/bin/gcc and /usr/bin/g++. There are instructions in the wiki (http://github.com/SciRuby/nmatrix/wiki). – Translunar Jul 10 '15 at 14:43
1

Do the following (using homebrew)

brew tap homebrew/versions
brew install gcc48

if this does not work, try gcc47 or gcc46.

Note: It make take a while to build. gcc is quite large.

Eli Sadoff
  • 7,173
  • 6
  • 33
  • 61
Roman Podolski
  • 329
  • 3
  • 17