[GRASS-user] Add-on compilation errors in GRASS 7

Hi all,

I am really struggling to to use the r.geomorphon (or indeed any) add-on in GRASS 7 (it’s not available in 6) and I have spent a great many hours trying to get this working before seeking advice here. Any help would be hugely appreciated. I really am a GRASS novice so I may well have missed something obvious, despite trying to be thorough. This is also my first post here so I hope it’s up to scratch.

First, system Info:
GRASS version: 7.0.0beta3
GRASS SVN Revision: 61541
Build Date: 2014-09-08
Build Platform: x86_64-unknown-linux-gnu
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.8.2
Python: 2.7.6
wxPython: 2.8.12.1
Platform: Linux-3.13.0-35-generic-x86_64-with-Ubuntu-14.04-trusty

How I got to this stage:
As you can see from System Info, I compiled GRASS GIS 7.0.0beta3 from source code via “svn checkout http://svn.osgeo.org/grass/grass/tags/release_20140806_grass_7_0_0beta3”, but I had also tried it via “svn co https://svn.osgeo.org/grass/grass/trunk” before, with the same negative result. I cannot use the stable version of GRASS GIS 7 (I tried that first) because of the issue with g.extension, which is fixed in these later versions (see http://lists.osgeo.org/pipermail/grass-user/2014-June/070480.html). I’ve compiled and installed GRASS 7 using the instructions from the OSGeo Ubuntu Wiki page (http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GRASS_GIS) and have been sure run the commands under ‘Dependencies’.

A post on this issue appears here - http://lists.osgeo.org/pipermail/grass-user/2013-February/067241.html

The compilation set-up that I’ve used is as follows (this does not produce any errors):

CFLAGS=“-O2 -Wall” LDFLAGS=“-s” ./configure
–enable-largefile=yes
–with-nls
–with-cxx
–with-python=yes
–with-wxwidgets
–with-cairo
–with-freetype=yes
–with-freetype-includes=“/usr/include/freetype2/”
–with-opengl-libs=/usr/include/GL
–with-postgres=yes
–with-postgres-includes=“/usr/include/postgresql”
–with-sqlite=yes
–with-mysql=yes
–with-mysql-includes=“/usr/include/mysql”
–with-odbc=no
–with-geos=yes

And here’s the summary once compiled (does anything stand out as being missing?):

BLAS support: no
C++ support: yes
Cairo support: yes
DWG support: no
FFMPEG support: no
FFTW support: yes
FreeType support: yes
GDAL support: yes
GEOS support: yes
LAPACK support: no
Large File support (LFS): yes
libLAS support: no
MySQL support: yes
NetCDF support: no
NLS support: yes
ODBC support: yes
OGR support: yes
OpenCL support: no
OpenGL support: yes
OpenMP support: no
PNG support: yes
POSIX thread support: no
PostgreSQL support: yes
Readline support: no
Regex support: yes
SQLite support: yes
TIFF support: yes
wxWidgets support: yes
X11 support: yes

