Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install nmatrix on ruby 2.0.0-p247 #505

Closed
ruggieroguida opened this issue Apr 24, 2016 · 18 comments
Closed

Failed to install nmatrix on ruby 2.0.0-p247 #505

ruggieroguida opened this issue Apr 24, 2016 · 18 comments

Comments

@ruggieroguida
Copy link

ruggieroguida commented Apr 24, 2016

Using rbenv I have succesfully installed nmatrix on ruby 2.2.0.

However the installation fails on ruby 2.0.0-p247 with with following errors
See here for the log.

@wlevine
Copy link

wlevine commented Apr 25, 2016

std::tuple is a C++11 feature. What compiler are you using? It looks like you need a newer version.

@ruggieroguida
Copy link
Author

ruggieroguida commented Apr 25, 2016

I have installed gcc with brew install gcc. If I run the command again I receive: Warning: gcc-5.3.0 already installed.

From the content of mkmf.log it looks like it is using clang instead.

Sorry, I have edited the comment. I have successfully installed nmatrix on 2.2.0 and not 2.0.0. In both case I am using gem install nmatrix Shouldn't they use the same compiler?

@wlevine
Copy link

wlevine commented Apr 25, 2016

I'm not quite sure why that is happening. For the time being, could you just try editing extconf.rb to force it to use g++? You can comment out this block of code and replace it with:

CONFIG['CXX'] == 'g++'
$CXX_STANDARD = 'c++11'

but make sure you use the correct name for the g++ binary, it may actually be called g++-5.3

If that works, then we can try to find a better solution.

@translunar
Copy link
Member

Any progress with this, or can I close it?

@ruggieroguida
Copy link
Author

No progress unfortunately. You can close it.

On Mon, 9 May 2016 at 18:38 Dr. John Woods [email protected] wrote:

Any progress with this, or can I close it?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#505 (comment)

@translunar
Copy link
Member

Did you attempt @wlevine's suggestion?

@ruggieroguida
Copy link
Author

I did, but it didn't work.

@translunar
Copy link
Member

@Rojj How are you installing NMatrix? From git, or from gem?

@ruggieroguida
Copy link
Author

From the gem

On Thu, 12 May 2016 at 18:04 Dr. John Woods [email protected]
wrote:

@Rojj https://github.com/Rojj How are you installing NMatrix? From git,
or from gem?


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#505 (comment)

@translunar
Copy link
Member

@Rojj Try from git. I think there have been some recent changes that may affect your outcome.

@chrhansen
Copy link

Hi @MohawkJohn, I just had to install NMatrix for the first time to use it in a Ruby wrapper around Tensorflow https://github.com/chrhansen/ruby-tensorflow/pull/1/files, but gem install nmatrix failed because of the GCC 4.3 requirements. I updated gcc using brew install gcc, but that wasn't picked up on my Mac, gcc --version still uses Apple's preinstalled 4.2.1.

Eventually, I found this issue, installed from git so that I could override extconf.rb like @wlevine suggested above, and after that I can finally do gem 'nmatrix' in my own ruby-tensorflow-gem. However, for future users of ruby-tensorflow this is a bit of a hassle, to say the least. How could this be made simpler and less error prone?

@wlevine
Copy link

wlevine commented Jul 8, 2016

@MohawkJohn, do you think we should default to clang on OS X?

@translunar
Copy link
Member

translunar commented Jul 8, 2016

Yes, definitely. #525

@mrkn
Copy link

mrkn commented Jul 28, 2016

@Rojj Is your problem fixed by nmatrix-0.2.3 ?

@chrhansen
Copy link

chrhansen commented Jul 28, 2016

@mrkn I don't know if I did something wrong or my system is special, but I followed the installation instructions and on OSX El Capitan using this version e3e5d12 I still have rake compile-issues.

In the installation process I get this:

$ bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
You have requested:
  json ~> 2.0.1

The bundle currently has json locked at 1.8.3.
Try running `bundle update json`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`

Then

$ bundle update json
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Bundler could not find compatible versions for gem "json":
  In Gemfile:
    json (~> 2.0.1)

    rdoc (>= 4.0.1, ~> 4.0) was resolved to 4.2.2, which depends on
      json (~> 1.4)

But bundle update works:

$ bundle update
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Using rake 10.5.0
Using backports 3.6.8
Using bundler 1.12.5
Using coderay 1.1.1
Using diff-lcs 1.2.5
Installing json 2.0.2 (was 1.8.3) with native extensions
Using method_source 0.8.2
...
Installing pry 0.10.4 (was 0.10.3)
...
Using nmatrix-lapacke 0.2.4 from source at `.`
Bundle complete! 12 Gemfile dependencies, 21 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

After that I do bundle exec rake compile:

$ bundle exec rake compile
cd tmp/x86_64-darwin14/nmatrix/2.2.1
/Users/<user>/.rvm/rubies/ruby-2.2.1/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
checking for apparent GNU g++ binary with C++0x/C++11 support... 4.7
/Users/<user>/dev/nmatrix/lib/nmatrix/mkmf.rb:50:in `gplusplus_version': unable to determine g++ version (match to get version was nil) (RuntimeError)
    from /Users/<user>/dev/nmatrix/lib/nmatrix/mkmf.rb:76:in `<top (required)>'
    from ../../../../ext/nmatrix/extconf.rb:28:in `require'
    from ../../../../ext/nmatrix/extconf.rb:28:in `<main>'
rake aborted!
Command failed with status (1): [/Users/<user>/.rvm/rubies/ruby-2.2.1/bin/rub...]
/Users/<user>/.rvm/gems/ruby-2.2.1/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:193:in `block (2 levels) in define_compile_tasks'
/Users/<user>/.rvm/gems/ruby-2.2.1/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:190:in `block in define_compile_tasks'
/Users/<user>/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/Users/<user>/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => compile => compile:x86_64-darwin14 => compile:nmatrix:x86_64-darwin14 => copy:nmatrix:x86_64-darwin14:2.2.1 => tmp/x86_64-darwin14/nmatrix/2.2.1/nmatrix.bundle => tmp/x86_64-darwin14/nmatrix/2.2.1/Makefile
(See full trace by running task with --trace)

All I needed install Nmatrix 20 days ago was to follow @wlevine's example mentioned above, #505 (comment), but it seems #530 touches a lot of other things. Perhaps I'm missing something, just wanted to show my install-log.

@ruggieroguida
Copy link
Author

@mrkn not yet.

This is the error I get

ERROR:  Error installing nmatrix:
    ERROR: Failed to build gem native extension.

    current directory: /Users/ruggiero/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/nmatrix-0.2.3/ext/nmatrix
/Users/ruggiero/.rbenv/versions/2.0.0-p247/bin/ruby -r ./siteconf20160728-3071-1icgkf.rb extconf.rb
*** 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=/Users/ruggiero/.rbenv/versions/2.0.0-p247/bin/ruby
/Users/ruggiero/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/nmatrix-0.2.3/lib/nmatrix/mkmf.rb:91:in `<top (required)>': undefined method `+' for nil:NilClass (NoMethodError)
    from /Users/ruggiero/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/ruggiero/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from extconf.rb:28:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/ruggiero/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/nmatrix-0.2.3 for inspection.
Results logged to /Users/ruggiero/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-14/2.0.0-static/nmatrix-0.2.3/gem_make.out

@translunar
Copy link
Member

@Rojj I think we need to see the compiler output. Can you clone from git and build manually with bundle exec rake compile?

@ruggieroguida
Copy link
Author

ruggieroguida commented Aug 14, 2016

@MohawkJohn I cloned the repository in my home directory. From within the directory I run bundle exec rake compile and I get the following output

mkdir -p tmp/x86_64-darwin14.5.0/nmatrix/2.0.0
cd tmp/x86_64-darwin14.5.0/nmatrix/2.0.0
/Users/ruggiero/.rbenv/versions/2.0.0-p247/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
*** ../../../../ext/nmatrix/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=../../../../ext/nmatrix
    --curdir
    --ruby=/Users/ruggiero/.rbenv/versions/2.0.0-p247/bin/ruby
/Users/ruggiero/nmatrix/lib/nmatrix/mkmf.rb:91:in `<top (required)>': undefined method `+' for nil:NilClass (NoMethodError)
    from ../../../../ext/nmatrix/extconf.rb:28:in `require'
    from ../../../../ext/nmatrix/extconf.rb:28:in `<main>'
rake aborted!
Command failed with status (1): [/Users/ruggiero/.rbenv/versions/2.0.0-p247...]

Tasks: TOP => compile => compile:x86_64-darwin14.5.0 => compile:nmatrix:x86_64-darwin14.5.0 => copy:nmatrix:x86_64-darwin14.5.0:2.0.0 => tmp/x86_64-darwin14.5.0/nmatrix/2.0.0/nmatrix.bundle => tmp/x86_64-darwin14.5.0/nmatrix/2.0.0/Makefile
(See full trace by running task with --trace)

I could not find the mkmf.log file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants