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

rgdal, sf and lwgeom build instructions for CentOS 7 fails. #76

Open
andrie opened this issue Jan 27, 2021 · 1 comment
Open

rgdal, sf and lwgeom build instructions for CentOS 7 fails. #76

andrie opened this issue Jan 27, 2021 · 1 comment

Comments

@andrie
Copy link
Member

andrie commented Jan 27, 2021

I'm trying to install the packages rgdal, sf and lwgeom on CentOS-7 to replicate a customer request.

The instructions on Public RSPM says to use:

rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y gdal-devel
yum install -y gdal
yum install -y proj-devel
yum install -y proj-epsg

But this fails for me, with versions of gdal and geos that are out of date.

To reproduce, I tried these instructions in a Dockerfile:

FROM rstudio/r-base:3.6.0-centos7
# Install sf dependencies
RUN rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install -y \
        epel-release \
        udunits2-devel \
        gdal-devel \
        geos-devel \
        proj-devel \
        proj-epsg
RUN Rscript -e 'install.packages(c("Rcpp"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'
RUN Rscript -e 'install.packages(c("rgdal"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'
RUN Rscript -e 'install.packages(c("sf"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'
RUN Rscript -e 'install.packages(c("lwgeom"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'

But this fails with an error:

checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.11.4
checking GDAL version >= 2.0.1... no

And similarly for geos

@andrie
Copy link
Member Author

andrie commented Jan 27, 2021

FWIW, I have found a workaround by installing geos from the PostgreSQL rpms. Here is my working Dockerfile:

FROM rstudio/r-base:3.6.0-centos7

RUN wget http://download.osgeo.org/gdal/2.4.0/gdal-2.4.0.tar.gz


# Install gdal

RUN tar xf gdal-2.4.0.tar.gz && \
        cd gdal-2.4.0/ && \
        ./configure && \
        make -j4 && \

        udunits2-devel \
        proj-devel \
        proj-epsg \
        openssl-devel

# Install geos using PostGres rpms at https://www.postgresql.org/download/linux/redhat/

RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

RUN yum install -y geos-devel

# Install R packages


RUN Rscript -e 'install.packages(c("Rcpp"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'

RUN Rscript -e 'install.packages(c("rgdal"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'


RUN Rscript -e 'install.packages(c("lwgeom"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'

RUN Rscript -e 'install.packages(c("sf"), repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant