WinGRASS 6 Current Status: Difference between revisions
(→Installer: g.extension) |
|||
Line 21: | Line 21: | ||
== Installing binary snapshots == | == Installing binary snapshots == | ||
Regular binary snapshots for windows are available | Regular binary snapshots for windows are available from the main GRASS [http://grass.osgeo.org/download/index.php download page]. | ||
== Compiling by yourself == | == Compiling by yourself == |
Revision as of 20:56, 18 September 2010
See also http://trac.osgeo.org/grass/wiki/BuildingOnWindows
This page describes the current status of winGRASS development:
- Older precompiled winGRASS/Cygwin packages are available for GRASS 6.3,
- Older native winGRASS packages GRASS 6.3,
Current status - Summary
The native windows port of GRASS is slowly coming to a stage where it can be considered mature beta status. All main functions seem to work, but much more testing is needed. The port is of the current SVN release branch for GRASS 6.4.0. The only prior native port of an earlier version is 6.3.0.
The general idea is to reach a point where GRASS runs in MS-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 MS-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 due to their interactive monitor requirements (see #Known_Issues).
Installing binary snapshots
Regular binary snapshots for windows are available from the main GRASS download page.
Compiling by yourself
(based on work from Paul Kelly - his message)
... or see the 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
Below is related to GRASS 6.3.x. See here for GRASS 6.4.x instructions.
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/mswindows
Known Issues
See also
Flagrant
- wxVdigit (vector digitizer) doesn't work. see trac #541.
- Workaround: Use the old Tcl/Tk v.digit module, simply type v.digit at the Cmd> prompt in the Layer Manager GUI.
- wxNviz (3D visualization) doesn't work. see trac #541.
- Workaround: Use the Tcl/Tk nviz module, simply type nviz at the terminal prompt in shell window.
- Spaces in path names
- Installation directory: WinGRASS uses the MSys software to run on MS-Windows. Unfortunately MSys isn't very interested in supporting spaces in path names, so for now GRASS and OSGeo4w software must live in a space-free path name.
- GIS data directory: It is generally safe to have spaces in your GIS data directory path, but there are few spots where it might still get confused and chop the path off at the first space. If you find one please report it to the bug tracker, the sooner we know about it the sooner we can fix it.
- Workaround: if this is causing problems for you the quick solution is to rename the GIS data directory and replace all spaces with underscores (_).
- The r.li suite and d.mon monitors won't work. These use UNIX pipes and won't work on Windows without a lot of work.
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 is directly to a file. 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.
In 7.0, these scripts have been rewritten in Python, thus totally eliminating the need for any shell.
Platform specific issues
XP/2000
nothing known specifically related to MS Windows XP/2000
Vista
ToDo
Installer
change the Uninstall iconfix the language errors in the StartMenu link's descriptionschange the name of the South-Dakota sample database to Spearfish60add a GRASS Command Line link (cmd.exe) into the GRASS StartMenu group- create a GRASS Addons installer or integrate the GRASS Addons in the current installer as downloadable options.
- See g.extension in GRASS 6.5+
Dependencies
GRASS Dependencies
add the Indipendent JPEG support to GRASS *- add the FFMPEG support in GRASS (reports an error in building OGSF library; probably needs to specify -lavutil in gcc command) ***
- add the NLS support in GRASS (needs gettext)
- add the wxWidgets support in GRASS (for the wxPython GUI v.digit replacement)
GDAL Dependencies
- add the ECW support in GDAL */**
- add the JPEG2000 support in GDAL (through Jasper or Kadaku *) **
- add the OGDI support in GDAL *
- add the MrSID support in GDAL */**
GRASS and GDAL Dependencies
- add the Xerces support in both GDAL and GRASS *
- add the ODBC support in both GDAL and GRASS */**
- add the MySQL support in both GDAL and GRASS */**
Miscellaneus Dependencies
- add the OpenSSL support in both PostgreSQL and SQLite *
add the AVCE00 tools (build from source in minGW)add the E00compr tools (build from source in minGW)add the GPSBabel tool (use prebuilt binaries from GPSBabel Web Site)
* needs to build related libraries from source in MinGW
** needs to check the licences first
*** FFMPEG has been already succesfully built on MinGW
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 compilefix 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.
Other modules
- r.li moduels do not compile (they require UNIX sockets, much the same situation as the display monitors)
- Use the older r.le modules instead.
GRASS Addons
- compile the GRASS Addons
TclTk issues
- var=val style argument is not valid for batch files: equal sign is a separator like a space. http://support.microsoft.com/?kbid=71247 http://www.gatago.com/alt/msdos/batch/17358926.html
- Could you give an example of where this is a problem ?
- file command returns bad code (catch is needed): http://sources.redhat.com/ml/insight/2003-q1/msg00079.html
- catch {file copy}
- catch {file delete}
- catch {file rename -force} does not work. Delete old file first: catch {file delete}; catch {file rename}
- exec a batch file doing redirection (>&2, 2>&1)
- no -permissions file attributes
- catch {file attributes -permissions}
Miscellaneous
- metacharacter escape in "sh -c '$cmd'"
- modules not working:
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 ?
- can't read "_data(.gronsole.gronsole,4,donecmd)": no such element in array error
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