[Gdal-dev] python support under cygwin?

Norman Vine nhv at cape.com
Wed May 14 16:09:19 EDT 2003


Amici Alessandro writes:
> 
> i installed Numeric-23.0 on cygwin in order to get python-gdal support.
> on:
> 	$ ./configure --withou-ld-shared
> 	$ make
> everything is ok, but on:
> 	# make install
> i get the following error:
> 
> /bin/true gdal_wrap.o numpydataset.o gdalnumeric.o \
>         -L.. -lgdal.1.1 -ljpeg -ltiff -lpng -lz -lm -lm -o _gdalmodule.so
> ../install-sh -d /usr/lib/python2.2/site-packages
> for f in *.py _gdalmodule.so ; do ../install-sh -c $f
> /usr/lib/python2.2/site-pa
> ckages ; done
> install:  _gdalmodule.so does not exist
> make[1]: *** [install] Error 1
> make[1]: Leaving directory
> `/cygdrive/c/home/amici/devel/gdal-cvs-030509/pymod'
> make: *** [install-actions] Error 2
> 
> the problem is linked to the lack of shared libraries 
> (LD_SHARED=/bin/true)
> on cygwin, which are assumed to be present in pymod/GNUmakefile.
> 
> is there any chance to get python support under cygwin?

the Python extension works well with Cygwin

> have you (or anybody else) any idea on what needs to be done?
> should i file a bug?

Just tweak the Makefile(s) a little :-)

Cheers

Norman

==== cut ====

GDAL_ROOT	=	..

include ../GDALmake.opt

GDALMODULE	=	_gdalmodule.$(SO_EXT)
OBJ        	=       gdal_wrap.o numpydataset.o gdalnumeric.o
PY_VER = python2.3
PYTHON_LIB = -L/usr/local/lib/$(PY_VER)/config -l$(PY_VER).$(SO_EXT)

default:	$(GDALMODULE)

clean:
	rm -f *.o *.$(SO_EXT)

%.o:	%.c
	$(CC) -c -I. $(GDAL_INCLUDE) $(PYTHON_INCLUDES)\
		$(CFLAGS) -DUSE_DL_IMPORT $(NUMPY_FLAG) $*.c -o $*.o

%.o:	%.cpp
	$(CXX) -c -I. $(GDAL_INCLUDE) $(PYTHON_INCLUDES) \
		 $(CXXFLAGS) -DUSE_DL_IMPORT $(NUMPY_FLAG) $*.cpp -o $*.o

gdal_wrap.c:	gdal.i
	-swig -python gdal.i

$(GDALMODULE):	$(OBJ) $(GDAL_LIB) $(GDAL_SLIB)
	$(LD_SHARED) $(OBJ) \
		$(GDAL_SLIB_LINK) $(LIBS) $(PYTHON_LIB) -o $(GDALMODULE)

install:	$(GDALMODULE)
	$(INSTALL_DIR) $(INST_PYMOD)
	for f in *.py $(GDALMODULE) ; do $(INSTALL) $$f $(INST_PYMOD) ; done





More information about the Gdal-dev mailing list