Skip to content

Commit a576910

Browse files
author
ripley
committed
workaround for building standalone nmath with recent compilers
git-svn-id: https://svn.r-project.org/R/trunk@88128 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 5c133d6 commit a576910

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

doc/NEWS.Rd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@
6767
}
6868

6969
}
70+
71+
\section{\Rlogo CHANGES IN R 4.5.0 patched}{
72+
\subsection{BUG FIXES}{
73+
\itemize{
74+
\item Standalone \code{nmath} can be built again with early-2025
75+
versions of \command{clang}-based compilers such as LLVM
76+
\command{clang}\sspace{}20, Apple \command{clang}\sspace{}17 and Intel
77+
\command{icx}\sspace{}2025.0.
78+
}
79+
}
80+
}
81+
7082
\section{\Rlogo CHANGES IN R 4.5.0}{
7183
%% \subsection{SIGNIFICANT USER-VISIBLE CHANGES}{
7284
%% \itemize{

src/nmath/mlutils.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,20 @@ double R_pow_di(double x, int n)
105105
return pow;
106106
}
107107

108-
double NA_REAL = ML_NAN; // Intel icx will not compile this.
109-
// In R it is computed at runtime.
108+
/* It is not clear why these are being defined in standalone nmath:
109+
* but that they are is stated in the R-admin manual.
110+
*
111+
* In R NA_AREAL is a specific NaN computed during initialization.
112+
*/
113+
#if defined(__clang__) && defined(NAN)
114+
// C99 (optionally) has NAN, which is a float but will coerce to double.
115+
double NA_REAL = NAN;
116+
#else
117+
// ML_NAN is defined as (0.0/0.0) in nmath.h
118+
// Fails to compile in Intel ics 2025.0, Apple clang 17, LLVM clang 20
119+
double NA_REAL = ML_NAN;
120+
#endif
121+
110122
double R_PosInf = ML_POSINF, R_NegInf = ML_NEGINF;
111123

112124
#include <stdio.h>

0 commit comments

Comments
 (0)