The Geographic Information Systems: GRASS HOWTO
Prev |  |

# E. Sample Files

Example Linux versions of some critical GRASS files

This appendix is the home of Linux-specific examples of selected GRASS configuration files. Currently, only several examples of a single file are offered. However, this is the most important file for configuration! Later, examples of database configuration files (e.g. DEFAULT_WIND) and other files may appear.

In the Installation Guide (pp. 10-11) you will see mention of the [header] file in directory $GIS/src/CMD/header (where $GIS is the directory in which you place GRASS - some folks put this in /usr/local - I put everything in a GRASS' own filesystem/directory /user/grass4.1). The installation guide favors Sun systems, as these were the development environment for GRASS4. (In case you cared, Masscomp workstations were earlier development environments.) Below are examples of this <header> file for linux (which you might want to name linux in your $GIS/src/CMD/header directory. You may want to refer to this section when running the setup ($GIS/src/CMD/utils/setup) command.

One version:

    CC                  = gcc
    ARCH                =

    GISBASE             = /user/grass4.1
    UNIX_BIN            = /user/grass4.1/bin

    DEFAULT_DATABASE    = /user/grass4.1/data
    DEFAULT_LOCATION    = china

    COMPILE_FLAGS       = -O2
    LDFLAGS             = -s

    XCFLAGS             = -D_NO_PROTO -DXM_1_1_BC
    XLDFLAGS            =
    XINCPATH            =
    XMINCPATH           =
    XLIBPATH            =
    XTLIBPATH           = -L/usr/lib
    XMLIBPATH           = -L/usr/lib
    XLIB                = -lX11
    XTLIB               = -lXt
    XMLIB               = -lXm
    XEXTRALIBS          =

    TERMLIB             =
    CURSES              = -lcurses $(TERMLIB)
    MATHLIB             = -lm

    #                   LIBRULE = ar ruv $@ $?
    #                   LIBRULE = ar ruv $@ $?; ranlib $@
    #                   LIBRULE = ar ruv $@ $?; ar ts $@
    #                   LIBRULE = ar rc $@ `lorder $(OBJ) | tsort`
    LIBRULE             = ar ruv $@ $?

    USE_TERMIO          = -DUSE_TERMIO
    USE_MTIO            = -DUSE_MTIO
    USE_FTIME           = -DUSE_FTIME
    DIGITFLAGS          = -DUSE_SETREUID -DUSE_SETPRIORITY
    VECTLIBFLAGS        =
    GETHOSTNAME         = -DGETHOSTNAME_OK

Another version:

    #CC                  = gcc
    #CC                  = gcc -ggdb -traditional
    CC                  = gcc -traditional
    #CC                  = gcc -static

    ARCH                = linux

    GISBASE             = /usr2/local/grass/grass4.1
    UNIX_BIN            = /usr/local/bin

    DEFAULT_DATABASE    = /usr2/local/grass
    DEFAULT_LOCATION    = grass4.1

    COMPILE_FLAGS       =
    #COMPILE_FLAGS       = -O
    LDFLAGS             = -s

    XCFLAGS             = -D_NO_PROTO
    XLDFLAGS            =
    XINCPATH            = -I$GISBASE/xgrass
    #XINCPATH            =
    XMINCPATH           =
    XLIBPATH            = -L/usr/lib
    XTLIBPATH           = -L/usr/lib
    XMLIBPATH           = -L/usr/lib
    XLIB                = -lX11
    XTLIB               = -lXt
    XMLIB               = -lXm
    XEXTRALIBS          =

    TERMLIB             =
    CURSES              = -lcurses $(TERMLIB)
    MATHLIB             = -lm

    #                   LIBRULE = ar ruv $@ $?
    #                   LIBRULE = ar ruv $@ $?; ranlib $@

    #                   LIBRULE = ar ruv $@ $?; ar ts $@
    #                   LIBRULE = ar rc $@ `lorder $(OBJ) | tsort`
    LIBRULE             = ar ruv $@ $?; ranlib $@

    USE_TERMIO          = -DUSE_TERMIO
    USE_MTIO            = -DUSE_MTIO
    USE_FTIME           = -DUSE_FTIME
    DIGITFLAGS          = -DUSE_SETREUID -DUSE_SETPRIORITY
    VECTLIBFLAGS        =
    GETHOSTNAME         = -DGETHOSTNAME_OK

Another version:

    #CC                  = gcc -traditional -ggdb
    CC                  = gcc -traditional -m486
    #CC                  = gcc
    ARCH                = linux

    GISBASE             = /usr/local/grass/grass4.1
    UNIX_BIN            = /usr/local/bin

    DEFAULT_DATABASE    = /usr/local/grass
    DEFAULT_LOCATION    = grass4.1

    COMPILE_FLAGS       = -O2
    LDFLAGS             = -s

    XCFLAGS             = -D_NO_PROTO -DXM_1_1_BC
    XLDFLAGS            =
    XINCPATH            =
    XMINCPATH           =
    XLIBPATH            = -L/usr/lib
    XTLIBPATH           = -L/usr/lib
    XMLIBPATH           = -L/usr/lib
    XLIB                = -lX11
    XTLIB               = -lXt
    XMLIB               = -lXm
    XEXTRALIBS          = -lXmu

    TERMLIB             =
    CURSES              = -lcurses $(TERMLIB)
    MATHLIB             = -lm

    #                   LIBRULE = ar ruv $@ $?
    #                   LIBRULE = ar ruv $@ $?; ranlib $@
    #                   LIBRULE = ar ruv $@ $?; ar ts $@
    #                   LIBRULE = ar rc $@ `lorder $(OBJ) | tsort`
    LIBRULE             = ar ruv $@ $?; ranlib $@

    #USE_TERMIO          = #-DUSE_TERMIO
    USE_TERMIO          = -DUSE_TERMIO
    USE_MTIO            = -DUSE_MTIO
    USE_FTIME           = -DUSE_FTIME
    DIGITFLAGS          = -DUSE_SETREUID -DUSE_SETPRIORITY
    VECTLIBFLAGS        =
    GETHOSTNAME         = -DGETHOSTNAME_OK

Yet another version:

    CC                  = cc
    ARCH                = linux

    GISBASE             = /usr/local/grass4.15/linux
    UNIX_BIN            = /usr/local/grass4.15/linux

    DEFAULT_DATABASE    = /data/grassdata
    DEFAULT_LOCATION    =

    # -fwritable-strings - for ps.map only
    #COMPILE_FLAGS       = -O -m486 -fwritable-strings
    COMPILE_FLAGS       = -O -m486
    LDFLAGS             = -s

    XCFLAGS             = -D_NO_PROTO
    XLDFLAGS            =
    XINCPATH            =
    XMINCPATH           =
    XLIBPATH            = -L/usr/X11R6/lib
    XTLIBPATH           = -L/usr/lib
    XMLIBPATH           = -L/usr/lib
    XLIB                = -lX11
    XTLIB               = -lXt
    XMLIB               = -lXm
    XEXTRALIBS          =

    TERMLIB             =
    CURSES              = -lcurses $(TERMLIB)
    MATHLIB             = -lm

    #                   LIBRULE = ar ruv $@ $?
    #                   LIBRULE = ar ruv $@ $?; ranlib $@
    #                   LIBRULE = ar ruv $@ $?; ar ts $@
    #                   LIBRULE = ar rc $@ `lorder $(OBJ) | tsort`
    LIBRULE             = ar ruv $@ $?

    USE_TERMIO          = -DUSE_TERMIO
    USE_MTIO            = -DUSE_MTIO
    USE_FTIME           = -DUSE_FTIME
    DIGITFLAGS          = -DUSE_SETREUID -DUSE_SETPRIORITY
    VECTLIBFLAGS        = -DPORTABLE_3
    GETHOSTNAME         = -DGETHOSTNAME_OK

Intimidating? It probably shouldn't be if you've configured X Windows on your Linux box. These examples should give you patterns to look for when running the setup utility in GRASS (described in the Installation Guide).

Prev | Home |
Enhancing GRASS |  |