[GRASS-user] GRASS 6.2.1-1 Installation Question

Hello,
I have installed grass6.2.1-1 on my WindowsXP machine with cygwin installed. When I type grass62 in the xwin termainal window, the introductory slash screen sucessfully appears. I proceed to enter the gis data directory, project location (spearfish60) and mapset (user1) and click ‘Enter Grass’. The following messages appear in the termainal window:

: command not found2.1/etc/Init.sh: line 480:
: command not found2.1/etc/Init.sh: line 480:
: command not found2.1/etc/Init.sh: line 480:
ERROR: Invalid return code from gis_set.tcl.
Please advise GRASS developers of this error.
/.gislock: No such file or directory
ERROR: /usr/local/grass-6.2.1/etc/lock:
rnarayan is currently running GRASS in selected mapset. Concurrent use not allowed.

I have installed grass using the tcltk-grass package available on the mirror site ( http://grass.ibiblio.org)

I had looked at Init.sh and therefore manually set the following environment variables as they appeared on line 480:
TCLTKGRASSBASE
GRASS_WISH
to their respective directories but this did not have any affect.

Can someone inform me about what I might be doing incorrectly?

Ramu Narayanan

Ramu Narayanan wrote:

Hello,
I have installed grass6.2.1-1 on my WindowsXP machine with cygwin
installed. When I type grass62 in the xwin termainal window, the
introductory slash screen sucessfully appears. I proceed to enter the
gis data directory, project location (spearfish60) and mapset (user1)
and click 'Enter Grass'. The following messages appear in the
termainal window:

: command not found2.1/etc/Init.sh: line 480:
: command not found2.1/etc/Init.sh: line 480:
: command not found2.1/etc/Init.sh: line 480:
ERROR: Invalid return code from gis_set.tcl.
Please advise GRASS developers of this error.
/.gislock: No such file or directory
ERROR: /usr/local/grass-6.2.1/etc/lock:
rnarayan is currently running GRASS in selected mapset. Concurrent use
not allowed.

I have installed grass using the tcltk-grass package available on the
mirror site ( http://grass.ibiblio.org)

I had looked at Init.sh and therefore manually set the following
environment variables as they appeared on line 480:
TCLTKGRASSBASE
GRASS_WISH
to their respective directories but this did not have any affect.

Can someone inform me about what I might be doing incorrectly?

Right, some environment variables aren't getting set correctly.

namely GRASS_WISH= is empty, and LOCATION= is empty for .gislock --

if a variable is empty it becomes "", ie nothing.

so if $LOCATION is empty:
(from Init.sh)
# Check for concurrent use
lockfile="$LOCATION/.gislock"

becomes just "/.gislock", which is the wrong place to look.

can you try this at the xterm prompt:

cd /usr/local/grass-6.2.1/lib/
cygcheck /usr/local/grass-6.2.1/etc/lock.exe
cygcheck /usr/local/grass-6.2.1/bin/g.gisenv
cygcheck /usr/local/grass-6.2.1/bin/g.region

and look for any errors due to missing DLL libraries.
?

If you ever manage to make it into GRASS you can try "g.gisenv --help" at
the command prompt and see if you get a useful help message there.
That will tell you if most of the program is working.
g.gisenv is what sets $LOCATION.

can you try setting GRASS_WISH before entering GRASS?

at the xterm prompt:
GRASS_WISH=wish grass62
  or
GRASS_WISH=wish
export GRASS_WISH
grass62

"which wish" at the xterm prompt should show
/usr/local/bin/wish or /usr/local/bin/wish8.4

Hamish

Hamish wrote:

If you ever manage to make it into GRASS you can try "g.gisenv --help" at
the command prompt and see if you get a useful help message there.
That will tell you if most of the program is working.
g.gisenv is what sets $LOCATION.

If you have trouble getting past Init.sh and into a shell, one option
is to avoid the -text/-gui interaction altogether and just specify the
complete path to the mapset directory, e.g.:

  grass62 -text ~/grass-data/spearfish57/glynn

[equivalent to specifying database:/home/glynn/grass-data,
location:spearfish57, mapset:glynn in the start-up screen.]

If that doesn't work, you can try bypassing Init.sh altogether, by
creating a ~/.grassrc6 file and setting up the "session" manually.

This is what I use in my ~/.bashrc to make GRASS commands available
everywhere:

  export GISBASE=/opt/grass-6.3.cvs
  export GRASS_GNUPLOT='gnuplot -persist'
  export GRASS_WIDTH=640
  export GRASS_HEIGHT=480
  export GRASS_HTML_BROWSER=firefox
  export GRASS_PAGER=cat
  export GRASS_PERL=perl
  export GRASS_TCLSH=tclsh
  export GRASS_WISH=wish
  
  export PATH="$GISBASE/bin:$GISBASE/scripts:$PATH"
  export LD_LIBRARY_PATH="$GISBASE/lib"
  export GRASS_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
  
  export GIS_LOCK=$$
  export GRASS_VERSION="6.1.cvs"
  
  tmp=/tmp/grass6-"`whoami`"-$GIS_LOCK
  export GISRC="$tmp/gisrc"
  mkdir "$tmp"
  cp ~/.grassrc6 "$GISRC"

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

Hello,
The problem that I encountered no longer appears.

I opened grass62 in text mode using the Spearfish60, typed in g.gisenv and noticed that LOCATION_NAME was set to Spearfish60 but not LOCATION. I then added a LOCATION variable (not sure if needed) and then entered gis.m which then opened up the GRASS6.2 manager, map display and output windows. I can now enter the GUI and the text based modes without seeing the same error message that I saw before. The problem I currently face is that when I enter the command into the GRASS command prompt:

d.mon x0

The following message appears:

GRASS 6.2.1 (spearfish60):~ > d.mon x0
using default visual which is TrueColor
ncolors: 16777216
Graphics driver [x0] started
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
Problem selecting x0. Will try once more
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
GRASS 6.2.1 (spearfish60):~ > d.rast soils
No graphics monitor has been selected for output.
Please run “d.mon” to select a graphics monitor.

I get similar messages regardless of whether I do this in the GRASS command prompt or the Grass Manager window.
The list and info commands appear to be working.

Ramu

On 2/19/07, Glynn Clements <glynn@gclements.plus.com > wrote:

Hamish wrote:

If you ever manage to make it into GRASS you can try " g.gisenv --help" at
the command prompt and see if you get a useful help message there.
That will tell you if most of the program is working.
g.gisenv is what sets $LOCATION.

If you have trouble getting past Init.sh and into a shell, one option
is to avoid the -text/-gui interaction altogether and just specify the
complete path to the mapset directory, e.g.:

grass62 -text ~/grass-data/spearfish57/glynn

[equivalent to specifying database:/home/glynn/grass-data,
location:spearfish57, mapset:glynn in the start-up screen.]

If that doesn’t work, you can try bypassing Init.sh altogether, by
creating a ~/.grassrc6 file and setting up the “session” manually.

This is what I use in my ~/.bashrc to make GRASS commands available
everywhere:

export GISBASE=/opt/grass-6.3.cvs
export GRASS_GNUPLOT=‘gnuplot -persist’
export GRASS_WIDTH=640
export GRASS_HEIGHT=480
export GRASS_HTML_BROWSER=firefox
export GRASS_PAGER=cat
export GRASS_PERL=perl
export GRASS_TCLSH=tclsh
export GRASS_WISH=wish

export PATH=“$GISBASE/bin:$GISBASE/scripts:$PATH”
export LD_LIBRARY_PATH=“$GISBASE/lib”
export GRASS_LD_LIBRARY_PATH=“$LD_LIBRARY_PATH”

export GIS_LOCK=$$
export GRASS_VERSION=“6.1.cvs”

tmp=/tmp/grass6-“whoami”-$GIS_LOCK
export GISRC=“$tmp/gisrc”
mkdir “$tmp”
cp ~/.grassrc6 “$GISRC”


Glynn Clements <glynn@gclements.plus.com>

Ramu Narayanan wrote:

I opened grass62 in text mode using the Spearfish60, typed in g.gisenv and
noticed that LOCATION_NAME was set to Spearfish60 but not LOCATION.

That's correct.

The naming is a historical artifact; there used to be an environment
variable named LOCATION which contained the full path to the mapset
directory.

I then
added a LOCATION variable (not sure if needed) and then entered gis.m which
then opened up the GRASS6.2 manager, map display and output windows. I can
now enter the GUI and the text based modes without seeing the same error
message that I saw before. The problem I currently face is that when I
enter the command into the GRASS command prompt:

d.mon x0

The following message appears:

GRASS 6.2.1 (spearfish60):~ > d.mon x0
using default visual which is TrueColor
ncolors: 16777216
Graphics driver [x0] started

This indicates that the driver has completed initialisation and is
ready to accept connections. But:

Socket is already in use or not accepting connections.

This suggests that it doesn't get beyond that point. Does the window
ever appear? Does XDRIVER.exe appear in the Processes tab of the
Windows Task Manager (Ctrl-Alt-Delete)?

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

Ramu Narayanan wrote:

d.mon x0

The following message appears:

GRASS 6.2.1 (spearfish60):~ > d.mon x0
using default visual which is TrueColor
ncolors: 16777216
Graphics driver [x0] started
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
Problem selecting x0. Will try once more
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
GRASS 6.2.1 (spearfish60):~ > d.rast soils
No graphics monitor has been selected for output.
Please run "d.mon" to select a graphics monitor.

I get similar messages regardless of whether I do this in the GRASS
command prompt or the Grass Manager window.
The list and info commands appear to be working.

does the same happen after quiting Cygwin and restarting?

what about,
d.mon start=x1
d.mon select=x1

(up to x6, "d.mon x0" is a shortcut to the above two commands)

Hamish

Hi,

‘d.mon start=x1’ and ‘d.mon select=x1’ both yeild the same result as ‘d.mon x0’

The monitor window is indeed opening up but I can’t properly select or use it. If I attempt to do so using the select command, I am told that the ‘socket is already in use or not accepting connections.’ The xDriver.exe is shown as a process in the Window process list. Restarting cygwin does not solve the problem.

Another point to note: When I type exit in the terminal window, I am told that the monitors are being closed. This however does not happen as I need to kill the monitor process (using ps) to actually close the monitor. The monitor windows therefore appears to hang. I am currently opening the grass in gui mode. I also note, however, that exiting in the terminal does not close the output, map display or GRASS manager windows. I get the same result (monitors hanging) if I run d.mon from the gui or from the terminal.

Ramu

On 2/19/07, Hamish <hamish_nospam@yahoo.com> wrote:

Ramu Narayanan wrote:

d.mon x0

The following message appears:

GRASS 6.2.1 (spearfish60):~ > d.mon x0
using default visual which is TrueColor
ncolors: 16777216
Graphics driver [x0] started
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
Problem selecting x0. Will try once more
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
GRASS 6.2.1 (spearfish60):~ > d.rast soils
No graphics monitor has been selected for output.
Please run “d.mon” to select a graphics monitor.

I get similar messages regardless of whether I do this in the GRASS
command prompt or the Grass Manager window.
The list and info commands appear to be working.

does the same happen after quiting Cygwin and restarting?

what about,
d.mon start=x1
d.mon select=x1

(up to x6, “d.mon x0” is a shortcut to the above two commands)

Hamish

Ramu Narayanan wrote:

'd.mon start=x1' and 'd.mon select=x1' both yeild the same result as 'd.monx0'

The monitor window is indeed opening up but I can't properly select or use
it. If I attempt to do so using the select command, I am told that the
'socket is already in use or not accepting connections.' The xDriver.exe is
shown as a process in the Window process list. Restarting cygwin does not
solve the problem.

IOW, the driver seems to be working, but simply not accepting
connections.

Do you have any firewall software which might get in the way? Cygwin
emulates Unix-domain sockets using TCP/IP sockets, so if there's
anything blocking "inbound" network connections, that will cause
problems.

[I have ZoneAlarm on my Windows machine, and every d.* program brings
up a dialog asking me if I want to allow the connection. Starting
XDRIVER or the PNG driver brings up a dialog asking if I want to allow
it to operate as a server.]

Another point to note: When I type exit in the terminal window, I am told
that the monitors are being closed. This however does not happen

That's to be expected in light of the above; if mon.stop can't connect
to the socket, it can't tell the monitor to terminate.

as I need
to kill the monitor process (using ps) to actually close the monitor.

Does clicking the close button on the Window work? If not, that
suggests that something else may be involved (or not; it's possible
that XDRIVER is blocking in the middle of trying to accept a
connection).

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

Typing in d.mon -L indicates that the x0 monitor is not running after I type d.mon x0

This is verified by trying d.mon stop=x0 which indicated that x0 was not running.

The only indication i see that it was running apart from the open window was by trying d.mon select=x0 which indicates that ‘socket is already in use or is not accepting connections’. I cannot close the monitor by hitting the close button.

I tried this before and after removing my firewall that I have installed but without any changes in the resulting messages.

I found this link online which appears to indicate that there may be a problem with xDriver when working with Gentoo but I’m not sure if it applies to my situation:
http://blog.gmane.org/gmane.comp.gis.grass.user/month=20031101

Is there something else that I might be able to try?

Thanks,
Ramu

On 2/19/07, Glynn Clements <glynn@gclements.plus.com> wrote:

Ramu Narayanan wrote:

‘d.mon start=x1’ and ‘d.mon select=x1’ both yeild the same result as ‘d.monx0’

The monitor window is indeed opening up but I can’t properly select or use
it. If I attempt to do so using the select command, I am told that the
‘socket is already in use or not accepting connections.’ The xDriver.exe is
shown as a process in the Window process list. Restarting cygwin does not
solve the problem.

IOW, the driver seems to be working, but simply not accepting
connections.

Do you have any firewall software which might get in the way? Cygwin
emulates Unix-domain sockets using TCP/IP sockets, so if there’s
anything blocking “inbound” network connections, that will cause
problems.

[I have ZoneAlarm on my Windows machine, and every d.* program brings
up a dialog asking me if I want to allow the connection. Starting
XDRIVER or the PNG driver brings up a dialog asking if I want to allow
it to operate as a server.]

Another point to note: When I type exit in the terminal window, I am told
that the monitors are being closed. This however does not happen

That’s to be expected in light of the above; if mon.stop can’t connect
to the socket, it can’t tell the monitor to terminate.

as I need
to kill the monitor process (using ps) to actually close the monitor.

Does clicking the close button on the Window work? If not, that
suggests that something else may be involved (or not; it’s possible
that XDRIVER is blocking in the middle of trying to accept a
connection).


Glynn Clements <glynn@gclements.plus.com>

Ramu Narayanan wrote:

Is there something else that I might be able to try?

do these work:

xeyes &
xlogo &
xclock &
?

Anyone know of any non-grass default X software what uses sockets which
Ramu could test?

Hamish

Ramu Narayanan wrote:

I also note, however, that exiting in the terminal does not
close the output, map display or GRASS manager windows.

this is normal (but annoying), the GUI is started as a different process
before the terminal prompt, so you have to quit both independently.

(see previous thread on the GUI not inheriting .grass.bashrc settings)

Hamish

Ramu Narayanan wrote:

Typing in d.mon -L indicates that the x0 monitor is not running after I type
d.mon x0

This is verified by trying d.mon stop=x0 which indicated that x0 was not
running.

Both of these are reporting the fact that they cannot connect to the
socket.

The only indication i see that it was running apart from the open window was
by trying d.mon select=x0 which indicates that 'socket is already in use or
is not accepting connections'.

The window (and the presence of XDRIVER.exe in Windows' process list)
implies that it is actually running.

I cannot close the monitor by hitting the close button.

That implies that the process has hung and isn't processing X events.

I tried this before and after removing my firewall that I have installed but
without any changes in the resulting messages.

I found this link online which appears to indicate that there may be a
problem with xDriver when working with Gentoo but I'm not sure if it applies
to my situation:
http://blog.gmane.org/gmane.comp.gis.grass.user/month=20031101

I couldn't find the post in question, but I use Gentoo, and haven't
had any problems. Also, 2003 is a long time ago.

Is there something else that I might be able to try?

Nothing springs to mind.

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

Hi,

I have been able to use the Map Display Monitor UI as oppossed to typing in d.mon for displaying raster maps. I have not encountered much difficulty with the UI when working with raster data. Is there a text command that can be used to select the UI Map Display Monitor?

When I use the UI to display a regular raster map, I see the following in the Output window:
d.frame -e
d.rast map= -o
g.pnmcomp in=####.#.ppm mask=####.#.pgm opacity=1.00 background=255:255:255 width=640 height=482 output= 3648.1.ppm

The raster map loads up without problem.

however, when I type d.frame -e in the terminal, I get the same response that no graphics monitor has been selected.

Thanks,
Ramu

On 2/20/07, Glynn Clements <glynn@gclements.plus.com> wrote:

Ramu Narayanan wrote:

Typing in d.mon -L indicates that the x0 monitor is not running after I type
d.mon x0

This is verified by trying d.mon stop=x0 which indicated that x0 was not
running.

Both of these are reporting the fact that they cannot connect to the
socket.

The only indication i see that it was running apart from the open window was
by trying d.mon select=x0 which indicates that ‘socket is already in use or
is not accepting connections’.

The window (and the presence of XDRIVER.exe in Windows’ process list)
implies that it is actually running.

I cannot close the monitor by hitting the close button.

That implies that the process has hung and isn’t processing X events.

I tried this before and after removing my firewall that I have installed but
without any changes in the resulting messages.

I found this link online which appears to indicate that there may be a
problem with xDriver when working with Gentoo but I’m not sure if it applies
to my situation:
http://blog.gmane.org/gmane.comp.gis.grass.user/month=20031101

I couldn’t find the post in question, but I use Gentoo, and haven’t
had any problems. Also, 2003 is a long time ago.

Is there something else that I might be able to try?

Nothing springs to mind.


Glynn Clements <glynn@gclements.plus.com>

Ramu Narayanan wrote:

I have been able to use the Map Display Monitor UI as oppossed to typing in
d.mon for displaying raster maps. I have not encountered much difficulty
with the UI when working with raster data. Is there a text command that can
be used to select the UI Map Display Monitor?

When I use the UI to display a regular raster map, I see the following in
the Output window:
d.frame -e
d.rast map=<mapname> -o
g.pnmcomp in=####.#.ppm mask=####.#.pgm opacity=1.00 background=255:255:255
width=640 height=482 output=3648.1.ppm

The raster map loads up without problem.

however, when I type d.frame -e in the terminal, I get the same response
that no graphics monitor has been selected.

gis.m doesn't use monitors; it uses the d.* commands to generate
PPM/PGM image files which it then loads and displays in a Tk canvas
widget.

gis.m cannot be controlled from the command line.

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