[Gdal-dev] Python modules fail to compile on MAC OS X

Zak James zak-ms at hoppsan.org
Wed Sep 22 20:29:03 EDT 2004


Jeroen,

I answered this question on the list a few months ago. You may find  
more details in the archive, but I'm including what I wrote then.

I've since determined that for install to proceed, you need to set a  
pymod install directory in GDALmake.opt:
INST_PYMOD      = ${prefix}/lib/python2.3/site-packages/

and make some modifications to the pymod makefile because it thinks the  
bundle extension will be .dylib instead of .so

zak

> Date: July 25, 2004 12:05:55 PM EDT
> Cc: gdal-dev at remotesensing.org
> Subject: Re: [Gdal-dev] Built gdal with python support - error
>
> I recently built gdal's python support on OS X 10.3 (with the OS  
> supplied Python 2.3) by relying on the apple compiler's support for  
> frameworks.
>
> After you configure --without-python, edit the python section of  
> GDALMake.opt like so:
>
> PYTHON_INCLUDES =  
> -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ 
> python2.3
> PYTHON_LIBS = -framework Python
> PYTHON_CFLAGS =
> PYTHON = yes
>
> and run make. The only other problem seems to be that the shared  
> library is not created as a bundle so after everything is built, you  
> need to build the python module using something like:
>
>  g++ -bundle -flat_namespace gdal_wrap.o numpydataset.o gdalnumeric.o  
> -L.. -lgdal -framework Python -ljpeg -lpng -lz -ldl -o _gdalmodule.so
>
> If you run otool -L on the .so file, you can verify that it is using  
> the appropriate libraries.
>
> zak
> --
> Zak James
> Applications and Software Development
> DM Solutions Group Inc.
> http://www.dmsolutions.ca
>
--
Zak James
Applications and Software Development
DM Solutions Group Inc.
http://www.dmsolutions.ca


On Sep 22, 2004, at 3:51 PM, Ticheler, Jeroen (SDRN) wrote:

> I have a problem compiling the Python modules of GDAL on MAC OS X. I  
> have
> seen this problem has been discussed previously (around December  
> 2003), but I
> have found no solution yet. Does anyone have a solution?
> Thanks,
> Jeroen
>
> Error while compiling:
>
> (cd pymod; make)
> GNUmakefile:35: warning: overriding commands for target  
> `_gdalmodule.la'
> GNUmakefile:29: warning: ignoring old commands for target  
> `_gdalmodule.la'
> /bin/sh ../libtool --mode=link  g++ gdal_wrap.lo numpydataset.lo
> gdalnumeric.lo
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
> ../libgdal.la -o _gdalmodule.la \
>         -rpath
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
> python2.3/site-p
> ackages \
>         -no-undefined \
>         -avoid-version \
>         -module
> g++ -Wl,-bind_at_load  -o .libs/_gdalmodule.so -bundle   
> .libs/gdal_wrap.o
> .libs/numpydataset.o .libs/gdalnumeric.o  -L/usr/local/lib
> ../.libs/libgdal.dylib
> ld: Undefined symbols:
> _PyArg_Parse
> _PyArg_ParseTuple
> _PyDict_New
> _PyDict_Next
> _PyDict_SetItem
> _PyDict_Type
> _PyErr_Clear
> _PyErr_SetString
> _PyEval_CallObjectWithKeywords
> _PyExc_MemoryError
> _PyExc_NameError
> _PyExc_TypeError
> _PyExc_ValueError
> _PyFloat_AsDouble
> _PyFloat_FromDouble
> _PyInt_AsLong
> _PyInt_FromLong
> _PyInt_Type
> _PyList_New
> _PyList_SetItem
> _PyList_Size
> _PyList_Type
> _PyModule_GetDict
> _PyObject_AsWriteBuffer
> _PyString_AsString
> _PyString_FromString
> _PyString_FromStringAndSize
> _PyString_Type
> _PyTuple_Size
> _PyTuple_Type
> _PyType_IsSubtype
> _PyType_Type
> _Py_BuildValue
> _Py_InitModule4
> __Py_NoneStruct
> make[1]: *** [_gdalmodule.la] Error 1
> make: *** [py-module] Error 2
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at xserve.flids.com
> http://xserve.flids.com/mailman/listinfo/gdal-dev
>




More information about the Gdal-dev mailing list