Index: /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 11729)
+++ /issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp	(revision 11730)
@@ -91,5 +91,7 @@
 		/*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++ 
 		 * correctly: */
-		MatFree(&(*pv)->matrix);
+		#ifdef _HAVE_PETSC_
+			MatFree(&(*pv)->matrix);
+		#endif
 		#endif
 		*pv=NULL;
@@ -108,5 +110,7 @@
 		/*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++ 
 		 * correctly: */
-		VecFree(&(*pv)->vector);
+		#ifdef _HAVE_PETSC_
+			VecFree(&(*pv)->vector);
+		#endif
 		#endif
 		*pv=NULL;
