I frequently find that attempts to install R packages that include
C++ code encounter

/Users/.../Library/R/arm64/4.5/library/Rcpp/include/Rcpp/platform/compiler.h:37:10:
fatal error:
      'cmath' file not found
   37 | #include <cmath>
      |          ^~~~~~~

To rectify this, I manually prefix to the call to R with

PKG_CXXFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1

Is there a configuration step I am missing?  I believe this is a stock
installation of the R binary from CRAN, and a conventional installation of
Xcode (16.4).

> sessionInfo()
R version 4.5.1 (2025-06-13)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.7.2

Matrix products: default
BLAS:
/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRblas.0.dylib

LAPACK:
/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;
 LAPACK version 3.12.1

-- 
The information in this email is intended only for the p...{{dropped:15}}

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to