[Rd] Small problem building a package containing .f90 source on Windows

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Aug 12 09:32:54 CEST 2006


On Fri, 11 Aug 2006, Jeffrey Lewis wrote:

> I am working on a package that includes some Fortran 90 source
> code, it builds and functions correctly, but I did run into a
> little problem when building the Windows version that I thought
> might of interest.
> 
> In 'Writing R Extensions' (2.3.1, 01 Jun 2006), the authors note
> that .f90 code can be used in packages on Windows if an F95
> compiler (such a gfortran) is installed and if the user
> 
> "...Set[s] F95 in MkRules to point to the installed compiler. Then
> R CMD SHLIB and R CMD INSTALL work for packages containing FORTRAN
> 90/95 source code." (p. 13)

R manuals have no page numbers, and you are probably using a non-standard 
page size (Americans do ignore ISO sizes).

> I found that it was also necessary to alter line 17 of
> gnuwin32/MakeDLL to include FCSOURCES in the list of variables
> that are used to form OBJSA.  Without making that addition,
> neither SHLIB nor INSTALL compiled my .f90 files (though they both
> used gfortran to build a .dll from the other object files that were
> correctly compiled from .c source).
> 
> Is this the correct solution to this problem?

Yes, this was fixed in R-devel recently (and spaces allowed in the 
relevant paths). To work around this you need to specify the F95 objects 
in your Makevars.win, e.g.

OBJS=$(FCSOURCES:.f90=.o)

I've just backported the fix to R-patched.

-- 
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