Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

psycopg2 extension fails to compile with clang

#127

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

double round(double);

    ^

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

Reported by Psycopg website · September 19th, 2012 @ 03:57 PM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from new to open

    Provide a patch then. You are the clang user.

    September 19th, 2012 @ 05:48 PM

  2. Daniele Varrazzo
    Daniele Varrazzo

    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.

    September 19th, 2012 @ 11:15 PM

  3. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from open to hold
    • Tag changed from rel-2.4.5 to clang, rel-2.4.5

    We have had other people compiling psycopg2 on clang and they have reported success. Putting the issue on hold until further details are provided.

    October 9th, 2012 @ 12:05 AM

  4. Andy Hooper
    Andy Hooper

    I got this error when building with pkgsrc gcc on Solaris. Modifying the #if to omit defining round got me a successful build.

    December 16th, 2012 @ 04:51 PM

  5. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from hold to resolved

    This must have gone with the last solaris patches in master.

    May 6th, 2013 @ 09:23 AM