CLAWRIM Wiki

The Computational Lab for Advanced Water Resources Informatics and Modeling

User Tools

Site Tools


howtos:how_to_compile_grass_on_slackware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:how_to_compile_grass_on_slackware [2026-02-20 08:10 am] – removed - external edit (Unknown date) 127.0.0.1howtos:how_to_compile_grass_on_slackware [2026-02-20 08:10 am] (current) hcho
Line 1: Line 1:
 +====== How to compile GRASS on Slackware ======
  
 +This HOWTO explains how to compile [[https://grass.osgeo.org/|GRASS]] on Slackware.
 +
 +<code bash>
 +# switch to root
 +su -
 +
 +# create postgres group and user for postgresql, one of pdal dependencies
 +groupadd -g 209 postgres
 +useradd -u 209 -g 209 -d /var/lib/pgsql postgres
 +
 +# install dependency libraries;
 +# build queuefiles, not packages, to automatically build any other dependencies
 +sbopkg -k -i "proj gdal pdal blas lapack"
 +
 +# switch to non-root
 +exit
 +
 +# clone github repositories
 +mkdir -p ~/usr/local/src
 +cd ~/usr/local/src
 +git clone https://github.com/HuidaeCho/grass-build-scripts.git
 +git clone https://github.com/OSGeo/grass.git
 +git clone https://github.com/OSGeo/grass-addons.git
 +git clone https://github.com/OSGeo/gdal-grass.git
 +
 +# create ~/.grassbuildrc
 +cd grass-build-scripts
 +cp .grassbuildrc-example ~/.grassbuildrc
 +
 +# build grass
 +./build.sh -m -a -g >& ~/usr/local/src/grass/build.log
 +
 +# install pkgconfig config
 +mkdir -p ~/usr/local/share/pkgconfig
 +cd ../grass
 +sed 's#/usr/local/grass[^/ ]*#'$HOME'/usr/local/src/grass/dist.x86_64-pc-linux-gnu#g' grass.pc > ~/usr/local/share/pkgconfig/grass.pc
 +if ! echo $PKG_CONFIG_PATH | grep -q $HOME/usr/local/share/pkgconfig; then
 +  echo 'export PKG_CONFIG_PATH="$HOME/usr/local/share/pkgconfig:$PKG_CONFIG_PATH"' > ~/.bash_profile
 +  . ~/.bash_profile
 +fi
 +
 +# create grass script
 +mkdir ~/usr/local/bin
 +cat << 'EOT' > ~/usr/local/bin/grass
 +#!/bin/sh
 +grass_master="$HOME/usr/local/src/grass/bin.x86_64-pc-linux-gnu/grass"
 +# workaround to avoid the annoying ~/grassdata/world_latlong_wgs84 feature
 +if [ $# -eq 0 ]; then
 +        last_used_mapset=$(awk '
 +                /^GISDBASE: /{gisdbase=$2}
 +                /^LOCATION_NAME: /{location_name=$2}
 +                /^MAPSET: /{mapset=$2}
 +                END{
 +                        printf "%s/%s/%s", gisdbase, location_name, mapset
 +                }' ~/.grass8/rc)
 +        $grass_master "$last_used_mapset"
 +else
 +        $grass_master "$@"
 +fi
 +EOT
 +chmod a+x ~/usr/local/bin/grass
 +if ! echo $PATH | grep -q $HOME/usr/local/bin; then
 +  echo 'export PATH="$HOME/usr/local/bin:$PATH"' > ~/.bash_profile
 +  . ~/.bash_profile
 +fi
 +</code>

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki