[R-SIG-Mac] unable to install from source packages needing compiled C code

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Thu Dec 2 21:56:16 CET 2021


Adrian,

please check your tools. The error looks like you may be mixing different compilers. So, first check that you are using Xcode tools (command line tools or Xcode itself doesn't matter) and not Homebrew or other non-Apple compilers as they need additional configuration. For example:

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

$ which clang
/usr/bin/clang

$ clang --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


If in doubt, you can always use
sudo xcode-select --install
to make sure you have the tools.

Second, make sure you don't have old overrides in ~/.R such as Makeconf or similar. Remove ~/.R if needed.

Finally, if you still have issues, please post the full output since you didn't give us any details whatsoever so we can only guess.

Cheers,
Simon



> On Dec 3, 2021, at 12:22 AM, Adrian Dușa <dusa.adrian using gmail.com> wrote:
> 
> Dear All,
> 
> I am not sure when this started, presumably after upgrading my OS to
> Monterey 12.0.1
> With packages needing compilation, under a Terminal I get this error:
> 
> /Library/Frameworks/R.framework/Resources/include/R.h:55:11: fatal error:
> 'stdlib.h' file not found
> # include <stdlib.h> /* Not used by R itself, but widely assumed in
> packages */
>          ^~~~~~~~~~
> 1 error generated.
> 
> I've searched over the Internet, the most common problem is the absence of
> the Command Line Tools, but I do have those installed.
> 
> An old topic mentioned installing:
> /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.
> pkg
> 
> However the /Library/Developer/CommandLineTools/ directory does not hold a
> "Packages" subdirectory.
> 
> Does anyone else have this problem?
> 
> Thanks very much in advance for any hint,
> Adrian
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> 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