Version 322 (modified by martinl, 7 years ago) ( diff )


Compiling GRASS on MS-Windows

Dependencies required for building with MinGW

Compiling your own copy of GRASS is greatly simplified by using the MSYS2 and OSGeo4W directory structure to install most dependencies and downloading the rest from a few other locations. Follow the steps below to set up the build environment for GRASS GIS.

Install the OSGeo4W directory structure

OSGeo4W has several of the required dependencies for compiling GRASS GIS:

  1. Download the OSGeo4W installer - 32bit or 64bit
  1. Run the installer.
  1. Select Advanced Install, and Next.
  1. Set the install directory to C:\OSGeo4W (32bit) or C:\OSGeo4W64 (64bit) (other directories are fine if there are no spaces in the path but make sure to adjust the instructions below). The MSYS maintainers have made it clear that they will not support spaces in path names nor accept patches fixing those issues. With some patches to msys.bat however it is possible to install a built GRASS into C:\Program Files\.
  1. Select:
    • cairo
    • gdal
    • geos
    • fftw
    • fftw-devel (32bit only)
    • freetype-devel
    • freetype-devel-mingw (32bit only)
    • iconv
    • libjpeg
    • liblas-devel
    • libpng
    • libpq
    • libtiff
    • libxdr
    • pdcurses
    • proj
    • regex-devel
    • sqlite3
    • zlib
  1. Optionally select also GDAL plugins for common GIS formats (be careful not to introduce GPL incompatibilities)
    • gdal-ecw
    • gdal-mrsid
  1. Click Next, the selected packages and their required subpackages will be downloaded and installed automatically.

Install the MSYS2 directory structure

MSYS2 has several of the required dependencies for compiling GRASS GIS (like gcc and others):

  1. Download and install MSYS2 - 32bit or 64bit.
  1. Start MSYS2 terminal and install requirements (both 32bit and 64bit):
pacman -S tar libintl make bison diffutils subversion dos2unix
  1. Install MinGW-w64 toolchain:
  • 32bit:
    pacman -S mingw-w64-i686-toolchain mingw-w64-i686-cairo mingw-w64-i686-python2-numpy mingw-w64-i686-sqlite3
  • 64-bit:
    pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python2-numpy mingw-w64-x86_64-sqlite3

Compiling and Installing GRASS GIS

Start MSYS2 terminal - mingw32_shell.bat (32bit) or mingw64_shell.bat (64bit).

  1. Download GRASS source code (see wiki:DownloadSource for details). Example for development version (trunk):
cd /usr/src
svn checkout grass_trunk
  1. Switch to GRASS GIS source code directory (in our case grass_trunk) and run compilation script:
cd grass_trunk

# for release builds on 32bit

# for daily builds on 32bit
PACKAGE_POSTFIX=-daily ./mswindows/osgeo4w/

# for release builds on 64bit
OSGEO4W_POSTFIX=64 ./mswindows/osgeo4w/

# for daily builds on 64bit
PACKAGE_POSTFIX=-daily OSGEO4W_POSTFIX=64 ./mswindows/osgeo4w/
  1. Check error.log for any error messages and mswindows/osgeo4w/package.log if you're having problems.

GRASS GIS should now be installed in c:\osgeo4w\apps\grass\grass-7.1.svn.


To start GRASS use the icon on the desktop or if you want to be able to use the command line from within GRASS.

Type in cmd console (assuming that we compiled GRASS 7.1):


Creating a WinGRASS Installer

The instructions for creating a WinGRASS native installer (self-contained package installer) using the scripts contained in the mswindows directory. In order to avoid mistakes or misunderstandings, we highly recommend to follow each step and command exactly as they are written in this document. See also scripts used for daily builds.

Install MSYS2/OSGeo4W Tree and Compile GRASS

First of all download the MSYS2, OSGeo4W installers, install the required dependencies, and build GRASS GIS from source (see notes above). Do not move on to step two until you have successfully tested your new version of GRASS.

Create a GRASS self-contained Package

  1. Copy all the content of the mswindows directory to a temporary directory, for example c:\temp.
  1. Launch the file c:\temp\GRASS-Packager.bat.
  1. When finished, you should have a GRASS self-contained release package in c:\temp\GRASS-<Version>-Package, e.g. c:\temp\GRASS-70-Package.

Install NSIS (2.46)

  1. Download the NSIS installer
  1. Install to c:\DevTools

Install NSIS: Untgz Plugin (1.0.16)

  1. Download the NSIS Untgz Plugin
  1. Unzip to c:\DevTools\Plugins\

Install NSIS: AccessControl Plugin

  1. Download the NSIS AccessControl Plugin
  1. Unzip to c:\DevTools\

Create the WinGRASS Installer

  1. Launch c:\temp\GRASS-Installer.nsi.
  1. When finished, you should have the WinGRASS installer in c:\temp.



wxGUI Cartographic Composer requires Ghostscript. Install gs package from OSGeo4W.


Required by GRASS Addons

  1. Download

TODO: Finish this part.


(dependency for

Download and copy to C:\OSGeo4W\bin.


  • Establish 64bit builds


external notes for building windows 64bit-binaries:

tool chains for building windows 64bit-binaries:

packages to include in OSGeo4W-64bit for a build/compile environment:

missing packages in OSGeo4W-64bit

  • libintl
  • tcltk
  • freetype-mingw
  • libcairo


Startup errors after installation

See here:

See also

  • Besides Cygwin and MinGW there is another along similar lines called "som" or "gow" or something?


  • Some anti-virus software seem to think that the r.out.png.exe module (etc.) is a sneaky attempt to fool you into thinking it's an image instead of what it really is: a program which exports a PNG file. g.version is also reported to set them off. You'll have to bypass these over-zealous warnings as appropriate.
  • Large File support ("LFS", >2GiB) is currently not supported for 32bit versions of Windows. A 64bit build of GRASS (or more accurately a build of the support libraries needed to build 64bit GRASS) is still in development.

Open Tickets

winGRASS 6:

WinGRASS fails to create .gislock opening a mapset
hardcoded /dev/null
stanalone installer: include the release notes
WinGRASS GIS.m: broken newlines in output window
i.spectral in GRASS6.4
#820 doesn't work in WinGRASS installer distribution
wx attribute table manger fails on wingrass with >188 dbf tables
v.out.ogr to MySQL does not work propely
db.out.ogr together with g.parser doesn't play nicely with non-lati characters containing DSN
winGRASS: r.statistics complains if path to grassdb has spaces
After abort command from wxGUI vector output of devation (devi) couldn´t be removed, or overwrited
r.tileset: projection string munching on wingrass
.inputrc improving msys WinGRASS command line
Python Menu: Japanese (double byte character) in menu may cause parser error.
ERROR: G_getenv(): Variable LOCATION_NAME not set
WinGrass using
WinGrass: v.krige not working due to missing rpy2 pkg for MS Windows
wxGUI wingrass scripts need whitespace in path
wingrass - different wingrass-modes are differently translated
wingrass - g.message in a python-script - no output
Texts in command dialogs are garbled
wingrass: background dosbox from regular wxgui startup
wingrass: Command Line can't find grass.python libs
wingrass: please add tac and seq to extrabin
wingrass: GRASS6\wx file has \r\r\n newline
wingrass wx carto composer: Image causes traceback
wingrass installer: install_msruntime dir not deleted despite rule for it
m.proj on wingrass: protect g.proj's path name to the grid file
wxGUI file type option. File path corrupt if contained backslash
Command console is crashing if any system user name contains accented character
Commandline switch "/S" is not working anymore
wxGUI.PsMap error loading two types north arrow and grass gis logo in the cartographic composer layout
MySQL driver failed to install
Cannot export GRASS raster map using r.out.png (crashes on windows)
r.tileset fails on windows due to permissions error
sql where statement encoding issue on windows
Add PDAL to standalone GRASS GIS install
update WinGRASS standalone installer to use GRASS_VERSION_GIT variable
winGRASS 7.8.1dev: 'charmap' codec can't decode byte 0x9d - issue in vector attribute data handling (e.g. opening attribute table,, etc)

winGRASS 7: No results

Closed Tickets

GRASS OGR Module failing
WinGRASS: Starting up gis.m & hangs (probably on g.region)
d.rast.edit.tcl: doesn't start from wxPython without aspect map
r.los fails with high values for max_dis parameter
r.patch fails on Vista
WinGRASS Tcl/Tk GUI - Text formatting error in Output window
WinGRASS Native: Ground Control Points Usability
WinGRASS: incompatability issue
r.regressionline incompatability issue in WinGRASS
v.type,, GUI and WinGRASS
WinGRASS MSYS Console doesn't run correctly
WinGRASS: Accsess Denied in .grassrc6
Georectify tool adds two EN coord pairs to one point in POINTS file
raster data needs binary mode on windows
MSYS Console fails to start when installed in Windows at a path with spaces.
fresh windows startup not very friendly
win grass6.4.0RC3 - started with --help returns no help
g.gui doesn't work in ms-windows
wxDigit on windows fails (osgeo4w 6.4.svn)
#555 on wingrass: g.proj error
wingrass stand-alone installer: MSys console doesn't work
WinGRASS not deleting temp ppm files from map display
startup problem with standalone winGRASS install and custom python
stanalone installer: permission denied on mdoule execution
WinGRASS: $GISBASE/etc/gui/scripts/ require something like $(EXE) to run
#581 from wxGUI in wingrass fails to getInterfaceDescription
init.bat should give usage info with --help
WinGRASS: 3D view wxNVIZ does not work
wxGUI: About GRASS GIS window doesn't let you view full lic or devs
WinGRASS GIS.m: cannot select maps from mapset GUI
WinGRASS g.version -c fails
r.sim.water crashes on WinGrass
wingrass native: wxNVIZ exits with lib compat error
wingrass native: vdigit error on new map
WinGRASS: spaces in pathnames
v.out.ogr error on Vista
Problems with paths in the TCL/TK Windows GUI
Wingrass native doesn't work
consider using console instead of cmd.exe
g.manual fails to open a browser
r.horizon crashes
OSGeo4W patch for g3d lib
OSGeo4W patch for DLLs
r.proj fails in wingrass
v.edit returns incorrect results on Windows
#744 for compiling on windows
WinGRASS: GUI window from cmd line
r.patch non-functional in WinGRASS 6.4 svn on Vista
r.watershed fails on wingrass
Update to
WinGRASS: Problem with special characters (wxpython GUI)
v.db.addtable consistently fails in winGrass
MYSYS shortcut starts an infinite number of windows
Location wizard - false path to the epsg-file
standalone-installer: execution failed on g.proj.exe -p
v.digit broken on new WinGrass release
r.proj fails in WinGRASS-6.4.0SVN-r40049-1
WinGrass64-compiling: `libintl_printf' is an unrecognized format function type'
WinGrass-Installer - definition of the destination folder
wxGUI: Location wizard bug when creating LatLong location
v.external not working on WinGrass
winGRASS compilation: dumpbin: command not found
i18n enabled winGRASS: properties dialog not opening
WinGrass: reducing size of the installer
WinGrass: displaying r.external-linked raster data not working
Msys-based commands fail when winGRASS is installed in %ProgramFiles%
shell scripts: %TMP% namespace collision
wingrass uninstaller: left over files
WinGrass: error with "Query vector map (edit mode)"
WinGrass: error
WinGrass: include patched msys.bat in the WinGrass-Installer
WinGrass: include patched msys.bat in the WinGrass-Installer
No Font Definition File, windows xp
(windows) r.external does not work in both osgeo4w and standalone packages
v.digit map creation weirdness on wingrass
GRASS installer can not install unser "program files" (Windows7 only)
no Start Menu entry created in Windows 7
Wingrass7 - compiling errors
wingrass7 - wxgui not starting
Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?
WinGRASS-6.4.0SVN-r40852-1 installs GRASS, but it doesn't run
Provide visual feedback when loading available vector map list
Unable to scroll map selection dropdown lists with mouse scroller
WxGUI histogram tool-bar icons messed up in WinGRASS
WxGUI fails to display vector attribute table if default db connection is missing
WinGRASS shouldn't use Internet Explorer as a default browser
WinGrass-Installer - Enhancement
WxGUI startup screen fails if GISDBASE path contains non-latin characters
Wingrass needs newer tcl version due to bug in file encodings
WxGUI CMD fails if command contains non-latin letters
r.terraflow fails to stat() stream file on Windows
WxGUI should provide visual feedback when adding new db column
WinGrass7 - disable LFS
WinGrass7: starting grass by fails
WinGrass7 - wxgui error
#1018 Bad file descriptor: Files
winGRASS: 'layer manager' window hidden by 'mapdisplay' windows
Display of vector maps fails
v.out.ogr fails on wi7
WinGrass7 + pythonhome/pythonpath
#1038 fails in Windows 7 with "Access is denied"
winGRASS Tcl/Tk: Cannot save image files (PNG/JPG/BMP/etc)
Crash on startup directly after install (wrong copy of python dll picked up)
Build of 7.0.SVN dont work
wxpython GUI error in d.vect
Windows native installer: reinstall
Wingrass7 - versioned libgrass needed for start, unversioned libgrass needed for wxnviz
Access is denied - r.statistics
WinGrass7 + v.krige: rpy2 not installed + nightly Wingrass-build
WinGrass + R's installation path in %PATH%
GRASS 6.4SVN with MSYS fails to start startup screen
WinGrass7 + scripts are not found in the command line
WinGrass64 - windows-commandline not released
r.terraflow limited to 32bit temp files in WinGrass
packaging osgeo4w-gdal18 in WinGrass-installer
v.rast.stats locks up on wingrass
g.proj & g.region fail after cygwin install
WinGrass7 - wxgui not starting
WinGrass7 - NVIZ not working
Command line hangs where dialog boxes work
wingrass - ctypes - compiling error
Global LFS for wingrass
WinGrass - 3D view mode crashes
#1139 has a problem (only via OSGEO4W package)
Formula in Raster Map Calc is not working with 'IF' condition, and NOT to have space. Only from GUI after commna.
GLWindow.OnPaint() broken on Windows
WinGrass64RC7 - db.execute
WinGrass - load R-installation-path dynamically into PATH
WinGrass-Installer should include a working gdal-version which is built against
Removing vector map in Windows fails with "Unable to delete vector map"
WinGrass: compiling against osgeo4w's gdal17 fails
wx wms import tool error
newlines in sed scripts not portable for wingrass
wingrass: cs2cs fails from the msys command line
wget misses libssl32.dll (affects
wingrass: include a gpsbabel with XML support
WinGrass: g.extension - problem with path to $GISBASE
daily wingrass binary snapshots are down
r.le.setup fails on WinGRASS due to missing xterm
"d.vect display=attr" imply grass open process but doesn't close them.
#1185 on WinGrass: "Bad file descriptor"
WinGrass7 - v.krige not working
wingrass: 'g.region -l' fails when using a NTv2 grid file
Error on compiling GRASS in Windows using osgeo4w
d.grid fails with -g flag in winGRASS
Error while parsing file paths in WinGRASS with Scripts
wingrass, gdal, proj4
installation incomplete/messed
g.remove fails to remove vector files under GRASS/OSgeo4w
wingrass 64bit branch
db.tables in Windows layer manager does not populate driver field for pg
d.vect -a flag locks up the wxGUI on windows
Error when creating vector(areas) from raster
wingrass7 - i.aster.toar - compiling error
Georectifier: RMS broken
Error on zoom to selected [vector] map
wingrass: Error in Attribute Table Manager
osgeo4w patch update
zipped HGT Import fails on wingrass as "unzip" isn't in the package
r.null after in winGRASS does not work properly
problem about the output of g.parser
clean_temp can not be called before LOCATION_NAME is set
Windows native installers TCL lacks .enc files for non-latin 1 encodings
g.dirseps breaks non-latin file/folder names on Windows
wingrass65 - Vector digitizer not available: Reason: xdr not found
Profile tool incorrectly processes no data values
db.out.ogr fails to start in 6.5
v.digit crashes dbf.exe on Windows when creating attribute table
Provide user-friendly error message when trying to edit vectors in Windows
wingrass: fails to load .csv file
#1303 leaves TMP file after import
wingrass: new wxgui dialog for in windows7 does not show *.shp files
wingrass - dbf.exe-crash
Browse button in WxPython GUIs (for scripts) does not provide a correct file path for WinGRASS
winGrass: hangs when displaying vector attribute labels
wingrass: during install generating font configuration file fails
Missing MSVCR71.dll / MSVCP.dll prevent winGRASS from starting
WinGRASS 6.4.1: SQLite driver errors: `Unable to open database'
WxGUI, menu does not work at all (languages using double-byte characters)
wingrass65 - wxgui compiling error and not starting
Missing MSVCR71.dll on startup
closecell: can't move + quant file error in winGRASS Msys shell
Error during Grass start
wingrass - change commandline to "windows home"
WinGRASS + how to deliver Microsoft Visual C++ Redistributable Package (vcredist)?
grass 6.4.svn nightly build fails on startup
wingrass7 not compiling
error running v.what.vect under Windows/Osgeo4w
GRASS6.4.2SVN WX-Python GUI, menu does not work at all
Cannot save workspace from wxGUI
NVIZ shows only English Menu
winGRASS problems
WXGUI GDAL/OGR import dialogs fail to open in WinGRASS
(Windows/osgeo4w) libtiff.dll is broken
references to g.echo in devbr6
wxGUI Cartographic Composer: division by zero
v.generalize: strange behaviour on win
#1549 lines not working well?
WinGRASS: spaces in pathnames for
osgeo4w and qgis builds: path settings to msys on wingrass find wrong 'sort'
wxGUI Cartographic Composer: preview broken on Windows
python-scripts in wingrass64svn
wingrass: errors while a DB is open results in a zombie dbf.exe
#1586 complains about xerces-c support in GDAL
winGrass 7 error
#1629 - odbc-driver - access-database: not working
wingrass7: i.spectral -error
wingrass: launching wxNviz fails
calling a script within a script failing on Windows XP
WinGRASS does not launch
Exiting GUI leaves minimized CMD window open
wingrass6.4.3svn: changing vector point symbol doesn't work
wingrass: python crashes by quit GUI after using 3D view in map display
wingrass: open attribute table fails
Windows users cannot access manage table controls in attribute manager
Cannot view vector table in wxGUI
Map Display Output Save Issue
wingrass6.x: python addon scripts aren't working
wingrass7: installing addons by wxgui-extensions manager fails
GRASS 6.4.3RC1 on Win 7: grass64.bat fails due to UNIX line endings in Init.bat
d.rast.edit error when attempting to edit a raster
wingrass: db_open_select_cursor fails for DBF driver.
broken db driver communication in winGRASS 7
wingrass7: - ERROR: Unable to load GDAL python bindings
wingrass: launch grass terminal fails
wingrass installer problems: missing DLLs
wingrass6.4.3svn: vector digitizing - a sort of incomplete
v.hull bit broken output on wingrass
wingrass - nsis - script in release mode: !define SVN_REVISION "@GRASS_VERSION_SVN@" not set
wxGUI fails with Japanese locale --> mixed Python installs on Windows
wingrass: python missing from extrabin
wingrass: demolocation includes .svn/ cruft
wingrass: %APPDATA%/GRASS6/grassrc6 and rc files
wingrass: replace rxvt with conhost.exe
Cartographic Composer: Raster map is not shown in preview
wingrass wx carto composer: adding north arrow causes Error and traceback
filesystem cruft from wingrass installer
wingrass: permission denied to open
The ordinal 32 could not be located in the dynamic link library proj.dll
WxGUI, menu does not work at all (languages using double-byte characters)
Missing file association dialog pops up all the time
wingrass7: v.db.addcolumn fails in attribute table manager
Startup Error: G_getenv(): Variable LOCATION_NAME not set
PyGRASS grid calls g.region at import time
wingrass7: no manifest files
Missing libintl-8.dll from all Windows binaries
winGRASS6.4.svn - addon python script status?
winGRASS6.4.svn - GUI problems with postgres as database backend
WinGRASS doesn't allow to close console window
wingrass71: rendering problems with raster layers automatically added by finished modules
wingrass: failure when loading addons
compiling grass in windows 8
GRASS 7 on windows starts with minimized CMD window
GRASS 7.0 Beta 3 for windows cannot read .laz files
Error in Grass-gis 7.1. svn
winGRASS GIS 6.4.5 svn modules - issues with hard coded path to conf files
winGRASS GIS 6.4.5 svn not working
Startup runs as in Cygwin when CYGWIN is set although running as native application
WinGRASS 7.1 download / website
#2597 fails on windows
r.horizon problem in Windows (horizon_zud)
Future winGRASS needs python-ply package
sqlbuilder: verify button
v.patch -e crashes
#2720 don't start on wingrass 7.0.1
Installing addons for windows gives error that File is not zip file
Simplify download options for MS Windows
Reduce number of Start menu shortcuts on MS Windows
Google Chrome blocks download of daily build
d.fontlist crashes on Windows
grass.script.array cannot read raster on Windows
t.rast.aggregate: error when input space time raster dataset store many rasters
Grass 7.0.3 Virus problem ?
MD5sum for WinGRASS-7.1.svn-r67975-87-Setup-x86_64.exe does not match md5sum file
support bash on windows 10
Problems with Numpy and matplotlib after updating through OSGeo4W
addons installl error
wingrass: provide grass.bat
Opening a workspace file
grass start up: buggy to_text_string
WinGRASS 7.5 installation error: missing ZSTD
upgrade winGRASS build environment to GDAL 2.4.0
wingrass: include also unversioned libraries
winGRASS7.7.svn - - python 3 issues
wrong OSGEO4W_ROOT when installing OSGeo4W to different target directory
winGRASS7.7.svn python3 build issues
wingrass: change instalation target
winGRASS 7.7svn execute command fails
winGRASS7.7.svn python 3: GUI freezes at start
OSGeo4W winGRASS77svn - startup error: TypeError: endswith first arg must be bytes or a tuple of bytes, not str
winGRASS master (git) - g.proj not found at startup
winGRASS: vector digitizing error messages
winGRASS Version: - wrong german Umlaut in wxGUI
winGRASS Version: - deprecated warning in 3D modus
winGRASS: not able to digitize vector polygons
winGRASS: defining a new location by EPSG code: TypeError: invalid result from TransList.OnMeasureItem(), an integer is required (got type NoneType)

Note: See TracWiki for help on using the wiki.