Skip to content

Commit

Permalink
Ensure PETSc headers are included after bout/petsclib.hxx
Browse files Browse the repository at this point in the history
From that header:

> PETSc "helpfully" defines macros for MPI functions that clobber the
> real names, and short of `#undef`-ing all of them in every file
> that includes any PETSc header, we can define the following macro
> which should disable them, which I'm sure will work forever. This
> means we _must_ `#include` this header _before_ any PETSc header!

A recent commit reordered the PETSc headers in this file
  • Loading branch information
ZedThree committed Nov 8, 2024
1 parent bb5f194 commit 9347754
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/bout/petsc_interface.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <algorithm>
#include <iterator>
#include <memory>
#include <petscsystypes.h>
#include <petscvec.h>
#include <type_traits>
#include <vector>

Expand All @@ -52,6 +50,9 @@
#include <bout/region.hxx>
#include <bout/traits.hxx>

#include <petscsystypes.h>
#include <petscvec.h>

/*!
* A class which wraps PETSc vector objects, allowing them to be
* indexed using the BOUT++ scheme. Note that boundaries are only
Expand Down

0 comments on commit 9347754

Please sign in to comment.