[GRASS-dev] Compiling r.example in LINUX

Greetings

I'm having a few difficulties in compiling modules (e.g. r.example).
*make -C r.example MODULE_TOPDIR=/usr/local/grass-6.4.0svn/*

I got:
make: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
gcc -L/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/lib -Wl,--export-dynamic -Wl,-rpath-link,/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/lib -o /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example OBJ.i686-pc-linux-gnu/main.o -lgrass_gis -lgrass_datetime -lz -lgrass_raster -lgrass_pngdriver -lgrass_driver -lgrass_gis -lgrass_datetime -lz -lfreetype -lgrass_gis -lgrass_datetime -lz -lpng -lz -lm -lgrass_psdriver -lgrass_driver -lgrass_gis -lgrass_datetime -lz -lfreetype -lgrass_gis -lgrass_datetime -lz -lgrass_driver -lgrass_gis -lgrass_datetime -lz -lfreetype -lgrass_gis -lgrass_datetime -lz -lm -lz
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:83: undefined reference to `G_add_keyword'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:84: undefined reference to `G_add_keyword'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:85: undefined reference to `G_add_keyword'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:103: undefined reference to `G_find_raster2'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:108: undefined reference to `Rast_map_type'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:111: undefined reference to `Rast_open_old'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:114: undefined reference to `Rast_get_cellhd'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:119: undefined reference to `Rast_allocate_buf'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:124: undefined reference to `Rast_allocate_buf'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:127: undefined reference to `Rast_open_new'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:138: undefined reference to `Rast_get_row'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:163: undefined reference to `Rast_put_row'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:171: undefined reference to `Rast_close'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:172: undefined reference to `Rast_close'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:175: undefined reference to `Rast_short_history'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:176: undefined reference to `Rast_command_history'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:177: undefined reference to `Rast_write_history'
collect2: ld returned 1 exit status
make: *** [/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example] Error 1
make: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'

It seems that it's not recognizing GRASS structures and functions.
Then I realized that my GRASS_HOME was pointing to:
GRASS_HOME = /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2
This folder was from where I run /configure it's not where my /svn is (/usr/local/grass-6.4.0svn/).

Question should I change GRASS_HOME to /usr/local/grass-6.4.0svn/ and and RUN_GISBASE
to /usr/local/grass-6.4.0svn//dist.i686-pc-linux-gnu ??
I know it's not suppose to change this files but, it's not running...

Thanks for the (future) tips :slight_smile:

Best regards,
Antonio

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4804 (20100125) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

António Rocha pisze:

Greetings

I'm having a few difficulties in compiling modules (e.g. r.example).
*make -C r.example MODULE_TOPDIR=/usr/local/grass-6.4.0svn/*

I got:
make: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
gcc -L/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/lib -Wl,--export-dynamic -Wl,-rpath-link,/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/lib -o /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example OBJ.i686-pc-linux-gnu/main.o -lgrass_gis -lgrass_datetime -lz -lgrass_raster -lgrass_pngdriver -lgrass_driver -lgrass_gis -lgrass_datetime -lz -lfreetype -lgrass_gis -lgrass_datetime -lz -lpng -lz -lm -lgrass_psdriver -lgrass_driver -lgrass_gis -lgrass_datetime -lz -lfreetype -lgrass_gis -lgrass_datetime -lz -lgrass_driver -lgrass_gis -lgrass_datetime -lz -lfreetype -lgrass_gis -lgrass_datetime -lz -lm -lz
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:83: undefined reference to `G_add_keyword'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:84: undefined reference to `G_add_keyword'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:85: undefined reference to `G_add_keyword'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:103: undefined reference to `G_find_raster2'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:108: undefined reference to `Rast_map_type'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:111: undefined reference to `Rast_open_old'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:114: undefined reference to `Rast_get_cellhd'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:119: undefined reference to `Rast_allocate_buf'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:124: undefined reference to `Rast_allocate_buf'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:127: undefined reference to `Rast_open_new'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:138: undefined reference to `Rast_get_row'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:163: undefined reference to `Rast_put_row'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:171: undefined reference to `Rast_close'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:172: undefined reference to `Rast_close'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:175: undefined reference to `Rast_short_history'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:176: undefined reference to `Rast_command_history'
/home/anrr/Desktop/GRASS_dvp/r.example/main.c:177: undefined reference to `Rast_write_history'
collect2: ld returned 1 exit status
make: *** [/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example] Error 1
make: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'

It seems that it's not recognizing GRASS structures and functions.
Then I realized that my GRASS_HOME was pointing to:
GRASS_HOME = /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2
This folder was from where I run /configure it's not where my /svn is (/usr/local/grass-6.4.0svn/).

Question should I change GRASS_HOME to /usr/local/grass-6.4.0svn/ and and RUN_GISBASE
to /usr/local/grass-6.4.0svn//dist.i686-pc-linux-gnu ??
I know it's not suppose to change this files but, it's not running...

Thanks for the (future) tips :slight_smile:

Best regards,
Antonio

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4804 (20100125) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

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

change in Makefile:

MODULE_TOPDIR = ../../..
to:
MODULE_TOPDIR = ../..

António Rocha wrote:

I'm having a few difficulties in compiling modules (e.g. r.example).
*make -C r.example MODULE_TOPDIR=/usr/local/grass-6.4.0svn/*

/home/anrr/Desktop/GRASS_dvp/r.example/main.c:108: undefined reference to `Rast_map_type'

You're trying to compile an example written for 7.0 against 6.4.

A lot has changed between 7.0 and 6.x. E.g. all of the raster-specific
functions have been removed from lib/gis and moved to lib/raster, and
renamed from G_* to Rast_*.

The r.example source code is included in the GRASS source tree, in
doc/raster/r.example. The version in the 6.4 source tree should
compile against 6.4.

--
Glynn Clements <glynn@gclements.plus.com>