From 6fe821c3593954a89383f1a15501f4e38e4d21b3 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 4 Jul 2013 18:20:59 +0000
Subject: [PATCH] fix compile

---
 Solver/linearSystemPETSc.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Solver/linearSystemPETSc.cpp b/Solver/linearSystemPETSc.cpp
index b458d8b2ba..dfd6069413 100644
--- a/Solver/linearSystemPETSc.cpp
+++ b/Solver/linearSystemPETSc.cpp
@@ -29,6 +29,7 @@ void linearSystemPETScBlockDouble::_kspCreate()
 
 linearSystemPETScBlockDouble::~linearSystemPETScBlockDouble()
 {
+#if (PETSC_VERSION_RELEASE == 0 || ((PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR >= 2)))
   if (_isAllocated) {
     MatDestroy(&_a);
     VecDestroy(&_b);
@@ -37,6 +38,16 @@ linearSystemPETScBlockDouble::~linearSystemPETScBlockDouble()
   if (_kspAllocated) {
     KSPDestroy(&_ksp);
   }
+#else
+  if (_isAllocated) {
+    MatDestroy(_a);
+    VecDestroy(_b);
+    VecDestroy(_x);
+  }
+  if (_kspAllocated) {
+    KSPDestroy(_ksp);
+  }
+#endif
 }
 
 void linearSystemPETScBlockDouble::addToMatrix(int row, int col,
-- 
GitLab