[Pythonmac-SIG] compiling gdal against macpython
Byron Amerson
byronea at u.washington.edu
Mon Dec 1 12:14:46 EST 2003
Hi Jack, thanks for the response....
I thought it was something like that, though my understanding of the terms
and details are minimal! The answer to the libtools question is unknown
to me.
Can you please tell me in fairly exact terms how I should define the
python libs? as in the proper path to type in. Now, when I do change the
definition, do I do this in the make file before I compile or in the
GDALmake.opt file after I compile(it seems that this file is made by
make, correct?). And if the latter, then once I change
it, I go ahead and make install? Sorry about these questions, but this is
new territory for me to be delving into.
thanks
Byron Amerson
MS student
University of Washington
Department of Earth and Space Sciences
On Mon, 1 Dec 2003, Jack Jansen wrote:
>
> On 30 Nov 2003, at 3:49, Byron Amerson wrote:
>
> > Hi there.
> >
> > I have compiled gdal(geospatial data abstraction lib) on my imac
> > running
> > 10.3.1 - without python. The default build is with python, which would
> > be cool to have.
> >
> > evidently(I think) make is dissatisfied and can not see any dynamic
> > libs.
> > here is a sample of the output:
> >
> > ...stuff above
> >
> > /bin/sh ../libtool --mode=link g++ gdal_wrap.lo numpydataset.lo
> > gdalnumeric.lo ../libgdal.la -lm -ldl -L/usr/local/pgsql/lib -lpq
> > -L../.libs -o _gdalmodule.la \
> > -rpath
> > /System/Library/Frameworks/Python.framework/Versions/2.3/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
> > ../.libs/libgdal.dylib -lm -ldl -lpq
> > -L/usr/local/src/gdal/gdal-cvs-031104/.libs
> > ld: Undefined symbols:
> > _PyArg_Parse
> > _PyArg_ParseTuple
> > _PyDict_New
> > _PyDict_Next
>
> There is something wrong with the way gdal builds the extension. I
> assume it is Makefile-based and not distutils based, because I don't
> think distutils ever used libtool (correct?).
>
> What happens is that it doesn't include a reference to the Python
> framework. This is okay for most flavors of unix: they will just
> remember all external references that weren't satisfied during the link
> phase and try to satisfy these at runtime.
>
> It doesn't work for MacOSX, though. Your best bet is to add "-framework
> Python" to the link command. Try adding it to your PYTHON_LIBS
> definition and see what happens.
>
> --
> Jack Jansen <Jack.Jansen at cwi.nl> http://www.cwi.nl/~jack
> If I can't dance I don't want to be part of your revolution -- Emma
> Goldman
>
>
More information about the Pythonmac-SIG
mailing list