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

[[llvm] Clearly document the OS X requirement for full XCode installation #571

Open
springmeyer opened this issue Mar 13, 2018 · 1 comment

Comments

@springmeyer
Copy link
Contributor

The llvm/clang++ compiler used and provided by mason needs a full XCode installation available. Otherwise you'll hit a warning like:

clang-5.0: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' [-Wmissing-sysroot]

And an error when the program tries to use something from the C standard library. For example:

fatal error: 'stdlib.h' file not found
#include <stdlib.h>
         ^~~~~~~~~~
1 error generated.

But this error will depend on what of the C standard library is being requested.

The way to solve this is for OS X users to install a full version of XCode.

This reliance on a full version of XCode is due to this line in our compiler config:

CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DDEFAULT_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
. It is possible we could try to get this working against the Command line tools install of C headers as well, but this is not something I've tried.

@springmeyer
Copy link
Contributor Author

Or, we could try to get the default build of LLVM changed such that it does work with the command line tools.

Debugging locally with @millzpaugh and @AllieOop we found that clang++ v5.0.1 from mason could be made to work without XCode (and only the "command line tools" install) by passing:

-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ -I/Library/Developer/CommandLineTools//usr/include/c++/v1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant