[R-pkg-devel] 'write' call in Fortran gives NOTE when running R CMD check

Stefan McKinnon Høj-Edwards sme at iysik.com
Thu May 25 11:28:32 CEST 2017

Apologies for this double posting; I asked this on Stackoverflow, but
hasn't received much attention.

I have quite successfully implemented an R package with some Fortran
functions. Some of these functions needs to write to files, so naturally I
use the Fortran statement `write(unit, fmt) var`.

When running R CMD check on the compiled package, it spits out the
following NOTE:

checking compiled code ... NOTE
File 'Siccuracy/libs/i386/Siccuracy.dll':
  Found '_gfortran_st_write', possibly from 'write' (Fortran), 'print'
    Objects: 'dip.o', 'chips.o', 'link.o'
File 'Siccuracy/libs/x64/Siccuracy.dll':
  Found '_gfortran_st_write', possibly from 'write' (Fortran), 'print'
    Objects: 'dip.o', 'chips.o', 'link.o'

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor the system RNG.

By removing the `write` calls one-by-one from `dip.f95`, I found that only
when removing all `write` calls, did the note disappear (for that file at

I am using the `write` calls for two different things: 1) Writing to flat
text files, combinations of both integers and real values, and 2) Using
`write` to convert an integer to a character by doing `write(char, *) int`.

Do I have options here to avoid this NOTE from R CMD check?
And if not, can I still submit this package to CRAN while having this NOTE?

Stefan McKinnon Høj-Edwards
ph.d. Genetics
+44 (0)776 231 2464
+45 2888 6598
Skype: stefan_edwards

	[[alternative HTML version deleted]]

More information about the R-package-devel mailing list