WinGRASS 6 Current Status: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
Line 124: Line 124:
==== Dependencies ====
==== Dependencies ====


* compile with libtiff support {{done}}
* <strike>compile with libtiff support</strike> done since 6.3.0RC5 release
* compile with nls support (needs gettext)
* compile with nls support (needs gettext)
* compile with wx for wx gui v.digit replacement
* compile with wx for wx gui v.digit replacement

Revision as of 07:58, 13 May 2008

See also http://trac.osgeo.org/grass/wiki/BuildingOnWindows

This page describes the current status of winGRASS development:

Current status - Summary

The native windows port of GRASS is slowly coming to a stage where it can be considered beta status. All main functions seem to work, but much more testing is needed. The port is of the current cvs branch GRASS 6.3. There are no ports of earlier versions.

The general idea is to reach a point where GRASS runs in Windows without any kind of unix emulation. Currently, this is possible, but limits the use to compiled modules as scripts are all of unix-shell type and cannot run within a Windows cmd.exe environment without a series of unix tools such as a shell, awk, sed, etc. So in order to run such scripts a collection of unix-like tools needs to be installed, such as Msys or Gnuwin32+Shell.

Another major feature not available in the windows version are the old-style interactive X monitors (i.e. the x0, PNG, PS, Cairo, etc, monitors opened with 'd.mon x0'). Only direct rendering works currently. Display is thus "limited" to the Tcl/Tk and wxPython GUIs (the latter might still need some cleanup of unix-specific code). Modules like i.points and d.zoom will not work (see #Known_Issues).

Installing binary snapshots

Regular binary snapshots for windows are available here. To install them, just download and unzip. In order to be able to use the graphical user interface, you also have to download and install ActiveState Tcl.

You can then launch the GRASS GUI by clicking on the grass63.bat which is in c:\grass\bin\ (or wherever you unzipped the package). This should launch the GUI which gives you access to all GRASS modules.

If you like the command line, you can launch Windows' cmd.exe via Start->Run->cmd.exe. Then type 'c:\grass\bin\grass63.bat -text' to launch grass without the GUI. If you want to access the GUI at a later stage, just type 'gis.m'.

If you want to have access to shell scripts, you also have to install Msys and then adapt the grass63.bat script according to the examples in the file.

Compiling by yourself

(based on work from Paul Kelly - his message)

... or see new GRASS Windows Native Binary Building Guide

Requirements

  • To compile winGRASS natively, you need the following additional libraries: libpng, PROJ.4, GDAL, Zlib, XDR. They are available in a gzipped tar file (to get started quickly): http://www.stjohnspoint.co.uk/grass/ (get wingrass-extralibs.tar.gz).
  • Additionally, you need Msys & MingW (current version)
  • bison
  • flex

Decompressing bison and flex in the root msys directory should position the files in the correct directories.

Optionally:

  • Freetype
  • FFTW
  • PDCurses

TODO: is PDCurses really optionally?

Configuration and compilation

The prefix where you untar that file you will need to supply to the GRASS configure as:

     --with-includes=prefix --with-libs=prefix

Before compilation, you need to set your path in msys in order to add the path to the lib/ and bin/ directories of Paul's tarball before compiling. You might also need to edit the first few lines of the gdal-config script in the bin/ directory, to reflect the path where it is actually installed.

You also have to erase $(MANDIR) $(MANPAGES) from line 13 of man/Makefile, i.e. 'default: $(MANDIR) $(MANPAGES)' -> 'default:'.

If you get an error such as 'cannot open file `/msys/share/bison/m4sugar/m4sugar.m4': No such file or directory', one solution is to move around the msys bison installation a bit, so that m4sugar.m4 is available in the indicated path.

A working configure line is:

     ./configure --prefix=c:/grass --bindir=c:/grass/bin \
     --with-includes=/c/grass/forgrass/include \
     --with-libs=/c/grass/forgrass/lib --with-cxx --without-jpeg --without-tiff \
     --without-postgres --with-opengl=windows --without-fftw --without-x \
     --enable-shared=yes --with-tcltk-includes=/c/tcl/include \
     --with-tcltk-libs=/c/tcl/bin

The configure line used for the current binary snapshots can be seen here.

Compile with make.

After compiling you should copy libxdr.dll, libproj.dll, libpng.dll, libgdal-1.dll and libz.dll.1.2.3 into the GRASS lib directory and all the GDAL and PROJ .exe files in the bin directory into the GRASS bin directory, and then you have a more or less self-contained GRASS distribution.

For the GUI, including for displaying anything, you need to install Activestate Tcl/Tk 8.4.13 (in c:\tcl).

Nullsoft installer

See http://trac.osgeo.org/grass/browser/grass/branches/develbranch_6/win32

Known Issues

See also GRASS Mailing list archives and the compilation error log here.

Won't fix (at least not immediately)

Issues listed here are rather impossible to fix due to the different nature of native Windows. Or, lend us a hand and let's try harder!

  • No monitors

This means that you cannot launch any monitor launched with d.mon (x0, PNG, PS, etc). The only way you can render directly to a file is setting GRASS_RENDER_IMMEDIATE=TRUE on the command line. But you cannot directly display to screen from the command line. This will be solved in GRASS 7 with a new rendering system and possibly via the new wxgrass GUI. So no work will probably be put into this until then.

The absence of monitors also makes impossible the use of interactive modules based on these monitors, such as:

    • i.class
    • i.ortho.photo/photo.2image
    • i.ortho.photo/photo.2target
    • i.points
    • i.vpoints

i.points and i.vpoints have already been replaced by the gis.m georectifier module (File -> Georectify). In replacement of i.class you can digitize training areas with v.digit. This will not however, give you all the information i.class provides, such as the histogram of the region, the statistics and the display of matches. These modules will have to be rewritten to clearly separate display and backend parts, so that the backend can be run on the command line or from any GUI frontend. Volunteers needed.

Another module affected is d.vect.thematic which uses monitors. This will hopefully be replaced by a C-version in a not too far future.

  • Scripts need *nix-like shell

All current GRASS scripts are written in shell language. This means they need a shell, and several related tools (awk, sed, etc), to function. This means that whoever wants to be able to run these scripts has to install a shell with these tools. Currently recommended is Msys as this is a simple install of a package containing everything which is needed.

It is planned that these scripts be rewritten in a more portable language such as Python, thus totally eliminating the need for any shell. But this will probably not happen until the python wxgrass GUI is officially declared stable, thus making Python a mandatory requirement anyhow. Volunteers needed.

Platform specific issues

XP/2000

nothing known

Vista

ToDo

Dependencies

  • compile with libtiff support done since 6.3.0RC5 release
  • compile with nls support (needs gettext)
  • compile with wx for wx gui v.digit replacement

Internal Libraries

  • parser: find out why launching a module from the command line without parameters does not call module GUI

Vector modules

  • v.in.ascii crashes on files with irregular line length (see this thread)

Raster modules

  • r.terraflow does not compile fix backported 27/3/2008
This seems to be due to the use of the function getrusage() which is not supported under MinGW. Check this octave patch email thread.

TclTk issues

Miscellaneous

  • metacharacter escape in "sh -c '$cmd'"
  • modules not working: r.proj (v.proj too?), r.surf.rst, v.neighbors, v.kernel, r.cost
  • Cannot open Help pages.
  • Have to type "exit" in the console to save ~/.grassrc file. Then, close gis.m to finish the session.
  • A previous installation of grass under cygwin is likely to cause problems with WinGrass. Follow the directions to remove cygwin at http://cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-all

The following items cannot be fixed in the near future:

    • can't read "_data(.gronsole.gronsole,4,donecmd)": no such element in array error
      • Could you be more precise about this error ? When does it occur ?

Dealing with shell scripts or .bat files

Bourne shell scripts require MSys (or some other Bourne shell), but you don't need to start GRASS from MSys.

The main issue with scripts is that Windows doesn't understand the "#!" notation used to specify the interpreter.

All of the supplied scripts in $GISBASE/scripts have a corresponding .bat file in $GISBASE/bin which invokes script via %GRASS_SH%. This allows you to run those scripts from the Windows command prompt.

If you write scripts of your own, you need to either add a corresponding .bat file, or give the script a .sh extension and associate that with the shell, e.g. via the ftype and assoc commands. You can use the PATHEXT variable to eliminate the need to type the extension.

Other libraries

GDAL

  • lib/gis/OBJ.*/fmode.o is needed for any GRASS related modules.
  • modified ltmain.sh to install binary files from wrapper scripts.
  • see also GDAL Building With MinGW

Related efforts