Skip to content

Using Fortran 95 in an R package?

3 messages · John Fox, Brian Ripley

#
Dear R-devel list members,

What's the best current advice about writing Fortran code for use in R
packages? The Writing R Extensions manual still says that the .Fortran
interface is primarily intended for FORTRAN 77 code. In particular, are
there portability issues if I use Fortran 95 in a package? For example, I
see that Rtools for Windows now include the gfortran compiler.

(I know that this question has come up before, but not, as far as I can see,
in the last year.)

Thanks,
 John

--------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox
#
On Sun, 9 Dec 2007, John Fox wrote:

            
Yes, there are still portability issues.  We do still see quite a few 
people using gcc3/g77 (especially on older Linux and commercial Unices) 
and there are further issues if you make use of subprogram names 
containing underlines.  We don't distribute a cross-building solution for 
Windows using gfortran (although one can be built, it will not be mature
until gcc 4.3.x is out).

However, I would not let that deter you: just use .f95 extensions on the 
Fortran 95 files and avoid underlines.  For Windows users you are 
effectively requiring R >= 2.6.0.

Brian
#
Dear Brian,

Thank you for this.

John