I am trying to install psycopg2 from source in Centos 6.7 x86_64, with
Python 3.4.3 and Postgresql 9.4
I have overcomed and resolved the documented 'gotchas':
a) Access to pg_config >> Added "export POSTGRESQL_HOME=/usr/pgsql-9.4;
pathmunge $POSTGRESQL_HOME/bin" to /etc/profile.d
b) Missing libpq-fs.h, pg_config_ext.h, postgres_ext.h, libpq-fe.h
>> All moved to psycopg2-2.6.1 directory
Currently the build is failing the "python setup.py build" at gcc. The
compiler complains about a "-lpq" switch (Just after "-o" switch. I am not
being able to resolve this problem.
Compile messages follows:
=========================================
creating /root/psycopg2-2.6.1/build/lib.3.4
creating /root/psycopg2-2.6.1/build/lib.3.4/psycopg2
gcc -pthread -shared -Wl,-rpath /usr/local/lib
build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o
build/temp.linux-x86_64-3.4/psycopg/green.o
build/temp.linux-x86_64-3.4/psycopg/pqpath.o
build/temp.linux-x86_64-3.4/psycopg/utils.o
build/temp.linux-x86_64-3.4/psycopg/bytes_format.o
build/temp.linux-x86_64-3.4/psycopg/connection_int.o
build/temp.linux-x86_64-3.4/psycopg/connection_type.o
build/temp.linux-x86_64-3.4/psycopg/cursor_int.o
build/temp.linux-x86_64-3.4/psycopg/cursor_type.o
build/temp.linux-x86_64-3.4/psycopg/diagnostics_type.o
build/temp.linux-x86_64-3.4/psycopg/error_type.o
build/temp.linux-x86_64-3.4/psycopg/lobject_int.o
build/temp.linux-x86_64-3.4/psycopg/lobject_type.o
build/temp.linux-x86_64-3.4/psycopg/notify_type.o
build/temp.linux-x86_64-3.4/psycopg/xid_type.o
build/temp.linux-x86_64-3.4/psycopg/adapter_asis.o
build/temp.linux-x86_64-3.4/psycopg/adapter_binary.o
build/temp.linux-x86_64-3.4/psycopg/adapter_datetime.o
build/temp.linux-x86_64-3.4/psycopg/adapter_list.o
build/temp.linux-x86_64-3.4/psycopg/adapter_pboolean.o
build/temp.linux-x86_64-3.4/psycopg/adapter_pdecimal.o
build/temp.linux-x86_64-3.4/psycopg/adapter_pint.o
build/temp.linux-x86_64-3.4/psycopg/adapter_pfloat.o
build/temp.linux-x86_64-3.4/psycopg/adapter_qstring.o
build/temp.linux-x86_64-3.4/psycopg/microprotocols.o
build/temp.linux-x86_64-3.4/psycopg/microprotocols_proto.o
build/temp.linux-x86_64-3.4/psycopg/typecast.o -L/usr/local/lib
-L/usr/pgsql-9.4/lib -lpython3.4m -lpq -o
/root/psycopg2-2.6.1/build/lib.3.4/psycopg2/_psycopg.cpython-34m.so
/usr/bin/ld: cannot find -lpq
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make: *** [/root/psycopg2-2.6.1/build/lib.3.4/psycopg2/_psycopg.so] Error 1
=============================================================
I will Appreciate any suggestions.
Carlos Sotto Maior
<mailto:csotto(at)uol(dot)com(dot)br> csotto(at)uol(dot)com(dot)br