error after installing on CentOS 5.8 with source

Поиск
Список
Период
Сортировка
От Alan Etkin
Тема error after installing on CentOS 5.8 with source
Дата
Msg-id CALtEXdry+iU7eY3BgghEhvnbn6QGVZP=nuiAAP8Z0N4LN=tP_g@mail.gmail.com
обсуждение исходный текст
Ответы Re: error after installing on CentOS 5.8 with source  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
error after installing on CentOS 5.8 with source  (Alan Etkin <spametki@gmail.com>)
Re: error after installing on CentOS 5.8 with source  (Devrim GÜNDÜZ <devrim@gunduz.org>)
Список psycopg
Hi

I am trying to build and install psycopg2-2.4.5 source distribution on  CentOS 5.8 VPS.
Installation ends without errors, but on Python interpreter, import psycopg2 returns:

Python 2.7.3 (default, Jul 25 2012, 19:59:36)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python2.7/lib/python2.7/site-packages/psycopg2/__init__.py", line 67, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: /opt/python2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so: undefined symbol: lo_truncate

I know It can be related to the issue posted in the FAQ
http://initd.org/psycopg/docs/faq.html#problems-compiling-and-deploying-psycopg2

"...You can avoid the problem by using the same version of the pg_config at install time and the libpq at runtime. ..."

But I cannot find the command/configuration needed to control the pg_config used at runtime, so I can set the pg_config to the newest version both for installation and runtime.

python setup.py build is returning this warnings:

psycopg/lobject_int.c: In function ‘lobject_write’:
psycopg/lobject_int.c:343: aviso: el paso del argumento 3 de ‘lo_write’ descarta los calificadores del tipo del destino del puntero
(something like "warning: passing third argument to lo_write discards target type classifiers of the pointer")

psycopg/lobject_int.c: In function ‘lobject_truncate’:
psycopg/lobject_int.c:478: aviso: declaración implícita de la función ‘lo_truncate’
("warning: implicit declaration of function lo_truncate")

I've installed Python 2.7.3 compiled from source
Also installed PostgreSQL 9.1.4 via yum

This is what ldd returns

[root@pycom ~] #  ldd /opt/python2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so | grep libpq
        libpq.so.4 => /usr/lib/libpq.so.4 (0x00716000)

Note: I have configured setup.cfg so it reads the updated pg_config file (pg 9.1) before installation.

There is an older pg_config version stored in /usr/bin with this output:

#########################################################################

BINDIR = /usr/bin
DOCDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/pgsql
INCLUDEDIR-SERVER = /usr/include/pgsql/server
LIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/pgsql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/pgsql
SYSCONFDIR = /etc/sysconfig/pgsql
PGXS = /usr/lib/pgsql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-rpath' '--with-perl' '--with-tcl' '--with-tclconfig=/usr/lib' '--with-python' '--with-openssl' '--with-pam' '--with-krb5' '--enable-nls' '--enable-thread-safety' '--sysconfdir=/etc/sysconfig/pgsql' '--datadir=/usr/share/pgsql' '--with-docdir=/usr/share/doc' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i386-redhat-linux-gnu'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
CFLAGS_SL = -fpic
LDFLAGS =
LDFLAGS_SL =
LIBS = -lpgport -lpam -lssl -lcrypto -lkrb5 -lz -lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl -lm -lbsd
VERSION = PostgreSQL 8.1.23

#########################################################################



The new pg_config output:
#########################################################################

BINDIR = /usr/pgsql-9.1/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/pgsql-9.1/include
PKGINCLUDEDIR = /usr/pgsql-9.1/include
INCLUDEDIR-SERVER = /usr/pgsql-9.1/include/server
LIBDIR = /usr/pgsql-9.1/lib
PKGLIBDIR = /usr/pgsql-9.1/lib
LOCALEDIR = /usr/pgsql-9.1/share/locale
MANDIR = /usr/pgsql-9.1/share/man
SHAREDIR = /usr/pgsql-9.1/share
SYSCONFDIR = /etc/sysconfig/pgsql
PGXS = /usr/pgsql-9.1/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-rpath' '--prefix=/usr/pgsql-9.1' '--includedir=/usr/pgsql-9.1/include' '--mandir=/usr/pgsql-9.1/share/man' '--datadir=/usr/pgsql-9.1/share' '--with-perl' '--with-python' '--with-tcl' '--with-tclconfig=/usr/lib' '--with-openssl' '--with-pam' '--with-krb5' '--with-gssapi' '--with-includes=/usr/include' '--with-libraries=/usr/lib' '--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 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -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 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL = -fpic
LDFLAGS = -L/usr/lib -L/usr/lib
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -ltermcap -lcrypt -ldl -lm
VERSION = PostgreSQL 9.1.4

#########################################################################

Thanks

В списке psycopg по дате отправления:

Предыдущее
От: Raheem Sarcar
Дата:
Сообщение: Re: Inconsistent results when calculating "age" of db records
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: error after installing on CentOS 5.8 with source