CLAWRIM Wiki

The Computational Lab for Advanced Water Resources Informatics and Modeling

User Tools

Site Tools


howtos:how_to_compile_grass_gis_on_slackware

This is an old revision of the document!


How to compile GRASS GIS on Slackware

This HOWTO explains how to compile GRASS GIS on Slackware.

# 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 ~
 
# build grass
./build.sh -m -a -g >& ~/usr/local/src/grass/build.log
 
# 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
howtos/how_to_compile_grass_gis_on_slackware.1724165389.txt.gz · Last modified: by hcho

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki