Incorrect defaulting of CC/CXX on macOS
From INSTALL.md:
On macOS, UPC++ defaults to using the Apple LLVM clang compiler that is part of the Xcode Command Line Tools.
Due to a script bug affecting all current releases, this defaulting is not working correctly for macOS.
Specifically, if the user does not set $CC
and $CXX
, then the first instances of {gcc,g++}
in the user $PATH
are always used. This means that if homebrew/fink versions of GCC appear in $PATH
before /usr/bin
(a common practice), then the install script will default to those instead.
There are two secondary effects of this installer bug when the compiler is defaulted:
- the compiler version info printed early in the install output may not reference the compiler actually being used
- the compiler compatibility checks performed early in install may be performed against the wrong compiler.
The recommended workaround is for macOS users to explicitly set the variables to select a compiler by full pathname, eg:
env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./install <install-path>
This is highly recommended as the first step when triaging any install/build issues on macOS until this defect is repaired.
Comments (4)
-
reporter -
reporter - changed status to resolved
issue
#209: Broken install defaulting of CC/CXX on macOSRemove the explicit subshell in platform_sanity_checks that was preventing its defaulting modifications to CC/CXX from propagating to the install script caller.
Add missing exports to ensure that defaulted CC/CXX are passed to nobs.
Convert most temporary variables to explicit locals to prevent their propagation.
Resolves issue
#209.→ <<cset 0fd8fd82aee1>>
-
reporter issue
#209: Broken install defaulting of CC/CXX on macOSRemove the explicit subshell in platform_sanity_checks that was preventing its defaulting modifications to CC/CXX from propagating to the install script caller.
Add missing exports to ensure that defaulted CC/CXX are passed to nobs.
Convert most temporary variables to explicit locals to prevent their propagation.
Resolves issue
#209.(cherry picked from commit 0fd8fd82aee107f013d91cc1084ff257599611e5)
→ <<cset 4b4d7f9e0a90>>
-
reporter This issue is fixed in the 2019.3.2 release
- Log in to comment
Proposed solution in pull request #83