How to build and install PL/R as a non-privileged user

compilingnot-root-userpostgresqlsoftware installation

There is a postgres instance, and I have the ability to build my own instance.

Using these instructions I ran:

USE_PGXS=1 make

which worked but then

USE_PGXS=1 make install

did not, with this error:

/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/mkinstalldirs '/usr/lib64/pgsql'
mkdir -p — /usr/share/pgsql/contrib
mkdir: cannot create directory `/usr/share/pgsql/contrib': Permission denied
make: * [installdirs] Error 1

Ideally I'd want to install this locally, but I do not know if that is possible.

I am on RedHat 5.

Best Answer

The pl/R list would probably be a better place to ask if you get stuck. Joe Conway also answers questions there. From a quick compile of the pl/R Debian package, it seems like you want to pass a DESTDIR argument to make. Something like

make DESTDIR=/home/...

Here is the make line from the Debian package

USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/8.4/bin/pg_config /usr/bin/make  -C . \   
CFLAGS="-g -Wall -O2" CXXFLAGS="-g -Wall -O2" CPPFLAGS="" LDFLAGS="" \
-I/usr/share/R/include PG_CPPFLAGS=-I/usr/share/R/include

and here is the make install line

USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/8.4/bin/pg_config /usr/bin/make  -C . \
CFLAGS="-g -Wall -O2" CXXFLAGS="-g -Wall -O2" CPPFLAGS="" LDFLAGS=""  USE_PGXS=1 \   
R_HOME=/usr/lib/R install DESTDIR=debian/tmp/

As you can see, there are a lot of other parameters you may want to set. Personally, I'd try to sweet talk your sys admin into installing a binary.

Related Question