[R-pkg-devel] Proper way to express Fortran 2008 dependence for R package

Avraham Adler @vr@h@m@@d|er @end|ng |rom gm@||@com
Fri Feb 3 19:08:48 CET 2023


For closure, I was advised by Professor Ripley to both pass
"-std=f008" in Makevars and add "SystemRequirements: A version of
gfortran supporting Fortran 2008" to the DESCRIPTION. CRAN accepted
the package with those two changes. I also note that the R Daily News
of 2023-02-03 [1] has the following entry under "R-devel": ‘check’'s
‘checking compilation flags in Makevars’ has been relaxed to accept
the use of flags such as ‘-std=f2008’ in ‘PKG_FFLAGS’. Hopefully, this
means future packages will have an easier time relying on more modern
features, albeit they are 5 or 15 years old by now :).

Thank you,

Avi

[1]: https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2023/02/02#n2023-02-02

On Mon, Jan 30, 2023 at 12:12 AM Avraham Adler <avraham.adler using gmail.com> wrote:
>
> I would like to convert some of my hand-rolled Fortran code to Fortran
> intrinsics which entered the language in Fortran 2008, which should be
> extremely widely supported at this time. Specifically, I would like to
> use the log_gamma function and ieee_arithmetic functions and values.
> If it helps, the current package is at [1] and devel branch with new
> code is at [2].
>
> If I understand it correctly, WRE allows for dependence on Fortran
> 2008 by explicitly passing -std=f2008 in PKG_FFLAGS (WRE section 1.2.3
> Using F9x code [3]). However, checking a package as-cran with that
> addition delivers a warning (further confirmed by win-builder and
> rhub).
>
> My question is is it appropriate to submit a package with that warning
> and note it in the submission or is there a better way to express
> reliance on Fortran 2008. The implication from WRE 1.2.4 is that
> passing standards in Makevars is preferable to stating them in
> DESCRIPTION, at least as regards C++.
>
> What somewhat complicates matters is that if I build my package
> (Rtools43 on Windows 10) without passing "-std=f2008" it still builds
> properly and passes all the tests because Rtools43 is based on GCC12.2
> which supports Fortran 2008 intrinsics. So I can probably submit it
> without the flag, but someone with a very old Fortran installation may
> suffer.
>
> I understand being told I should just address CRAN directly, but I
> thought I would try the collected institutional memory here first.
>
> Thank you,
>
> Avi
>
> [1] https://github.com/aadler/Delaporte
> [2] https://github.com/aadler/Delaporte/tree/devel
> [3] https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-F9x-code



More information about the R-package-devel mailing list