terra icon indicating copy to clipboard operation
terra copied to clipboard

Issue with GDAL on installation

Open angelosnm opened this issue 7 months ago • 0 comments

I am using Ubuntu as underlying OS and I have installed both PROJ & GDAL from source along with their needed OS dependecies inside a Dockerfile:

ENV PROJ_VERSION=9.3.0
ENV GDAL_VERSION=3.8.3

RUN cd /tmp && \
    wget https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz && \
    tar -xvf proj-${PROJ_VERSION}.tar.gz && \
    sudo mv proj-${PROJ_VERSION} /opt && \
    cd /opt/proj-${PROJ_VERSION} && \
    sudo mkdir build && \
    cd build && \
    sudo cmake .. && \
    sudo cmake --build . && \
    sudo cmake --build . --target install

RUN wget https://github.com/OSGeo/gdal/releases/download/v${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz && \
    tar -xvf gdal-${GDAL_VERSION}.tar.gz && \
    sudo mv gdal-${GDAL_VERSION} /opt && \
    cd /opt/gdal-${GDAL_VERSION} && \
    sudo mkdir build && \
    cd build && \
    sudo cmake .. && \
    sudo cmake --build . && \
    sudo cmake --build . --target install

Although both are installed succesfully I get this error on the package installation:

2024-01-23T14:24:38.1179512Z rspatial/raster#38 781.8 ./gdal_proj: error while loading shared libraries: libgdal.so.34: cannot open shared object file: No such file or directory
2024-01-23T14:24:38.2680494Z rspatial/raster#38 781.8 configure: error: OGRCoordinateTransformation() does not return a coord.trans: PROJ not available?
2024-01-23T14:24:38.2681525Z rspatial/raster#38 781.8 ERROR: configuration failed for package ‘terra’
2024-01-23T14:24:38.2682030Z rspatial/raster#38 781.8 * removing ‘/usr/local/lib/R/site-library/terra’
2024-01-23T14:24:38.3909377Z rspatial/raster#38 782.1 ERROR: dependency ‘terra’ is not available for package ‘raster’
2024-01-23T14:24:38.3910010Z rspatial/raster#38 782.1 * removing ‘/usr/local/lib/R/site-library/raster’

angelosnm avatar Jan 23 '24 16:01 angelosnm