Fix broken conda(-forge) compilers on MacOS

I got stuck on this error for a long time:

ld: library not found for -lSystem

In the end, it turned out that the conda-build system was setting $CONDA_BUILD_SYSROOT to /opt/MacOSX10.10.sdk, which was a path that did not exist on my machine. I can't figure out where exactly the setting gets injected.

There may be a way to override it, but I thought it was easier just to make a symlink to that path. This command prints the sysroot for the main XCode install:

xcrun --show-sdk-path

Which may yield a result something like /Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk.

See also conda-forge/conda-forge.github.io#824.

Questions or comments? For better or worse this website isn’t interactive, so send me an email or, uh, Toot me.

To get notified of new posts, try subscribing to my lightweight newsletter or my RSS/Atom feed. No thirsty influencering — you get alerts about what I’m writing; I get warm fuzzies from knowing that someone’s reading!

See a list of all how-to guides.

On GitHub you can propose a revision to this guide or view its revision history.