Hmm, you seem not to be running the very latest xcode CLT, but that is a good 
thing, because 4.5.1 is built with 16.2 which uses clang 16 like you do.

You seem to have some sort of issue with the include path. You could start by 
checking that you actually have the cmath include file. I have

/Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk/usr/include/c++/v1/cmath

so you should have the same thing with 15.2. 

You might also verify that you are actually running the C++ compiler and not 
the C compiler. And check that you can compile a simple C++ program.

-pd

> On 29 Aug 2025, at 20:09 , Lee Hsiang Liow <l.h.l...@nhm.uio.no> wrote:
> 
> New to the list.
> 
> Got a new laptop, running OS 15.5 Sequoia.
> R version 4.5.1 (2025-06-13) -- "Great Square Root"
> Have new Xcode, new gofortran
> 
> Trying to install an R package that runs C++, have the R dependencies, the 
> error in installation is:
> 
> ** using staged installation
> ** libs
> using C++ compiler: ‘Apple clang version 16.0.0 (clang-1600.0.26.6)’
> using SDK: ‘MacOSX15.2.sdk’
> [……. Removing some non relevant info……]
> 
> fatal error: 'cmath' file not found
>   37 | #include <cmath>
>      |          ^~~~~~~
> 1 error generated.
> 
> Can any one advise? Thank you!
> 
> 
> 
>       [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd....@cbs.dk  Priv: pda...@gmail.com

_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to