Fix broken conda(-forge) compilers on MacOS
2019 July 23
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.