Hello Guys,
I am trying to build R using the Intel compilers: ICC, ICPC. The first time I
ran the built I got the error below:
mlutils.c(107): error: floating-point operation result is out of range
double NA_REAL = ML_NAN;
^
mlutils.c(108): error: floating-point operation result is out of range
double R_PosInf = ML_POSINF, R_NegInf = ML_NEGINF;
^
mlutils.c(108): error: floating-point operation result is out of range
double R_PosInf = ML_POSINF, R_NegInf = ML_NEGINF;
^
compilation aborted for mlutils.c (code 2)
I had to make a change to the mlutils.c file to avoid the issue, that problem is
related to the Intel ICC compiler:
http://software.intel.com/en-us/articles/floating-point-operation-result-out-of-range-in-static-initialization/
The workaround I tried first is to use some built in function:
#ifdef __INTEL_COMPILER
double NA_REAL = ((__builtin_nanl("")));
double R_PosInf = ((__builtin_huge_vall()));
double R_NegInf = ((-__builtin_huge_vall()));
#else
double NA_REAL = ML_NAN;
double R_PosInf = ML_POSINF, R_NegInf = ML_NEGINF;
#endif
Once I fix that issue, everything built without problems. However if I run the
"make check" to test R,
I got one issue:
Testing examples for package 'base'
Error: testing 'base' failed
Execution halted
make[3]: *** [test-Examples-Base] Error 1
This issue is related to the identical() function, it does not give the expected
output when using the arguments:
num.eq, single.NA, etc.
Here is an example:
> ### ------- Pickyness Flags : -----------------------------
>
> ## the infamous example:
> identical(0., -0.) # TRUE, i.e. not differentiated
[1] TRUE> identical(0., -0., num.eq = FALSE)
[1] TRUE> ## similar:
> identical(NaN, -NaN) # TRUE
[1] TRUE> identical(NaN, -NaN, single.NA=FALSE) # differ on bit-level
[1] TRUE> ## for functions:
> f <- function(x) x
> f
function (x)
x> g <- compiler::cmpfun(f)
> g
function (x)
x
<bytecode: 0x14840330>> identical(f, g)
[1] TRUE> identical(f, g, ignore.bytecode=FALSE)
[1] FALSE> ## Don't show:
> m0 <- m <- structure(cbind(I=1, a=1:3), foo = "bar", class
= "matrix")
> attributes(m0) <- rev(attributes(m))
> names(attributes(m0)) # 'dim' remains first, interestingly...
[1] "dim" "class" "foo"
"dimnames">
> stopifnot(identical(0, -0), !identical(0, -0, num.eq=FALSE),
+ identical(NaN, -NaN), !identical(NaN, -NaN, single.NA=FALSE),
+ identical(m, m0), !identical(m, m0, attrib.as.set=FALSE) )
Error: !identical(0, -0, num.eq = FALSE) is not TRUE
Do you have any idea what could be causing this issue?
Is that a correct way to initialize the Infinitive Positive,Infinitive Negative,
NA_REAL?
Any help would be appreciated.
Thanks in advance,
Humberto.
[[alternative HTML version deleted]]