Skip to content

Add cxx_std_11 CMake compile feature to PCU#533

Merged
cwsmith merged 1 commit intodevelopfrom
apw/pcu-cxx11
Apr 14, 2026
Merged

Add cxx_std_11 CMake compile feature to PCU#533
cwsmith merged 1 commit intodevelopfrom
apw/pcu-cxx11

Conversation

@bobpaw
Copy link
Copy Markdown
Collaborator

@bobpaw bobpaw commented Apr 14, 2026

Add cxx_std_11 feature to PCU

std::unique_ptr was introduced in C++11 and is used by the new public PCU interface.

When the C++ standard is not set with CMAKE_CXX_STANDARD and does not default to at least C++11 for the selected compiler, errors are emitted when other projects try to link against PUMI. The default build behavior should be successful.

This change allows the C++11 requirement to propagate to targets that link against pcu. The default PUMI C++ standard is already C++11:

core/CMakeLists.txt

Lines 28 to 37 in 395d3a2

if(NOT ENABLE_CGNS AND NOT ENABLE_OMEGA_H)
message(STATUS "enabling cxx11")
bob_set_cxx_standard(11)
elseif(ENABLE_CGNS)
message(STATUS "enabling cxx14")
bob_set_cxx_standard(14)
elseif(ENABLE_OMEGA_H)
message(STATUS "enabling cxx17")
bob_set_cxx_standard(17)
endif()

This change propagates that setting outward for at least the pcu library (which the core links against, and so the library as a whole gets cxx_std_11 as a PUBLIC feature).

std::unique_ptr was introduced in C++11 and required for the new public PCU interface.
@bobpaw bobpaw requested a review from cwsmith April 14, 2026 17:07
@bobpaw
Copy link
Copy Markdown
Collaborator Author

bobpaw commented Apr 14, 2026

@cwsmith, we ran into errors when building a project that links against PUMI with a compiler that didn't default to C++11. We were using -DCMAKE_CXX_STANDARD=11 as a workaround but I wanted to get this fix into the upstream so that it isn't required.

@cwsmith
Copy link
Copy Markdown
Contributor

cwsmith commented Apr 14, 2026

/runtests

@github-actions
Copy link
Copy Markdown

Build Log
Simmetrix Test Result: success
Simmetrix + CGNS Test Result: success

Copy link
Copy Markdown
Contributor

@cwsmith cwsmith left a comment

Choose a reason for hiding this comment

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

Thank you.

@cwsmith cwsmith merged commit a3dd1d5 into develop Apr 14, 2026
21 checks passed
@cwsmith cwsmith deleted the apw/pcu-cxx11 branch April 14, 2026 17:25
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