How to build a port with a different compiler
ryandesign at macports.org
Tue Dec 29 03:48:19 UTC 2020
Please Reply All so that the conversation stays on the list.
On Dec 28, 2020, at 20:04, Tom wrote:
> Because nearly no port is building here, I wanted to try a different compiler. But that is not the problem.
> And because of this error:
> Warning: The macOS 11.1 SDK does not appear to be installed. Ports may not build correctly.
> Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install’.
> I don’t want to install the cli tools over and over again.
Neither does anyone else, but there is or was a bug in macOS that deletes the CLT receipt. If that's still happening, file a bug report with Apple so that they fix it. We require the receipt to be present because that's the only way we know of to determine what version of the CLT you have installed. The receipt is also what Apple uses to know when your CLT is outdated, and without the receipt Apple won't invite you to update to later versions of the CLT.
A very small number of ports do some inadvisable things that cause that warning to appear, even if the SDK is present, for example qt5 and its subports: https://trac.macports.org/ticket/61736
On Dec 28, 2020, at 20:10, Tom wrote:
> and gcc builds faster executables than llvm.
I'm don't know anything about that. But llvm/clang is the official toolchain for use on macOS and has been for almost a decade so trying to contravene that is probably counterproductive.
Especially, trying to use g++ to build C++ software will cause tremendous problems due to a mismatch of C++ standard libraries. Use clang++ to build C++ software on macOS.
More information about the macports-users