Skip to content

bugfix: ignore Apple's "gcc" by default#17589

Merged
tgamblin merged 1 commit intodevelopfrom
fix-apple-gcc-detection
Jul 21, 2020
Merged

bugfix: ignore Apple's "gcc" by default#17589
tgamblin merged 1 commit intodevelopfrom
fix-apple-gcc-detection

Conversation

@tgamblin
Copy link
Copy Markdown
Member

@tgamblin tgamblin commented Jul 19, 2020

Apple's gcc is really clang. We previously ignored it by default but there was a regression in #17110.

Originally we checked for all clang versions with this, but I know of none other than gcc on macos that actually do this, so limiting to apple-clang should be ok.

  • Fix check for apple-clang in gcc.py to use version detection from spack.compilers.apple_clang
  • regression test

@tgamblin tgamblin added macOS compilers bugfix Something wasn't working, here's a fix labels Jul 19, 2020
@tgamblin tgamblin requested a review from alalazo July 19, 2020 07:32
@tgamblin tgamblin force-pushed the fix-apple-gcc-detection branch from 8c24055 to 20e136b Compare July 19, 2020 21:30
@tgamblin
Copy link
Copy Markdown
Member Author

tgamblin commented Jul 19, 2020

Another weirdness: when apple clang is run as gcc, it prints more output when you call gcc --version:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

The "Configured with..." line is new to me. I tweaked the regex to be multi-line to handle this.

@tgamblin tgamblin force-pushed the fix-apple-gcc-detection branch 2 times, most recently from e1a50b6 to 338b20a Compare July 20, 2020 00:00
Apple's gcc is really clang. We previously ignored it by default but
there was a regression in #17110.

Originally we checked for all clang versions with this, but I know of
none other than `gcc` on macos that actually do this, so limiting to
`apple-clang` should be ok.

- [x] Fix check for `apple-clang` in `gcc.py` to use version detection
  from `spack.compilers.apple_clang`
@tgamblin tgamblin force-pushed the fix-apple-gcc-detection branch from 338b20a to c681609 Compare July 20, 2020 18:02
@tgamblin tgamblin merged commit 897e80e into develop Jul 21, 2020
@alalazo alalazo deleted the fix-apple-gcc-detection branch July 21, 2020 03:20
becker33 pushed a commit that referenced this pull request Jul 23, 2020
Apple's gcc is really clang. We previously ignored it by default but
there was a regression in #17110.

Originally we checked for all clang versions with this, but I know of
none other than `gcc` on macos that actually do this, so limiting to
`apple-clang` should be ok.

- [x] Fix check for `apple-clang` in `gcc.py` to use version detection
  from `spack.compilers.apple_clang`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something wasn't working, here's a fix compilers macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants