diff --git a/opm/core/linalg/LinearSolverPetsc.cpp b/opm/core/linalg/LinearSolverPetsc.cpp index 57823aad2..89521aff5 100644 --- a/opm/core/linalg/LinearSolverPetsc.cpp +++ b/opm/core/linalg/LinearSolverPetsc.cpp @@ -19,6 +19,9 @@ */ #include "config.h" + +#if HAVE_PETSC + #include #include #include @@ -287,3 +290,4 @@ namespace{ } // namespace Opm +#endif // HAVE_PETSC diff --git a/opm/core/linalg/LinearSolverPetsc.hpp b/opm/core/linalg/LinearSolverPetsc.hpp index c5ba9a504..e8b9931c5 100644 --- a/opm/core/linalg/LinearSolverPetsc.hpp +++ b/opm/core/linalg/LinearSolverPetsc.hpp @@ -20,6 +20,11 @@ #ifndef 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 #include #include