Installing GRASS 5.0 on Win32 with Cygwin 1.x

(arch i686-pc-cygwin)

$Date$

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://sources.redhat.com/cygwin/download.html.

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.

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 from http://sources.redhat.com/cygwin/xfree/. Download at least the following packages (you find them on ftp://mirrors.rcn.net/pub/sourceware/cygwin/xfree/xc-4-binaries/4.0.3/): DLLs, fonts, Prog, twm, Xterm, Xwin. Please refer to the XFree install guide for further details.

There are a lot of different free and commercial servers. If you don't want to use the XFree Server (which is beta-quality and runs only in full screen mode), 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

Get the file
GRASS5.0beta12_CYGWIN_NT-4.0_bin.tar.gz or a newer package
from
http://grass.itc.it/grass5/binary/windows_cygnus/

And download the install script grass5install.sh from the same directory.

3a. Get the tcl/tk 8.x libraries

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

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

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

4. 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*_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.

5. Starting GRASS 5

You can log into a GRASS session on the commandline (no graphics monitors) by issuing 'grass5' in the cygwin shell. Follow the on-screen description and enter in the directories for your sample data. You can use GRASS from within the cygwin shell for scripting/programming, but without graphical output to screen. For running GRASS with graphical output (X Window monitors) and the graphical user interface (tcltkgrass) you have two choices: Either with the XFree86 Server (not well tested) or with the StarNet demo or full product (recommended, tested, faster, simpler setup etc.).

XFree86

For running the graphics monitors start first the X Window Server by double-clicking on the startxwin.bat file in /usr/X11R6/bin. In the xterminal that starts up, re-create your login with bash --login -i and type in /usr/local/bin/grass5 and you get the GRASS login screen. From there you can log into an GRASS session.

If you have problems starting up the X Window Server, please check the path in the startxwin.bat file under /usr/X11R6/bin. In my case the path was wrong, you need to specify an absolute path (e. g. C:\CYGWIN\USR\X11R6\BIN) for the Win32 console. If you have problems starting the tcltkgrass GUI (e. g. libX11.dll not found), check that you have /usr/X11R6/bin in your path.

You can switch back to the Windows screen by pressing ALT-TAB (beware, this does not work on my system), you end the X Server with ALT-F4.

Star Net XWin-32

On the server 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 grass5@grass.itc.it or the winGRASS mailing list at winGRASS@grass.itc.it. See subsrciption information.

6. This build was compiled with Cygwin 1.1.8

Read about Unix running under Windows here:
Andreas Lange, andreas.lange@rhein-main.de, $Date$