[R-pkg-devel] New package submission error (ieee_arithmetic)

Avraham Adler avraham.adler at gmail.com
Thu Nov 30 18:46:28 CET 2017

On Wed, Nov 29, 2017 at 4:37 PM, Waleed Almutiry <walmutir at uoguelph.ca> wrote:
> Hi all,
> I tried to upload my package to CRAN and did not pass the the incoming checks. This was because the use of ieee_arithmetic module in a fortran subroutine in the src folder. I built and checked the package using (R CMD build) and (R CMD check) under IOS system and it is working fine without errors. The gcc version in my system is (GNU Fortran (GCC) 5.2.0) while the gcc version in the CRAN system is 4.9.3. This is the message that I have got from the CRAN:
> I used the ieee_arithmetic in some subroutines to read and write results of Infinity values. I used it inside the subroutine as
> IF (ieee_support_inf(Inf)) THEN Inf = ieee_value(Inf, ieee_positive_inf) END IF

Hello, Waleed.

I handled Inf and NaN by writing a C function that passes the magic
code words R_NaN and INFINITY and called them as external functions in
Fortran. See the source code of 'utils_and_wrappers.c' and
'delaporte.f95' at [1] for a working example of "set_nan" and
"set_inf"ideas. Originally, I used the actual bitpatterns to make the
functions pure, if not elemental, but Soldaris SPARC through a fit
since it was the opposite endian from the rest of the known universe.
Using the magic R words will ensure that the proper values will be
passed regardless of platform.

Hope that helps,


[1] https://bitbucket.org/aadler/delaporte

More information about the R-package-devel mailing list