Skip to content

Creating MDiG distribution for Windows

Joel Pitt edited this page Feb 6, 2014 · 1 revision

To build GRASS, follow instructions here

MDiG setup

MDiG module compilation

  • Need library libgsl - download from GnuWin32, move directory structure in the GnuWin32 install path to the msys local directory (e.g. c:\msys\local\)
  • check out from bzr
  • compile:
 export GRASS_SRC=/usr/local/src/grass-6.3.0.1/
 make -S MODULE_TOPDIR=$GRASS_SRC
 cd $GRASS_SRC
 make install

Note that "make install" overwrites the batch and shell script for running GRASS. Edit the files and replace c:\msys\local\bin\grass63.bat with:

@echo off
rem #########################################################################
rem #
rem # GRASS Initialization
rem #
rem #########################################################################

rem *******Environment variables***********

rem Directory where your .grassrc6 file will be stored
set HOME=%USERPROFILE%

rem Name of the wish (Tk) executable
set GRASS_WISH=wish.exe

rem Path to the shell command 
set GRASS_SH=c:\msys\bin\sh.exe

rem Set Path to utilities (libraries and bynaries) used by GRASS
set PATH=c:\msys\bin;c:\msys\local\bin;c:\msys\local\tcl-tk\bin;%PATH%
set PATH=c:\msys\local\pgsql\lib;c:\msys\local\sqlite\bin;%PATH%

rem Set Path to MSIE web browser
set GRASS_HTML_BROWSER=%PROGRAMFILES%/Internet Explorer/iexplore.exe

rem Path to the proj files (notably the epsg projection list)
set GRASS_PROJSHARE=c:\msys\local\share\proj

set WINGISBASE=c:\msys\local\grass-6.3.1svn
"%WINGISBASE%\etc\init.bat" %*

Copy the following code and and paste it in a new document, then save it as c:\msys\local\bin\grass63 (overwrite the existing file):

#! /bin/sh
#############################################################################
#
# $Id: grass.src 22360 2007-01-22 22:41:45Z markus $
#
# MODULE:   	GRASS Initialization
# AUTHOR(S):	Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
# PURPOSE:  	The source file for this shell script is in
#   	    	lib/init/grass.src and is the grass startup script. It
#   	    	requires a source file because the definition of GISBASE
#   	    	is not known until compile time and is substituted from the
#   	    	Makefile. Any command line options are passed to Init.sh.
# COPYRIGHT:    (C) 2000-2005 by the GRASS Development Team
#
#               This program is free software under the GNU General Public
#   	    	License (>=v2). Read the file COPYING that comes with GRASS
#   	    	for details.
#
#############################################################################

trap "echo 'User break!' ; exit" 2 3 9 15

# Set the GISBASE variable
GISBASE=/usr/local/grass-6.3.1svn
export GISBASE

# Set the PATH variable
PATH="/usr/local/tcl-tk/bin:/usr/local/sqlite/bin:/usr/local/pgsql/lib:$PATH"
export PATH

exec "$GISBASE/etc/Init.sh" "$@"

Note you may have to chance the GISBASE and WINGISBASE environmental variables with the appropriate path if you are using a different version of the GRASS source.

MDiG Python distribution