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

Stefan McKinnon Høj-Edwards sme at iysik.com
Thu Sep 14 16:56:00 CEST 2017


Oh. I was under the impression the risk of interference was only for stdout
and stderr.

I suspect the affected Fortran subroutines should be re-written in R or C.
Is writing to files with Rcpp affected by the interference?
Or would it be feasible to have the Fortran subroutine call a C subroutine
for writing to files?

Thanks in advance,
Stefan

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

2017-09-14 15:27 GMT+01:00 Duncan Murdoch <murdoch.duncan at gmail.com>:

> 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
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list