#336 invalid
Mayo Jordanov

extconf.rb fails to locate -lpq, --llibpq

Reported by Mayo Jordanov | June 2nd, 2008 @ 02:59 PM

When compiling do_postgres (gem install or ruby ext/extconf.rb with no options), it fails with:

checking for main() in -lpq... no
checking for main() in -llibpq... no
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
*** ext/extconf.rb failed ***

inspecting mkmf.log, it tries to run

"/usr/bin/gcc-4.0 -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -Iext -I/opt/local/include/postgresql82 -I/opt/local/include -O2  -fno-common -pipe -fno-common conftest.c  -L\".\" -L\"/opt/local/lib\" -L\"/opt/local/lib/postgresql82\" -L. -L/opt/local/lib     -lruby-static -lpq  -lpthread -ldl -lobjc  "

removing the outer quotes(") and escape chars on the inner quotes, and running it, it seems to execute just fine

/usr/bin/gcc-4.0 -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin9.2.2 -Iext -I/opt/local/include/postgresql82 -I/opt/local/include -O2  -fno-common -pipe -fno-common conftest.c  -L"." -L"/opt/local/lib" -L"/opt/local/lib/postgresql82" -L. -L/opt/local/lib     -lruby-static -lpq  -lpthread -ldl -lobjc

Comments and changes to this ticket

  • Mayo Jordanov

    Mayo Jordanov June 2nd, 2008 @ 03:01 PM

    • Assigned user changed from “Sam Smoot” to “Bernerd Schaefer”
  • Mayo Jordanov

    Mayo Jordanov June 2nd, 2008 @ 03:20 PM

    I also have do_postgres-0.9.0.gem from May 2nd, which will compile just fine, with no issues. If it would be helpful to get it, let me know and I can attach it here.

  • Mayo Jordanov

    Mayo Jordanov June 3rd, 2008 @ 09:24 PM

    OK, this has nothing to do with DO really, and happens because (as pointed out above) the paths to libraries are getting double quoted...

    This, apparently, is caused by ruby's CONFIG (rbconfig) returning " -L\\\"%s\\\"" for LIBPATHFLAG, instead of not defining it or returning ' -L"%s"''

    I assume these options come from values set at compile time, which leaves the question why they are set to those values (I haven't set those options) and how come this process worked several weeks ago (were there some monkey patches that fixed this that were removed?)

    Not that it's a problem of DO, but I thought it might be worth having it documented for the future, and I know of at least few other people who hit this problem...

    This should probably be marked invalid, but I'll update once I figure out what's going on.

  • Mayo Jordanov

    Mayo Jordanov June 4th, 2008 @ 10:11 AM

    Seems like this is a bad setting at either compile time or when rbconfig.rb is generated. The value in rbconfig.rb is wrong for LIBPATHFLAG

  • Bernerd Schaefer

    Bernerd Schaefer June 4th, 2008 @ 11:32 AM

    This seems to attribute the problem to autoconf.

    http://groups.google.com/group/r...

  • Bernerd Schaefer

    Bernerd Schaefer June 9th, 2008 @ 12:30 PM

    • State changed from “new” to “open”

    So were you able to solve this? Is it an invalid ticket?

  • Bernerd Schaefer

    Bernerd Schaefer June 9th, 2008 @ 12:39 PM

    • State changed from “open” to “hold”
  • Mayo Jordanov

    Mayo Jordanov June 9th, 2008 @ 05:58 PM

    Yes, it's a problem with ruby configuration at compile time and/or the rbconfig.rb (generated at compile-time) in the base install of ruby.

    It's not related to any code in DO, so it can be marked invalid.

    thanks!

  • Bernerd Schaefer

    Bernerd Schaefer June 10th, 2008 @ 09:33 AM

    • State changed from “hold” to “invalid”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages