On 7/13/2015 5:36 PM, Andrew Dunstan wrote:

On 07/12/2015 05:06 PM, Tom Lane wrote:
Andrew Dunstan <and...@dunslane.net> writes:
On 07/04/2015 11:02 AM, Tom Lane wrote:
It's not apparent to me how that works at all.
BTW, the .a files being linked to above are not like Unix .a static
archives - they are import library files, which I think they are only
used at link time, not run time. The path to the DLLs isn't being
hardcoded.
Ah, I see.  So then what Marco is suggesting is copying a coding pattern
that does work.

Unless there is further argument I propose to commit something very like
Marco's suggestion for hstore_plperl, hstore_plpython and ltree_plpython
No objection here.



OK, I tried the attached patch.

but when trying to build with python 3 I get this (no such problems with
python2, which builds and tests fine):

    make -C hstore_plpython all
    make[1]: Entering directory
    '/home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython'
    ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith
    -Wdeclaration-after-statement -Wendif-labels
    -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
    -fwrapv -fexcess-precision=standard -g -O2 -I../../src/pl/plpython
    -I/usr/include/python3.4m -I../../contrib/hstore -I. -I.
    -I../../src/include -I/usr/include/libxml2   -c -o hstore_plpython.o
    hstore_plpython.c
    ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith
    -Wdeclaration-after-statement -Wendif-labels
    -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
    -fwrapv -fexcess-precision=standard -g -O2   -shared -o
    hstore_plpython3.dll  hstore_plpython.o  -L../../src/port
    -L../../src/common -Wl,--allow-multiple-definition
    -Wl,--enable-auto-import -L/usr/lib  -L/usr/local/lib
    -Wl,--as-needed   -L../../src/backend -lpostgres -L../hstore
    -lhstore -L../../src/pl/plpython -lplpython3
    -L/usr/lib/python3.4/config-3.4m -lpython3.4m -lpgcommon -lpgport
    -lxslt -lxml2 -lssl -lcrypto -lz -lreadline -lcrypt
    hstore_plpython.o: In function `hstore_to_plpython':

/home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:35:

    undefined reference to `PLyUnicode_FromStringAndSize'

[cut]
I'd like to get that fixed before applying anything. Marco, any ideas?

To build with python 3, set the environment like this:
PYTHON=/usr/bin/python3 - this can be done in the config file.

I am only building with python2, but on cygwin
there is an additional "intl" library for python3 binding

$ python2-config --libs
-lpython2.7 -ldl

$ python3-config --libs
-lpython3.4m -lintl -ldl

cheers

andrew

Regards
Marco



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to