Finally, here’s the output upon attempting to install r.geomorphon via g.extension (g.extension extension=r.geomorphon svnurl=http://svn.osgeo.org/grass/grass-addons/grass7). I’ve also put another couple of error-filled outputs from other add-ons below. Many thanks in advance, Joe

g.extension extension=r.geomorphon svnurl=http://svn.osgeo.org/grass/grass-addons/grass7
Fetching <r.geomorphon> from GRASS-Addons SVN (be patient)…
Compiling…
geom.c: In function ‘ternary_rotate’:
geom.c:22:9: warning: unused variable ‘res’ [-Wunused-
variable]
int res;
^
geom.c: At top level:
geom.c:2:15: warning: ‘dirs’ defined but not used
[-Wunused-variable]
static double dirs[8] = { 0.7854, 0., 5.4978, 4.7124,
3.9270, 3.1416, 2.3562, 1.5708 }; /* radians */
^
geom.c: In function ‘shape’:
geom.c:252:26: warning: ‘rymax’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
rymax = ry > rymax ? ry : rymax;
^
geom.c:251:26: warning: ‘rymin’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
rymin = ry < rymin ? ry : rymin;
^
geom.c:250:26: warning: ‘rxmax’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
rxmax = rx > rxmax ? rx : rxmax;
^
geom.c:249:26: warning: ‘rxmin’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
rxmin = rx < rxmin ? rx : rxmin;
^
geom.c:232:15: warning: ‘avg_x_square’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
avg_x_square += pattern->x[i] * pattern->x[i];
^
main.c: In function ‘main’:
main.c:312:20: warning: unused variable ‘formC’
[-Wunused-variable]
int formA, formB, formC;
^
main.c:312:13: warning: unused variable ‘formB’
[-Wunused-variable]
int formA, formB, formC;
^
main.c:312:6: warning: unused variable ‘formA’
[-Wunused-variable]
int formA, formB, formC;
^
main.c:93:28: warning: unused variable ‘radius’
[-Wunused-variable]
int row, cur_row, col, radius;
^
main.c:91:15: warning: unused variable ‘n’ [-Wunused-
variable]
int i, j, n;
^
main.c:91:12: warning: unused variable ‘j’ [-Wunused-
variable]
int i, j, n;
^
main.c:553:1: warning: control reaches end of non-void
function [-Wreturn-type]
}
^
memory.c: In function ‘open_map’:
memory.c:10:9: warning: unused variable ‘bufsize’
[-Wunused-variable]
int bufsize;
^
memory.c:7:9: warning: unused variable ‘fd’ [-Wunused-
variable]
int fd;
^
memory.c: In function ‘shift_buffers’:
memory.c:75:39: warning: unused variable ‘aspect_tmp’
[-Wunused-variable]
FCELL *tmp_elev_buf, *slope_tmp, *aspect_tmp;
^
memory.c:75:27: warning: unused variable ‘slope_tmp’
[-Wunused-variable]
FCELL *tmp_elev_buf, *slope_tmp, *aspect_tmp;
^
memory.c: In function ‘write_contrast_colors’:
memory.c:131:23: warning: unused variable ‘cats’
[-Wunused-variable]
struct Categories cats;
^
multires.c: In function ‘pattern_matching’:
multires.c:23:29: warning: suggest parentheses around
comparison in operand of ‘&’ [-Wparentheses]
return (result & source == source) ? 1 : 0;
^
pattern.c: In function ‘calc_pattern’:
pattern.c:134:24: warning: ‘nadir_distance’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
pattern->distance[i] = nadir_distance;
^
pattern.c:128:24: warning: ‘zenith_distance’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
pattern->distance[i] = zenith_distance;
^
pattern.c:133:25: warning: ‘nadir_height’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
pattern->elevation[i] = nadir_height; //ZMIANA!
^
pattern.c:127:25: warning: ‘zenith_height’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
pattern->elevation[i] = zenith_height; //ZMIANA!
^
Installing…
Updating metadata file…
WARNING: Unable to parse ‘http://grass.osgeo.org/addons/grass7/modules.xml’. Metadata file not updated.
Installation of <r.geomorphon> successfully finished

– END of OUTPUT 1 –

I also get errors when attempting to install other add-ons, e.g. r.bioclim:

g.extension extension=r.bioclim svnurl=http://svn.osgeo.org/grass/grass-addons/grass7
Fetching <r.bioclim> from GRASS-Addons SVN (be patient)…
Compiling…
/bin/sh: 1: cannot create /usr/local/grass-7.0.0beta3/locale
/scriptstrings/r.bioclim_to_translate.c: Directory
nonexistent
make: [/usr/local/grass-7.0.0beta3/locale/scriptstrings/r.bi
oclim_to_translate.c] Error 2 (ignored)
Installing…
Updating metadata file…
WARNING: Unable to parse ‘http://grass.osgeo.org/addons/grass7/modules.xml’. Metadata file not updated.
Installation of <r.bioclim> successfully finished

– END of OUTPUT 2 –

e.g. r.stream.basins:

Fetching <r.stream.basins> from GRASS-Addons SVN (be patient)…
Compiling…
io.c: In function ‘ram_write_map’:
io.c:221:10: warning: ‘c’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
G_debug(1, “ram_null:Cannot convert to null at: %d %d”,
r, c);
^
io.c: In function ‘seg_write_map’:
io.c:531:12: warning: ‘c’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
G_warning(_(“Unable to convert to null at: %d %d”), r,
^
Installing…
Updating metadata file…
WARNING: Unable to parse ‘http://grass.osgeo.org/addons/grass7/modules.xml’. Metadata file not updated.
Installation of <r.stream.basins> successfully finished

– END of OUTPUT 3 –

— END —

Hi,

2014-09-08 22:48 GMT+02:00 Joseph Bailey <misc2345@outlook.com>:

WARNING: Unable to parse 'http://grass.osgeo.org/addons/grass7/modules.xml’.
Metadata file not updated.
Installation of <r.geomorphon> successfully finished

it's related to the problem on the server where modules.xml is
generated. I am working on solving it.

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

Thanks for the quick reply; much appreciated. I was partly hoping it was
something I was doing wrong so that it was fixable. Not to worry. Is there
anything that I can do in the meantime so that I can use the add-on, please?
Is it possible to compile locally from the source code
(https://svn.osgeo.org/grass/grass-addons/grass7/raster/r.geomorphon/), for
example? The add-on does load and runs but produces no output and doesn't
appear in the 'installed add-ons' list as it is, despite saying
"Installation ... successfully finished".

Many thanks,

Joe

-----

Joe B
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Add-on-compilation-errors-in-GRASS-7-tp5160758p5160795.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

2014-09-09 9:04 GMT+02:00 geo-joe <misc2345@outlook.com>:

Thanks for the quick reply; much appreciated. I was partly hoping it was
something I was doing wrong so that it was fixable. Not to worry. Is there
anything that I can do in the meantime so that I can use the add-on, please?

this warning (modules.xml) has nothing to do the with the
functionality of addons module...

Is it possible to compile locally from the source code
(https://svn.osgeo.org/grass/grass-addons/grass7/raster/r.geomorphon/), for
example? The add-on does load and runs but produces no output and doesn't
appear in the 'installed add-ons' list as it is, despite saying
"Installation ... successfully finished".

Can you launch the module or not?

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

Hello,
r.geomorphon launches and presents the GUI when I type 'r.geomorphon' into
the command line. I can launch the module's GUI and enter the inputs but it
doesn't produce an output when it runs, which I assumed was to do with the
warning following compilation.
Thanks,
Joe

-----

Joe B
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Add-on-compilation-errors-in-GRASS-7-tp5160758p5160798.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I just thought, does that final warning on the parsing issue relate to the
previous warnings or are they separate issues? I was assuming that it did
but maybe not, considering what you say. Could these be caused by missing
components during GRASS compilation?
e.g.
geom.c: In function ‘ternary_rotate’:
geom.c:22:9: warning: unused variable ‘res’ [-Wunused-
variable]
     int res;
         ^
Thanks,
Joe

-----

Joe B
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Add-on-compilation-errors-in-GRASS-7-tp5160758p5160809.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

2014-09-09 9:43 GMT+02:00 geo-joe <misc2345@outlook.com>:

I just thought, does that final warning on the parsing issue relate to the
previous warnings or are they separate issues? I was assuming that it did

right, completely separated issues. The first part comes from
compilation (such warnings/errors should be fixed by an author of the
module). Warning about broken modules.xml is related to g.extension
which tries to keep metadata about installed modules [1]. This will be
fixed by me since the generation of modules.xml file is done on our
university server (CTU in Prague).

but maybe not, considering what you say. Could these be caused by missing
components during GRASS compilation?
e.g.
geom.c: In function 'ternary_rotate':
geom.c:22:9: warning: unused variable 'res' [-Wunused-
variable]
     int res;
         ^

No, such warnings are harmless and have no impact on functionality of
the module.

Martin

[1] http://trac.osgeo.org/grass/wiki/AddOnsManagement

Hi,
Ok, sorry, my lack of GRASS know-how is being highlighted here!
So, if I've understood correctly, the module /should/ work, despite the
separate 'Wunused' and 'broken modules.xml' warnings received? It would be
great to get this ironed out. I'll contact the module's authors and link
through to this thread.
Thanks for your time on this,
Joe

-----

Joe B
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Add-on-compilation-errors-in-GRASS-7-tp5160758p5160822.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

2014-09-08 22:48 GMT+02:00 Joseph Bailey <misc2345@outlook.com>:

/bin/sh: 1: cannot create /usr/local/grass-7.0.0beta3/locale
/scriptstrings/r.bioclim_to_translate.c: Directory
nonexistent
make: [/usr/local/grass-7.0.0beta3/locale/scriptstrings/r.bi
oclim_to_translate.c] Error 2 (ignored)

this issue has been fixed after beta3 [1], could you try out more
recent version from SVN [2]?

Martin

[1] http://trac.osgeo.org/grass/changeset/61713/grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py
[2] http://trac.osgeo.org/grass/wiki/DownloadSource#GRASS7.0

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

2014-09-09 10:08 GMT+02:00 Martin Landa <landa.martin@gmail.com>:

module). Warning about broken modules.xml is related to g.extension
which tries to keep metadata about installed modules [1]. This will be
fixed by me since the generation of modules.xml file is done on our
university server (CTU in Prague).

hopefully fixed.

g.extension r.geomorphon
Fetching <r.geomorphon> from GRASS-Addons SVN repository (be patient)...
Compiling...
geom.c: In function 'ternary_rotate':
geom.c:22:9: warning: unused variable 'res' [-Wunused-variable]
...
Installing...
Updating metadata file...
Installation of <r.geomorphon> successfully finished

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

Martin Landa wrote

2014-09-09 10:08 GMT+02:00 Martin Landa &lt;

landa.martin@

&gt;:

module). Warning about broken modules.xml is related to g.extension
which tries to keep metadata about installed modules [1]. This will be
fixed by me since the generation of modules.xml file is done on our
university server (CTU in Prague).

hopefully fixed.

Thanks for fixing. Installation works fine now [1]. I will close my ticket
from earlier today [2].

r.geomorphon seems to work fine for me and creates a forms output map as
expected. I'm using svn/grass7_releasebranch

Hermann

[1]

[GRASS:test]> g.extension r.geomorphon
Fetching <r.geomorphon> from GRASS-Addons SVN repository (be patient)...
Compiling...
Installing...
Updating metadata file...
Installation of <r.geomorphon> successfully finished
[GRASS:test]> g.extension -l
List of available extensions (modules):
r.geomorphon
[GRASS:test]>

[2] https://trac.osgeo.org/grass/ticket/2411

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Add-on-compilation-errors-in-GRASS-7-tp5160758p5160862.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Ah yes, the parsing error is now gone. The others are still present, however,
and the add-on isn't working... I'll try a clean install and maybe contact
the author of the tool when I'm sure it's not something that I'm doing.
Thanks again for all of this, Joe

-----

Joe B
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Add-on-compilation-errors-in-GRASS-7-tp5160758p5160964.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On 2014-09-09 8:57, Martin Landa wrote:

it's related to the problem on the server where modules.xml is
generated. I am working on solving it.

Hi Martin,

I assume that at some point, there will be a full-size modules.xml file for grass7, i.e. comparable to http://grass.osgeo.org/addons/grass6/modules.xml

Any idea when this will be?

Thanks in advance, Hermann

Hi,

2014-09-10 8:06 GMT+02:00 Hermann Peifer <peifer@gmx.eu>:

I assume that at some point, there will be a full-size modules.xml file for
grass7, i.e. comparable to http://grass.osgeo.org/addons/grass6/modules.xml

Any idea when this will be?

hm, it's broken again, strangely only when launched via cronjobs (this
happens after I reinstalled the server where it's running). Manually
launched scripts simply work. Will fix it manually right now, and I
will try to find out what is wrong with cronjob which should work in
the same way as launching scripts manually.

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

2014-09-10 9:23 GMT+02:00 Martin Landa <landa.martin@gmail.com>:

launched scripts simply work. Will fix it manually right now, and I
will try to find out what is wrong with cronjob which should work in

it's back. I will test cronjobs and try to fix the real problem behind. Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

Hi,

2014-09-10 10:11 GMT+02:00 Martin Landa <landa.martin@gmail.com>:

launched scripts simply work. Will fix it manually right now, and I
will try to find out what is wrong with cronjob which should work in

it's back. I will test cronjobs and try to fix the real problem behind. Martin

the problem was that the path defined by crontab lacked
`/usr/local/bin`. I have fixed that, hopefully the next call (this
night) will be finally OK.

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa