Thread: dependency on 32 bit libpq.so on 64 bit Postgres server.

dependency on 32 bit libpq.so on 64 bit Postgres server.

From
"surabhi.ahuja"
Date:
Hi
 
I have downloaded Postgres 8.1.4 for FC4 x86_64 bit arch.
and installed on my m/c
 
Earlier this machine had Postgres 8.0.0. However that time It was the normal 32 bit server.
 
I build my project (which has dependency on libpq.so)
and so i have the libraries which i copy onto the above machine.
 
The client application then dynamically links to these libraries.
 
However now (after upgrading Postgres server) i get this error:
 
 | 2006-11-16 10:41:50.045 | 21532:1436573184 | DMF | 0 | ERROR | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 | Ca
nnot find library for dbexpress: libpq.so.3: cannot open shared object file: No such file or directory
 
my team has decided that we ll keep the Postgres server as a 64 bit server.
But the libraries and binaries should be 32 bit ones only.
 
I will have to rebuild my project , this time the libpq.so that i use will be for Postgres 8.1.4 FC 4.
But please tell me , if i should have the 64 bit libpq.so or the 32 bit one.
 
Please help solve my confusion.
 
Thanks,
regards
Surabhi

Re: dependency on 32 bit libpq.so on 64 bit Postgres server.

From
"Albe Laurenz"
Date:
> I have downloaded Postgres 8.1.4 for FC4 x86_64 bit arch.
> and installed on my m/c
>
> Earlier this machine had Postgres 8.0.0. However that time It
> was the normal 32 bit server.
>
> I build my project (which has dependency on libpq.so)
> and so i have the libraries which i copy onto the above machine.
>
> The client application then dynamically links to these libraries.
>
> However now (after upgrading Postgres server) i get this error:
>
>  | 2006-11-16 10:41:50.045 | 21532:1436573184 | DMF | 0 |
> ERROR | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 | Ca
> nnot find library for dbexpress: libpq.so.3: cannot open
> shared object file: No such file or directory
>
> my team has decided that we ll keep the Postgres server as a
> 64 bit server.
> But the libraries and binaries should be 32 bit ones only.
>
> I will have to rebuild my project , this time the libpq.so
> that i use will be for Postgres 8.1.4 FC 4.
> But please tell me , if i should have the 64 bit libpq.so or
> the 32 bit one.
>
> Please help solve my confusion.

I cannot quite follow, but I think I can still help you.

It depends on the executable that is linked with PostgreSQL.

If you have a 64-bit executable that loads libpq.so, you will need
the 64-bit libpq.so; similar for 32-bit.

libpq.so is part of the client installation.
You can access a 64-bit server with a 32-bit client.

Does that answer your question?

Yours,
Laurenz Albe

Re: dependency on 32 bit libpq.so on 64 bit Postgres server.

From
Richard Huxton
Date:
surabhi.ahuja wrote:
> Hi
>
> I have downloaded Postgres 8.1.4 for FC4 x86_64 bit arch. and
> installed on my m/c
>
> Earlier this machine had Postgres 8.0.0. However that time It was the
> normal 32 bit server.
>
> I build my project (which has dependency on libpq.so) and so i have
> the libraries which i copy onto the above machine.
>
> The client application then dynamically links to these libraries.
>
> However now (after upgrading Postgres server) i get this error:
>
> | 2006-11-16 10:41:50.045 | 21532:1436573184 | DMF | 0 | ERROR |
> error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 | Ca nnot find
> library for dbexpress: libpq.so.3: cannot open shared object file: No
> such file or directory

I'm not sure this is to do with upgrading the PostgreSQL server. This
should be due to upgrading the PostgreSQL client libraries. I take it
you did both?

> my team has decided that we ll keep the Postgres server as a 64 bit
> server. But the libraries and binaries should be 32 bit ones only.
>
> I will have to rebuild my project , this time the libpq.so that i use
> will be for Postgres 8.1.4 FC 4.

I'm not sure why you would *have* to rebuild. It might make sense to
keep server and client at the same version.

> But please tell me , if i should have the 64 bit libpq.so or the 32
> bit one.

Imagine you had the client application running on a different machine
from the server. Would the server know or care whether you were running
a 32-bit or 64-bit client library? Would it even know or care if you
were running Intel or PPC?

--
   Richard Huxton
   Archonet Ltd

