[GRASS-dev] Re: [GRASS GIS] #308: Compiler error while building python swig

GRASS GIS trac at osgeo.org
Tue Sep 16 02:16:45 EDT 2008


#308: Compiler error while building python swig
----------------------------------+-----------------------------------------
  Reporter:  cgsbob               |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect               |      Status:  new                      
  Priority:  major                |   Milestone:  6.4.0                    
 Component:  SWIG (all bindings)  |     Version:  svn-develbranch6         
Resolution:                       |    Keywords:  python swig              
  Platform:  Unspecified          |         Cpu:  Unspecified              
----------------------------------+-----------------------------------------
Comment (by hamish):

 can {{{ extern CELL CELL_NODATA; }}} be removed from gis.h?
 AFAICT CELL_NODATA is not used or defined anywhere in the code.


 After removing CELL_NODATA python_grass6.pyc compiles ok upon running
 "python test.py" but then test.py gets stuck due to the new definition of
 G_gisinit():

 {{{
 Traceback (most recent call last):
   File "test.py", line 17, in ?
     g6lib.G_gisinit('')
 AttributeError: 'module' object has no attribute 'G_gisinit'
 }}}

 Within a python shell "help(g6lib)" only shows G__gisinit() as a valid
 function name. Running g6lib.G__gisinit('','') in python exits with the
 mismatched version error.

 How to recreate these from gis.h in a way that SWIG will like?
 {{{
 #define GIS_H_VERSION "$Revision: 33187 $"
 #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
 #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
 }}}

 if in test.py I replace G_gisinit() with G__gisinit():
 {{{
 -g6lib.G_gisinit('')
 +g6lib.G__gisinit(g6lib.GIS_H_VERSION, '')
 }}}

 Then it all works, but that's more to type.


 Hamish

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/308#comment:18>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list