Thread: Trouble finding libpq on Centos 6.5

Trouble finding libpq on Centos 6.5

From
Aqz
Date:
Hi.

I'm not sure if I should write here, or on a Centos mailing list...

I have fresh, vanilla Centos 6.5 with postgresql yum repository added.
I've successfully installed postgresql93 and postgresql93-libs packages, but still :

$ ld -lpq
ld: cannot find -lpq

$ ldconfig -p
        libpq.so.5 (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so.5
        libpq.so (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so


What did I do wrong?

--
Wojtek

Re: Trouble finding libpq on Centos 6.5

From
Alberto Cabello Sánchez
Date:
On Thu, 8 May 2014 08:54:44 +0200
Aqz <poczta@aquaz.eu> wrote:

> Hi.
>
> I'm not sure if I should write here, or on a Centos mailing list...
>
> I have fresh, vanilla Centos 6.5 with postgresql yum repository added.
> I've successfully installed postgresql93 and postgresql93-libs packages,
> but still :
>
> $ ld -lpq
> ld: cannot find -lpq
>
> $ ldconfig -p
>         libpq.so.5 (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so.5
>         libpq.so (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so
>
>
> What did I do wrong?

Hi, Wojtek

Maybe you need to install postgresql93-devel package?


--
Alberto Cabello Sánchez <alberto@unex.es>


Re: Trouble finding libpq on Centos 6.5

From
Asif Naeem
Date:
Hi,

Yes. It seems that /usr/pgsql-9.3/lib is not in linker default library search path. You may either require to provide it explicitly via -L option while linking or add /usr/pgsql-9.3/lib to the default library search path.

As suggested by Alberto, for development work related devel package is required.

Regards,
Muhammad Asif Naeem

On Thu, May 8, 2014 at 1:06 PM, Alberto Cabello Sánchez <alberto@unex.es> wrote:
On Thu, 8 May 2014 08:54:44 +0200
Aqz <poczta@aquaz.eu> wrote:

> Hi.
>
> I'm not sure if I should write here, or on a Centos mailing list...
>
> I have fresh, vanilla Centos 6.5 with postgresql yum repository added.
> I've successfully installed postgresql93 and postgresql93-libs packages,
> but still :
>
> $ ld -lpq
> ld: cannot find -lpq
>
> $ ldconfig -p
>         libpq.so.5 (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so.5
>         libpq.so (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so
>
>
> What did I do wrong?

Hi, Wojtek

Maybe you need to install postgresql93-devel package?


--
Alberto Cabello Sánchez <alberto@unex.es>


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: Trouble finding libpq on Centos 6.5

From
Steve Clark
Date:
On 05/08/2014 02:54 AM, Aqz wrote:
Hi.

I'm not sure if I should write here, or on a Centos mailing list...

I have fresh, vanilla Centos 6.5 with postgresql yum repository added.
I've successfully installed postgresql93 and postgresql93-libs packages, but still :

$ ld -lpq
ld: cannot find -lpq

$ ldconfig -p
        libpq.so.5 (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so.5
        libpq.so (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so


What did I do wrong?

--
Wojtek

They put the postgres stuff in versioned directories.
there is a program you use to find out where stuff is.
do a man on pg_config

$ pg_config --bindir
/usr/pgsql-9.3/bin

$ pg_config

BINDIR = /usr/pgsql-9.3/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/pgsql-9.3/include
PKGINCLUDEDIR = /usr/pgsql-9.3/include
INCLUDEDIR-SERVER = /usr/pgsql-9.3/include/server
LIBDIR = /usr/pgsql-9.3/lib
PKGLIBDIR = /usr/pgsql-9.3/lib
LOCALEDIR = /usr/pgsql-9.3/share/locale
MANDIR = /usr/pgsql-9.3/share/man
SHAREDIR = /usr/pgsql-9.3/share
SYSCONFDIR = /etc/sysconfig/pgsql
PGXS = /usr/pgsql-9.3/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-rpath' '--prefix=/usr/pgsql-9.3' '--includedir=/usr/pgsql-9.3/include' '--mandir=/usr/pgsql-9.3/share/man' '--datadir=/usr/pgsql-9.3/share' '--with-perl' '--with-python' '--with-tcl' '--with-tclconfig=/usr/lib64' '--with-openssl' '--with-pam' '--with-krb5' '--with-gssapi' '--with-includes=/usr/include' '--with-libraries=/usr/lib64' '--enable-nls' '--with-ossp-uuid' '--with-libxml' '--with-libxslt' '--with-ldap' '--with-system-tzdata=/usr/share/zoneinfo' '--sysconfdir=/etc/sysconfig/pgsql' '--docdir=/usr/share/doc' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et' 'CPPFLAGS= -I/usr/include/et'
CC = gcc
CPPFLAGS = -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include
CFLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL = -fpic
LDFLAGS = -L../../../src/common -L/usr/lib64 -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgport -lpgcommon -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lcrypt -ldl -lm
VERSION = PostgreSQL 9.3.4



--
Stephen Clark
NetWolves Managed Services, LLC.
Director of Technology
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.clark@netwolves.com
http://www.netwolves.com

Re: Trouble finding libpq on Centos 6.5

From
Aqz
Date:
I have devel package installed.

Centos postgresql package adds file to /etc/ld.so.conf.d with path to pgsql libraries directory (/usr/pgsql-9.3/lib/) so I don't think that is the problem.
As you can see in my first message ldconfig -p lists libpq library among others..
Also :
$ LD_LIBRARY_PATH="/usr/pgsql-9.3/lib" ld -lpq
ld: cannot find -lpq


2014-05-08 13:14 GMT+02:00 Asif Naeem <anaeem.it@gmail.com>:
Hi,

Yes. It seems that /usr/pgsql-9.3/lib is not in linker default library search path. You may either require to provide it explicitly via -L option while linking or add /usr/pgsql-9.3/lib to the default library search path.

As suggested by Alberto, for development work related devel package is required.

Regards,
Muhammad Asif Naeem

On Thu, May 8, 2014 at 1:06 PM, Alberto Cabello Sánchez <alberto@unex.es> wrote:
On Thu, 8 May 2014 08:54:44 +0200
Aqz <poczta@aquaz.eu> wrote:

> Hi.
>
> I'm not sure if I should write here, or on a Centos mailing list...
>
> I have fresh, vanilla Centos 6.5 with postgresql yum repository added.
> I've successfully installed postgresql93 and postgresql93-libs packages,
> but still :
>
> $ ld -lpq
> ld: cannot find -lpq
>
> $ ldconfig -p
>         libpq.so.5 (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so.5
>         libpq.so (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so
>
>
> What did I do wrong?

Hi, Wojtek

Maybe you need to install postgresql93-devel package?


--
Alberto Cabello Sánchez <alberto@unex.es>


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




--
Wojtek Dziubiński
www.aquaz.eu

Re: Trouble finding libpq on Centos 6.5

From
Alberto Cabello Sánchez
Date:
On Thu, 8 May 2014 14:02:01 +0200
Aqz <poczta@aquaz.eu> wrote:

> I have devel package installed.
>
> Centos postgresql package adds file to /etc/ld.so.conf.d with path to pgsql
> libraries directory (/usr/pgsql-9.3/lib/) so I don't think that is the
> problem.

So, it seems "ldconfig" searches in ld.so.conf.d paths, but "ld" doesn't...
which doesn't make sense to me.


--
Alberto Cabello Sánchez <alberto@unex.es>


Re: Trouble finding libpq on Centos 6.5

From
Asif Naeem
Date:
On Thu, May 8, 2014 at 5:02 PM, Aqz <poczta@aquaz.eu> wrote:
I have devel package installed.

Centos postgresql package adds file to /etc/ld.so.conf.d with path to pgsql libraries directory (/usr/pgsql-9.3/lib/) so I don't think that is the problem.
As you can see in my first message ldconfig -p lists libpq library among others..
Also :
$ LD_LIBRARY_PATH="/usr/pgsql-9.3/lib" ld -lpq
ld: cannot find -lpq

I am not sure if Linux linker (ld) pick run time linker/loader paths by default ( AFAIR Solaris compiler/linker can use library search path from LD_LIBRARY_PATH etc ). I would suggest to use -L or add directory /usr/pgsql-9.3/lib to linker (ld) default library search path. you can check current search path via "ld --verbose | grep SEARCH_DIR".


2014-05-08 13:14 GMT+02:00 Asif Naeem <anaeem.it@gmail.com>:
Hi,

Yes. It seems that /usr/pgsql-9.3/lib is not in linker default library search path. You may either require to provide it explicitly via -L option while linking or add /usr/pgsql-9.3/lib to the default library search path.

As suggested by Alberto, for development work related devel package is required.

Regards,
Muhammad Asif Naeem

On Thu, May 8, 2014 at 1:06 PM, Alberto Cabello Sánchez <alberto@unex.es> wrote:
On Thu, 8 May 2014 08:54:44 +0200
Aqz <poczta@aquaz.eu> wrote:

> Hi.
>
> I'm not sure if I should write here, or on a Centos mailing list...
>
> I have fresh, vanilla Centos 6.5 with postgresql yum repository added.
> I've successfully installed postgresql93 and postgresql93-libs packages,
> but still :
>
> $ ld -lpq
> ld: cannot find -lpq
>
> $ ldconfig -p
>         libpq.so.5 (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so.5
>         libpq.so (libc6,x86-64) => /usr/pgsql-9.3/lib/libpq.so
>
>
> What did I do wrong?

Hi, Wojtek

Maybe you need to install postgresql93-devel package?


--
Alberto Cabello Sánchez <alberto@unex.es>


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




--
Wojtek Dziubiński
www.aquaz.eu