Обсуждение: Snow Leopard and plpython problem

Поиск
Список
Период
Сортировка

Snow Leopard and plpython problem

От
Jerry LeVan
Дата:
Hi I am having a problem building Postgresql 8.4.0 in Snow Leopard.

I cannot get plpython to build...

I have installed MacPython 2.6.2 in /Library/Frameworks/Python.framework

The binary:

mbp:postgresql-8.4.0 postgres$ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python

mbp:postgresql-8.4.0 postgres$ file `which python`
/Library/Frameworks/Python.framework/Versions/Current/bin/python: Mach-
O universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/Current/bin/python (for
architecture ppc):    Mach-O executable ppc
/Library/Frameworks/Python.framework/Versions/Current/bin/python (for
architecture i386):    Mach-O executable i386

mbp:postgresql-8.4.0 postgres$ echo $PATH
/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/
bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
mbp:postgresql-8.4.0 postgres$ python
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information

I use the following config params:

mbp:postgresql-8.4.0 postgres$ cat configJHL
./configure --bindir=/usr/local/bin --mandir=/usr/local/share/man  \
  --enable-thread-safety \
  --with-python \
  --with-perl --with-tcl \
  --with-libedit-preferred \
   --with-openssl --with-bonjour

Configure completes ok.

When I do a "make 2>mylog.log"

The build fails on
gcc -no-cpp-precomp -O2 -Wall -Wmissing-prototypes -Wpointer-arith -
Wdeclaration-after-statement
-Wendif-labels -fno-strict-aliasing -fwrapv  -bundle -multiply_defined
suppress  plpython.o
-bundle_loader ../../../src/backend/postgres  -L../../../src/port -
framework Python  -o plpython.so

