[Rd] include dll in R-package

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Aug 31 14:33:16 CEST 2012

On 30/08/2012 16:59, LIYING HUANG wrote:
> One very simple question, probably not appropriate to post this to rdevel list,
> I put all Fortran files in src, when I do R CMD check, it tries to compile
> the files by alphabetical order. I tried to modify Makevar, but no luck
> after staring at the manual for hours. It seems that I could use R CMD SHLIB
> as following to compile the codes first to get around this problem before
> doing "R CMD check", but I am curious how to specify the file compilation order
> in Makevar? Thanks!

Well, it is in the manual you stared at ....  However, for Fortran the 
order of compilation never matters.   If you have Fortran90 modules, it 
may and that is why Makefiles can have dependencies.

1) You can set OBJECTS to set the order.

2) To avoid problems with parallel makes you should set dependencies, e.g.

constants.o: error_handler.o

or more likely some module file.

Beyond that, R-devel is indeed not the place for a tutorial on Makefiles 
and compilation.

> R CMD SHLIB -o lcca.dll error_handler.f90 constants.f90
> Liy
> ----- Original Message -----
> From: "Berend Hasselman" <bhh at xs4all.nl>
> To: "LIYING HUANG" <lxh37 at psu.edu>
> Cc: "Kasper Daniel Hansen" <kasperdanielhansen at gmail.com>, r-devel at r-project.org
> Sent: Tuesday, August 28, 2012 7:02:02 AM
> Subject: Re: [Rd] include dll in R-package
> On 28-08-2012, at 01:29, LIYING HUANG wrote:
>> I am quite new in R, I looked at R manual- how to build R Package,
>> still not very clear. Yes, it would be very helpful if I could
>> download a package having Fortran source codes to look at, Do
>> you know any package built with Fortran source code? Thanks!
> To mention a few:
> deSolve
> minpack.lm
> nleqslv
> rootSolve
> xts
> and probably many more.
> Berend
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list