[GRASS-dev] Make files for g.extension

Hi,

I wrote an addon (r.denoise) that I would like to be able to use with g.extension. I am running 6.5.svn from my home directory, so that I have permissions to install extra modules without sudo. The installation fails, telling me that the module did not install correctly (see below). I have a few questions:

- is this a problem with 1) my 6.5.svn installation, 2) with g.extension, or 3) with the r.denoise addon?

- if 1) or 3), how can I fix it? Do I need to change the Make file for r.denoise?

I have trouble installing other addons (r.surf.volcano, r.colors.quantiles), so if the problem is with the addons, then it will affect them, too.

Cheers

John

GRASS 6.5.svn (thingy):~/laptop/grassdata/thingy > g.extension r.denoise
Fetching <r.denoise> from GRASS-Addons SVN (be patient)...
A r.denoise/description.html
A r.denoise/r.denoise
A r.denoise/Makefile
Checked out revision 39770.
Compiling r.denoise...
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
if [ ! -d /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts ]; then mkdir -p /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts; fi
/usr/bin/install -c r.denoise /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.denoise
make htmlscript scriptstrings
make[1]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
make /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.denoise.html HTMLSRC=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.denoise
make[2]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
if [ "/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.denoise" != "" ] ; then GISRC=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/demolocation/.grassrc65 GISBASE=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu PATH="/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/bin:$PATH" LD_LIBRARY_PATH="/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/bin:/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/lib:/home/mbessjs3/usr/local/grass-6.5.svn/lib" LC_ALL=C /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.denoise --html-description < /dev/null | grep -v '</body>\|</html>' > r.denoise.tmp.html ; true ; fi
/home/mbessjs3/usr/local/grass-6.5.svn/tools/mkhtml.sh r.denoise ; mkdir -p /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html ; /usr/bin/install -c -m 644 r.denoise.tmp.html /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.denoise.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/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html ; fi done 2> /dev/null ; true
make[2]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
GISRC=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/demolocation/.grassrc65 GISBASE=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu PATH=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/bin:$PATH LD_LIBRARY_PATH="/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/lib:/home/mbessjs3/usr/local/grass-6.5.svn/lib" g.parser -t r.denoise | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > /home/mbessjs3/usr/local/grass-6.5.svn/locale/scriptstrings/r.denoise_to_translate.c ; true
/bin/sh: cannot create /home/mbessjs3/usr/local/grass-6.5.svn/locale/scriptstrings/r.denoise_to_translate.c: Directory nonexistent
make[1]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
make mancmd
make[1]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
make /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1/r.denoise.1 MANSRC=/home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.denoise.html
make[2]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
mkdir -p /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1
GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.5.svn sh /home/mbessjs3/usr/local/src/grass/develbranch_6/tools/g.html2man/g.html2man /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.denoise.html /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1/r.denoise.1 1
Converting: /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.denoise.html to /home/mbessjs3/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1/r.denoise.1
make[2]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
make[1]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/16278.0/r.denoise'
Installing r.denoise...
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/home/mbessjs3/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
ERROR: Module did not install properly

--

Dr John Stevenson
Postdoctoral Research Associate
School of Earth, Atmospheric and Environmental Sciences
Williamson Building (Room 2.42)
University of Manchester
Manchester M13 9PL, UK
tel. +44(0)161 306 6585; fax. +44(0)161 306 9361;
john.stevenson@manchester.ac.uk

On Fri, Nov 20, 2009 at 10:30 AM, John A Stevenson
<john.stevenson@manchester.ac.uk> wrote:

Hi,

I wrote an addon (r.denoise) that I would like to be able to use with
g.extension. I am running 6.5.svn from my home directory, so that I have
permissions to install extra modules without sudo. The installation fails,
telling me that the module did not install correctly (see below). I have a
few questions:

- is this a problem with 1) my 6.5.svn installation, 2) with g.extension, or
3) with the r.denoise addon?

- if 1) or 3), how can I fix it? Do I need to change the Make file for
r.denoise?

I have trouble installing other addons (r.surf.volcano, r.colors.quantiles),
so if the problem is with the addons, then it will affect them, too.

It is likely g.extension in 6.4 and 6.5 and the related Makefile systems.

Can you please make a try with GRASS 7? In GRASS 7 it is written
in Python and the overall Makefile system is better.
If it works for you in GRASS 7 we may think how to backport that.

Markus

Markus Neteler wrote:

It is likely g.extension in 6.4 and 6.5 and the related Makefile systems.

Can you please make a try with GRASS 7? In GRASS 7 it is written
in Python and the overall Makefile system is better.
If it works for you in GRASS 7 we may think how to backport that.
  

No luck. Is this a problem with shell script type addons? The addon isn't a Python script (yet...)

