[GRASS-dev] compile gdal with grass

Just compiled the latest gdal (1.11) and grass (trunk - rev 63950) and now want to compile gdal again with grass support. However, I am getting an error, which appears to be a problem in gdal/frmts/grass (see below). Any idea how to solve this?

paulo@paulo-HP-Z600-Workstation:~/Software/spatial/gdal/frmts/grass$ make
/bin/bash /home/paulo/Software/spatial/gdal/libtool --mode=compile --tag=CXX g++ -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DGRASS_GISBASE="/usr/local/grass7/grass-7.1.svn" -I/usr/local/grass7/grass-7.1.svn/include -I/home/paulo/Software/spatial/gdal/port -I/home/paulo/Software/spatial/gdal/gcore -I/home/paulo/Software/spatial/gdal/alg -I/home/paulo/Software/spatial/gdal/ogr -I/home/paulo/Software/spatial/gdal/ogr/ogrsf_frmts -DOGR_ENABLED -I/home/paulo/Software/spatial/gdal/port -c -o grass57dataset.lo grass57dataset.cpp
libtool: compile: g++ -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DGRASS_GISBASE="/usr/local/grass7/grass-7.1.svn" -I/usr/local/grass7/grass-7.1.svn/include -I/home/paulo/Software/spatial/gdal/port -I/home/paulo/Software/spatial/gdal/gcore -I/home/paulo/Software/spatial/gdal/alg -I/home/paulo/Software/spatial/gdal/ogr -I/home/paulo/Software/spatial/gdal/ogr/ogrsf_frmts -DOGR_ENABLED -I/home/paulo/Software/spatial/gdal/port -c grass57dataset.cpp -fPIC -DPIC -o .libs/grass57dataset.o
grass57dataset.cpp: In member function ‘CPLErr GRASSRasterBand::ResetReading(Cell_head*)’:
grass57dataset.cpp:440:61: error: ‘G__setenv’ was not declared in this scope
G__setenv( “GISDBASE”, ((GRASSDataset )poDS)->pszGisdbase );
^
grass57dataset.cpp: In static member function 'static GDALDataset
GRASSDataset::Open(GDALOpenInfo*)':
grass57dataset.cpp:899:37: error: ‘G__setenv’ was not declared in this scope
G__setenv( “GISDBASE”, pszGisdb );
^
make: *** [grass57dataset.lo] Error 1

On Sun, Jan 4, 2015 at 3:48 PM, Paulo van Breugel
<p.vanbreugel@gmail.com> wrote:

Just compiled the latest gdal (1.11) and grass (trunk - rev 63950) and now
want to compile gdal again with grass support.

It is recommended to compile the plugin (way easier than dealing with
circular dependencies):
http://grasswiki.osgeo.org/wiki/Compile_and_install_GDAL-GRASS_plugin

However, I am getting an
error, which appears to be a problem in gdal/frmts/grass (see below). Any
idea how to solve this?

Convince the GDAL developers to take care of
http://trac.osgeo.org/gdal/ticket/2953

Markus

On Sun, Jan 4, 2015 at 10:30 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Sun, Jan 4, 2015 at 3:48 PM, Paulo van Breugel
<p.vanbreugel@gmail.com> wrote:
> Just compiled the latest gdal (1.11) and grass (trunk - rev 63950) and
now
> want to compile gdal again with grass support.

It is recommended to compile the plugin (way easier than dealing with
circular dependencies):
http://grasswiki.osgeo.org/wiki/Compile_and_install_GDAL-GRASS_plugin

Compiling gdal with grass support takes more time but isn't terribly
difficult. If it works, which it did for the last half a year or so (during
which I updated grass various times, each time also recompiling gdal). But
yes, I would rather use the plugin as that is quicker. However, with grass7
I have never got it to work. The problem is that I don't really understand
how to use the various patches and suggestions in above-mentioned ticket.
Perhaps somebody could summarize how to do this in the wiki?

> However, I am getting an
> error, which appears to be a problem in gdal/frmts/grass (see below). Any
> idea how to solve this?

