singularityfile_debian 4.0 KB

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