[GRASS-user] grass.bat script for Cygwin GRASS 6.2.2-1

Luigi Ponti lponti at infinito.it
Mon Sep 3 14:44:24 EDT 2007


Hamish wrote:
> Luigi Ponti wrote:
>   
>>>> Installation instructions at 
>>>> <http://grass.itc.it/grass62/binary/mswindows/>
>>>>         
> ..
>   
>>>> Starting GRASS ...
>>>> Application initialization failed: this isn't a Tk
>>>> applicationcouldn't connect to display "localhost:0"
>>>> Error in startup script: dynamic loading is not currently available
>>>> on this system
>>>>     while executing
>>>> "load /usr/local/lib/tk8.4/../libtk8.4.a Tk"
>>>>         
>>> ..
>>>       
> Hamish:
>   
>>> Did you modify the bash line to run startx, launching X at startup?
>>>   bash --login -i -c startx
>>>       
>> Yes, I did. Here is my cygwin_grass.bat file:
>>     
> ..
>   
>> the next thing I see is the GRASS startup message
>>
>>     Cleaning up temporary files.....
>>     Starting GRASS ...
>>
>> And no X runs. GRASS starts in text mode but then it tries to load a
>> GUI and off course this fails.
>>     
>
>
> No idea as to what is going wrong.
>
> The plan is that cygwin starts X11 on startup (-c startx) in the cygwin
> dos-box; then X11 opens a xterm when it starts; and that xterm launches
> grass. The '-n "$DISPLAY"' part should protect against it trying to start
> grass from the cygwin dos-box outside of X11. What does:
>   echo $DISPLAY
> say from the cygwin dos-box prompt (not the xterm).
>
> ?
> Hamish
It says

    127.0.0.1:0.0

Nice cue: I had a $DISPLAY set via the winXP control panel that was 
apparently interfering with the

    if [ -n "$DISPLAY" ] && [ -n "$GRASS_AUTOSTART" ] ; then

switch at the bottom of .bashrc (this is probably why GRASS would start 
before the XTerm was running, as you said. Now I understand the 
rationale behind it).

As an aside, if I run a cygwin_grass_modified.bat script that is 
basically grass61.bat (and all related environmental variables that are 
set therein) except that I deleted the

    run xterm ...

line and added

    set GRASS_AUTOSTART=1
    bash --login -i -c startx

what happens is that GRASS runs inside dos-box (or at least this what 
the shell looks like -- the title bar says 
"C:\WINDOWS\system32\cmd.exe") but since there is an X Server running, 
the GUI loads OK and faster than with the regular cygwin_grass.bat file. 
Apparently, the lower loading time is due to no XTerm starting up in the 
latter case -- there is only one shell open. Don't know if this can be 
of any use.

Unrelated thing: in the process I also found out that in order for the 
g.manual script to display cygwin/GRASS HTML help files, the cygwin_root 
environmental variable needs to be set up in cygwin_grass.bat

    SET CYGWIN_ROOT=c:\cygwin

otherwise it is empty (it used to be set up by grass61.bat, but not by 
cygwin_grass.bat) when g.manual calls it. (Again, from a previous post, 
there is a lot of missing HTML help files in the version I downloaded -- 
6.2.2-1: is it just a download error?)

Thanks and regards,

Luigi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20070903/e8cb8a64/attachment.html


More information about the grass-user mailing list