reconverse-darwin-arm8: compile with C++17 - Apple clang default C++98#3930
Open
lvkale wants to merge 1 commit into
Open
reconverse-darwin-arm8: compile with C++17 - Apple clang default C++98#3930lvkale wants to merge 1 commit into
lvkale wants to merge 1 commit into
Conversation
…++98) Apple clang still defaults to gnu++98; reconverse headers require C++17. Append -std=gnu++17 to CMK_CXX_FLAGS and also to CMK_NATIVE_CXX_FLAGS / CMK_SEQ_CXX_FLAGS, because conv-mach-darwin.sh snapshots those from CMK_CXX_FLAGS before this arch script runs (charmxi builds with NATIVE). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
an alternative fix is putting -std=gnu++17 in cc-clang.sh or conv-mach-darwin.sh so all darwin targets get it . @ritvikrao which is better? |
Contributor
I think this makes sense, I think C++17 should work for netlrts and multicore builds too (the other darwin targets we need) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apple clang still defaults to gnu++98; reconverse headers require C++17. Append -std=gnu++17 to CMK_CXX_FLAGS and also to CMK_NATIVE_CXX_FLAGS / CMK_SEQ_CXX_FLAGS, because conv-mach-darwin.sh snapshots those from CMK_CXX_FLAGS before this arch script runs (charmxi builds with NATIVE).
Problem
A fresh ./build charm++ reconverse-darwin-arm8 ... on macOS fails compiling charmxi with ~20 errors per file (alignas rejected, constexpr unknown, >> in template args requiring > >). Reconverse headers (included via xi-util.h → converse.h) require C++17, but Apple clang (tested: 16.0.0) still defaults to C++98 when no -std= flag is given — verified with clang++ -x c++ -dM -E /dev/null | grep __cplusplus → 199711L. The Linux arch files don't hit this because modern g++ defaults to gnu++17.
Fix (7 lines, mac arch file only)
Append -std=gnu++17 in src/arch/reconverse-darwin-arm8/conv-mach.sh to three flag sets:
Testing
On macOS 15 / Apple clang 16 / arm64:
No effect on any non-darwin arch.
🤖 Generated with Claude Code (https://claude.com/claude-code)