Re: Unable to build python extension with PGXS - Mailing list pgsql-general

From Jim Nasby
Subject Re: Unable to build python extension with PGXS
Date
Msg-id 5696BD66.4070606@BlueTreble.com
Whole thread Raw
In response to Unable to build python extension with PGXS  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Unable to build python extension with PGXS  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-general
On 1/12/16 10:04 PM, Jim Nasby wrote:
> Attempting to build a python extension, I'm getting:
>
> Undefined symbols for architecture x86_64:
>    "_PyErr_Clear", referenced from:
>        _PLyNdarray_FromDatum in pg_ndarray.o
>        _PLyObject_To_ndarray in pg_ndarray.o
>    "_PyImport_ImportModule", referenced from:
>        _PLyNdarray_FromDatum in pg_ndarray.o
>        _PLyObject_To_ndarray in pg_ndarray.o
>    "_PyObject_CallFunction", referenced from:
>        _PLyNdarray_FromDatum in pg_ndarray.o
>        _PLyObject_To_ndarray in pg_ndarray.o
>    "_PyObject_GetAttrString", referenced from:
>        _PLyNdarray_FromDatum in pg_ndarray.o
>        _PLyObject_To_ndarray in pg_ndarray.o
>    "_PyString_AsString", referenced from:
>        _PLyObject_To_ndarray in pg_ndarray.o
>    "_PyString_FromStringAndSize", referenced from:
>        _PLyNdarray_FromDatum in pg_ndarray.o
>    "_PyString_Size", referenced from:
>        _PLyObject_To_ndarray in pg_ndarray.o
> ld: symbol(s) not found for architecture x86_64
>
> I've included $(python_includespec) in my Makefile:
>
> override CPPFLAGS := $(python_includespec) $(CPPFLAGS)
>
> Is there some other magic I need? Do I need to switch to using
> MODULE_big or something?

After some Screwing Around(TM), I figured out that the magic trick is to
add the output of python-config --ldflags to LDFLAGS. I see we have a
$(perl_embed_ldflags), should there be something similar for python?
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


pgsql-general by date:

Previous
From: Steve Litt
Date:
Subject: Re: WIP: CoC V5
Next
From: Kevin Grittner
Date:
Subject: Re: Data Packaging/Data Unpacking