[GRASS-dev] [GRASS GIS] #564: python_grass7 compilation

#564: python_grass7 compilation
-------------------------+--------------------------------------------------
Reporter: neuba | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: default | Version: unspecified
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
I am trying to compile python_grass7 (i configure grass using this
command: ./configure --with-cxx --with-python=/usr/bin/python2.5-config
--with-wxwidgets=/usr/bin/wx-config --with-postgres --enable-largefile
--with-cairo --with-proj-share=/usr/share/proj/ --without-freetype --with-
gdal=/usr/bin/gdal-config --with-proj-includes=/usr/include/) but i got
the following error:

ake[1]: entrant dans le répertoire «
/home/danho/gis_soft/grass_trunk/swig/python »
make[1]: « /home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/etc/python/swig/_utils.so » est à jour.
make[1]: « /home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/etc/python/swig/_date.so » est à jour.
make[1]: « /home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/etc/python/swig/_grass.so » est à jour.
make[1]: « /home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/etc/python/swig/_math.so » est à jour.
gcc -I/home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-gnu/include -g
-O2 -fPIC -I/usr/include/python2.5 -I/usr/include/python2.5
-DPACKAGE=\""grasslibs"\" -I/home/danho/gis_soft/grass_trunk/dist.i686-
pc-linux-gnu/include -o OBJ.i686-pc-linux-gnu/proj_wrap.o -c proj_wrap.c
Dans le fichier inclus à partir de proj_wrap.c:2623:
/home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/include/grass/gprojects.h:23:29: erreur: ogr_srs_api.h : Aucun fichier
ou dossier de ce type
In file included from proj_wrap.c:2623:
/home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/include/grass/gprojects.h:84: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘GPJ_grass_to_osr’
/home/danho/gis_soft/grass_trunk/dist.i686-pc-linux-
gnu/include/grass/gprojects.h:88: erreur: expected declaration specifiers
or ‘...’ before ‘OGRSpatialReferenceH’
make[1]: *** [OBJ.i686-pc-linux-gnu/proj_wrap.o] Erreur 1
make[1]: quittant le répertoire «
/home/danho/gis_soft/grass_trunk/swig/python »
make: *** [default] Erreur 2

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/564&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
----------------------+-----------------------------------------------------
  Reporter: neuba | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by neuba):

  * status: new => closed
  * platform: Unspecified => Linux
  * resolution: => fixed
  * cpu: Unspecified => x86-32

Comment:

Ok I finally solve my problem. I modified gproject.h and dig_struct.h by
adding gdal like gdal/ogr_api.h or gdal/ogr_srs_api.h and it solve the
problem.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/564#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
------------------------+---------------------------------------------------
  Reporter: neuba | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: swig
  Platform: Linux | Cpu: x86-32
------------------------+---------------------------------------------------
Changes (by hamish):

  * status: closed => reopened
  * component: default => Compiling
  * priority: normal => major
  * version: unspecified => svn-trunk
  * keywords: => swig
  * resolution: fixed =>

Comment:

I see the bug too on debian/lenny + amd64.

the problem is a missing -I$(GDALCFLAGS) in the Makefile, not user error.

{{{
...
gcc -I/usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/include
-I/usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/include -ggdb
-march=amdfam10 -Wall -Werror-implicit-function-declaration -fPIC
-I/usr/include/python2.5 -I/usr/include/python2.5
-DPACKAGE=\""grasslibs"\" -I/usr/src/grass/svn/trunk/dist.x86_64-
unknown-linux-gnu/include -I/usr/src/grass/svn/trunk/dist.x86_64-unknown-
linux-gnu/include -o OBJ.x86_64-unknown-linux-gnu/vector_wrap.o -c
vector_wrap.c
In file included from /usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/vect/digit.h:3,
                  from /usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/Vect.h:4,
                  from vector_wrap.c:2731:
/usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/vect/dig_structs.h:24:21: error: ogr_api.h: No such file
or directory
...
}}}

the vars seem to be set correctly:
{{{
Platform.make:GDALCFLAGS = -I/usr/include/gdal
Platform.make:PROJINC = $(GDALCFLAGS)
}}}

source:grass/trunk/swig/python/Makefile@#L31 :
{{{
vector_wrap_c_FLAGS = $(VECT_INC)
proj_wrap_c_FLAGS = $(PROJINC) $(GDALCFLAGS)
}}}

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/564#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
------------------------+---------------------------------------------------
  Reporter: neuba | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: swig
  Platform: Linux | Cpu: x86-32
------------------------+---------------------------------------------------
Comment (by mlennert):

Replying to [comment:2 hamish]:
> I see the bug too on debian/lenny + amd64.
>
> the problem is a missing -I$(GDALCFLAGS) in the Makefile, not user
error.

Also see this thread:
http://lists.osgeo.org/pipermail/grass-dev/2009-June/044588.html

Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/564#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
------------------------+---------------------------------------------------
  Reporter: neuba | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: swig
  Platform: Linux | Cpu: x86-32
------------------------+---------------------------------------------------
Comment (by hamish):

Glynn:
> Er, right. It's using $(VECT_INC), which is always empty.
> It should be using $(VECT_CFLAGS), which contains $(GDALCFLAGS).
> Try r37944.

Ok, now it gets a little further but fails on vedit_wrap.c:
{{{
gcc -I/usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/include
-I/usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/include -ggdb
-march=amdfam10 -Wall -Werror-implicit-function-declaration -fPIC
-I/usr/include/python2.5 -I/usr/include/python2.5
-DPACKAGE=\""grasslibs"\" -I/usr/src/grass/svn/trunk/dist.x86_64-
unknown-linux-gnu/include -I/usr/src/grass/svn/trunk/dist.x86_64-unknown-
linux-gnu/include -o OBJ.x86_64-unknown-linux-gnu/vedit_wrap.o -c
vedit_wrap.c
In file included from /usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/vect/digit.h:3,
                  from /usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/Vect.h:4,
                  from /usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/vedit.h:5,
                  from vedit_wrap.c:2693:
/usr/src/grass/svn/trunk/dist.x86_64-unknown-linux-
gnu/include/grass/vect/dig_structs.h:24:21: error: ogr_api.h: No such file
or directory
}}}

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/564#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
------------------------+---------------------------------------------------
  Reporter: neuba | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: swig
  Platform: Linux | Cpu: x86-32
------------------------+---------------------------------------------------

Comment(by wenzeslaus):

What is the status of this ticket? Does it apply to the current trunk
(r59060)?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/564#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
------------------------+---------------------------------------------------
  Reporter: neuba | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: major | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: swig
  Platform: Linux | Cpu: x86-32
------------------------+---------------------------------------------------

Comment(by mlennert):

Replying to [comment:5 wenzeslaus]:
> What is the status of this ticket? Does it apply to the current trunk
(r59060)?

I haven't seen this issue pop up in a long time, so I would consider it
fixed.

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/564#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#564: python_grass7 compilation
-------------------------+--------------------------------------------------
  Reporter: neuba | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Resolution: worksforme | Keywords: swig
  Platform: Linux | Cpu: x86-32
-------------------------+--------------------------------------------------
Changes (by wenzeslaus):

  * status: reopened => closed
  * resolution: => worksforme

Comment:

Replying to [comment:6 mlennert]:
> Replying to [comment:5 wenzeslaus]:
> > What is the status of this ticket? Does it apply to the current trunk
(r59060)?
>
> I haven't seen this issue pop up in a long time, so I would consider it
fixed.
>
Compiling works now. This is probably some old bug which does not apply to
current code at all. Closing as worksforme.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/564#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>