Re: dependency on 32 bit libpq.so on 64 bit Postgres server.

From
"surabhi.ahuja"
Date:
 hi,
 
let me explain with an example
say i have a 32 bit exceutable called Installer
 
it dynamically links to 4 libraries which are called:
libdbx1, it is dependent on (ROOT)/postgres/arch/$(ARCH)d/lib -lpq (specified in the makefile)
libdbx2, it is also dependent on (ROOT)/postgres/arch/$(ARCH)d/lib -lpq (specified in the makefile)
libdbx3
libdbx4
 
the above directory (ROOT)/postgres/arch/$(ARCH)d/lib
 
has libpq.so which i got by installing the 32 bit Postgres 8.1.5 on fc4
its sixe is : 116532
 
now i put these 4 libs and the exe in the target mach
and i run the executable Installer
 
the traget m/c is FC4 has Postgres 8.1.5 installed which is 64 bit
 
so it has libpq.so.4 and libpq.so.4.1 in /usr/lib64/ of that machine.
 
rwxrwxrwx  1 root root     12 Nov 16 15:11 libpq.so.4 -> libpq.so.4.1*
-rwxr-xr-x  1 root root 135960 Nov 16 00:30 libpq.so.4.1*
 
so when i run the exe it gives me this error:
 
| 2006-11-17 13:56:18.085 | 5659:1436573184 | DMF | 0 | ERROR | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 | Can
not find library for dbexpress: libpq.so.4: cannot open shared object file: No such file or directory
| 2006-11-17 13:56:18.085 | 5659:1436573184 | DMF | 0 | ERROR | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:122 | Un
known repository: dbexpress

 

thanks

regards

Surabhi


From: Albe Laurenz [mailto:all@adv.magwien.gv.at]
Sent: Thu 11/16/2006 2:54 PM
To: surabhi.ahuja; pgsql-general@postgresql.org
Subject: RE: [GENERAL] dependency on 32 bit libpq.so on 64 bit Postgres server.

> I have downloaded Postgres 8.1.4 for FC4 x86_64 bit arch.
> and installed on my m/c

> Earlier this machine had Postgres 8.0.0. However that time It
> was the normal 32 bit server.

> I build my project (which has dependency on libpq.so)
> and so i have the libraries which i copy onto the above machine.

> The client application then dynamically links to these libraries.

> However now (after upgrading Postgres server) i get this error:

>  | 2006-11-16 10:41:50.045 | 21532:1436573184 | DMF | 0 |
> ERROR | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 | Ca
> nnot find library for dbexpress: libpq.so.3: cannot open
> shared object file: No such file or directory

> my team has decided that we ll keep the Postgres server as a
> 64 bit server.
> But the libraries and binaries should be 32 bit ones only.

> I will have to rebuild my project , this time the libpq.so
> that i use will be for Postgres 8.1.4 FC 4.
> But please tell me , if i should have the 64 bit libpq.so or
> the 32 bit one.

> Please help solve my confusion.

I cannot quite follow, but I think I can still help you.

It depends on the executable that is linked with PostgreSQL.

If you have a 64-bit executable that loads libpq.so, you will need
the 64-bit libpq.so; similar for 32-bit.

libpq.so is part of the client installation.
You can access a 64-bit server with a 32-bit client.

Does that answer your question?

Yours,
Laurenz Albe

Re: dependency on 32 bit libpq.so on 64 bit Postgres server.

From
"Albe Laurenz"
Date:
> let me explain with an example
> say i have a 32 bit exceutable called Installer
>
> it dynamically links to 4 libraries which are called:
> libdbx1, it is dependent on (ROOT)/postgres/arch/$(ARCH)d/lib -lpq
(specified in the makefile)
> libdbx2, it is also dependent on (ROOT)/postgres/arch/$(ARCH)d/lib
-lpq (specified in the makefile)
> libdbx3
> libdbx4
>
> the above directory (ROOT)/postgres/arch/$(ARCH)d/lib
>
> has libpq.so which i got by installing the 32 bit Postgres 8.1.5 on
fc4
> its sixe is : 116532
>
> now i put these 4 libs and the exe in the target mach
> and i run the executable Installer
>
> the traget m/c is FC4 has Postgres 8.1.5 installed which is 64 bit
>
> so it has libpq.so.4 and libpq.so.4.1 in /usr/lib64/ of that machine.
>
> rwxrwxrwx  1 root root     12 Nov 16 15:11 libpq.so.4 -> libpq.so.4.1*
> -rwxr-xr-x  1 root root 135960 Nov 16 00:30 libpq.so.4.1*
>
> so when i run the exe it gives me this error:
>
> | 2006-11-17 13:56:18.085 | 5659:1436573184 | DMF | 0 | ERROR
> | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 |
> Cannot find library for dbexpress: libpq.so.4: cannot open
> shared object file: No such file or directory
> | 2006-11-17 13:56:18.085 | 5659:1436573184 | DMF | 0 | ERROR
> | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:122 |
> Unknown repository: dbexpress

