[R-pkg-devel] Write and print Fortran commands yields Note in R CMD check

Duncan Murdoch murdoch.duncan at gmail.com
Thu Sep 14 16:27:33 CEST 2017


On 14/09/2017 9:20 AM, Stefan McKinnon Høj-Edwards wrote:
> Dear all,
> 
> I am in the process of preparing a R-package that uses Fortran subroutines,
> and upon R CMD check (both local and on win-builder), I receive the
> following Note:
> 
> File 'Siccuracy/libs/i386/Siccuracy.dll':
>    Found '_gfortran_st_write', possibly from 'write' (Fortran), 'print'
>      (Fortran)
>      Objects: 'converters.o', 'mutate_chips.o', 'plink.o'
> 
> 
> I use the write command in two ways: 1) writing to a file, and 2)
> convert a numeric value to a string.
> 
> For 1), it is the usual 'write(unit=int, fmt) vars'.
> 
> For 2), the 'write(nChar,*) ncol' is required for integer 'ncol' and
> character 'nChar'.
> 
> 
> These instances are the only occurrences of 'write' and 'print'. Can I
> ignore this Note?
> 

I suspect not.  The Writing R Extensions manual describes the problem: 
Fortran I/O initialization can interfere with the C I/O used by R.

This won't happen on all platforms, so it's really difficult for you to 
be sure your uses are safe.

The recommended way to handle this is to do all the I/O in R or C code.

Duncan Murdoch



More information about the R-package-devel mailing list