Hi,
I am trying to install the newest version of RPostgreSQL on a linux cluster, where I have PostgreSQL-9.5.3 running.
Because the installation is in a non-standard location, I need to update my search path before that:
> export PATH=$PATH:postgres/bin
(I guess, the export command here is not necessary and PATH=$PATH:postgres/bin would be sufficient, but I am not sure. I tested both ways anyway)
Then I run R CMD INSTALL (which fails) and the last check tells me that pg_config was not found (and as a consequence libpg-fe.h, which is in postgres/include, can neither be found) . In the lines that follow, which list the places where the configure script has looked for the 'include' and 'lib' folders, my 'postgres' folder does not show up. So, does this mean my path has not been taken over by the configure script?
> R CMD INSTALL RPostgreSQL_0.4-1.tar.gz
* installing to library ‘/home/hpc/pr48co/gu28luf2/r/R-3.2.2/library’
* installing *source* package ‘RPostgreSQL’ ...
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for pg_config... no # pg_config is in ~/postgres/bin
configure: checking for PostgreSQL header files
configure: Checking include /usr/include.
configure: Checking include /usr/include/pgsql.
configure: Checking include /usr/include/postgresql.
configure: Checking include /usr/local/include.
configure: Checking include /usr/local/include/pgsql.
configure: Checking include /usr/local/include/postgresql.
configure: Checking include /usr/local/pgsql/include.
configure: Checking include /usr/local/postgresql/include.
configure: Checking include /opt/include.
configure: Checking include /opt/include/pgsql.
configure: Checking include /opt/include/postgresql.
configure: Checking include /opt/local/include.
configure: Checking include /opt/local/include/postgresql.
configure: Checking include /opt/local/include/postgresql84.
configure: Checking include /sw/opt/postgresql-8.4/include.
configure: Checking include /Library/PostgresPlus/8.4SS/include.
configure: Checking include /sw/include/postgresql.
configure: Checking lib /usr/lib.
configure: Checking lib /usr/lib/pgsql.
configure: Checking lib /usr/lib/postgresql.
configure: Checking lib /usr/local/lib.
configure: Checking lib /usr/local/lib/pgsql.
configure: Checking lib /usr/local/lib/postgresql.
configure: Checking lib /usr/local/pgsql/lib.
configure: Checking lib /usr/local/postgresql/lib.
configure: Checking lib /opt/lib.
configure: Checking lib /opt/lib/pgsql.
configure: Checking lib /opt/lib/postgresql.
configure: Checking lib /opt/local/lib.
configure: Checking lib /opt/local/lib/postgresql.
configure: Checking lib /opt/local/lib/postgresql84.
configure: Checking lib /sw/opt/postgresql-8.4/lib.
configure: Checking lib /Library/PostgresPlus/8.4SS/lib.
configure: Checking lib /sw/lib.
checking for "/libpq-fe.h"... no
I wonder, how I can tell R CMD INSTALL to find pg_config in postgres/bin. There are two options in R CMD INSTALL ( --configure-args and --configure-vars),
which I have tried with something like:
R CMD INSTALL RPostgreSQL_0.4-1.tar.gz --configure.args='PG_CONFIG=postgres/bin'
or
R CMD INSTALL RPostgreSQL_0.4-1.tar.gz --configure.args=postgres/bin/pg_bin
or
R CMD INSTALL RPostgreSQL_0.4-1.tar.gz --configure.vars='PG_CONFIG=postgres/bin/pg_bin'
but that does not work either.
I know that people (including me) have succeded in the past finding 'libpq-fe.h' by setting environmental variables like
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pg_config --includedir)
export LD_LIBRARY_PATH
but strangely this does not work anymore for me and, besides, it might me more resonable to resolve the issue upstream by making the configuration process find and use pg_config. (When I call pg_config on the command line it return correctly the location of include and lib.)
Any help is greatly appreciated!
Best,
Nelson Jaiva