“R.h” and “Rmath.h” are header files for an interface between R.app and C. But, they seems to be readable only through a R command ‘R CMD SHLIB something.c’
I wish to compile my native C program to include them using gcc. I’m using Snow Leopard where I’m not able to locate those header files!
Any help?
Please see the ‘Writing R Extensions’ manual about details, you can easily compile and link against Rmath.h and the standalone R Math library — but not R.h. (Which you can use via Rcpp / RInside but that is a different story.)
There are a number of examples floating around for use of libRmath, one is in the manual itself. Here is one I ship in the Debian package
r-mathlibcontaining this standalone math library:and on Linux you simply build like this (as I place the library and header in standard locations in the package; add -I and -L as needed on OS X)