4

I am trying to install the package in R on a Fedora platform. However, the following error message appears: configure: error: GDALAllRegister not found in libgdal.
I don't know what to do with the error message. In this post there was already the same problem, but on an Ubuntu platform:
Install rgdal library in rstudio - GDALAllRegister not found in libgdal
The solution there apparently did not work for me.
Can anyone help me with this problem?

> install.packages("rgdal")
Installiere Paket nach ‘/home/user/R/x86_64-redhat-linux-gnu-library/4.2’
(da ‘lib’ nicht spezifiziert)
versuche URL 'https://cran.rstudio.com/src/contrib/rgdal_1.6-5.tar.gz'
Content type 'application/x-gzip' length 4465310 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

* installing *source* package ‘rgdal’ ...
** Paket ‘rgdal’ erfolgreich entpackt und MD5 Summen überprüft
** using staged installation
configure: R_HOME: /usr/lib64/R
configure: CC: gcc
configure: CXX: g++ -std=gnu++14
configure: CFLAGS: -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
configure: CPPFLAGS: -I/usr/local/include
configure: CXXFLAGS: -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
configure: LDFLAGS: -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
configure: LDFLAGS: -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
configure: CXX17 is: g++, CXX17STD is: -std=gnu++17
configure: CXX is: g++ -std=gnu++17
configure: C++17 support available
configure: rgdal: 1.6-5
checking for /usr/bin/svnversion... no
configure: svn revision: 1199
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.5.2
checking GDAL version != 3.6.0... yes
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking GDAL: linking with --libs only... no
checking GDAL: linking with --libs and --dep-libs... no
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQcmdStatus@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQfname@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQsetNoticeProcessor@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQftable@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQcancel@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQstatus@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQftablecol@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQconnectdb@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQescapeStringConn@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `lo_close@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQputCopyEnd@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQgetvalue@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQgetisnull@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQftype@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQfmod@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `lo_creat@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQresultStatus@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `lo_read@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQexec@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQsetClientEncoding@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQgetlength@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQputCopyData@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQgetResult@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `lo_write@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQfinish@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQclear@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQerrorMessage@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQnfields@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `lo_open@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQexecParams@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQgetCancel@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQntuples@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQresultErrorMessage@RHPG_9.6'
/usr/bin/ld: /usr/lib64/libgdal.so: undefined reference to `PQfreeCancel@RHPG_9.6'
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lodbcinst: No such file or directory
/usr/bin/ld: cannot find -larmadillo: No such file or directory
/usr/bin/ld: cannot find -lqhull_r: No such file or directory
/usr/bin/ld: cannot find -lgeotiff: No such file or directory
/usr/bin/ld: cannot find -lLerc: No such file or directory
/usr/bin/ld: cannot find -lpoppler: No such file or directory
/usr/bin/ld: cannot find -lgif: No such file or directory
/usr/bin/ld: cannot find -lnetcdf: No such file or directory
/usr/bin/ld: cannot find -lcfitsio: No such file or directory
/usr/bin/ld: cannot find -lhdf5: No such file or directory
/usr/bin/ld: cannot find -lgta: No such file or directory
/usr/bin/ld: cannot find -lwebp: No such file or directory
/usr/bin/ld: cannot find -ldf: No such file or directory
/usr/bin/ld: cannot find -lmfhdf: No such file or directory
/usr/bin/ld: cannot find -lopenjp2: No such file or directory
/usr/bin/ld: cannot find -lOpenEXR: No such file or directory
/usr/bin/ld: cannot find -lOpenEXRUtil: No such file or directory
/usr/bin/ld: cannot find -lImath: No such file or directory
/usr/bin/ld: cannot find -lIex: No such file or directory
/usr/bin/ld: cannot find -lkmlbase: No such file or directory
/usr/bin/ld: cannot find -lkmldom: No such file or directory
/usr/bin/ld: cannot find -lkmlengine: No such file or directory
/usr/bin/ld: cannot find -lspatialite: No such file or directory
/usr/bin/ld: cannot find -lsqlite3: No such file or directory
/usr/bin/ld: cannot find -lxerces-c: No such file or directory
/usr/bin/ld: cannot find -lmysqlclient: No such file or directory
/usr/bin/ld: cannot find -lodbc: No such file or directory
/usr/bin/ld: cannot find -lfreexl: No such file or directory
/usr/bin/ld: cannot find -logdi: No such file or directory
/usr/bin/ld: cannot find -lexpat: No such file or directory
/usr/bin/ld: cannot find -lgeos_c: No such file or directory
/usr/bin/ld: cannot find -lproj: No such file or directory
/usr/bin/ld: cannot find -ljson-c: No such file or directory
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/user/R/x86_64-redhat-linux-gnu-library/4.2/rgdal’
Warning in install.packages :
  Installation des Pakets ‘rgdal’ hatte Exit-Status ungleich 0
TobKel
  • 1,293
  • 8
  • 20
  • 3
    Sorry I don't have an answer for you. But want to let you know that `rgdal` is supposed to be deprecated this year. Obviously, I don't know what you plan to use it for, but you might want to think about an alternate workflow for whatever you had in mind. I know `rgdal` is used with `sp` a lot, while other libraries rely on it as well. `sf` is a great replacement for `sp` which doesn't rely on `rgdal`. – John Polo Mar 18 '23 at 13:48
  • This kind of failure of compilation often occurs when required system dependencies are not installed. Compiling packages yourself is generally not the recommended way of installing packages on Fedora, because precompiled binaries are available via COPR. I explain how to set this up in [this answer to another question](https://stackoverflow.com/a/75449961/11932936). If you want to go ahead with compilation anyhow, make sure that you have installed the [system requirements listed on CRAN](https://cran.r-project.org/web/packages/rgdal/) – shs Mar 18 '23 at 18:07

1 Answers1

1

I've been having this issue recently and am able to successfully build rgdal by reverting to the previous version via this response.

In your R console, pass:

packageurl <- "https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.6-3.tar.gz"

and then:

install.packages(packageurl, repos=NULL, type="source")

d48sp23
  • 11
  • 2