[GRASS-dev] FW: [GRASS-user] GRASS for windows script solution

Moritz,

Here is more information on GRASS for Windows and NVIZ from Isaac. We still can’t get NVIZ to launch if GRASS is started from the grass.bat file. Given that it DOES work fine if launched from within MySys, it seems that this must be some kind of path issue that is potentially solvable.

Also, I think we need to make MySys a dependency of GRASS for Windows. There is just too much lost by not having access to the scripts—including the nviz script. Users without MySys will perceive GRASS as partly non-functional. This is not a problem license-wise is it?

Michael


Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

------ Forwarded Message
From: Isaac Ullah isaac.ullah@asu.edu
Date: Mon, 3 Dec 2007 11:44:20 -0700
To: Michael Barton michael.barton@asu.edu
Subject: Re: FW: [GRASS-user] GRASS for windows script solution

I tried both of these solutions, and neither resulted in success (ie. NVIS still does not launch!) So far, the only solution that works for me is to move the grass install directory into the c:\mysys\1.0 directory, edit the “grass63” shell script so that the GISBASE is now set to “/c/msys/1.0/grass63RC2/grass- 6.3.0RC2”, and then start grass by invoking that script at the command prompt in the mysys shell. If the grass directory is not installed in the mysys root directory, (ie. it’s just in c:) then mysys can find it since I can’t cd in the mysys terminal below the mysys root folder “c/mysys/1.0/”

Cheers,

Isaac

On 11/29/07, Michael Barton michael.barton@asu.edu wrote:

Did you try the solution listed below?

Michael


Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

------ Forwarded Message

From: Moritz Lennert mlennert@club.worldonline.be
Date: Wed, 28 Nov 2007 11:38:31 +0100
To: francesco < francesco.pirotti@unipd.it mailto:francesco.pirotti@unipd.it >
Cc: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] GRASS for windows script solution

On 28/11/07 11:01, francesco wrote:

Hello,

For all fearless Wingrass users, I would like to share a solution for
the following bug …“many shell scripts do not work, even if you
enable correctly msys and include LIB and BIN paths in the PATH windows
variable…” (from the readme file at the wingrass webpage).

PROBLEM - Long story short, g.mlist gave me errors because it did not
fine “sed” and other executables, therefore scripts like g.mlist and
g.mremove do not work
SOLUTION -
1 - open the “Init.bat” file located in the
“/grass-6.3.xxx/etc” … do not use
notepad but a better editor that recognizes unix formatted text
2 - add the line below after the …if not
“%GRASS_ADDON_PATH%”==… line (should be line 29)
set PATH=/c/msys/1.0/bin;%PATH%
3 - of course /c/msys/1.0/bin is the path to the bin directory of
msys, if yours is different, adapt.
4 - start grass and try.

As mentioned int he README: “in order for shell scripts to work, you
will have to add msys’ lib and bin directories to your path in the
grass63.bat file.”

So, no need to fiddle with Init.bat, just add it in grass63.bat:

set PATH=%PATH+;c:\msys\1.0\bin;c:\msys\1.0\lib

The information used to be in the .bat file, but we decided to take it
out in the effort of making wingrass independent of msys. But seeing the
many reactions on this, I think I will add it again.

Moritz

------ End of Forwarded Message

Isaac I Ullah, M.A.

Archaeology PhD Student,
ASU School of Evolution and Social Change

Research Assistant,
Mediterranean Landscape Dynamics Project


isaac.ullah@asu.edu
ullah@archaeologist.com

http://www.public.asu.edu/~iullah


------ End of Forwarded Message

On 03/12/07 19:51, Michael Barton wrote:

Moritz,

Here is more information on GRASS for Windows and NVIZ from Isaac. We still can’t get NVIZ to launch if GRASS is started from the grass.bat file. Given that it DOES work fine if launched from within MySys, it seems that this must be some kind of path issue that is potentially solvable.

I think I found the culprit, although I don't understand why it used to work before, nor why it works on my machine...

In etc/gm/gm.tcl, lines 142 and 143 read:

append regexp .* $env(GISBASE) {[^:]*}
regsub -- $regexp $env(PATH) "&:$env(GISBASE)/etc/gui/scripts" env(PATH)

However, in windows, the seperator in the PATH variable is a ';', not a ':'. Could you try changing the two ':' in these two lines to ';' and see what happens:

append regexp .* $env(GISBASE) {[^;]*}
regsub -- $regexp $env(PATH) "&;$env(GISBASE)/etc/gui/scripts" env(PATH)

Moritz

On Wed, December 5, 2007 11:05, Moritz Lennert wrote:

On 03/12/07 19:51, Michael Barton wrote:

Moritz,

Here is more information on GRASS for Windows and NVIZ from Isaac. We
still can’t get NVIZ to launch if GRASS is started from the grass.bat
file. Given that it DOES work fine if launched from within MySys, it
seems that this must be some kind of path issue that is potentially
solvable.

I think I found the culprit, although I don't understand why it used to
work before, nor why it works on my machine...

I now understand why it works on my machine and not on my colleague's:

On my colleague's machine c:\tcl\bin is the first element in path, and
this gets thus mangled by setting the path with a ':' separator and thus
the tclsh or wish executable isn't found any more. On my machine there is
something else before c:\tcl\bin and so this doesn't get mangled and the
executable still is found.

This is not a problem in msys as the path is set *nix style.

Is there a way to tell within tcltk whether we are in windows or in *nix
path mode and thus to conditionalise the setting of the path ? Or to
rewrite the expression so that it works everywhere ?

Moritz

Moritz Lennert wrote:

Is there a way to tell within tcltk whether we are in windows or in *nix
path mode and thus to conditionalise the setting of the path ? Or to
rewrite the expression so that it works everywhere ?

$tcl_platform(platform) should be either "windows", "macintosh", or
"unix". On Linux and Cygwin, I get "unix", while my MSys version says
"windows". I'm not sure what MacOSX will have; I suggest treating
everything except "windows" as Unix.

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