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

Unable to install in R #117

Open
xiw588 opened this issue Oct 28, 2021 · 6 comments
Open

Unable to install in R #117

xiw588 opened this issue Oct 28, 2021 · 6 comments

Comments

@xiw588
Copy link

xiw588 commented Oct 28, 2021

I am trying to install the package in r but kept receiving the following error messages and was unable to install.

trying URL 'https://mirrors.nics.utk.edu/cran/src/contrib/RPostgreSQL_0.7-3.tar.gz'
Content type 'application/x-gzip' length 580771 bytes (567 KB)

downloaded 567 KB

  • installing source package ‘RPostgreSQL’ ...
    ** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
    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 we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking target system type... x86_64-pc-linux-gnu
    checking for pg_config... no
    configure: checking for PostgreSQL header files
    configure: Checking include /usr/include.
    configure: Checking include /usr/include/postgresql.
    configure: Checking include /usr/local/include.
    configure: Checking include /usr/local/include/postgresql.
    configure: Checking include /usr/local/pgsql/include.
    configure: Checking include /usr/local/postgresql/include.
    configure: Checking lib /usr/lib.
    configure: Checking lib /usr/lib/postgresql.
    configure: Checking lib /usr/local/lib.
    configure: Checking lib /usr/local/lib/postgresql.
    configure: Checking lib /usr/local/postgresql/lib.
    gcc -g -O2 -I -L conftest.c -lpq -o pqconftest
    conftest.c:1:22: fatal error: libpq-fe.h: No such file or directory
    #include <libpq-fe.h>
    ^
    compilation terminated.
    ./pqconftest
    ./configure: line 2852: ./pqconftest: No such file or directory
    system -lpq don't appear to work; use internal
    checking for "/libpq-fe.h"... no
    configure: creating ./config.status
    config.status: creating src/Makevars
    ** libs
    gcc -I/n/helmod/apps/centos7/Core/curl/7.45.0-fasrc01/include -I/n/helmod/apps/centos7/Core/bzip2/1.0.6-fasrc01/include -I -I/n/helmod/apps/centos7/Core/pcre/8.37-fasrc02/include -I/n/helmod/apps/centos7/Core/readline/6.3-fasrc02/include -L/n/helmod/apps/centos7/Core/bzip2/1.0.6-fasrc01/lib -L/n/helmod/apps/centos7/Core/pcre/8.37-fasrc02/lib -L/n/helmod/apps/centos7/Core/curl/7.45.0-fasrc01/lib -L/n/helmod/apps/centos7/Core/readline/6.3-fasrc02/lib64 -std=gnu99 -I"/n/helmod/apps/centos7/Core/R_core/3.5.1-fasrc01/lib64/R/include" -DNDEBUG -I -I/usr/local/include -fpic -g -O2 -c RS-DBI.c -o RS-DBI.o
    gcc -I/n/helmod/apps/centos7/Core/curl/7.45.0-fasrc01/include -I/n/helmod/apps/centos7/Core/bzip2/1.0.6-fasrc01/include -I -I/n/helmod/apps/centos7/Core/pcre/8.37-fasrc02/include -I/n/helmod/apps/centos7/Core/readline/6.3-fasrc02/include -L/n/helmod/apps/centos7/Core/bzip2/1.0.6-fasrc01/lib -L/n/helmod/apps/centos7/Core/pcre/8.37-fasrc02/lib -L/n/helmod/apps/centos7/Core/curl/7.45.0-fasrc01/lib -L/n/helmod/apps/centos7/Core/readline/6.3-fasrc02/lib64 -std=gnu99 -I"/n/helmod/apps/centos7/Core/R_core/3.5.1-fasrc01/lib64/R/include" -DNDEBUG -I -I/usr/local/include -fpic -g -O2 -c RS-PQescape.c -o RS-PQescape.o
    In file included from RS-PQescape.c:7:0:
    RS-PostgreSQL.h:23:26: fatal error: libpq-fe.h: No such file or directory

include "libpq-fe.h"

                      ^

compilation terminated.
make: *** [RS-PQescape.o] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’

@benz0li
Copy link

benz0li commented Oct 28, 2021

See Issue #116

@tomoakin
Copy link
Owner

Have you installed a postgresql-devel package with
sudo yum install postgresql-devel
or
sudo yum install postgresql[appropriate version no]-devel
?

@xiw588
Copy link
Author

xiw588 commented Oct 29, 2021

@tomoakin no..I was trying to install on cluster, not allowed to sudo

@xiw588
Copy link
Author

xiw588 commented Oct 29, 2021

@benz0li I tried install.packages("RPostgreSQL", configure.args = c(PG_INCDIR = "/usr/pgsql-11/include")) but same error

@tomoakin
Copy link
Owner

The first thing you should do is to find pg_config and put it in your PATH.
If there isn't on the system, I do not understand what is your idea to use PostgreSQL at all (where is the server running and are they accessible?)
Regardless of sudo privilege, you can compile and install the whole PostgreSQL under your home directory if you have sufficient capacity. Then you can direct the PATH to include them.
However, the PostgreSQL server normally requires to occupy certain resource (port etc.) for operation and belongs to the superuser control. You can use some non-default port, though.

@tomoakin
Copy link
Owner

The lesson of #116 is to ask the IT staff for necessary information.
If your include files aren't in /usr/pgsql-11/include,
install.packages("RPostgreSQL", configure.args = c(PG_INCDIR = "/usr/pgsql-11/include"))
will not help.

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

3 participants