1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
Bootstrap: docker
From: debian:bullseye
%help
Singularity container for GRASS GIS to be run into GRASS main directory
%labels
Maintainer Luca Delucchi
%setup
mkdir -p /tmp/grass_build
%files
* /tmp/grass_build
%post
# Install useful libraries
apt-get -y update
apt-get -y install \
build-essential \
bison \
bzip2 \
cmake \
curl \
flex \
g++ \
gcc \
gdal-bin \
gettext \
git \
libbz2-dev \
libcairo2 \
libcairo2-dev \
libcurl4-gnutls-dev \
libfftw3-bin \
libfftw3-dev \
libfreetype6-dev \
libgdal-dev \
libgeos-dev \
libgsl-dev \
libjpeg-dev \
libjsoncpp-dev \
libopenblas-base \
libopenblas-dev \
libnetcdf-dev \
libncurses5-dev \
libopenjp2-7 \
libopenjp2-7-dev \
libpdal-dev \
libpnglite-dev \
libpq-dev \
libpython3-all-dev \
libreadline-dev \
libsqlite3-dev \
libtiff-dev \
libzstd-dev \
make \
mesa-common-dev \
moreutils \
ncurses-bin \
netcdf-bin \
pdal \
python3 \
python3-dateutil \
python3-dev \
python3-gdal \
python3-magic \
python3-numpy \
python3-pdal \
python3-pillow \
python3-pip \
python3-ply \
python3-requests \
python3-setuptools \
python3-venv \
software-properties-common \
sqlite3 \
subversion \
unzip \
vim \
wget \
zip \
zlib1g-dev
# Set Python 3 as default Python version
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
echo LANG="en_US.UTF-8" > /etc/default/locale
# compile GRASS
cd /tmp/grass_build
# -O2 -march=native -std=gnu99 -m64
LDFLAGS="-s"
CFLAGS="-O2 -std=gnu99 -m64"
CXXFLAGS="-O2"
GRASS_PYTHON=/usr/bin/python3
./configure \
--enable-largefile \
--with-cxx \
--with-nls \
--with-readline \
--with-sqlite \
--with-bzlib \
--with-zstd \
--with-cairo \
--with-cairo-ldflags=-lfontconfig \
--with-freetype \
--with-freetype-includes="/usr/include/freetype2/" \
--with-fftw \
--with-netcdf \
--with-pdal \
--with-proj \
--with-proj-share=/usr/share/proj \
--with-geos=/usr/bin/geos-config \
--with-postgres \
--with-postgres-includes="/usr/include/postgresql" \
--without-mysql \
--without-odbc \
--without-openmp \
--without-ffmpeg \
--without-opengl
make -j 2 && make install && ldconfig
# Create generic GRASS GIS binary name regardless of version number
ln -sf `find /usr/local/bin -name "grass??" | sort | tail -n 1` /usr/local/bin/grass
# Create generic GRASS GIS lib name regardless of version number
ln -sf `grass --config path` /usr/local/grass
# Remove unused file
apt-get autoremove -y
apt-get clean -y
cd /tmp
rm -rf /tmp/grass_build
# Add useful GRASS addons
grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=i.modis
grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=i.sentinel
grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=r.in.pdal
#grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=i.wi
#grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=r.bioclim
#grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=r.series.lwr
#grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=v.clip
#grass -c EPSG:4326 --tmp-project --exec g.extension -s ext=v.strds.stats
%environment
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export SHELL=/bin/bash
export LD_LIBRARY_PATH="/usr/local/lib"
%runscript
grass --version
|