Repository navigation
Open
Description
Apologies @jeroen and @krlmlr for bringing this up as it seems to have been addressed previously: #118 and #350
I am running RHEL 8.9 using R 4.3.3 and attempted to install RPostgres, which failed with the following error:
trying URL 'https://cloud.r-project.org/src/contrib/RPostgres_1.4.7.tar.gz'
Content type 'application/x-gzip' length 1476313 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
* installing *source* package ‘RPostgres’ ...
** package ‘RPostgres’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lpq
Using PKG_PLOGR=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libpq was not found. Try installing:
* deb: libpq-dev libssl-dev (Debian, Ubuntu, etc)
* rpm: postgresql-devel (Fedora, EPEL)
* rpm: postgreql8-devel, postgresql92-devel, postgresql93-devel, or postgresql94-devel (Amazon Linux)
* csw: postgresql_dev (Solaris)
* brew: libpq (OSX)
If libpq is already installed, check that either:
(i) 'pkg-config' is in your PATH AND PKG_CONFIG_PATH contains
a libpq.pc file; or
(ii) 'pg_config' is in your PATH.
If neither can detect , you can set INCLUDE_DIR
and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------[ ERROR MESSAGE ]----------------------------
<stdin>:1:10: fatal error: libpq-fe.h: No such file or directory
compilation terminated.
-----------------------------------------------------------------------
ERROR: configuration failed for package ‘RPostgres’
* removing ‘/opt/R/4.3.3/lib/R/library/RPostgres’
The downloaded source packages are in
‘/tmp/RtmpFVocGF/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RPostgres") :
installation of package ‘RPostgres’ had non-zero exit status
I attempted the following:
sudo yum install postgresql-develsudo yum install libpq
which did install these things, but did not resolve the install error.
I tried export PATH=$PATH:/usr/pgsql-15/bin/pg_config as well (thinking this would address (ii) above, by adding pg_config to my PATH) but this also did not resolve the error. I can confirm that neither condition in (i) is true, nor do I know how to address them.
Other output requested in the referenced issues:
$ pkg-config --cflags libpq
Package libpq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpq.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpq', required by 'virtual:world', not found
... and the closest I can find to libpq.pc appears to be /usr/lib64/libpq.so
Metadata
Metadata
Assignees
Labels
No labels
Activity
krlmlr commentedon Jun 5, 2024
Thanks. Do you need
? I do wonder why it's not put on the PATH automatically.
jeroen commentedon Jun 5, 2024
FWIW I was able to install in rocky-8 using only
dnf install libpq-develwithout customizing any paths.baderstine commentedon Jun 5, 2024
Aha! This seems to have worked:
export PATH=$PATH:/usr/pgsql-15/bin(I also tried:
export PKG_CONFIG_PATH=/usr/lib64but this didn't work. I can confirm that theexport PATH ...fix above was thing that actually got it to work.)krlmlr commentedon Jun 5, 2024
Thanks, Jeroen. Should we then add:
or similar to the
configureoutput?baderstine commentedon Jun 5, 2024
When I try that, it doesn't seem to change anything:
baderstine commentedon Jun 6, 2024
I modified my .bashrc file to include
export PATH=$PATH:/usr/pgsql-15/binso that this would persist across sessions, although other users on the machine would need to modify their own .bashrc file. However, I would have thought that this would be added to the path by the dnf/yum install? Am I missing something?krlmlr commentedon Jun 9, 2024
Should this be raised with the maintainers of the relevant RHEL packages? It seems that we have a workaround here.