Skip to content

Installation Issues with sf Library on AlmaLinux 8 #2540

@ElMiguelNarvaez

Description

@ElMiguelNarvaez

I am encountering several errors while trying to install the sf library in R on an AlmaLinux 8 system. Below are the details of the errors and the steps I have taken to resolve them.

Environment Details:
Operating System: AlmaLinux 8
RStudio Server Version: RStudio 2024.12.1+563 "Kousa Dogwood" Release (27771613951643d8987af2b2fb0c752081a3a853, 2025-02-02) for RHEL 8
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36, Quarto 1.5.57 (/usr/lib/rstudio-server/bin/quarto/bin/quarto)

Steps taken
install.packages('sf')
sudo dnf install gdal gdal-devel
sudo dnf install postgresql-devel
sudo dnf install openldap-devel

Error messages

> install.packages('sf')
Installation du package dans ‘/home/R/libs’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://pbil.univ-lyon1.fr/CRAN/src/contrib/sf_1.0-21.tar.gz'
Content type 'application/x-gzip' length 4491745 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

* installing *source* package ‘sf’ ...
** this is package ‘sf’ version ‘1.0-21’
** package ‘sf’ correctement décompressé et sommes MD5 vérifiées
** using staged installation
configure: CC: gcc
configure: CXX: g++ -std=gnu++17
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.0.4
checking GDAL version >= 2.0.1... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... no
checking GDAL: linking with --libs and --dep-libs... no
/usr/lib64/libgdal.so: undefined reference to `PQcmdStatus@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQfname@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQsetNoticeProcessor@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQftable@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQstatus@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQftablecol@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQconnectdb@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQescapeStringConn@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `lo_close@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQputCopyEnd@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQgetvalue@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQgetisnull@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQftype@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQfmod@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `lo_creat@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQresultStatus@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `lo_read@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQexec@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQsetClientEncoding@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQgetlength@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQputCopyData@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQgetResult@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `lo_write@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQfinish@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQclear@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQerrorMessage@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQnfields@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `lo_open@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQexecParams@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQntuples@RHPG_9.6'
/usr/lib64/libgdal.so: undefined reference to `PQresultErrorMessage@RHPG_9.6'
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -ldapclient
/usr/bin/ld: cannot find -ldapserver
/usr/bin/ld: cannot find -ldap
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
*** Installing this package from source requires the prior
*** installation of external software, see for details
*** https://r-spatial.github.io/sf/#installing
ERROR: configuration failed for package ‘sf’
* removing ‘/home/R/libs/sf’

Les packages source téléchargés sont dans
        ‘/tmp/RtmpNIQsSu/downloaded_packages’
Message d'avis :
Dans install.packages("sf") :
  l'installation du package ‘sf’ a eu un statut de sortie non nul

Question:
What additional steps can I take to resolve these installation issues? Are there specific configurations or additional dependencies that I need to install to successfully set up the sf library on AlmaLinux 8?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions