CLAWRIM Wiki

The Computational Lab for Advanced Water Resources Informatics and Modeling

User Tools

Site Tools


howtos:how_to_compile_grass_gis_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_gis_on_slackware [2024-08-20 07:59 am] hchohowtos:how_to_compile_grass_gis_on_slackware [2024-08-21 06:08 am] (current) hcho
Line 4: Line 4:
  
 <code bash> <code bash>
-su - # switch to root+# switch to root 
 +su -
  
 # create postgres group and user for postgresql, one of pdal dependencies # create postgres group and user for postgresql, one of pdal dependencies
Line 13: Line 14:
 # build queuefiles, not packages, to automatically build any other dependencies # build queuefiles, not packages, to automatically build any other dependencies
 sbopkg -k -i "proj gdal pdal blas lapack" 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> </code>
howtos/how_to_compile_grass_gis_on_slackware.1724162367.txt.gz · Last modified: by hcho

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki