Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS header problem #61

Open
jennybc opened this issue Oct 15, 2019 · 1 comment
Open

macOS header problem #61

jennybc opened this issue Oct 15, 2019 · 1 comment
Labels
radmin personal R administration

Comments

@jennybc
Copy link
Member

jennybc commented Oct 15, 2019

On Mojave, one often needs to make some missing headers available:

https://silvae86.github.io/sysadmin/mac/osx/mojave/beta/libxml2/2018/07/05/fixing-missing-headers-for-homebrew-in-mac-osx-mojave/


Things are different on Catalina, for which the Mojave "fix" (the header-containing package) is not available. Summary courtesy of @kevinushey:

R 3.6.1-patched handles the issue by updating etc/Makeconf with:

CPPFLAGS = -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include

I think once could also fix the issue by putting that in their own ~/.R/Makevars file.
So I think the "do I have command line tools ready and installed?" checklist is now:

  1. xcode-select --install (make sure command line tools are installed)
  2. /usr/bin/git --version (may trigger the Xcode license agreement)
  3. Update ~/.R/Makevars, or (on Mojave) install the header-providing package.

Also worth saying: if someone has Xcode installed, but not command line tools, then regular command line tools will still work, even though compilation may fail (since R expects to find and use command line tools explicitly, as opposed to the version that might be bundled with Xcode).
And Xcode bundles its own version of command line tools, and the system binaries are smart enough to find and use whichever one happens to be installed.

@jennybc
Copy link
Member Author

jennybc commented Nov 18, 2019

More recent discovery by @kevinushey, shared in slack:

setting the environment variable

SDKROOT = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

appears to be enough to fix compilation for older versions of R on macOS Catalina (without having to edit Makevars or Makeconf)
I think this is the moral equivalent of passing -isysroot <...>, which newer versions of R do

@edavidaja edavidaja added the radmin personal R administration label Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
radmin personal R administration
Projects
None yet
Development

No branches or pull requests

2 participants