2

I am trying to install the r.geomorphons GRASS addon (available from http://sil.uc.edu/pdfFiles/jarek/r.geom.zip) in GRASS. I tried on Windows but gave up and decided the best thing to do was to try on an installation of the OSGEO Live CD, as I assumed that would have everything nicely configured. I have installed the Live CD to a virtual machine, and tried following the instructions at http://grasswiki.osgeo.org/wiki/Compile_and_Install#Addons.

There doesn't appear to be a configure script in the directory, so I have simply run sudo make MODULE_TOPDIR=/usr/lib/grass64. I also tried various other versions of this command, including some setting the GRASS_HOME directory, but all of them give lots of errors saying undefined reference. I assume somehow I am not including the GRASS libraries properly.

Does anyone have any idea what I am doing wrong?

The errors I get are:

user@osgeolive:~/build/r.geom$ sudo make MODULE_TOPDIR=/usr/lib/grass64 GRASS_HOME=.
/usr/lib/grass64/include/Make/Module.make:25: warning: overriding commands for target `install'
/usr/lib/grass64/include/Make/Rules.make:90: warning: ignoring old commands for target `install'
gcc -L/usr/lib/grass64/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--export-dynamic -Wl,-rpath-link,/usr/lib/grass64/lib    -o /usr/lib/grass64/bin/r.geomorphon OBJ.i686-pc-linux-gnu/geom.o OBJ.i686-pc-linux-gnu/main.o OBJ.i686-pc-linux-gnu/memory.o OBJ.i686-pc-linux-gnu/pattern.o  -lgrass_raster.6.4.2 -lgrass_pngdriver.6.4.2 -lgrass_driver.6.4.2 -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz     -lfreetype    -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz     -lpng  -lz  -lm  -lgrass_psdriver.6.4.2 -lgrass_driver.6.4.2 -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz     -lfreetype    -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz      -lgrass_driver.6.4.2 -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz     -lfreetype    -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz      -lgrass_gis.6.4.2 -lgrass_datetime.6.4.2 -lz     -lm  -lm  -lz 
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/user/build/r.geom/main.c:84: undefined reference to `G_add_keyword'
/home/user/build/r.geom/main.c:85: undefined reference to `G_add_keyword'
/home/user/build/r.geom/main.c:86: undefined reference to `G_add_keyword'
/home/user/build/r.geom/main.c:157: undefined reference to `Rast_window_rows'
/home/user/build/r.geom/main.c:158: undefined reference to `Rast_window_cols'
/home/user/build/r.geom/main.c:159: undefined reference to `Rast_get_window'
/home/user/build/r.geom/main.c:163: undefined reference to `Rast_row_to_northing'
/home/user/build/r.geom/main.c:163: undefined reference to `Rast_row_to_northing'
/home/user/build/r.geom/main.c:229: undefined reference to `Rast_open_new'
/home/user/build/r.geom/main.c:230: undefined reference to `Rast_allocate_buf'
/home/user/build/r.geom/main.c:245: undefined reference to `Rast_is_f_null_value'
/home/user/build/r.geom/main.c:252: undefined reference to `Rast_set_c_null_value'
/home/user/build/r.geom/main.c:255: undefined reference to `Rast_set_f_null_value'
/home/user/build/r.geom/main.c:258: undefined reference to `Rast_set_d_null_value'
/home/user/build/r.geom/main.c:334: undefined reference to `Rast_put_row'
/home/user/build/r.geom/main.c:343: undefined reference to `Rast_close'
/home/user/build/r.geom/main.c:344: undefined reference to `Rast_short_history'
/home/user/build/r.geom/main.c:345: undefined reference to `Rast_command_history'
/home/user/build/r.geom/main.c:346: undefined reference to `Rast_write_history'
OBJ.i686-pc-linux-gnu/memory.o: In function `get_cell':
/home/user/build/r.geom/memory.c:44: undefined reference to `Rast_is_null_value'
/home/user/build/r.geom/memory.c:45: undefined reference to `Rast_set_f_null_value'
/home/user/build/r.geom/memory.c:51: undefined reference to `Rast_is_null_value'
/home/user/build/r.geom/memory.c:52: undefined reference to `Rast_set_f_null_value'
/home/user/build/r.geom/memory.c:58: undefined reference to `Rast_is_null_value'
/home/user/build/r.geom/memory.c:59: undefined reference to `Rast_set_f_null_value'
OBJ.i686-pc-linux-gnu/memory.o: In function `open_map':
/home/user/build/r.geom/memory.c:12: undefined reference to `G_find_raster2'
/home/user/build/r.geom/memory.c:17: undefined reference to `Rast_open_old'
/home/user/build/r.geom/memory.c:18: undefined reference to `Rast_get_cellhd'
/home/user/build/r.geom/memory.c:19: undefined reference to `Rast_map_type'
/home/user/build/r.geom/memory.c:25: undefined reference to `Rast_allocate_buf'
/home/user/build/r.geom/memory.c:29: undefined reference to `Rast_allocate_buf'
/home/user/build/r.geom/memory.c:30: undefined reference to `Rast_get_row'
OBJ.i686-pc-linux-gnu/memory.o: In function `shift_buffers':
/home/user/build/r.geom/memory.c:75: undefined reference to `Rast_allocate_buf'
/home/user/build/r.geom/memory.c:82: undefined reference to `Rast_get_row'
OBJ.i686-pc-linux-gnu/memory.o: In function `write_form_cat_colors':
/home/user/build/r.geom/memory.c:103: undefined reference to `Rast_init_colors'
/home/user/build/r.geom/memory.c:106: undefined reference to `Rast_add_color_rule'
/home/user/build/r.geom/memory.c:110: undefined reference to `Rast_write_colors'
/home/user/build/r.geom/memory.c:111: undefined reference to `Rast_free_colors'
/home/user/build/r.geom/memory.c:112: undefined reference to `Rast_init_cats'
/home/user/build/r.geom/memory.c:114: undefined reference to `Rast_set_cat'
/home/user/build/r.geom/memory.c:115: undefined reference to `Rast_write_cats'
/home/user/build/r.geom/memory.c:116: undefined reference to `Rast_free_cats'
OBJ.i686-pc-linux-gnu/memory.o: In function `write_contrast_colors':
/home/user/build/r.geom/memory.c:135: undefined reference to `Rast_init_colors'
/home/user/build/r.geom/memory.c:138: undefined reference to `Rast_add_d_color_rule'
/home/user/build/r.geom/memory.c:142: undefined reference to `Rast_write_colors'
/home/user/build/r.geom/memory.c:143: undefined reference to `Rast_free_colors'
OBJ.i686-pc-linux-gnu/pattern.o: In function `calc_pattern':
/home/user/build/r.geom/pattern.c:26: undefined reference to `Rast_row_to_northing'
/home/user/build/r.geom/pattern.c:27: undefined reference to `Rast_col_to_easting'
/home/user/build/r.geom/pattern.c:46: undefined reference to `Rast_is_f_null_value'
/home/user/build/r.geom/pattern.c:50: undefined reference to `Rast_row_to_northing'
/home/user/build/r.geom/pattern.c:51: undefined reference to `Rast_col_to_easting'
/home/user/build/r.geom/pattern.c:75: undefined reference to `Rast_row_to_northing'
/home/user/build/r.geom/pattern.c:76: undefined reference to `Rast_col_to_easting'
collect2: ld returned 1 exit status
make: *** [/usr/lib/grass64/bin/r.geomorphon] Error 1

1 Answer 1

4

The module r.geomorphon has been written for GRASS 7 (as I can see from the used functions) while the OSGeo Live DVD offers GRASS 6.

Two options:

  • install GRASS 7 (that may even work on the OSGeo Live DVD, then the module
  • modify the code to use the GRASS 6 functions, see here

Concerning Windows: if you convince the author to upload the code to the GRASS Addons SVN repository, Windows executables will be autogenerated every night for it.

4
  • That's great - thanks. Is there some information on how to add to the GRASS Addons SVN repository somewhere - I could then direct the author to it and hopefully it'll happen.
    – robintw
    Nov 20, 2012 at 15:55
  • Sure! May I ask where you have looked (URL)? Then I'll add the link there, too, for easier orientation. Will also post it here of course.
    – markusN
    Nov 20, 2012 at 16:58
  • I looked at trac.osgeo.org/grass/wiki/DownloadSource, which seemed to give a SVN repository address and implied that you needed an OSGeo user account to get access, but I was wondering whether there was a kind of tutorial 'How to add your addon to the repository' guide?
    – robintw
    Nov 20, 2012 at 17:10
  • OK, on that page is "Subversion GRASS Addons source code repository". I have added now there "Want to contribute? Read on here" with "here" pointing to trac.osgeo.org/grass/wiki/…
    – markusN
    Nov 20, 2012 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.