Skip to content

Fix gcc 12 compilation - #4160

Merged
dkachuma merged 2 commits into
fix/paludettomag1/pygeosx-cpp20from
dkachuma/fix-compositional-utility-gcc-12
Oct 9, 2026
Merged

dkachuma merged 2 commits into
fix/paludettomag1/pygeosx-cpp20from
dkachuma/fix-compositional-utility-gcc-12

Conversation

@dkachuma

@dkachuma dkachuma commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

On gcc 12 on one of our machines, I'm getting the error below. This is the proposed fix

coreComponents/physicsSolvers/multiphysics/CMakeFiles/multiPhysicsSolvers.dir/__/__/__/generatedSrc/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/PoromechanicsKernels_CellElementSubRegion_PorousSolid_DruckerPragerExtended__ConstantPermeability__H1_Hexahedron_Lagrange1_GaussLegendre2.cpp.o] Error 1
In file included from /src/geos/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp:28,
                 from /build/geos/release/generatedSrc/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/PoromechanicsKernels_CellElementSubRegion_PorousSolid_DruckerPragerExtended__ConstantPermeability__H1_Wedge_Lagrange1_Gauss6.cpp:17:
In function ‘void geos::compositionalMultiphaseUtilities::shiftBlockRowsAheadByOneAndReplaceFirstRowWithColumnSum(geos::integer, geos::integer, geos::integer, geos::integer, MATRIX&&, VEC&&) [with MATRIX = double (&)[3][18]; VEC = double (&)[18]]’,
    inlined from ‘void geos::compositionalMultiphaseUtilities::shiftRowsAheadByOneAndReplaceFirstRowWithColumnSum(geos::integer, geos::integer, MATRIX&&, VEC&&) [with MATRIX = double (&)[3][18]; VEC = double (&)[18]]’ at /src/geos/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseUtilities.hpp:219:58,
    inlined from ‘geos::real64 geos::poromechanicsKernels::MultiphasePoromechanics<SUBREGION_TYPE, CONSTITUTIVE_TYPE, FE_TYPE>::complete(geos::localIndex, StackVariables&) const [with SUBREGION_TYPE = geos::CellElementSubRegion; CONSTITUTIVE_TYPE = geos::constitutive::PorousSolid<geos::constitutive::DruckerPragerExtended, geos::constitutive::ConstantPermeability>; FE_TYPE = geos::finiteElement::H1_Wedge_Lagrange1_Gauss6_impl]’ at /src/geos/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp:668:55:
/src/geos/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseUtilities.hpp:189:26: error: iteration 2147483646 invokes undefined behavior [-Werror=aggressive-loop-optimizations]
  189 |         mat[i][j] = mat[i-1][j];
      |                         ~^~
/src/geos/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseUtilities.hpp:185:29: note: within this loop
  185 |     for( integer i = ind; i > firstRow; --i )
      |                           ~~^~~~~~~~~~
cc1plus: all warnings being treated as errors

@victorapm victorapm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, Dick! We could merge this into #4156

@dkachuma
dkachuma changed the base branch from develop to fix/paludettomag1/pygeosx-cpp20 October 9, 2026 14:30
@dkachuma
dkachuma merged commit 76fd2ad into fix/paludettomag1/pygeosx-cpp20 Oct 9, 2026
14 of 20 checks passed
@dkachuma
dkachuma deleted the dkachuma/fix-compositional-utility-gcc-12 branch October 9, 2026 14:36
OmarDuran pushed a commit that referenced this pull request Oct 14, 2026
* Fix gcc 12 build

* Fix code style

* Update LvArray

* Fix gcc 12 compilation (#4160)

---------

Co-authored-by: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com>
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