[GRASS-dev] Re: [GRASS GIS] #658: swig/python fails to build with older version of swig

GRASS GIS trac at osgeo.org
Sun Feb 21 06:40:29 EST 2010


#658: swig/python fails to build with older version of swig
----------------------------------+-----------------------------------------
  Reporter:  hamish               |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect               |      Status:  new                      
  Priority:  major                |   Milestone:  6.5.0                    
 Component:  SWIG (all bindings)  |     Version:  svn-develbranch6         
Resolution:                       |    Keywords:  python                   
  Platform:  Linux                |         Cpu:  x86-32                   
----------------------------------+-----------------------------------------
Changes (by hamish):

  * version:  6.4.0 RCs => svn-develbranch6
  * milestone:  6.4.0 => 6.5.0

Comment:

 I'm pretty sure Glynn fixed this bug some time later (see ML archives).
 Now 6.4 swig/python builds fine for me.


 But now I get an error building 6.5svn

 {{{
 cd swig/python
 make clean
 make
 [...]
 make[1]: Entering directory `/usr/local/src/grass/svn/grass65/swig/python'
 test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
 I/usr/local/src/grass/svn/grass65/dist.i686-pc-linux-gnu/include
 -I../include/python -outdir . -python -o utils_wrap.c -module utils
 -shadow ../include/python/utils.i
 make[1]: I/usr/local/src/grass/svn/grass65/dist.i686-pc-linux-gnu/include:
 Command not found
 make[1]: [utils_wrap.c] Error 127 (ignored)
 gcc -I/usr/local/src/grass/svn/grass65/dist.i686-pc-linux-gnu/include
 -ggdb -march=pentium4 -Wall -Werror-implicit-function-declaration    -fPIC
 -DPACKAGE=\""grasslibs"\" -fPIC     -DPACKAGE=\""grasslibs"\"
 -I/usr/include/gdal -I/usr/include/gdal -I/usr/include
 -I/usr/local/src/grass/svn/grass65/dist.i686-pc-linux-gnu/include -o OBJ.
 i686-pc-linux-gnu/utils_wrap.o -c utils_wrap.c
 gcc: utils_wrap.c: No such file or directory
 gcc: no input files
 make[1]: *** [OBJ.i686-pc-linux-gnu/utils_wrap.o] Error 1
 make[1]: Leaving directory `/usr/local/src/grass/svn/grass65/swig/python'
 make: *** [default] Error 2
 }}}


 -I becomes I in "`make[1] I$(GISBASE)/include`" .... ??



 also, is this a typo?? (6.5svn swig/python/Makefile)
 {{{
 Index: Makefile
 ===================================================================
 --- Makefile    (revision 41135)
 +++ Makefile    (working copy)
 @@ -36,7 +36,7 @@

  EXTRA_INC = $(VECT_INC) $(PROJINC) $(GDALCFLAGS) $(GEOSCFLAGS)

 -EXTRA_SWG = ../include/python/my_typemaps.i ../include/python/common.i
 +EXTRA_SWIG = ../include/python/my_typemaps.i ../include/python/common.i
  SWIGFLAGS = $(ARCH_INC) -I../include/python -outdir .
  EXTRA_CFLAGS = $(PYMOD_CFLAGS)
  EXTRA_CLEAN_FILES := $(foreach M,$(MODULES),$(M)_wrap.o $(M)_wrap.c
 $(M).pyc $(M).py _$(M).so)
 }}}


 6.4 builds ok. there are some differences:

 {{{
 grass65/swig/python$ diff ../../../releasebranch_6_4/swig/python/Makefile
 Makefile
 --- ../../../releasebranch_6_4/swig/python/Makefile     2009-09-10
 14:47:27.000000000 +1200
 +++ Makefile    2010-02-22 00:38:21.000000000 +1300
 @@ -34,9 +34,9 @@
  trans_LIBS      = $(TRANSLIB)
  vedit_LIBS      = $(VEDITLIB)

 -EXTRA_INC = $(VECT_INC) $(PROJINC) $(GDALCFLAGS)
 +EXTRA_INC = $(VECT_INC) $(PROJINC) $(GDALCFLAGS) $(GEOSCFLAGS)

 -EXTRA_SWIG = ../include/python/my_typemaps.i ../include/python/common.i
 +EXTRA_SWG = ../include/python/my_typemaps.i ../include/python/common.i
  SWIGFLAGS = $(ARCH_INC) -I../include/python -outdir .
  EXTRA_CFLAGS = $(PYMOD_CFLAGS)
  EXTRA_CLEAN_FILES := $(foreach M,$(MODULES),$(M)_wrap.o $(M)_wrap.c
 $(M).pyc $(M).py _$(M).so)
 @@ -50,13 +50,14 @@

  LIBFILES := $(patsubst %,$(DSTDIR)/_%.so,$(MODULES))
  PYFILES  := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__)
 +PYCFILES  := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES) __init__)
  LLIBFILES := $(patsubst %,_%.so,$(MODULES))
  WRAPFILES := $(patsubst %,%_wrap.c,$(MODULES))
  LPYFILES := $(patsubst %,%.py,$(MODULES))

  default:
         $(MAKE) $(DSTDIR)
 -       $(MAKE) $(LLIBFILES) $(WRAPFILES) $(LPYFILES) $(LIBFILES)
 $(PYFILES)
 +       $(MAKE) $(LLIBFILES) $(WRAPFILES) $(LPYFILES) $(LIBFILES)
 $(PYFILES) $(PYCFILES)

  %_wrap.c %.py: ../include/%.i $(EXTRA_SWIG)
         $(SWIG) $(SWIGFLAGS) -python -o $*_wrap.c -module $* -shadow $<
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/658#comment:1>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list