Backport #8130

ArgumentError being thrown when using find_library

Added by Carlos Agarie about 1 year ago. Updated about 1 year ago.

[ruby-core:53568]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

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)
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:893:in
block in checkingfor'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:337:in block (2 levels) in postpone'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:307:in
open'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:337:in block in postpone'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:307:in
open'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:333:in postpone'
from /Users/carlosagarie/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/mkmf.rb:891:in
checking
for'
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:

findlibrary("lapack", "clapackdgetrf", "/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

Revision 40255
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) 39842: [Backport #8130]

* lib/mkmf.rb (find_library): fix to format message.
   [Bug #8130]

History

#1 Updated by Tomoyuki Chikanaga about 1 year ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to ruby-trunk
  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

Hello,

project Backport200 is for backport tickets. I'll move this ticket to ruby-trunk.

#2 Updated by Nobuyoshi Nakada about 1 year 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. [Bug #8130]

#3 Updated by Nobuyoshi Nakada about 1 year ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from Nobuyoshi Nakada to Tomoyuki Chikanaga

#4 Updated by Tomoyuki Chikanaga about 1 year ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40255.
Carlos, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39842: [Backport #8130]

* lib/mkmf.rb (find_library): fix to format message.
   [Bug #8130]

Also available in: Atom PDF