pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed9.2 won't load C-language function
4+ messages / 3 participants
[nested] [flat]
* 9.2 won't load C-language function
@ 2012-10-10 18:22 Craig James <cjames@emolecules.com>
2012-10-10 21:11 ` Re: 9.2 won't load C-language function Tom Lane <tgl@sss.pgh.pa.us>
2012-10-11 05:08 ` Re: 9.2 won't load C-language function Craig Ringer <ringerc@ringerc.id.au>
0 siblings, 2 replies; 4+ messages in thread
From: Craig James @ 2012-10-10 18:22 UTC (permalink / raw)
To: pgsql-admin
I have a C-language function I've been using on 8.4 for a long time. On
9.2 it won't load:
test=# set search_path = public;
SET
test=# CREATE OR REPLACE FUNCTION chmoogle_session_id() RETURNS integer
AS '/usr/local/pgsql/lib/libchmoogle.so', 'chmoogle_session_id'
LANGUAGE c VOLATILE;
ERROR: could not load library "/usr/local/pgsql/lib/libchmoogle.so":
libopenbabel.so.4: cannot open shared object file: No such file or directory
But libopenbabel.so.4 does exist:
# ls -l /usr/local/pgsql/lib/libopenbabel.so.4
-rwxr-xr-x 1 root root 18250709 2012-10-09 18:05
/usr/local/pgsql/lib/libopenbabel.so.4*
There seems to be some difference in the library search path from 8.4 to
9.2. For administrative simplicity, I don't use ldconfig, besides which it
wasn't needed for 8.4.
What changed in how libraries are loaded between 8.4 and 9.2?
Thanks,
Craig
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: 9.2 won't load C-language function
2012-10-10 18:22 9.2 won't load C-language function Craig James <cjames@emolecules.com>
@ 2012-10-10 21:11 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 2012-10-10 21:11 UTC (permalink / raw)
To: Craig James <cjames@emolecules.com>; +Cc: pgsql-admin
Craig James <cjames@emolecules.com> writes:
> ERROR: could not load library "/usr/local/pgsql/lib/libchmoogle.so":
> libopenbabel.so.4: cannot open shared object file: No such file or directory
> But libopenbabel.so.4 does exist:
> # ls -l /usr/local/pgsql/lib/libopenbabel.so.4
> -rwxr-xr-x 1 root root 18250709 2012-10-09 18:05
> /usr/local/pgsql/lib/libopenbabel.so.4*
It may exist, but is it in the dynamic linker's search path?
You didn't say what platform this is, but on Linux you normally have to
negotiate with ldconfig, or else set rpath in the referencing shlib,
if you want to use shlibs that are in nonstandard directories.
> What changed in how libraries are loaded between 8.4 and 9.2?
Nothing, AFAIR. But you may have dropped an rpath spec when rebuilding
your library, or forgotten about a ldconfig adjustment you made on the
old machine.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: 9.2 won't load C-language function
2012-10-10 18:22 9.2 won't load C-language function Craig James <cjames@emolecules.com>
@ 2012-10-11 05:08 ` Craig Ringer <ringerc@ringerc.id.au>
2012-10-11 17:35 ` Re: 9.2 won't load C-language function Craig James <cjames@emolecules.com>
1 sibling, 1 reply; 4+ messages in thread
From: Craig Ringer @ 2012-10-11 05:08 UTC (permalink / raw)
To: Craig James <cjames@emolecules.com>; +Cc: pgsql-admin
On 10/11/2012 02:22 AM, Craig James wrote:
> I have a C-language function I've been using on 8.4 for a long time. On
> 9.2 it won't load:
>
> test=# set search_path = public;
> SET
> test=# CREATE OR REPLACE FUNCTION chmoogle_session_id() RETURNS integer
> AS '/usr/local/pgsql/lib/libchmoogle.so', 'chmoogle_session_id'
> LANGUAGE c VOLATILE;
> ERROR: could not load library "/usr/local/pgsql/lib/libchmoogle.so":
> libopenbabel.so.4: cannot open shared object file: No such file or directory
What does `ldd /usr/local/pgsql/lib/libchmoogle.so` say? What about when
run under the PostgreSQL user account?
You may need to set LD_LIBRARY_PATH in the Pg startup script, or modify
ld.so.conf, or re-build your extension with rpath linking enabled.
As for why it worked with 8.4 - I expect you either altered
LD_LIBRARY_PATH in the 8.4 startup scripts, or maybe the 8.4 version of
the extension was built with -Wl,-rpath so the paths to required
libraries were embedded into the extension library.
--
Craig Ringer
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: 9.2 won't load C-language function
2012-10-10 18:22 9.2 won't load C-language function Craig James <cjames@emolecules.com>
2012-10-11 05:08 ` Re: 9.2 won't load C-language function Craig Ringer <ringerc@ringerc.id.au>
@ 2012-10-11 17:35 ` Craig James <cjames@emolecules.com>
0 siblings, 0 replies; 4+ messages in thread
From: Craig James @ 2012-10-11 17:35 UTC (permalink / raw)
To: Craig Ringer <ringerc@ringerc.id.au>; +Cc: pgsql-admin
On Wed, Oct 10, 2012 at 10:08 PM, Craig Ringer <ringerc@ringerc.id.au>wrote:
> On 10/11/2012 02:22 AM, Craig James wrote:
>
>> I have a C-language function I've been using on 8.4 for a long time. On
>> 9.2 it won't load:
>>
>> test=# set search_path = public;
>> SET
>> test=# CREATE OR REPLACE FUNCTION chmoogle_session_id() RETURNS integer
>> AS '/usr/local/pgsql/lib/**libchmoogle.so', 'chmoogle_session_id'
>> LANGUAGE c VOLATILE;
>> ERROR: could not load library "/usr/local/pgsql/lib/**libchmoogle.so":
>> libopenbabel.so.4: cannot open shared object file: No such file or
>> directory
>>
>
> What does `ldd /usr/local/pgsql/lib/**libchmoogle.so` say? What about
> when run under the PostgreSQL user account?
>
Too late ... after reading up on LD_LIBRARY_PATH and why ldconfig is
better, I just ran ldconfig on the /usr/local/pgsql/lib and
/usr/local/openbabel/lib directories. Problem fixed.
> You may need to set LD_LIBRARY_PATH in the Pg startup script, or modify
> ld.so.conf, or re-build your extension with rpath linking enabled.
>
> As for why it worked with 8.4 - I expect you either altered
> LD_LIBRARY_PATH in the 8.4 startup scripts, or maybe the 8.4 version of the
> extension was built with -Wl,-rpath so the paths to required libraries were
> embedded into the extension library.
>
It is a bit odd ... 8.4 was working, and I just compiled and installed 9.2
on top of it (and created a fresh database). Oh well, I guess it will
remain a mystery.
Craig James
>
> --
> Craig Ringer
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2012-10-11 17:35 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10 18:22 9.2 won't load C-language function Craig James <cjames@emolecules.com>
2012-10-10 21:11 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-10-11 05:08 ` Craig Ringer <ringerc@ringerc.id.au>
2012-10-11 17:35 ` Craig James <cjames@emolecules.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox