[gdal-dev] upgrading to gdal-2.4.2 on debian:buster

Jon Seymour jon at upowr.com.au
Wed Feb 5 20:14:55 PST 2020


I finally solved this, I have added some notes inline to my original post
to explain how and some misconceptions I had that have now been cleaned up.
Although I now have a working solution, I would be interested in
understanding cleaner approaches, if there are any (e.g. ways to rebuild
the debian package).

On Thu, Feb 6, 2020 at 11:55 AM Jon Seymour <jon at upowr.com.au> wrote:

> Hello all,
>
> I have been using gdal-2.4.0 on debian buster for some time now. I ran
> across an issue with the vsis3 driver and its interplay with the vrt driver
> (AWS container credentials were expiring after 6 hours). This issue is
> fixed in 2.4.2 so I wanted to upgrade my system to gdal-2.4.2 so I could
> take advantage of the fix.
>
> What I am looking for is a sketch of the most correct and efficient way
> for me to do this.
>
> What I have tried is the following:
>
> I downloaded 2.4.2 from source and rebuilt it with the
> --with-python=/usr/bin/python3 configuration option
>

> This resulted in an installation in /usr/local. I noticed that another
> dependency (the .deb package python-opencv) installs gdal-2.4.0 in
> /usr/lib. I updated the symbolic link in /usr/lib to refer to the version
> of libgdal.so.20 in /usr/local/lib and this worked for gdalinfo, it didn't
> work for my larger program:
>
>
In the end, for the functionality I wanted, I needed to
install libcurl4-openssl-dev libproj-dev into my build environment, and
then run ./configure with --prefix=/usr --with-python=/usr/bin/python3


> ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of
> OGRCoordinateTransformation failed.
>


> Presumably this resulted from having a mix of 2.4.0 and 2.4.2 artefacts in
> the same path.
>
>


> This problem was actually caused by not installing libproj-dev prior to
the gdal build.

>

> I am now in the process of rebuilding the source with a prefix of /usr so
> that I can at least replace the /usr version of the binary with my locally
> built versions, but I don't know yet if that will work better.
>
> I also experimented with rebuilding the 2.4.2 .deb package from the 2.4.2
> tag of  https://salsa.debian.org/debian-gis-team/gdal but ran into
> problems with an unresolved dependency (libodgi) which I wasn't able to
> resolve trivially so I abandoned that attempt.
>
>
I didn't try this, but I wondered later if I should have considered adding
the debian experimental repo to the build image in order to resolve the
libogdi-dev dependency.


> What is the best way for me to upgrade gdal from 2.4.0 to 2.4.2 on a
> debian buster system?
>
>
Ultimately, I built gdal-2.4.2 with this Dockerfile:

ARG BASE_IMAGE=debian:buster
FROM ${BASE_IMAGE}
ARG GDAL_VERSION=2.4.2
ENV GDAL_VERSION=${GDAL_VERSION}
RUN apt-get update && apt-get install -y \
                wget \
                build-essential \
                cmake \
                cython3 \
                libavcodec-dev \
                libavdevice-dev \
                libavfilter-dev \
                libavformat-dev \
                libblosc-dev \
                libbz2-dev \
                libjpeg62-turbo-dev \
                libjxr-dev \
                liblcms2-dev \
                liblz4-dev \
                liblzma-dev \
                libpng-dev \
                libswscale-dev \
                libtiff-dev \
                libwebp-dev \
                libz-dev \
                pkg-config \
                python-opencv \
                python3 \
                python3-dev \
                python3-numpy \
                python3-pip \
                python3-pip \
                python3-pytest \
                python3-pytest-cov \
                python3-setuptools \
                python3-virtualenv \
                python3-wheel \
                libcurl4-openssl-dev \
                libjpeg-dev \
                libopenjp2-7-dev \
                libproj-dev \
                libzstd-dev
RUN mkdir -p /usr/src && \
        cd /usr/src && \
        wget
https://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz
&& \
        tar xzf gdal-${GDAL_VERSION}.tar.gz && \
        cd gdal-${GDAL_VERSION} && \
        ./configure --prefix=/usr --with-python=/usr/bin/python3 && \
        make && \
        make install
RUN pip3 install cython jupyter GDAL==${GDAL_VERSION}

Feel free to let me know if there is a better way to skin this cat.

jon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200206/11ecb10b/attachment.html>


More information about the gdal-dev mailing list