I have been revising some FORTRAN 77 routines in R packages I have previously submitted. Since R is now using gfortan I experimented with some Fortran 90 code (array intrinsics primarily). So far the code is still in F77 fixed format, in files suffixed .f (not .f90), but incorporates some F90 constructs. It has worked fine in linux/R. I tried to follow the thread of previous discussions on this subject, but as fast as things are changing, it was somewhat dated, and not too definitive. I don't so my own Windows versions of packages, but rather rely on CRAN to do the conversions, and I don't want to send them code that won't work on Windows. Does anybody have extensive experience on what elements of F90 can be used in R packages for Windows? If R CMD SHLIB is happy with it, is it likely to work? Thanks, Dave -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ David W. Roberts office 406-994-4548 Professor and Head FAX 406-994-3190 Department of Ecology email droberts at montana.edu Montana State University Bozeman, MT 59717-3460
Dave Roberts wrote:> I have been revising some FORTRAN 77 routines in R packages I have > previously submitted. Since R is now using gfortan I experimented with > some Fortran 90 code (array intrinsics primarily). So far the code is > still in F77 fixed format, in files suffixed .f (not .f90), but > incorporates some F90 constructs. It has worked fine in linux/R. I > tried to follow the thread of previous discussions on this subject, but > as fast as things are changing, it was somewhat dated, and not too > definitive. > > I don't so my own Windows versions of packages, but rather rely on CRAN > to do the conversions, and I don't want to send them code that won't > work on Windows. Does anybody have extensive experience on what > elements of F90 can be used in R packages for Windows? If R CMD SHLIB > is happy with it, is it likely to work? > > Thanks, Dave >The Windows toolkit is also GCC, hence gfortran for new enough R. The thing to worry about is the "other" category of machines. Either oldish/specialized Unixes which ship with their own toolchains and optimized libraries, or commercial compilers like the ones from Intel. Brian Ripley and/or http://cran.r-project.org/doc/manuals/R-exts.html can fill you in on the details. See also Brian's reply to John Fox on December 9 ("I wouldn't let that deter you."). -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On Mon, 17 Dec 2007, Dave Roberts wrote:> I have been revising some FORTRAN 77 routines in R packages I have > previously submitted. Since R is now using gfortan I experimented with > some Fortran 90 code (array intrinsics primarily). So far the code is > still in F77 fixed format, in files suffixed .f (not .f90), but > incorporates some F90 constructs. It has worked fine in linux/R. I > tried to follow the thread of previous discussions on this subject, but > as fast as things are changing, it was somewhat dated, and not too > definitive.'Writing R Extensions' is both up-to-date and definitive, so please read the primary documentation. In particular, we have strengthened the comments about not using Fortran I/O, which can cause severe problems when using the GUI version of R under Windows (although we now have a workaround).> I don't so my own Windows versions of packages, but rather rely on CRAN > to do the conversions, and I don't want to send them code that won't > work on Windows. Does anybody have extensive experience on what > elements of F90 can be used in R packages for Windows? If R CMD SHLIB > is happy with it, is it likely to work?Since Windows' builds nowadays use gcc 4.2.1, if it works on your unspecified version of gfortran on Linux it will very likely work on Windows. And you can check that for yourself via win-builder.r-project.org. However, using F9x code suffixed .f is not portable, and there are plenty of other systems where it will fail, some of which would accept .f90 or .f95 extensions. See also my reply to John Fox: https://stat.ethz.ch/pipermail/r-devel/2007-December/047695.html -- 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
Apparently Analagous Threads
- Building packages with subroutine in fortran 90 under windows xp
- [LLVMdev] compiling the full SPEC CPU2000 suite to LLVM bytecode
- Problem building a DLL from Fortran 90 source under Windows (with solution)
- Linking R with Fortran 90: make: m2c: Command not found
- Fortran level mismatch between package and R