[Rd] Building R package with .c sub-routine files

William Dunlap wdunlap at tibco.com
Wed Sep 16 17:30:11 CEST 2009


> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of 
> pleydell at supagro.inra.fr
> Sent: Wednesday, September 16, 2009 7:35 AM
> To: Kjell Konis
> Cc: r-devel at r-project.org
> Subject: Re: [Rd] Building R package with .c sub-routine files
> 
> > Create a file named Makevars in the same directory and put the  
> > following line in it:
> >
> > OBJECTS=file1.o
> >
> > Then R CMD SHLIB will only compile file1.c.
> >
> > Kjell
> 
> Great, that's done the job nicely.

Note that this will fail if your compiler makes object
files with a different suffix, say ".obj".  Using the
conventional '.h' for included files fixes this problem
and helps others understand your code more quickly.

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com  

> 
> Many thanks
> David
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



More information about the R-devel mailing list