Fortran vs C
Douglas Bates
bates@stat.wisc.edu
10 Apr 1999 17:00:07 -0500
>>>>> "Ross" == Ross Ihaka <ihaka@stat.auckland.ac.nz> writes:
Ross> To follow up the "eigen" issue. What should our position on
Ross> translating Fortran into C be? Should we leave as much code
Ross> as possible in Fortran or should we move it to C as much as
Ross> possible?
I can think of three different sets of circumstances:
a) creating new code: This one is obvious, just say "no" to Fortran.
b) enhancing existing code: For something small do the automatic
translation to C with f2c then modify the C sources and regard
those as the definitive version. For a big Fortran routine, try
to write a C wrapper around it and make modifications in the
wrapper.
c) using established code without modification (e.g. Eispack, Linpack):
Regard the Fortran sources as the definitive version and don't
translate.
Now that g77 is available and reasonably stable, a lot of the
motivation for using f2c is gone. There are still the messy linkage
issues when calling Fortran from C but most of those are now resolved
by the configure script. Passing character strings, etc. will
continue to be problematic but most of the legacy Fortran code we
would use will be strictly numerical routines with, we hope,
comparatively simple calling sequences. (Lapack is an exception in
that it uses strings to declare options but we aren't using Lapack.)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._