mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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
244871829d
commit
503c7d1ca8
@ -19,6 +19,9 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_PETSC
|
||||
|
||||
#include <cstring>
|
||||
#include <opm/core/linalg/LinearSolverPetsc.hpp>
|
||||
#include <unordered_map>
|
||||
@ -287,3 +290,4 @@ namespace{
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // HAVE_PETSC
|
||||
|
@ -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 <opm/core/linalg/LinearSolverInterface.hpp>
|
||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||
#include <string>
|
||||
|
Loading…
Reference in New Issue
Block a user