I'm trying to install PL/R on Mountain Lion 10.8.2, I've installed R 2.15.3 from r-project and PostgreSQL 9.1 from KyngChaos. I've got PL/R 8.3.0.14 from http://www.joeconway.com/plr/. I've put the expanded folder in /usr/local/pgsql/share/contrib and cd'd into that folder.
The environment variables $R_HOME and $CUSTOM_COPT are set as instructed at http://www.joeconway.com/web/guest/pl/r/-/wiki/Main/Installation_Mac by writing them into .bash_profile, and also added /library/frameworks/r.framework/resources/bin to my path by writing to the same file.
XCode 4.6 and the Command Line Tools are installed. There are multiple copies of standard C header files, including stdio.h, for example there is /usr/include/stdio.h.
Next step seems to be:
DiMac:plr duncan$ make
Makefile:40: ../../src/Makefile.global: No such file or directory
Makefile:41: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.
That didn't work, and then I try:
DiMac:plr duncan$ make USE_PGXS=1
gcc -Os -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -arch x86_64 -I"." -I"-I/library/frameworks/r.framework/resources/include" -I/library/frameworks/r.framework/resources/include -I. -I. -I/usr/local/pgsql-9.1/include/server -I/usr/local/pgsql-9.1/include/internal -I/usr/include/libxml2 -DPKGLIBDIR=\"/usr/local/pgsql-9.1/lib\" -DDLSUFFIX=\".so\" -DR_HOME_DEFAULT=\"/library/frameworks/r.framework/resources\" -c -o plr.o plr.c
In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
from plr.h:38,
from plr.c:33:
/usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file or directory
/usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file or directory
...
and then pages more of errors.
It seems to me that make is looking in the wrong place for the standard header files and can't find them.From my reading around it seems that the flag -isysroot
is telling gcc to look for header files by prepending the normal search path(s) with the /developer.../macosx10.6.sdk
path and this path does not exist on my machine, which I believe is standard with the current version of Xcode.
So, the question:
Is this flag set somehow by the Makefile within /plr, or is it set somewhere else? Either way, how do I change it to get make to find the header files that it needs? If changing it is, indeed, the correct thing to do?