Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated OSGeo recipes #708

Merged
merged 29 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 102 additions & 64 deletions scripts/experimental/install_dev_osgeo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PROJ_VERSION=${PROJ_VERSION:-"latest"}
GDAL_VERSION=${GDAL_VERSION:-"latest"}
GEOS_VERSION=${GEOS_VERSION:-"latest"}

CRAN=${CRAN_SOURCE:-"https://cloud.r-project.org"}
CRAN_SOURCE=${CRAN_SOURCE:-"https://cloud.r-project.org"}
echo "options(repos = c(CRAN = '${CRAN}'))" >>"${R_HOME}/etc/Rprofile.site"

# cmake does not understand "-1" as "all cpus"
Expand All @@ -31,57 +31,117 @@ function apt_install() {
fi
}

# a function to remove apt packages only if they are installed
function apt_remove() {
if dpkg -s "$@" >/dev/null 2>&1; then
apt-get remove -y "$@"
fi
}

function url_latest_gh_released_asset() {
wget -qO- "https://api.github.com/repos/$1/releases/latest" | grep -oP "(?<=\"browser_download_url\":\s\")https.*\.tar.gz(?=\")" | head -n 1
}

export DEBIAN_FRONTEND=noninteractive
apt_install \
gdb \

apt_remove gdal-bin libgdal-dev libgeos-dev libproj-dev &&
apt-get autoremove -y

## Derived from osgeo/gdal
apt-get update
apt-get install -y --fix-missing --no-install-recommends \
ant \
autoconf \
automake \
bash-completion \
build-essential \
ca-certificates \
cmake \
curl \
git \
lsb-release \
libarchive-dev \
libarmadillo-dev \
libblosc-dev \
libboost-dev \
libbz2-dev \
libcairo2-dev \
libclc-15-dev \
libcfitsio-dev \
libcrypto++-dev \
libcurl4-openssl-dev \
libexpat1-dev \
libdeflate-dev \
libexpat-dev \
libfreexl-dev \
libfyba-dev \
libgif-dev \
libheif-dev \
libhdf4-alt-dev \
libhdf5-serial-dev \
libjpeg-dev \
libkml-dev \
liblcms2-2 \
liblerc-dev \
liblz4-dev \
liblzma-dev \
libmysqlclient-dev \
libnetcdf-dev \
libogdi-dev \
libopenexr-dev \
libopenjp2-7-dev \
libpcre3-dev \
libpng-dev \
libpq-dev \
libpoppler-dev \
libpoppler-private-dev \
libqhull-dev \
libsqlite3-dev \
libssl-dev \
libtiff5-dev \
libudunits2-dev \
libwebp-dev \
libxerces-c-dev \
libxml2-dev \
lsb-release \
make \
pandoc \
qpdf \
mdbtools-dev \
pkg-config \
python3-dev \
python3-numpy \
python3-setuptools \
sqlite3 \
subversion \
valgrind \
vim \
tk-dev \
wget \
libv8-dev \
libjq-dev \
libprotobuf-dev \
libxml2-dev \
libprotobuf-dev \
protobuf-compiler \
swig \
unixodbc-dev \
libssh2-1-dev \
libgit2-dev \
libnetcdf-dev \
locales \
libssl-dev \
libtiff-dev \
cmake \
libtiff5-dev \
libhdf4-alt-dev \
libhdf5-dev \
liblzma-dev \
libblosc-dev \
libzstd-dev \
liblz4-dev

wget \
zlib1g-dev
## geoparquet support
wget https://apache.jfrog.io/artifactory/arrow/"$(lsb_release --id --short | tr '[:upper:]' '[:lower:]')"/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
apt_install -y -V ./apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
apt-get update && apt-get install -y -V libarrow-dev libparquet-dev libarrow-dataset-dev

rm -rf /build_local
mkdir /build_local && cd /build_local

## tiledb
GCC_ARCH="$(uname -m)"
export TILEDB_VERSION=2.16.3
apt-get update -y &&
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libspdlog-dev &&
mkdir tiledb &&
wget -q https://github.com/TileDB-Inc/TileDB/archive/${TILEDB_VERSION}.tar.gz -O - |
tar xz -C tiledb --strip-components=1 &&
cd tiledb &&
mkdir build_cmake &&
cd build_cmake &&
../bootstrap --prefix=/usr --disable-werror &&
make "-j$(nproc)" &&
make install-tiledb DESTDIR="/build_thirdparty" &&
make install-tiledb &&
cd ../.. &&
rm -rf tiledb &&
for i in /build_thirdparty/usr/lib/"${GCC_ARCH}"-linux-gnu/*; do strip -s "$i" 2>/dev/null || /bin/true; done &&
for i in /build_thirdparty/usr/bin/*; do strip -s "$i" 2>/dev/null || /bin/true; done

LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

# install geos
Expand All @@ -103,6 +163,7 @@ cd build
cmake ..
cmake --build . --parallel "$CMAKE_CORES" --target install
ldconfig
cd /build_local

# install proj
# https://download.osgeo.org/proj/
Expand All @@ -120,8 +181,8 @@ mkdir build
cd build
cmake ..
cmake --build . --parallel "$CMAKE_CORES" --target install
cd ../..
ldconfig
cd /build_local

# install gdal
# https://download.osgeo.org/gdal/
Expand All @@ -141,37 +202,16 @@ cd ./build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel "$CMAKE_CORES" --target install
ldconfig
cd /build_local

install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
sp \
rgeos \
rgdal \
RPostgreSQL \
RSQLite \
testthat \
knitr \
tidyr \
geosphere \
maptools \
maps \
microbenchmark \
raster \
dplyr \
tibble \
units \
DBI \
covr \
protolite \
tmap \
mapview \
odbc \
pool \
rmarkdown \
RPostgres \
spatstat \
apt-get update && apt-get -y install cargo

install2.r --error --skipmissing -n "$NCPUS" -r "${CRAN_SOURCE}" \
sf \
terra \
lwgeom \
stars
stars \
gdalcubes

# Clean up
rm -rf /var/lib/apt/lists/*
Expand All @@ -180,7 +220,5 @@ rm -rf /tmp/downloaded_packages
# Check the geospatial packages

echo -e "Check the stars package...\n"

R -q -e "library(stars)"

echo -e "\nInstall stars package, done!"