psycopg2 extension fails to compile with clang
Reported by Psycopg website | May 6th, 2013 @ 09:23 AM
Submitted by: Bradley Saulteaux
building 'psycopg2._psycopg' extension
clang -march=corei7-avx -O3 -ffast-math -fPIC -Wimplicit -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090200 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/include/pypy1.9 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.freebsd-9.0-RELEASE-amd64-2.7/psycopg/psycopgmodule.o
In file included from psycopg/psycopgmodule.c:27:
In file included from ./psycopg/psycopg.h:33:
./psycopg/config.h:146:15: error: static declaration of 'round' follows non-static declaration
static double round(double num)
/usr/include/math.h:273:8: note: previous declaration is here
psycopg/psycopgmodule.c:544:37: warning: incompatible pointer types passing 'PyTypeObject ' (aka 'struct _typeobject ') to parameter of type 'PyObject ' (aka 'struct _object ') [-Wincompatible-pointer-types]
if (!(descr = PyDescr_NewMethod((PyTypeObject *)Error, ^~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pypy1.9/pypy_decl.h:70:52: note: passing argument to parameter 'arg0' here
PyAPI_FUNC(PyObject ) PyDescr_NewMethod(PyObject arg0, PyMethodDef *arg1);
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1
Comments and changes to this ticket
I've tried installing clang on ubuntu and compiling psycopg and found no problem (I was signaled a warning unrelated to what you have reported here, and I'm working on fixing that).
It must be something related to your platform, not strictly to clang. As it is now we cannot debug it. Either you will have to fix yourself or provide us an ssh access to a box to test it.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.