extconf.rb search path

J

Joe Van Dyk

Hi,

Whenever I run extconf.rb for gnome2, it compiles against the gnome
libraries found in /usr. I want it to compile against the gnome
libraries found in /usr/local. Isn't that what it should do by
default?

Anyways, how can I get the gnome2 Ruby extensions to compile against
the headers/libraries in /usr/local?

Thanks,
Joe
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: extconf.rb search path"

|Whenever I run extconf.rb for gnome2, it compiles against the gnome
|libraries found in /usr. I want it to compile against the gnome
|libraries found in /usr/local. Isn't that what it should do by
|default?

It's according to your compiler's default priority. Blame the
compiler. You can specify the dir prefix by options to extconf.rb,
such as

ruby extconf.rb --with-opt-dir=/usr/local

matz.
 
A

Ara.T.Howard

Hi,

Whenever I run extconf.rb for gnome2, it compiles against the gnome
libraries found in /usr. I want it to compile against the gnome
libraries found in /usr/local. Isn't that what it should do by
default?

Anyways, how can I get the gnome2 Ruby extensions to compile against
the headers/libraries in /usr/local?

Thanks,
Joe

try this

~ > LD_LIBRARY_PATH=/usr/local:$LD_LIBRARY_PATH LD_RUN_PATH=/usr/local:$LD_RUN_PATH ruby extconf.rb

perhaps your compiler will like this...

probably there is also a

--with-gnome-dir=/usr/local

option for that extconf.

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| My religion is very simple. My religion is kindness.
| --Tenzin Gyatso
===============================================================================
 
J

Joe Van Dyk

On Tue, 2 Aug 2005, Joe Van Dyk wrote:
=20
=20
try this
=20
~ > LD_LIBRARY_PATH=3D/usr/local:$LD_LIBRARY_PATH LD_RUN_PATH=3D/usr/l=
ocal:$LD_RUN_PATH ruby extconf.rb
=20
perhaps your compiler will like this...
=20
probably there is also a
=20
--with-gnome-dir=3D/usr/local
=20
option for that extconf.
=20
-a
--

Weirdly, if I run /usr/local/bin/ruby (and not /usr/bin/ruby) on
extconf.rb, it uses libraries/headers in /usr/local (and not /usr).

So, part of it seems to depend on where Ruby is installed.
 
A

Ara.T.Howard

Weirdly, if I run /usr/local/bin/ruby (and not /usr/bin/ruby) on
extconf.rb, it uses libraries/headers in /usr/local (and not /usr).

So, part of it seems to depend on where Ruby is installed.


absolutely - you should always be aware of which ruby you are using to compile
extensions. basically ruby caches tons of stuff when it's compiled itself.
it stores all this info and this is the foundation of 'mkmf', which extconf.rb
uses. this should be illuminating:

ruby -r rbconfig -r yaml -e 'y Config::CONFIG'

if you're using the 'right' ruby you should see a /usr/local or two in there.

another rule of thumb: unless you understand why you wouldn't do so - always
set LD_RUN_PATH to your system libdir (for example /usr/local/lib) when
compiling extensions. this is __very__ important in the case of ruby libs
which themselves require libs : for example sqlite or gnome. if you don't set
this you'll have issues at runtime with the gnome-ruby libs loading gnome libs
from /usr/lib/ vs. /usr/local/lib. run ldd on the ruby-gnome extension to see
what i mean. if you re-compile with LD_RUN_PATH set to /usr/local you'll see
a difference.

btw my command above should have been

~ > LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH LD_RUN_PATH=/usr/local/lib:$LD_RUN_PATH ruby extconf.rb

cheers.

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| My religion is very simple. My religion is kindness.
| --Tenzin Gyatso
===============================================================================
 
J

Joe Van Dyk

On Tue, 2 Aug 2005, Joe Van Dyk wrote:
=20
=20
=20
absolutely - you should always be aware of which ruby you are using to co= mpile
extensions. basically ruby caches tons of stuff when it's compiled itsel= f.
it stores all this info and this is the foundation of 'mkmf', which extco= nf.rb
uses. this should be illuminating:
=20
ruby -r rbconfig -r yaml -e 'y Config::CONFIG'
=20
if you're using the 'right' ruby you should see a /usr/local or two in th= ere.
=20
another rule of thumb: unless you understand why you wouldn't do so - alw= ays
set LD_RUN_PATH to your system libdir (for example /usr/local/lib) when
compiling extensions. this is __very__ important in the case of ruby lib= s
which themselves require libs : for example sqlite or gnome. if you don'= t set
this you'll have issues at runtime with the gnome-ruby libs loading gnome= libs
from /usr/lib/ vs. /usr/local/lib. run ldd on the ruby-gnome extension t= o see
what i mean. if you re-compile with LD_RUN_PATH set to /usr/local you'll= see
a difference.
=20
btw my command above should have been
=20
~ > LD_LIBRARY_PATH=3D/usr/local/lib:$LD_LIBRARY_PATH LD_RUN_PATH=3D/u=
sr/local/lib:$LD_RUN_PATH ruby extconf.rb


I have new libraries installed in /opt/lib. LD_LIBRARY_PATH and
LD_RUN_PATH include /opt/lib. When I run extconf.rb, it generates
Makefiles that don't include -L/opt/lib. And running ldd on the
resulting shared library shows no libraries from /opt/lib.

Ideas?
Joe
 
J

Joe Van Dyk

/usr/local/lib:$LD_RUN_PATH ruby extconf.rb
=20
=20
I have new libraries installed in /opt/lib. LD_LIBRARY_PATH and
LD_RUN_PATH include /opt/lib. When I run extconf.rb, it generates
Makefiles that don't include -L/opt/lib. And running ldd on the
resulting shared library shows no libraries from /opt/lib.
=20
Ideas?
Joe

Nevermind! Somehow, I missed Matz's post.

ruby extconf.rb --with-opt-dir=3D/opt worked.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,501
Latest member
log5Sshell/alfa5

Latest Threads

Top