make the PETSc code compile even if PETSc is not available
if PETSc is not available, the .cpp file will compile fine because it will be reduced to be empty, but trying to include LinearSolverPetsc.hpp in this case will result in an error.
This commit is contained in:
parent
9796066199
commit
fbec8c2300
@ -19,6 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#if HAVE_PETSC
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <opm/core/linalg/LinearSolverPetsc.hpp>
|
#include <opm/core/linalg/LinearSolverPetsc.hpp>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
@ -287,3 +290,4 @@ namespace{
|
|||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
|
#endif // HAVE_PETSC
|
||||||
|
@ -20,6 +20,11 @@
|
|||||||
|
|
||||||
#ifndef OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
|
#ifndef OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
|
||||||
#define OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
|
#define OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#if !HAVE_PETSC
|
||||||
|
#error "LinearSolverPetsc.hpp included, but the PETSc libraries are not available!"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
Loading…
Reference in New Issue
Block a user