From simon.urbanek at r-project.org  Fri Apr 18 18:38:33 2008
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Fri, 18 Apr 2008 12:38:33 -0400
Subject: [Rd] R-extension in unix system -- help to locate header files
In-Reply-To: <16763526.post@talk.nabble.com>
References: <d9ad173c0804172123y6f5470fdh14a991b4bc168bc7@mail.gmail.com>
	<alpine.LFD.1.00.0804180608260.843@gannet.stats.ox.ac.uk>
	<16763526.post@talk.nabble.com>
Message-ID: <A5956AE2-72F5-487B-8F12-0355A853FB86@r-project.org>


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



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