[R-SIG-Mac] C extension, Makevars ignores PKG_LIBS

Tyler Pirtle teeler at gmail.com
Tue Nov 8 18:21:33 CET 2011


Hi there,

I've got a sample C project I'm trying to get built correctly, but as
you may have guessed from the subject
line, the compilation is missing some things.


rtp-macbookpro:foo rtp$ R CMD INSTALL --build .
* installing to library
‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
* installing *source* package ‘foo’ ...
** Creating default NAMESPACE file
** libs
*** arch - i386
gcc-4.2 -arch i386 -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include    -fPIC  -g -O2 -c foo.c -o foo.o
foo.c:1:17: error: some_library.h: No such file or directory
...

Where foo.c includes some_library.h.

My makevars:
PKG_CFLAGS = -I/usr/include/some/library
PKG_LIBS = -lsomelib -L/usr/local/lib/somelib

As you can see from the gcc args that were constructed, my PKG_*
definitions are nowhere to be found. I thought it might have been
a problem with just my setup, but as it turns out I've not been able
to build _any_ C extensions for R packages on the mac at all.

What am I missing? ;)
Thanks,


Tyler



More information about the R-SIG-Mac mailing list