Table of Contents
- Dependencies required for building with MinGW
- Compiling and Installing GRASS GIS
- Creating a WinGRASS Installer
- Open Tickets
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 environment
- Download the OSGeo4W installer
- Run the installer.
osgeo4w-setup -g -k -a x86_64 -q -P proj-devel,gdal-devel,geos-devel,libtiff-devel,libpng-devel,pdal-devel,netcdf-devel,cairo-devel,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,libpq-devel,pdcurses,python3-matplotlib,python3-numpy,python3-ply,python3-pywin32,python3-six,python3-wxpython,regex-devel,wxwidgets-devel,zstd-devel,sqlite3-devel
Install the MSYS2 environment
- Download and install MSYS2.
- Start MSYS2 terminal and install requirements:
pacman -S tar libintl make bison flex diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-fftw mingw-w64-x86_64-lapack mingw-w64-x86_64-pkg-config mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv mingw-w64-x86_64-bzip2 mingw-w64-x86_64-gettext mingw-w64-x86_64-libsystre mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-libpng mingw-w64-x86_64-pcre mingw-w64-x86_64-python3-six mingw-w64-x86_64-openblas
- Add to
Part of packaging process is also producing VC libraries using
dumpbin command which is part of Visual Studio framework. It's recommended to install Common Tools for Visual C++.
Compiling and Installing GRASS GIS
Start MSYS2 terminal.
- Download GRASS source code (see wiki:DownloadSource for details). Example for development version (main branch):
cd /usr/src git clone https://github.com/OSGeo/grass grass
- Switch to GRASS GIS source code directory (in our case
grass) and run
cd grass export OSGEO4W_ROOT_MSYS=/c/osgeo4w export VCPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64" # for release builds ./mswindows/osgeo4w/package.sh # for daily builds PACKAGE_POSTFIX=-daily ./mswindows/osgeo4w/package.sh
error.logfor any error messages and
mswindows/osgeo4w/package.logif you're having problems.
GRASS GIS should now be installed in
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 the OSGeo4W cmd console (assuming that we compiled GRASS 7.6):
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
- Copy all the content of the
mswindowsdirectory to a temporary directory, for example
- Launch the file
- When finished, you should have a GRASS self-contained release package in
- Download the NSIS installer
- Install to
Install NSIS: Untgz Plugin
- Download the NSIS Untgz Plugin
Install NSIS: AccessControl Plugin
- Download the NSIS AccessControl Plugin
- Unzip to
- Copy file
Create the WinGRASS Installer
- When finished, you should have the WinGRASS installer in
Required by GRASS Addons v.in.redwg.
TODO: Finish this part.
WinGRASS 64bit Notes
External notes for building windows 64bit-binaries:
- OSGeo4W-64bit inital notes
- GRASS changes for OSGeo4W 64bit
- Building R for 64-bit Windows
- Building SpatiaLite for 64-bit Windows
- gvSIG and MinGW-w64 (C/C++ compiler)
- recipe used to build GRASS 6.4.3 on OSGeo4W in 64bit
Tool chains for building windows 64bit-binaries:
- MinGW-w64 - GCC for both 64 & 32 bits Windows
- TDM-GCC - A compiler suite for 32- and 64-bit Windows based on the GNU toolchain
- Native windows x64 software develop with Mingw-w64
Startup errors after installation
See here: http://grass.osgeo.org/wiki/WinGRASS_errors
- GRASS package page in OSGeo4W (including packaging notes)
- Develop your own GRASS modules on MS-Windows
- http://wiki.qgis.org/qgiswiki/BuildingFromSource by QGIS Team
- http://www.webalice.it/marco.pasetti/grass/BuildFromSource.html by Marco Pasetti
- http://www.webalice.it/marco.pasetti/qgis+grass/BuildFromSource.html by Marco Pasetti
- Besides Cygwin and MinGW there is another along similar lines called "som" or "gow" or something?
- see also OSGeo4W pkg-grass buglist
- 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.
- 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
- r.in.wms 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 v.surf.rst 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 www.python.org-installation
- 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, v.report, etc)
winGRASS 7: No results