Convince the GDAL developers to take care of
http://trac.osgeo.org/gdal/ticket/2953

I would try if I knew how. To file a bug report I would need to understand

what the issue is, which I don't really get from the ticket mentioned above

Markus

On Sun, Jan 4, 2015 at 10:54 PM, Paulo van Breugel
<p.vanbreugel@gmail.com> wrote:

On Sun, Jan 4, 2015 at 10:30 PM, Markus Neteler <neteler@osgeo.org> wrote:

Convince the GDAL developers to take care of
http://trac.osgeo.org/gdal/ticket/2953

I would try if I knew how. To file a bug report I would need to understand
what the issue is, which I don't really get from the ticket mentioned above

There is no need to file a new ticket. The one mentioned above needs
to be solved, patches have been proposed therein.

Markus

Hi,

2015-01-04 15:48 GMT+01:00 Paulo van Breugel <p.vanbreugel@gmail.com>:

Just compiled the latest gdal (1.11) and grass (trunk - rev 63950) and now
want to compile gdal again with grass support. However, I am getting an
error, which appears to be a problem in gdal/frmts/grass (see below). Any
idea how to solve this?

[...]

grass57dataset.cpp:440:61: error: 'G__setenv' was not declared in this scope
  G__setenv( "GISDBASE", ((GRASSDataset *)poDS)->pszGisdbase );
                                                             ^
grass57dataset.cpp: In static member function 'static GDALDataset*
GRASSDataset::Open(GDALOpenInfo*)':
grass57dataset.cpp:899:37: error: 'G__setenv' was not declared in this scope
     G__setenv( "GISDBASE", pszGisdb );
                                     ^
make: *** [grass57dataset.lo] Error 1

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

Martin

[1] http://trac.osgeo.org/gdal/changeset/28288

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

On Mon, Jan 5, 2015 at 12:56 PM, Martin Landa <landa.martin@gmail.com> wrote:
...

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

Martin

[1] http://trac.osgeo.org/gdal/changeset/28288

Thanks, looking forward to it.

Markus

Hi,

2015-01-05 15:32 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

On Mon, Jan 5, 2015 at 12:56 PM, Martin Landa <landa.martin@gmail.com> wrote:
...

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

done in r28291. To compile GDAL against GRASS you need at least GDAL
1.11 from svn branch [1].

Martin

[1] http://svn.osgeo.org/gdal/branches/1.11/

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

Great, thanks, I’ll try it out a.s.a.p.

···

On Mon, Jan 5, 2015 at 3:50 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2015-01-05 15:32 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

On Mon, Jan 5, 2015 at 12:56 PM, Martin Landa <landa.martin@gmail.com> wrote:

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

done in r28291. To compile GDAL against GRASS you need at least GDAL
1.11 from svn branch [1].

Martin

[1] http://svn.osgeo.org/gdal/branches/1.11/


Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

Hi Martin, just recompiled GDAL against GRASS, and I can confirm it works. Thanks for the fix!

···

On Mon, Jan 5, 2015 at 3:50 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2015-01-05 15:32 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

On Mon, Jan 5, 2015 at 12:56 PM, Martin Landa <landa.martin@gmail.com> wrote:

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

done in r28291. To compile GDAL against GRASS you need at least GDAL
1.11 from svn branch [1].

Martin

[1] http://svn.osgeo.org/gdal/branches/1.11/


Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

Hi Martin,

On Mon, Jan 5, 2015 at 3:50 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2015-01-05 15:32 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

On Mon, Jan 5, 2015 at 12:56 PM, Martin Landa <landa.martin@gmail.com> wrote:
...

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

done in r28291. To compile GDAL against GRASS you need at least GDAL
1.11 from svn branch [1].

Since it appears to work, can you please backport it to GDAL 1.11?
They want to close http://trac.osgeo.org/gdal/ticket/1587#comment:26
which doesn't make sense yet.

Thanks
Markus

Martin

[1] http://svn.osgeo.org/gdal/branches/1.11/

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

Hi Markus,

2015-01-16 10:44 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