The contents of mylog.log are:
postmaster.c: In function ‘PostmasterMain’:
postmaster.c:859: warning: ‘DNSServiceRegistrationCreate’ is
deprecated (declared at /usr/include/DNSServiceDiscovery/
DNSServiceDiscovery.h:139)
pgc.c:4363: warning: ‘yy_flex_realloc’ defined but not used
ld: warning: in ../../../src/backend/postgres, file is not of required
architecture
ld: warning: in plperl.o, file is not of required architecture
ld: warning: in spi_internal.o, file is not of required architecture
ld: warning: in SPI.o, file is not of required architecture
ld: warning: in ../../../src/backend/postgres, file is not of required
architecture
ld: warning: in plperl.o, file is not of required architecture
ld: warning: in spi_internal.o, file is not of required architecture
ld: warning: in SPI.o, file is not of required architecture
ld: warning: in /Library/Frameworks//Python.framework/Python, missing
required architecture x86_64 in file
Undefined symbols:
   "_PyDict_DelItemString", referenced from:
       _PLy_function_delete_args in plpython.o
   "_PyIter_Next", referenced from:
       _PLy_function_handler in plpython.o
   "_PyFloat_FromDouble", referenced from:
       _PLyFloat_FromString in plpython.o
   "_PyErr_Fetch", referenced from:
       _PLy_elog in plpython.o
   "_PyErr_NewException", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
   "_PyErr_GivenExceptionMatches", referenced from:
       _PLy_elog in plpython.o
       _PLy_elog in plpython.o
   "_PyDict_GetItemString", referenced from:
       _PLy_modify_tuple in plpython.o
       _PLy_procedure_get in plpython.o
   "_Py_Initialize", referenced from:
       __PG_init in plpython.o
   "_PyArg_ParseTuple", referenced from:
       _PLy_plan_status in plpython.o
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute in plpython.o
       _PLy_spi_execute in plpython.o
   "_PyList_New", referenced from:
       _PLy_trigger_build_args in plpython.o
       _PLy_function_build_args in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
   "_PyCObject_FromVoidPtr", referenced from:
       _PLy_procedure_create in plpython.o
   "_PyRun_StringFlags", referenced from:
       _PLy_procedure_create in plpython.o
   "_PyDict_GetItem", referenced from:
       _PLy_modify_tuple in plpython.o
   "_PyObject_GetIter", referenced from:
       _PLy_function_handler in plpython.o
   "_PySequence_Check", referenced from:
       _PLy_function_handler in plpython.o
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute_plan in plpython.o
   "_PyMapping_GetItemString", referenced from:
       _PLyMapping_ToTuple in plpython.o
   "_PySequence_Size", referenced from:
       _PLySequence_ToTuple in plpython.o
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute_plan in plpython.o
   "_PyErr_NormalizeException", referenced from:
       _PLy_elog in plpython.o
   "_PySequence_GetItem", referenced from:
       _PLySequence_ToTuple in plpython.o
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute_plan in plpython.o
   "_PyObject_GetAttrString", referenced from:
       _PLyObject_ToTuple in plpython.o
   "_PyBool_FromLong", referenced from:
       _PLyBool_FromString in plpython.o
       _PLyBool_FromString in plpython.o
   "_PyObject_Str", referenced from:
       _PLy_elog in plpython.o
       _PLy_elog in plpython.o
       _PLy_modify_tuple in plpython.o
       _PLySequence_ToTuple in plpython.o
       _PLyMapping_ToTuple in plpython.o
       _PLyObject_ToTuple in plpython.o
       _PLy_function_handler in plpython.o
       _PLy_output in plpython.o
       _PLy_spi_execute_plan in plpython.o
       _PLy_spi_execute_plan in plpython.o
   "_PyDict_SetItemString", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
       _PLyDict_FromTuple in plpython.o
       _PLyDict_FromTuple in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_procedure_call in plpython.o
       _PLy_procedure_create in plpython.o
       _PLy_procedure_create in plpython.o
       _PLy_function_build_args in plpython.o
   "_PyObject_Init", referenced from:
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
   "_PyCObject_AsVoidPtr", referenced from:
       _PLy_procedure_get in plpython.o
   "_PyErr_SetString", referenced from:
       _PLy_exception_set_plural in plpython.o
       _PLy_exception_set in plpython.o
       _PLy_output in plpython.o
   "_PyCObject_Type", referenced from:
       _PLy_procedure_get in plpython.o
   "_PyLong_FromString", referenced from:
       _PLyLong_FromString in plpython.o
   "_PyString_FromString", referenced from:
       _PLyString_FromString in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
   "_PyString_AsString", referenced from:
       _PLy_elog in plpython.o
       _PLy_elog in plpython.o
       _PLy_modify_tuple in plpython.o
       _PLy_modify_tuple in plpython.o
       _PLy_modify_tuple in plpython.o
       _PLy_trigger_handler in plpython.o
       _PLySequence_ToTuple in plpython.o
       _PLyMapping_ToTuple in plpython.o
       _PLyObject_ToTuple in plpython.o
       _PLy_function_handler in plpython.o
       _PLy_spi_prepare in plpython.o
       _PLy_output in plpython.o
       _PLy_spi_execute_plan in plpython.o
       _PLy_spi_execute_plan in plpython.o
   "_PyImport_AddModule", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
   "_PyErr_Clear", referenced from:
       _plpython_call_handler in plpython.o
       _PLy_spi_execute in plpython.o
   "_Py_InitModule4_64", referenced from:
       __PG_init in plpython.o
   "_PyObject_Malloc", referenced from:
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
   "_PyList_GetSlice", referenced from:
       _PLy_result_slice in plpython.o
   "_PyList_SetSlice", referenced from:
       _PLy_result_ass_slice in plpython.o
   "__Py_TrueStruct", referenced from:
       _PLy_plan_status in plpython.o
   "_Py_CompileStringFlags", referenced from:
       _PLy_procedure_create in plpython.o
   "_PyList_Size", referenced from:
       _PLy_result_length in plpython.o
       _PLy_modify_tuple in plpython.o
   "_PyModule_GetDict", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
   "_PyInt_FromLong", referenced from:
       _PLyInt_FromString in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
   "_PyDict_Copy", referenced from:
       _PLy_procedure_create in plpython.o
   "_PyErr_Occurred", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
       __PG_init in plpython.o
       _PLy_procedure_call in plpython.o
       _PLy_procedure_create in plpython.o
       _PLy_procedure_create in plpython.o
       _PLy_function_handler in plpython.o
       _PLy_spi_prepare in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
       _PLy_spi_execute_plan in plpython.o
       _PLy_spi_execute_query in plpython.o
   "_PyDict_Keys", referenced from:
       _PLy_modify_tuple in plpython.o
   "_PyList_GetItem", referenced from:
       _PLy_result_item in plpython.o
       _PLy_modify_tuple in plpython.o
   "_PyList_SetItem", referenced from:
       _PLy_result_ass_item in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_function_build_args in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
   "_PyType_Ready", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
   "_PyEval_EvalCode", referenced from:
       _PLy_procedure_call in plpython.o
   "_PyDict_New", referenced from:
       __PG_init in plpython.o
       __PG_init in plpython.o
       _PLyDict_FromTuple in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_procedure_create in plpython.o
   "_Py_FindMethod", referenced from:
       _PLy_result_getattr in plpython.o
       _PLy_plan_getattr in plpython.o
   "__Py_NoneStruct", referenced from:
       _PLyDict_FromTuple in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_trigger_build_args in plpython.o
       _PLy_modify_tuple in plpython.o
       _PLy_trigger_handler in plpython.o
       _PLy_function_build_args in plpython.o
       _PLySequence_ToTuple in plpython.o
       _PLyMapping_ToTuple in plpython.o
       _PLyObject_ToTuple in plpython.o
       _PLy_function_handler in plpython.o
       _PLy_function_handler in plpython.o
       _PLy_output in plpython.o
       _PLy_spi_execute_fetch_result in plpython.o
       _PLy_spi_execute_plan in plpython.o
   "_PyMapping_Check", referenced from:
       _PLy_function_handler in plpython.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [plpython.so] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
mbp:postgresql-8.4.0 postgres$
***********************************************
If I change my PATH:

mbp:postgresql-8.4.0 postgres$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

This will cause the 2.6.1 Snow Leopard version of python to be used.
mbp:postgresql-8.4.0 postgres$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Doing a make clean and a rm config.status and starting over results in
the identical Python errors.

Does plpython not work with python2.6.x ?

Thanks,

Jerry

Re: Snow Leopard and plpython problem

От
Emanuel Calvo Franco
Дата:
2009/9/3 Jerry LeVan <jerry.levan@eku.edu>:
> Hi I am having a problem building Postgresql 8.4.0 in Snow Leopard.
>
> I cannot get plpython to build...
>
> I have installed MacPython 2.6.2 in /Library/Frameworks/Python.framework
>
> The binary:
>

In Debian I had to install these libs to get work 8.4:libsdl-perl,
libperl-dev, python-all-dev (for perl and python). For 8.3 i didn't
need it (seems).
But in my case i use 2.5. Hope it helps :S




--
              Emanuel Calvo Franco
             DBA at:  www.siu.edu.ar
        www.emanuelcalvofranco.com.ar

Re: Snow Leopard and plpython problem

От
Jan Otto
Дата:
hi jerry,

> Hi I am having a problem building Postgresql 8.4.0 in Snow Leopard.
>
> I cannot get plpython to build...
>
> I have installed MacPython 2.6.2 in /Library/Frameworks/
> Python.framework

do you really need python 2.6.2? snow leopard has python 2.6.1 on
board and
there are no problems compiling/using postgresql with the python that
comes
with snow leopard.

> The binary:
>
> mbp:postgresql-8.4.0 postgres$ which python
> /Library/Frameworks/Python.framework/Versions/Current/bin/python
>
> mbp:postgresql-8.4.0 postgres$ file `which python`
> /Library/Frameworks/Python.framework/Versions/Current/bin/python:
> Mach-O universal binary with 2 architectures
> /Library/Frameworks/Python.framework/Versions/Current/bin/python
> (for architecture ppc):    Mach-O executable ppc
> /Library/Frameworks/Python.framework/Versions/Current/bin/python
> (for architecture i386):    Mach-O executable i386

you need the 64-bit version of python (x86_64) or try compile
postgresql 32-bit (i386)

asche:~ asche$ file `which python`
/usr/bin/python: Mach-O universal binary with 3 architectures
/usr/bin/python (for architecture x86_64):    Mach-O 64-bit executable
x86_64
/usr/bin/python (for architecture i386):    Mach-O executable i386
/usr/bin/python (for architecture ppc7400):    Mach-O executable ppc

> ./configure --bindir=/usr/local/bin --mandir=/usr/local/share/man  \
> --enable-thread-safety \
> --with-python \
> --with-perl --with-tcl \
> --with-libedit-preferred \
>  --with-openssl --with-bonjour
>
> Configure completes ok.
>
> When I do a "make 2>mylog.log"

i have tried configuring an building with the same options as you and
it compiles without an error or warning
about python.

regards, jan otto



Re: Snow Leopard and plpython problem

От
Jerry LeVan
Дата:
On Sep 3, 2009, at 11:01 AM, Jan Otto wrote:

> hi jerry,
>
>> Hi I am having a problem building Postgresql 8.4.0 in Snow Leopard.
>>
>> I cannot get plpython to build...
>>
>> I have installed MacPython 2.6.2 in /Library/Frameworks/
>> Python.framework
>
> do you really need python 2.6.2? snow leopard has python 2.6.1 on
> board and
> there are no problems compiling/using postgresql with the python that
> comes
> with snow leopard.
>
>> The binary:
>>
>> mbp:postgresql-8.4.0 postgres$ which python
>> /Library/Frameworks/Python.framework/Versions/Current/bin/python
>>
>> mbp:postgresql-8.4.0 postgres$ file `which python`
>> /Library/Frameworks/Python.framework/Versions/Current/bin/python:
>> Mach-O universal binary with 2 architectures
>> /Library/Frameworks/Python.framework/Versions/Current/bin/python
>> (for architecture ppc):    Mach-O executable ppc
>> /Library/Frameworks/Python.framework/Versions/Current/bin/python
>> (for architecture i386):    Mach-O executable i386
>
> you need the 64-bit version of python (x86_64) or try compile
> postgresql 32-bit (i386)
>
> asche:~ asche$ file `which python`
> /usr/bin/python: Mach-O universal binary with 3 architectures
> /usr/bin/python (for architecture x86_64):    Mach-O 64-bit executable
> x86_64
> /usr/bin/python (for architecture i386):    Mach-O executable i386
> /usr/bin/python (for architecture ppc7400):    Mach-O executable ppc
>
>> ./configure --bindir=/usr/local/bin --mandir=/usr/local/share/man  \
>> --enable-thread-safety \
>> --with-python \
>> --with-perl --with-tcl \
>> --with-libedit-preferred \
>> --with-openssl --with-bonjour
>>
>> Configure completes ok.
>>
>> When I do a "make 2>mylog.log"
>
> i have tried configuring an building with the same options as you and
> it compiles without an error or warning
> about python.
>
> regards, jan otto
>
>

Jan, Thanks for convincing me that it could be done...

It appears to me that even though I simplified my PATH to a bare
minimum that
the link process was picking up the framework in /Library/Frameworks/
Python
instead of /System/Library/Frameworks/Python.framework.

I renamed /Library/Frameworks/Python so it was no longer visible and
the build succeeded.

Jerry