Skip to content

Disable GNU extensions for CMake targets - #2072

Merged
paulromano merged 1 commit into
openmc-dev:developfrom
paulromano:turn-off-gnu-extensions
May 25, 2022
Merged

paulromano merged 1 commit into
openmc-dev:developfrom
paulromano:turn-off-gnu-extensions

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

A user ran into a build issue using gcc 7 building the latest branch of OpenMC. I was able to trace this down to the fact that CMake will by default turn on GNU compiler extensions (-std=gnu14 instead of -std=c++14), which apparently can cause a conflict for complex literals. The solution is to simply turn off GNU extensions using the CXX_EXTENSIONS target property.

@paulromano paulromano changed the title Disabled GNU extensions for CMake targets Disable GNU extensions for CMake targets May 23, 2022
@shimwell
shimwell self-requested a review May 23, 2022 21:53

@shimwell shimwell left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this with the same system that was previously failing to compile openmc and can confirm that this now compiles 🎉

Link to issue https://openmc.discourse.group/t/compile-error-no-match-for-operator/2065/4

@paulromano
paulromano merged commit 5107ef5 into openmc-dev:develop May 25, 2022
@paulromano
paulromano deleted the turn-off-gnu-extensions branch May 25, 2022 11:41
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
…sions

Disable GNU extensions for CMake targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants