Backport #8130
ArgumentError being thrown when using find_library
Description
Hi,
I'm a contributor to SciRuby and I'm currently working on NMatrix, a numerical linear algebra library that uses LAPACK and ATLAS. I was compiling it with Ruby 2.0.0p0 installed through RVM and had a problem I didn't have when using 1.9.3:
/Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:893:in %': too many arguments for format string (ArgumentError)
block in checking_for'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:893:in
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:337:in block (2 levels) in postpone'
open'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:307:in
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:337:in block in postpone'
open'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:307:in
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:333:in postpone'
checking_for'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:891:in
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:969:in find_library'
'
from ../../../../ext/nmatrix/extconf.rb:124:in
The complete output can be found in this gist: https://gist.github.com/agarie/5202139#file-gistfile1-sh. And extconf.rb:124 contains the following:
find_library("lapack", "clapack_dgetrf", "/usr/local/lib", "/usr/local/atlas/lib")
I couldn't find a note on the 2.0 changelog about something that could have "broken" it.
I can get it working by commenting lines 893 and 896 of mkmf.rb, which are explicitly shown in this gist: https://gist.github.com/agarie/5202139#file-gistfile2-rb.
And this is the mkmf.log: https://gist.github.com/agarie/5202139#file-mkmf-log
Regarding ruby version:
$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2]
I also couldn't find a similar bug on the issue tracker or on Google. And to reproduce the error:
$ git clone git://github.com/SciRuby/nmatrix.git
$ cd nmatrix
$ bundle install
$ bundle exec rake compile
It might give other problems because of the libraries necessary for installation. I'm trying to come up with a simpler script that reproduces this error -- I'll update this ticket as soon as I'm successful.
Another thing is that when using 1.9.3-p392 and doing the same set of steps, it works correctly.
Thanks for your time.
Associated revisions
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
merge revision(s) 39842: [Backport #8130]
* lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39842: [Backport #8130]
* lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
History
Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago
- Tracker changed from Backport to Bug
- Project changed from Backport200 to Ruby trunk
- Status changed from Open to Assigned
- Assignee set to nobu (Nobuyoshi Nakada)
Hello,
project Backport200 is for backport tickets. I'll move this ticket to ruby-trunk.
Updated by nobu (Nobuyoshi Nakada) almost 6 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r39842.
Carlos, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
mkmf.rb: format message
- lib/mkmf.rb (find_library): fix to format message. [ruby-core:53568] [Bug #8130]
Updated by nobu (Nobuyoshi Nakada) almost 6 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby trunk to Backport200
- Status changed from Closed to Assigned
- Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago
- Status changed from Assigned to Closed
mkmf.rb: format message
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e