I see.

You will need the 32-bit library libpq.so.4 to run your installer
executable.

You can copy this library to some other place on the machine with the
64-bit libpq.so (I assume it is the database server) and try to make the
executable use this library.

First, check if the installer executable or libdbx<n> has an RPATH set:

objdump -p -j .dynstr <executable>|egrep RUNPATH\|RPATH

If yes, and it points to the location of the 64-bit library, you are out
of
luck and the only solution I can see is to install the server in another
directory...

If no, or the RPATH points somewhere else, you can use the environment
variable
LD_LIBRARY_PATH to make the installer executable use the correct
libpq.so.4:

env LD_LIBRARY_PATH=/location/of/32bit/lib <executable>

Yours,
Laurenz Albe

Re: dependency on 32 bit libpq.so on 64 bit Postgres server.

From
"surabhi.ahuja"
Date:
thanks a lot i followed your instruction i have put the 32 bit libpq.so.4 in a separate folder which is pointed to by
LD_LIBRARY_PATH
and the exe functions.
 
thanks,
regards
Surabhi 


From: Albe Laurenz [mailto:all@adv.magwien.gv.at]
Sent: Fri 11/17/2006 3:12 PM
To: surabhi.ahuja; pgsql-general@postgresql.org
Subject: RE: [GENERAL] dependency on 32 bit libpq.so on 64 bit Postgres server.

> let me explain with an example
> say i have a 32 bit exceutable called Installer

> it dynamically links to 4 libraries which are called:
> libdbx1, it is dependent on (ROOT)/postgres/arch/$(ARCH)d/lib -lpq
(specified in the makefile)
> libdbx2, it is also dependent on (ROOT)/postgres/arch/$(ARCH)d/lib
-lpq (specified in the makefile)
> libdbx3
> libdbx4

> the above directory (ROOT)/postgres/arch/$(ARCH)d/lib

> has libpq.so which i got by installing the 32 bit Postgres 8.1.5 on
fc4
> its sixe is : 116532

> now i put these 4 libs and the exe in the target mach
> and i run the executable Installer

> the traget m/c is FC4 has Postgres 8.1.5 installed which is 64 bit

> so it has libpq.so.4 and libpq.so.4.1 in /usr/lib64/ of that machine.

> rwxrwxrwx  1 root root     12 Nov 16 15:11 libpq.so.4 -> libpq.so.4.1*
> -rwxr-xr-x  1 root root 135960 Nov 16 00:30 libpq.so.4.1*

> so when i run the exe it gives me this error:

> | 2006-11-17 13:56:18.085 | 5659:1436573184 | DMF | 0 | ERROR
> | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:77 |
> Cannot find library for dbexpress: libpq.so.4: cannot open
> shared object file: No such file or directory
> | 2006-11-17 13:56:18.085 | 5659:1436573184 | DMF | 0 | ERROR
> | error@dmf | DMFConcreteRepositoryCreatorFactory.cxx:122 |
> Unknown repository: dbexpress

I see.

You will need the 32-bit library libpq.so.4 to run your installer
executable.

You can copy this library to some other place on the machine with the
64-bit libpq.so (I assume it is the database server) and try to make the
executable use this library.

First, check if the installer executable or libdbx<n> has an RPATH set:

objdump -p -j .dynstr <executable>|egrep RUNPATH\|RPATH

If yes, and it points to the location of the 64-bit library, you are out
of
luck and the only solution I can see is to install the server in another
directory...

If no, or the RPATH points somewhere else, you can use the environment
variable
LD_LIBRARY_PATH to make the installer executable use the correct
libpq.so.4:

env LD_LIBRARY_PATH=/location/of/32bit/lib <executable>

Yours,
Laurenz Albe