[Gdal-dev] Built gdal with python support - error

Zak James zak-ms at hoppsan.org
Sun Jul 25 12:05:55 EDT 2004


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


On Jul 23, 2004, at 6:14 PM, Lorenzo Moretti wrote:

> Hi everybody
>
> I want to build a Python support for Gdal on OS X.
> Python version is 2.3.
>
> I have this error message in make:
>
> (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=compile gcc   -Wall  -O3 -fno-common  
> -no-cpp-precomp -DCPL_MULTIPROC_PTHREAD   -I../port -I../gcore  
> -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include   -c -o gdal_wrap.o gdal_wrap.c
>  gcc -Wall -O3 -fno-common -no-cpp-precomp -DCPL_MULTIPROC_PTHREAD  
> -I../port -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -c gdal_wrap.c -fno-common -DPIC -o  
> .libs/gdal_wrap.o
> In file included from  
> /Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3/Python.h:70,
>                  from gdal_wrap.c:44:
> /Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3/objimpl.h:255: warning: use of `long double' type; its size  
> may change in a future release
> /Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3/objimpl.h:255: warning: (Long double usage is reported only  
> once for each file.
> /Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3/objimpl.h:255: warning: To disable this warning, use  
> -Wno-long-double.)
> gdal_wrap.c: In function `ptrset':
> gdal_wrap.c:868: warning: unused variable `obj'
> gdal_wrap.c: In function `ptradd':
> gdal_wrap.c:954: warning: `obj' might be used uninitialized in this  
> function
> gdal_wrap.c: At top level:
> gdal_wrap.c:211: warning: `SWIG_addvarlink' defined but not used
>  gcc -Wall -O3 -fno-common -no-cpp-precomp -DCPL_MULTIPROC_PTHREAD  
> -I../port -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -c gdal_wrap.c -o gdal_wrap.o >/dev/null  
> 2>&1
> /bin/sh ../libtool --mode=compile g++   -Wall  -O3 -fno-common  
> -no-cpp-precomp -Wno-long-double -DCPL_MULTIPROC_PTHREAD   -I../port  
> -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include   -c -o numpydataset.o numpydataset.cpp
>  g++ -Wall -O3 -fno-common -no-cpp-precomp -Wno-long-double  
> -DCPL_MULTIPROC_PTHREAD -I../port -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -c numpydataset.cpp  -fno-common -DPIC  
> -o .libs/numpydataset.o
>  g++ -Wall -O3 -fno-common -no-cpp-precomp -Wno-long-double  
> -DCPL_MULTIPROC_PTHREAD -I../port -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -c numpydataset.cpp -o numpydataset.o  
> >/dev/null 2>&1
> /bin/sh ../libtool --mode=compile g++   -Wall  -O3 -fno-common  
> -no-cpp-precomp -Wno-long-double -DCPL_MULTIPROC_PTHREAD   -I../port  
> -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include   -c -o gdalnumeric.o gdalnumeric.cpp
>  g++ -Wall -O3 -fno-common -no-cpp-precomp -Wno-long-double  
> -DCPL_MULTIPROC_PTHREAD -I../port -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -c gdalnumeric.cpp  -fno-common -DPIC -o  
> .libs/gdalnumeric.o
>  g++ -Wall -O3 -fno-common -no-cpp-precomp -Wno-long-double  
> -DCPL_MULTIPROC_PTHREAD -I../port -I../gcore -I../ogr  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3  
> -I/Library/Frameworks/Python.framework/Versions/Current/include/ 
> python2.3 -I../port -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -I/usr/local/grasslib  
> -I/usr/local/grasslib/include -c gdalnumeric.cpp -o gdalnumeric.o  
> >/dev/null 2>&1
> /bin/sh ../libtool --mode=link  g++ gdal_wrap.lo numpydataset.lo  
> gdalnumeric.lo  
> -L/Library/Frameworks/Python.framework/Versions/Current/lib/python2.3  
> -L/Library/Frameworks/Python.framework/Versions/Current/lib/python2.3  
> ../libgdal.la -o _gdalmodule.la \
>         -rpath  
> /Library/Frameworks/Python.framework/Versions/Current/lib/python2.3/ 
> site-packages \
>         -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/pgsql/lib /usr/local/grasslib/lib/libdl.dylib  
> /usr/local/grasslib/lib/libjpeg.dylib  
> /usr/local/grasslib/lib/libodbc.dylib -L/usr/local/grasslib/lib  
> -L/usr/local/grasslib /usr/local/grasslib/lib/libproj.dylib  
> -L/usr/local/grasslib/src  
> -L/Library/Frameworks/Python.framework/Versions/Current/lib/python2.3  
> ../.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
>
>
> There is a problem in gdalwarp.c with some variables...
> Thanx for help
>
> _______________________________________________
> 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