[Rd] R-extension in unix system -- help to locate header files

Simon Urbanek simon.urbanek at r-project.org
Fri Apr 18 18:38:33 CEST 2008


On Apr 18, 2008, at 11:49 AM, Kyeongmi Cheon wrote:

> Thank you for your reply. I'm really new to this unix system and let  
> me ask
> one more
> time to make sure if I understand it right.
>
> So I do it this way?
> 1. Change my codes to like below:
> #include <stdlib.h>
> #include <R.h>
> #include <Rdefines.h>
> #include <Rmath.h>
> #include <R_ext/Applic.h>
> #include <R_ext/PrtUtil.h>
>
> 2. and at the command line,
> set path = (/gpfs/data/local/linux/R-2.6.2/lib64/R/include $path)
> set path = (/gpfs/data/local/linux/R-2.6.2/lib64/R/include/R_ext  
> $path)
>

No. You're confusing PATH (I supposed) and compilation.


> Then what is about -I flags? I googled it but couldn't find anything.

I hope you didn't google for "-I" ;) Those flags (see man gcc for  
details) are added automatically when you compile code for R via R CMD  
SHLIB or R CMD INSTALL so you should not worry about it at all.
Please read "Writing R Extensions" manual, but before you do that you  
should familiarize yourself with the basics of C and compilation in  
the first place. The process it the same on both Windows and unix, so  
you should be using R CMD INSTALL for your package as you did on  
Windows without any changes.

Cheers,
Simon



More information about the R-devel mailing list