[GRASS-user] Re: [GRASS-dev] Compiling r.example in LINUX

Greetings Glynn

The thing is that I went here: http://trac.osgeo.org/grass/browser/grass/trunk/doc/raster and I donwloaded the r.example that is there.
At least I didn«t saw any information regarding GRASS version :(.

Now I realize thatr the trunk relates with 7.0 version and in Branches I can find 6.4 version. :slight_smile:

Ok After I did this:
sudo make -C Desktop/GRASS_dvp/r.example/ MODULE_TOPDIR=/usr/local/grass-6.4.0svn

Instead of putting r.example in /usr/local/grass-6.4.0svn my r.example was putted in
/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu
this is the path to my snapshot from which I installed grass-6.4.0svn.
Shouldn't it be placed in usr/local/grass-6.4.0svn? Because altough it has been compiled it's not available to be used.

Thanks for your help.
Antonio

By the way, the error text might be helpful:

ake: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
gcc -I/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/include -g -O2 -DPACKAGE=\""grassmods"\" -I/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/include -o OBJ.i686-pc-linux-gnu/main.o -c main.c
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 -lm -lz
make htmlcmd
make[1]: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
make /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html/r.example.html HTMLSRC=/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example
make[2]: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
if [ "/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example" != "" ] ; then GISRC=/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/demolocation/.grassrc64 GISBASE=/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu PATH="/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin:$PATH" LD_LIBRARY_PATH="/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin:/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/lib:" LC_ALL=C /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/bin/r.example --html-description < /dev/null | grep -v '</body>\|</html>' > r.example.tmp.html ; true ; fi
ERROR: MAPSET PERMANENT - permission denied
/usr/local/grass-6.4.0svn/tools/mkhtml.sh r.example ; mkdir -p /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html ; /usr/bin/install -c -m 644 r.example.tmp.html /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html/r.example.html ; for file in *.png *.jpg ; do head -n 1 $file | grep '^#!' > /dev/null ; if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html ; fi done 2> /dev/null ; true
make[2]: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'
make[1]: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'
make mancmd
make[1]: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
make /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/man/man1/r.example.1 MANSRC=/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html/r.example.html
make[2]: Entering directory `/home/anrr/Desktop/GRASS_dvp/r.example'
mkdir -p /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/man/man1
GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.4.0svn sh /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/tools/g.html2man/g.html2man /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html/r.example.html /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/man/man1/r.example.1 1
Converting: /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/docs/html/r.example.html to /home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu/man/man1/r.example.1
make[2]: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'
make[1]: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'
make: Leaving directory `/home/anrr/Desktop/GRASS_dvp/r.example'

Glynn Clements wrote:

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.

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

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

António Rocha wrote:

The thing is that I went here:
http://trac.osgeo.org/grass/browser/grass/trunk/doc/raster and I
donwloaded the r.example that is there.
At least I didn«t saw any information regarding GRASS version :(.

Now I realize thatr the trunk relates with 7.0 version and in Branches I
can find 6.4 version. :slight_smile:

Ok After I did this:
sudo make -C Desktop/GRASS_dvp/r.example/
MODULE_TOPDIR=/usr/local/grass-6.4.0svn

Instead of putting r.example in /usr/local/grass-6.4.0svn my r.example
was putted in
/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu
this is the path to my snapshot from which I installed grass-6.4.0svn.
Shouldn't it be placed in usr/local/grass-6.4.0svn? Because altough it
has been compiled it's not available to be used.

The *.make files continue to reflect the build directory; you'll need
to override certain other variables, e.g. GRASS_HOME and RUN_GISBASE.

There may be other issues; the ability to build modules outside of the
source tree against an installed version of GRASS is a relatively
recent feature, and may still have bugs.

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

Hi All
Ok I've changed my ARCH_DISTDIR, ARCH_BINDIR (GRASS.MAKE), GRASS_HOME and RUN_GISBASE (PLATFORM.MAKE) in order to point to my grass-6.4.0svn installation instead of my Snapshot folder.

Is it helpful to create a Wiki regarding this matters? (two other persons sent me PMs regarding this questions with the same questions).

Thank you Glynn for your help.

Best regards,
Antonio

Glynn Clements wrote:

António Rocha wrote:

The thing is that I went here: http://trac.osgeo.org/grass/browser/grass/trunk/doc/raster and I donwloaded the r.example that is there.
At least I didn«t saw any information regarding GRASS version :(.

Now I realize thatr the trunk relates with 7.0 version and in Branches I can find 6.4 version. :slight_smile:

Ok After I did this:
sudo make -C Desktop/GRASS_dvp/r.example/ MODULE_TOPDIR=/usr/local/grass-6.4.0svn

Instead of putting r.example in /usr/local/grass-6.4.0svn my r.example was putted in
/home/anrr/Downloads/grass-6.4.svn_src_snapshot_2010_01_16-2/dist.i686-pc-linux-gnu
this is the path to my snapshot from which I installed grass-6.4.0svn.
Shouldn't it be placed in usr/local/grass-6.4.0svn? Because altough it has been compiled it's not available to be used.
    
The *.make files continue to reflect the build directory; you'll need
to override certain other variables, e.g. GRASS_HOME and RUN_GISBASE.

There may be other issues; the ability to build modules outside of the
source tree against an installed version of GRASS is a relatively
recent feature, and may still have bugs.

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4807 (20100126) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Regarding this issue.
Although it's compiling r.example I'm getting the following error:
ERROR: G_getenv(): Variable LOCATION_NAME not set

What does this mean? I need to have a demolocation folder in my GRASSsvn6.4.0 folder?

Thanks

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4815 (20100128) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

António Rocha wrote:

Regarding this issue.
Although it's compiling r.example I'm getting the following error:
ERROR: G_getenv(): Variable LOCATION_NAME not set

What does this mean? I need to have a demolocation folder in my
GRASSsvn6.4.0 folder?

The default rule for a module attempts to build the HTML
documentation, which involves running the program with the
--html-description flag to obtain the module/option/flag descriptions.

Running the module requires that GISRC is set and refers to a file
containing settings for at least GISDBASE, LOCATION_NAME and MAPSET. I
don't recall whether those values need to be valid, or just exist.

The rule sets GISRC from RUN_GISRC, which is defined as:

RUN_GISRC = ${ARCH_DISTDIR}/demolocation/.grassrc${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}

You can either copy the demolocation directory from the source tree,
or just change the value of RUN_GISRC to point to a suitable file.

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