-----------------------------------
g.extension output:

GRASS 7.0.svn (iceland_srtm):~/laptop/grassdata/iceland_srtm > g.extension r.denoise svnurl=https://svn.osgeo.org/grass/grass-addons/
Fetching 'r.denoise' from GRASS-Addons SVN (be patient)...
A r.denoise/description.html
A r.denoise/r.denoise
A r.denoise/Makefile
Checked out revision 39791.
Compiling 'r.denoise'...
make: *** No rule to make target `/home/mbessjs3/usr/local/src/grass/grass_trunk/dist.i686-pc-linux-gnu/scripts/r.denoise', needed by `script'. Stop.
ERROR: Compilation failed, sorry. Please check above error messages.

-----------------------------------
r.denoise makefile:

MODULE_TOPDIR = ../..

PGM=r.denoise

include $(MODULE_TOPDIR)/include/Make/Script.make

default: script

--

Dr John Stevenson
Postdoctoral Research Associate
School of Earth, Atmospheric and Environmental Sciences
Williamson Building (Room 2.42)
University of Manchester
Manchester M13 9PL, UK
tel. +44(0)161 306 6585; fax. +44(0)161 306 9361;
john.stevenson@manchester.ac.uk

On Mon, Nov 23, 2009 at 3:30 PM, John A Stevenson
<john.stevenson@manchester.ac.uk> wrote:

Markus Neteler wrote:

It is likely g.extension in 6.4 and 6.5 and the related Makefile systems.

Can you please make a try with GRASS 7? In GRASS 7 it is written
in Python and the overall Makefile system is better.
If it works for you in GRASS 7 we may think how to backport that.

No luck. Is this a problem with shell script type addons?

Good question.

The addon isn't a Python script (yet...)

The addon can be C or Shell or ... (say, that's the idea).

g.extension output:

GRASS 7.0.svn (iceland_srtm):~/laptop/grassdata/iceland_srtm > g.extension
r.denoise svnurl=https://svn.osgeo.org/grass/grass-addons/
Fetching 'r.denoise' from GRASS-Addons SVN (be patient)...
A r.denoise/description.html
A r.denoise/r.denoise
A r.denoise/Makefile
Checked out revision 39791.
Compiling 'r.denoise'...
make: *** No rule to make target
`/home/mbessjs3/usr/local/src/grass/grass_trunk/dist.i686-pc-linux-gnu/scripts/r.denoise',
needed by `script'. Stop.
ERROR: Compilation failed, sorry. Please check above error messages.

I guess that's due to the fact that some (don't know how
much) shell support was removed from the Makefile system
in GRASS 7.

-----------------------------------
r.denoise makefile:

MODULE_TOPDIR = ../..

PGM=r.denoise

include $(MODULE_TOPDIR)/include/Make/Script.make

default: script

--

Unfortunately no idea but I can replicate the problem.

Markus

Markus Neteler wrote:

I guess that's due to the fact that some (don't know how
much) shell support was removed from the Makefile system
in GRASS 7.

The Script.make and ScriptRules.make files assume Python; there are no
longer any rules for shell scripts.

The "script" target will attempt to make $GISBASE/scripts/$PGM.py
(Windows) or $GISBASE/scripts/$PGM (Unix) from ./$PGM.py (it will also
make $GISBASE/docs/html/$PGM.html and the
locale/scriptstrings/${PGM}_to_translate.c file for use by xgettext).

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

Glynn Clements wrote:

The "script" target will attempt to make $GISBASE/scripts/$PGM.py
(Windows) or $GISBASE/scripts/$PGM (Unix) from ./$PGM.py

Does it alter the file in the process? Could I just rename the script r.denoise.py and have it copied into the scripts directory, and therefore be made visible on the PATH?

Or is that just asking for trouble/confusion?

John

--

Dr John Stevenson
Postdoctoral Research Associate
School of Earth, Atmospheric and Environmental Sciences
Williamson Building (Room 2.42)
University of Manchester
Manchester M13 9PL, UK
tel. +44(0)161 306 6585; fax. +44(0)161 306 9361;
john.stevenson@manchester.ac.uk

John A Stevenson wrote:

> The "script" target will attempt to make $GISBASE/scripts/$PGM.py
> (Windows) or $GISBASE/scripts/$PGM (Unix) from ./$PGM.py

Does it alter the file in the process?

No.

Could I just rename the script
r.denoise.py and have it copied into the scripts directory, and
therefore be made visible on the PATH?

Or is that just asking for trouble/confusion?

That will probably work on Unix; on Windows, the installed script will
retain the .py extension.

I can't guarantee that it will continue to work even on Unix; if it
works at the moment, that's a coincidence, not by design.

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