Since it appears to work, can you please backport it to GDAL 1.11?

already done [1].

Martin

[1] http://trac.osgeo.org/gdal/changeset/28291

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

Hi Martin and list,
would it be possible to reflect these changes in the Ubuntu packages on the gdal launchpad (ubuntugis-unstable) and making them compatible with the grass7 packages?

I tried building gdal 1.11.2 --with-grass against preinstalled grass7 packages (Ubuntu 14.04), but the grass7 (and qgis for that matter) are still depending on gdal-1.11.1. Now just to be able to browse the GRASS database in QGIS it would make it necessary to build all three from source. Or are there any ideas on avoiding that? The gdal-grass plugin unfortunately doesnt work with grass-7.

Thanks,
Michel

···

On 01/07/2015 12:51 PM, Paulo van Breugel wrote:

Hi Martin, just recompiled GDAL against GRASS, and I can confirm it works. Thanks for the fix!

On Mon, Jan 5, 2015 at 3:50 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2015-01-05 15:32 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

On Mon, Jan 5, 2015 at 12:56 PM, Martin Landa <landa.martin@gmail.com> wrote:

these errors are related to the recent API changes in GRASS 7. I fixed
that in gdal trunk [1] and later will do backport it to gdal 1.11
branch.

done in r28291. To compile GDAL against GRASS you need at least GDAL
1.11 from svn branch [1].

Martin

[1] http://svn.osgeo.org/gdal/branches/1.11/


Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

_______________________________________________
grass-dev mailing list
[grass-dev@lists.osgeo.org](mailto:grass-dev@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-dev](http://lists.osgeo.org/mailman/listinfo/grass-dev)

Hi Martin and list,
would it be possible to reflect these changes in the Ubuntu packages on
the gdal launchpad (ubuntugis-unstable) and making them compatible with
the grass7 packages?

You should direct this question to the UbuntuGIS list.

I tried building gdal 1.11.2 --with-grass against preinstalled grass7
packages (Ubuntu 14.04), but the grass7 (and qgis for that matter) are
still depending on gdal-1.11.1. Now just to be able to browse the GRASS
database in QGIS it would make it necessary to build all three from
source. Or are there any ideas on avoiding that? The gdal-grass plugin
unfortunately doesnt work with grass-7.

The libgdal-grass Debian package has support for GRASS 7, but since
UbuntuGIS is highly understaffed, there is hardly anyone actively
maintaining the packages there.

If you care about GIS software on Ubuntu, consider contributing the
UbuntuGIS packaging. It's probably a good idea if the GRASS upstream
packagers actively contribute to the GRASS packages in UbuntuGIS like jef
does for QGIS.

Kind Regards,

Bas

Ok thanks for info, Bas, and sorry for the Ubuntu noise. I'll get in touch with the ubuntuGIS list then, I'd be happy to build packages at least for the new Ubuntu LTS 14.04 although I'm a packaging newbie.
Regards,
Michel

On 03/11/2015 10:55 AM, Sebastiaan Couwenberg wrote:

Hi Martin and list,
would it be possible to reflect these changes in the Ubuntu packages on
the gdal launchpad (ubuntugis-unstable) and making them compatible with
the grass7 packages?

You should direct this question to the UbuntuGIS list.

I tried building gdal 1.11.2 --with-grass against preinstalled grass7
packages (Ubuntu 14.04), but the grass7 (and qgis for that matter) are
still depending on gdal-1.11.1. Now just to be able to browse the GRASS
database in QGIS it would make it necessary to build all three from
source. Or are there any ideas on avoiding that? The gdal-grass plugin
unfortunately doesnt work with grass-7.

The libgdal-grass Debian package has support for GRASS 7, but since
UbuntuGIS is highly understaffed, there is hardly anyone actively
maintaining the packages there.

If you care about GIS software on Ubuntu, consider contributing the
UbuntuGIS packaging. It's probably a good idea if the GRASS upstream
packagers actively contribute to the GRASS packages in UbuntuGIS like jef
does for QGIS.

Kind Regards,

Bas

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev