[GRASS-dev] winGRASS native

Just finished 1 day beginners GIS training on QGIS grass plugin and
GRASS GIS native on Windows.

it is overall an interesting experience for people on Windows, since
they compared it directly to other commercial software on
similar/identical processing. People (even really beginners) get
excited about scripting the most and with playing in NVIZ.

Things that could not work on GRASS GIS native:
- r.watershed (Neither GUI nor CLI worked)
- r.mapcalc (GUI version did not work, CLI worked)

Thanks to all working on winGRASS native,
Yann

--
----

Yann Chemin wrote:

Things that could not work on GRASS GIS native:
- r.watershed (Neither GUI nor CLI worked)
- r.mapcalc (GUI version did not work, CLI worked)

what were the errors?
what version/CVSdate of winGRASS native?

Hamish

Yann Chemin wrote:

> > I used the GRASS version from:
> > http://geni.ath.cx/grass.html#toc2
> > It says: 6.3.CVS September 17, 2006
> >
> > Unfortunately i have not recorded the errors... But if i remember
> > well

..

> > Things that could not work on GRASS GIS native:
> > - r.watershed (Neither GUI nor CLI worked)

..

> > About r.watershed, it mentioned something about /RAM that was
> > making the problem. sorry for this poor info, i dont have Windows
> > box around.

IIUC, r.watershed/seg/Makefile and r.watershed/ram/Makefile need to have
$(EXE) added to the end of the support binaries so they'll get .exe
extensions. (I'm not sure where/how in the Makefile to do this)

bug: ram.exe and seg.exe are getting installed in both $GISBASE/etc/ and
$GISBASE/etc/water/. I'm not sure why, is it because "default: etc" ?
The version in water/ is what is called.

these should be checked for the same missing $(EXE):

cd $GISBASE/etc
for PGM in `find . -perm +3 -type f | grep -v '\.tcl$'` ; do
  file "$PGM" | grep ELF | cut -f1 -d:
done

# some verified ones removed
./form/form
./frame.create
./frame.select
./frame.dumper
./frame.list
./mon.list
./mon.release
./mon.select
./mon.start
./mon.status
./mon.stop
./mon.which
./lister/cell
./lister/vector
./i.ask
./i.find
./photo.2image
./photo.2target
./photo.camera
./photo.elev
./photo.init
./photo.rectify
./photo.target
./support/modcats
./support/modcolr
./support/modhist
./support/modhead
./current_time_s_ms

---

Any more thoughts on a hierarchy for the $GISBASE/etc/ dir?
To help with multi-platform packaging it would be nice to segregate
scripts and tcl from binaries, but as far as GRASS is concerned a
support program is a support program regardless of what language was
used to write it.

Compromise:
If we have nviz/, startup/, and gui/ dirs [tcl] then ELF binaries could
be put in system/ (lock, run, mon.*. frame.*), and modules/ (water/, ..)

Hamish

Hamish wrote:

> > > I used the GRASS version from:
> > > http://geni.ath.cx/grass.html#toc2
> > > It says: 6.3.CVS September 17, 2006
> > >
> > > Unfortunately i have not recorded the errors... But if i remember
> > > well
..
> > > Things that could not work on GRASS GIS native:
> > > - r.watershed (Neither GUI nor CLI worked)
..
> > > About r.watershed, it mentioned something about /RAM that was
> > > making the problem. sorry for this poor info, i dont have Windows
> > > box around.

IIUC, r.watershed/seg/Makefile and r.watershed/ram/Makefile need to have
$(EXE) added to the end of the support binaries so they'll get .exe
extensions. (I'm not sure where/how in the Makefile to do this)

There are two possible approaches:

1. Add $(EXE) to the definition of PGM= in the Makefile.

2. Add $(EXE) to the "etc" rules in Module.make, and add it to the
$(INSTALL) command in the Makefile.

I prefer the latter option, as this is consistent with the way that
"normal" programs are handled. Module.make automatically adds $(EXE)
to $(PGM) for "cmd" and "inter" rules, but not for "etc". This means
that the definition of PGM in the module's Makefile has to include
$(EXE) for "etc" but mustn't include it for "cmd" or "inter".

Any more thoughts on a hierarchy for the $GISBASE/etc/ dir?
To help with multi-platform packaging it would be nice to segregate
scripts and tcl from binaries, but as far as GRASS is concerned a
support program is a support program regardless of what language was
used to write it.

I suggest treating scripts the same as binary executables, even though
that means having multiple copies on multi-architecture filesystems.

They don't take up much space, and we won't have to track down their
callers if someone replaces a binary with an equivalent script (or
vice-versa).

Separating programs (whether binaries or scripts) from data files
seems a reasonable goal. However, some binary data files may be
platform dependent (byte order, sizeof(long) etc). Aren't some of the
datum grids architecture-specific?

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

> > > > Things that could not work on GRASS GIS native:
> > > > - r.watershed (Neither GUI nor CLI worked)
> ..
> > > > About r.watershed, it mentioned something about /RAM that was
> > > > making the problem. sorry for this poor info, i dont have
> > > > Windows box around.

HB:

> IIUC, r.watershed/seg/Makefile and r.watershed/ram/Makefile need to
> have $(EXE) added to the end of the support binaries so they'll get
> .exe extensions. (I'm not sure where/how in the Makefile to do this)

GC:

There are two possible approaches:

1. Add $(EXE) to the definition of PGM= in the Makefile.

2. Add $(EXE) to the "etc" rules in Module.make, and add it to the
$(INSTALL) command in the Makefile.

compare:
  raster/r.support/modhead/Makefile
and
  raster/r.watershed/ram/Makefile

r.support/modhead:
---
MODULE_TOPDIR = ../../..

PGM = modhead$(EXE)

LIBES = $(EDITLIB) $(VASKLIB) $(GISLIB) $(CURSES)
DEPENDENCIES = $(GISDEP) $(EDITDEP) $(VASKDEP)

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

default: etc
        $(MKDIR) $(ETC)/support
        mv $(ETC)/$(PGM) $(ETC)/support

htmletc1:
        @echo "No docs to generate."
---

r.watershed/ram:
---
MODULE_TOPDIR = ../../..

PGM = r.watershed.ram

LIBES = $(GISLIB)
DEPENDENCIES = $(GISDEP)

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

default: etc
        $(MKDIR) $(ETC)/water
        $(INSTALL) -m 755 $(ETC)/$(PGM) $(ETC)/water

htmletc1:
        @echo "No docs to generate."
---

* in r.support $(EXE) gets added to $(PGM) so no need for it to be used
with each $(INSTALL) as well.

* r.support uses "mv" while r.watershed uses $(INSTALL). This explains
why there end up being two copies of seg and ram in etc/ and etc/water/.
(cp vs mv). The solution eludes me.

* after renaming "ram" and "seg" to "r.watershed.{ram|seg}" it complains
that those module are missing man pages when rebuilding grass. does it
have anything to do with raster/r.watershed/Makefile missing this line:
  include $(MODULE_TOPDIR)/include/Make/Dir.make
?

I prefer the latter option, as this is consistent with the way that
"normal" programs are handled. Module.make automatically adds $(EXE)
to $(PGM) for "cmd" and "inter" rules, but not for "etc". This means
that the definition of PGM in the module's Makefile has to include
$(EXE) for "etc" but mustn't include it for "cmd" or "inter".

I agree. Better to be consistent and control it from one place.

I leave it to someone else to implement as I don't use windows & can't
test.

> Any more thoughts on a hierarchy for the $GISBASE/etc/ dir?
> To help with multi-platform packaging it would be nice to segregate
> scripts and tcl from binaries, but as far as GRASS is concerned a
> support program is a support program regardless of what language was
> used to write it.

I suggest treating scripts the same as binary executables, even though
that means having multiple copies on multi-architecture filesystems.

I agree for shell scripts, but what about big tcl files? (etc/ gis.m,
d.m, nviz,..) and in future large amounts of python code..

They don't take up much space, and we won't have to track down their
callers if someone replaces a binary with an equivalent script (or
vice-versa).

agree.

Separating programs (whether binaries or scripts) from data files
seems a reasonable goal. However, some binary data files may be
platform dependent (byte order, sizeof(long) etc). Aren't some of the
datum grids architecture-specific?

sounds vaugely familiar.

Hamish

Hamish wrote:

> > > > > Things that could not work on GRASS GIS native:
> > > > > - r.watershed (Neither GUI nor CLI worked)
> > ..
> > > > > About r.watershed, it mentioned something about /RAM that was
> > > > > making the problem. sorry for this poor info, i dont have
> > > > > Windows box around.
HB:
> > IIUC, r.watershed/seg/Makefile and r.watershed/ram/Makefile need to
> > have $(EXE) added to the end of the support binaries so they'll get
> > .exe extensions. (I'm not sure where/how in the Makefile to do this)
GC:
> There are two possible approaches:
>
> 1. Add $(EXE) to the definition of PGM= in the Makefile.
>
> 2. Add $(EXE) to the "etc" rules in Module.make, and add it to the
> $(INSTALL) command in the Makefile.

compare:
  raster/r.support/modhead/Makefile

Uses #1.

and
  raster/r.watershed/ram/Makefile

Uses neither, and so fails.

r.support/modhead:
---
MODULE_TOPDIR = ../../..

PGM = modhead$(EXE)

LIBES = $(EDITLIB) $(VASKLIB) $(GISLIB) $(CURSES)
DEPENDENCIES = $(GISDEP) $(EDITDEP) $(VASKDEP)

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

default: etc
        $(MKDIR) $(ETC)/support
        mv $(ETC)/$(PGM) $(ETC)/support

htmletc1:
        @echo "No docs to generate."
---

r.watershed/ram:
---
MODULE_TOPDIR = ../../..

PGM = r.watershed.ram

LIBES = $(GISLIB)
DEPENDENCIES = $(GISDEP)

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

default: etc
        $(MKDIR) $(ETC)/water
        $(INSTALL) -m 755 $(ETC)/$(PGM) $(ETC)/water

htmletc1:
        @echo "No docs to generate."
---

* in r.support $(EXE) gets added to $(PGM) so no need for it to be used
with each $(INSTALL) as well.

Adding it to PGM may cause problems with HTML files. It's probably
better to consider the .exe suffix as not being part of the program
name.

Makefiles which need to know the executable's exact filename should
probably use $(PROG) (but we need something similar for "etc"
programs).

Ultimately, I suspect that using subdirectories of $(ETC) will cause
more problems than it's worth.

* r.support uses "mv" while r.watershed uses $(INSTALL). This explains
why there end up being two copies of seg and ram in etc/ and etc/water/.
(cp vs mv). The solution eludes me.

* after renaming "ram" and "seg" to "r.watershed.{ram|seg}" it complains
that those module are missing man pages when rebuilding grass. does it
have anything to do with raster/r.watershed/Makefile missing this line:
  include $(MODULE_TOPDIR)/include/Make/Dir.make
?

In my copy, the Makefile includes that line.

I'm not sure whether you've made any changes, but Html.make uses
$(PGM) in the rules. If you add $(EXE) to the definition of PGM, the
.exe will end up in the name of the .html file, which might cause
problems.

> > Any more thoughts on a hierarchy for the $GISBASE/etc/ dir?
> > To help with multi-platform packaging it would be nice to segregate
> > scripts and tcl from binaries, but as far as GRASS is concerned a
> > support program is a support program regardless of what language was
> > used to write it.
>
> I suggest treating scripts the same as binary executables, even though
> that means having multiple copies on multi-architecture filesystems.

I agree for shell scripts, but what about big tcl files? (etc/ gis.m,
d.m, nviz,..) and in future large amounts of python code..

Don't worry about it. If there are significant directory trees which
take up a significant amount of space, the administrator can always
replace copies with symlinks.

To be honest, I suspect that the number of multi-architecture GRASS
installations could be counted on the fingers of one hand (and quite
possibly even on the thumbs of one hand :wink: ).

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