build: SG-45024 - Support C++20 - #1399
Open
cedrik-fuoco-adsk wants to merge 11 commits into
Open
Conversation
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
MuMathLinear was the only consumer of the Eigen headers in src/pub, and used them for six operations: 3x3 and 4x4 multiply and inverse, plus a generic inverse and transpose over arbitrarily sized fixed arrays. Use Imath for the fixed size paths. It is already a hard dependency and was already on this target's include path. gjInverse() is used rather than inverse() because it makes no assumption about matrix convention -- RV stores translation in the last column, while Imath's affine fast path assumes the last row. The generic ?fixed_array overloads have no Imath equivalent, so they now use Gauss-Jordan elimination with partial pivoting. Two behavior changes: - Singular matrices return the identity instead of Eigen's inf/NaN, now consistent across all four inverse functions. - The generic overloads verify their argument is a square two dimensional array. Previously size(1) was read unconditionally, which indexes dimensions() out of bounds for a one dimensional argument, and Eigen's dynamic inverse() on a non-square map relied on an assert compiled out under NDEBUG. This also fixes transpose_mXX mapping its output with the input's dimensions. Verified with mu-interp that a non-affine projection matrix, an RV-convention translation matrix and a general 3x3 each round-trip to exact identity through inverse(), that A * B remains the A-times-B product rather than its transpose, and that the generic 5x5 inverse and transpose are unchanged. Removing the vendored copy is a separate change in openrv-pub. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…indings Patch ShibokenHelpers.cmake during PySide6 preparation to add -Wno-error=cast-function-type-mismatch and -Wno-cast-function-type-mismatch alongside the existing GNU warning flags. The generated CPython-style PyMethodDef casts otherwise produce thousands of Clang warnings. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
GCC does not recognize the Clang-specific flag, so add it only in the Clang branch of ShibokenHelpers.cmake rather than unconditionally. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Commit 0d53c20 renamed the `requires` members to `requires_`, but the clang-format run of that commit had been done while the identifier was still `requires`, which clang-format treats as the C++20 requires-clause keyword. The result was badly wrapped expressions such as: entry. requires_ = mode. requires_; Now that the identifier is no longer a keyword, clang-format collapses these back to normal statements. Applying it here means the affected files stop failing the clang-format pre-commit hook for anyone who touches them. No functional change: this commit is the output of the pinned clang-format hook and nothing else. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…C++17 otherwise) Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
cedrik-fuoco-adsk
marked this pull request as ready for review
September 4, 2026 13:59
cedrik-fuoco-adsk
requested review from
bernie-laberge and
eloisebrosseau
as code owners
September 4, 2026 13:59
|
|
||
| SET(RV_CPP_STANDARD | ||
| "${_RV_CPP_STANDARD}" | ||
| CACHE STRING "RV's general C++ coding standard" |
Contributor
There was a problem hiding this comment.
This is the only important finding from our AI friend. Adding FORCE at the end would save us some trouble I think:
cmake/defaults/rv_options.cmake:82 — RV_CPP_STANDARD is set as a cache var without FORCE, unlike RV_VFX_PLATFORM right above it. Existing build trees reconfigured to a newer VFX platform won't actually pick up C++20.
bernie-laberge
approved these changes
Sep 4, 2026
bernie-laberge
left a comment
Contributor
There was a problem hiding this comment.
LGTM thanks !
The only comment that we might address
- cmake/defaults/rv_options.cmake:82 — RV_CPP_STANDARD is set as a cache var without FORCE, unlike RV_VFX_PLATFORM right above it. Existing build trees reconfigured to a newer VFX platform won't actually pick up C++20.
…igure The C++ standard is derived from RV_VFX_PLATFORM, not user-set, so mark the cache entry with FORCE so reconfiguring an existing build tree to a newer platform updates the standard instead of keeping the first-configured value. Also restrict the cache STRINGS to the derived standard. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
… load/store Replace memcpy and direct ImathMatrix::x access with std::copy_n via getValue() when converting to/from Imath matrices, and remove the now unused <cstring> include. Also use std::abs instead of fabsf, expand a few single-line control statements with braces, and rename local variables for clarity. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Contributor
Author
|
All comments should be covered! |
eloisebrosseau
approved these changes
Sep 10, 2026
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.
SG-45024 - Support C++20
Linked issues
none
Summarize your change.
OpenRV-pub PR: shotgunsoftware/openrv-pub#22
Eigen will be re move from OpenRV-pub for both CY2025 and CY2026.
Describe the reason for the change.
Fix issues while compiling OpenRV with C++20 while staying backwards compatible with C++17.
Describe what you have tested and on which operating system.
MacOS and Linux
Testing Windows compilation with CI