[R-pkg-devel] .Fortran opinion

Neal Fultz n|u|tz @end|ng |rom gm@||@com
Sun May 26 21:21:22 CEST 2019


I think the current best practice is to wrap the Fortran code in a C
helper, and invoke that using .Call - more information on that is available
in Hadley's book - http://adv-r.had.co.nz/C-interface.html

It shouldn't be too much work, maybe another 10-20 lines of code, most of
which could probably autogenerated using Rcpp if you wanted to take that
route.

On Sun, May 26, 2019 at 6:31 AM Berry Boessenkool <
berryboessenkool using hotmail.com> wrote:

>
> Recently, users of my package rdwd have provided Fortran code for a nice
> extension of the package.
> According to the following site, calling .Fortran() is no longer
> recommended:
> https://github.com/wrathematics/Romp/blob/master/README.md#fortran
>
> Since this is my first time using native code, I'd highly appreciate any
> thoughts on the following question:
> How much additional work should I put into avoiding .Fortran() for
> long-term CRAN suitability?
>
> Thanks ahead,
> Berry
>
> PS: In case you want a look at the (two very short) Fortran routines:
> https://github.com/brry/rdwd/tree/master/src
> and their call in R:
> https://github.com/brry/rdwd/blob/master/R/readRadarFile.R#L119
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list