[R-SIG-Mac] Link to headers lost? Headers not where they should be?

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Sat Oct 23 00:54:08 CEST 2021


Bryan,

you seen to be using non-standard compiler in /usr/local/clang4. Remove it and check you overrides - do you have some forgotten invalid ~/.R/Makeconf file? Remove those if you do - and check ~/.R for any old stuff. (In fact the latter will probably fix it alone).

Cheers,
Simon



> On Oct 23, 2021, at 11:29 AM, Bryan Hanson <hanson using depauw.edu> wrote:
> 
> I don’t know how/when this problem arose, but as of a few days ago, I can’t build source packages any longer.  I’ve been through quite a lot of resources looking for answers and no luck so far, so turning to the mercies of this list.
> 
> I have this problem with either R 4.1.1 or R 4.2.0  I’ve disabled .Rprofile and .cshrc files and the problem persists.  Running BigSur 10.16
> 
> When I try for instance to install MASS (as an example, the problem occurs with any pkg needing compilation) I see this:
> 
> [Abbott-2:~/Desktop] bryanhanson% R CMD INSTALL MASS
> * installing to library ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library’
> * installing *source* package ‘MASS’ ...
> ** package ‘MASS’ successfully unpacked and MD5 sums checked
> ** using staged installation
> ** libs
> /usr/local/clang4/bin/clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c MASS.c -o MASS.o
> MASS.c:18:10: fatal error: 'stdlib.h' file not found
> #include <stdlib.h>
>         ^~~~~~~~~~
> 1 error generated.
> make: *** [MASS.o] Error 1
> ERROR: compilation failed for package ‘MASS’
> * removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/MASS’
> * restoring previous ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/MASS’
> 
> I think this feedback says the compiler is present and working. 
> 
> Most resources about "fatal error: 'stdlib.h' file not found” end up being cases  of the headers are actually not installed.  However I can see the “missing” headers in /Library/Developer/CommandLineTools/usr/include/c++/v1 but I’m not sure this is place R is looking (information on the web is sometimes dated, and Apple seems to have moved things around in recent versions).  So my best guess is that R is looking elsewhere or doesn’t have a link to the correct location.  R Installation and Administration doesn’t appear to spell the location or I missed it.
> 
> I have carefully uninstalled Xcode (13) and re-installed it, and run Xcode-select —install (it thinks the CLTs are already installed).  This does not make any difference, the problem persists.  Restarting the machine after updates does not make a difference either.
> 
> Thanks for any suggestions, as I’m really stuck...
> 
> Bryan
> 
> 
>> sessionInfo()
> R version 4.1.1 Patched (2021-10-18 r81073)
> Platform: x86_64-apple-darwin17.0 (64-bit)
> Running under: macOS Big Sur 10.16
> 
> Matrix products: default
> BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
> LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
> 
> Random number generation:
> RNG:     Mersenne-Twister 
> Normal:  Inversion 
> Sample:  Rounding 
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base     
> 
> loaded via a namespace (and not attached):
> [1] compiler_4.1.1
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 



More information about the R-SIG-Mac mailing list