Installing GRASS 5.0 on Win32 with Cygwin

(arch i686-pc-cygwin)

$Date: 2004/06/15 16:13:14 $

Prerequisites:

This text was written by Andreas Lange. Most of the text was taken out of the description from John Huddleston. Many thanks to Malcolm Blue for proof-reading. All errors and mistakes are of course mine.

1. Get the Cygwin tools

The Cygwin tools are required to run UNIX compliant applications on Windows.
Get the latest version from http://www.cygwin.com.

Download the file setup.exe to a local disk, run it and follow the instructions.

When installing the Cygwin tools, please select all packages, or at least:

Please select for the install directory a local drive on your computer with enough space for the entire cygwin distribution (150 MB without X11R6.4), the X Window System (additional 65 MB) and the GRASS binaries (programs, about 150 MB). If you want to do real work, you need at least another 500 MB for GRASS data storage.

Additionally you will need the precompiled X Window (XFree86, X11R6.4) System. See next paragraph.

NOTE: When selecting the root install directory, make sure that the "Default Text File Type" is set to Unix.

2. Install the X11 libraries and the X Server

NOTE: not needed for the winGRASS with generic display driver

If you want to use the GRASS monitors (graphical output), you need the X Server and the X11 libraries. Get them by selecting the XFree86 options in the Cygwin setup program checklist.
Download at least the following XFree packages: base, bin, lib, etc, doc, fnts, f100, prog and xserv. Please refer to the XFree install guide for further details.

Alternative to XFree/Cygwin:
There are a lot of different free and commercial servers. If you don't want to use the XFree Server, you can download the StarNet X Server from http://www.starnet.com/en/products/. This is a demo version that will time out after 2 hours. You can restart it again after it times out. Currently only the XFree86 Server and the StarNet X Server have been tested with the GRASS distribution. The Microimages X Server will not work reliable with the X11R6.4 libraries GRASS is linked with.

3. Get the latest binary distribution for GRASS

You can download either

4. Only, when using winGRASS with X11 display: Get the tcl/tk 8.x libraries

NOTE: you need to ensure that the "official" Cygwin Tcl/Tk package *is not* installed. (see Cygwin setup for this issue).

The only GRASS features which require an X Server are tcltkgrass and NVIZ. Hopefully, it will be possible to use tcltkgrass on Cygwin without X in the near future, although NVIZ will require X for the foreseeable future.

Download the precompiled X tcl/tk 8.x libraries and executables from
http://grass.itc.it/grass50/binary/windows_cygnus/wingrass_xserver/.

Go to the root directory (cd /) and unpack this file:

cd /
tar xzf /where/ever/you/saved/this/xtcltk-*.tar.gz

5. And now FINALLY to the GRASS installation

Log into the cygwin shell. Please check the required disk space and permissions first. The default installation path is /usr/local/grass5. Next:
  cd /wherever/you/saved/package
  ./grass5install.sh grass5.0.2_i686-pc-cygwin_bin.tar.gz
This will install the GRASS package under /usr/local/grass5 and store the start files under /usr/local/bin. Please note that the paths are all relative to the cygwin root (usually C:\CYGWIN or C:\PROGRAM FILES\CYGWIN or similar). Do not install the file from the root directory of cygwin (C:\CYGWIN from Windows or / from within cygwin), due to some bug of cygwin this will result in an error.

Next you should install some data to test GRASS. You can get the global_grass5data.tar.gz sample data set from http://grass.itc.it/data.html. Unpack the data with:

tar xzf global_grass5data.tar.gz
in an empty directory, e. g. /home/andreas/data. Again remember to do this from within the cygwin shell.

6. Starting GRASS 5

You can log into a GRASS session on the commandline by issuing 'grass5' in the cygwin shell. Follow the on-screen description and enter in the directories for your sample data.

Depending on the winGRASS version you use (generic winGRASS or winGRASS with X Server support), you continue like this:

6.1 winGRASS with generic display driver

To open a GRASS monitor, enter:
d.mon x0
d.mon sel=x0
Then continue as usual. All GRASS modules except 'tcltkgrass' and 'nviz' are supported.

6.2 winGRASS with X Server support under XFree86

This version supports all GRASS modules including 'tcltkgrass' and 'nviz'. There are two options to use the XFree86 Server: With on desktop (stable) or in multiwindow mode (not yet stable).

6.2.1 XFree86 desktop mode

In cygwin, launch the XFree86 server at Cygwin Bash prompt with:

startxwin.bat
Then start GRASS in a terminal within the X desctop.

6.2.2 XFree86 multiwindow mode

In cygwin, launch the XFree86 server at Cygwin Bash prompt with:

export DISPLAY=127.0.0.1:0
XWin -multiwindow  -clipboard &
Now the X Server is listening and will open X related windows in individual windows. Then start GRASS as usual:
grass5
d.mon x0
d.mon sel=x0

tcltkgrass &
nviz elevation.dem vect=roads &
This runs GRASS similar to a common MS-Windows application.

Please also read the Cygwin/XFree86 User's Guide.

6.3 winGRASS with X Server support and Star Net XWin-32

On the GRASS web site you can find a StartGrass.bat script to put in your home directory. Please edit this file to adapt to your local paths. This sets the PATH and all needed environment variables and spawns an xterm window. From within that window run 'grass5'.

Please report any problems, errors and solutions to the GRASS developers mailing list at http://grass.itc.it/grassdevel.html#list or the winGRASS mailing list at http://grass.itc.it/wingrass.html.

7. References

Read about Unix running under Windows here:
Andreas Lange, updated by Mike Thomas, Markus Neteler. $Date: 2004/06/15 16:13:14 $