diff --git a/Geo/Homology.cpp b/Geo/Homology.cpp
index b04b8ffe84821abc298a9cf8b9f51550031d5a5c..debcba1a0aa8978db5662af6f74bba6a9c28d226 100644
--- a/Geo/Homology.cpp
+++ b/Geo/Homology.cpp
@@ -5,9 +5,12 @@
 //
 // Contributed by Matti Pellikka <matti.pellikka@tut.fi>.
  
-
 #include "Homology.h"
 
+#if defined(HAVE_POST)
+#include "PView.h"
+#endif
+
 #if defined(HAVE_KBIPACK)
 
 Homology::Homology(GModel* model, std::vector<int> physicalDomain, 
@@ -594,9 +597,10 @@ int Chain::createPGroup()
   if(!data.empty()){
     _model->storeChain(getDim(), entityMap, physicalMap);
     _model->setPhysicalName(getName(), getDim(), physicalNum);
-    
+#if defined(HAVE_POST)    
     // create PView for visualization
     new PView(getName(), "ElementData", getGModel(), data, 0, 1);
+#endif
   }
    
   return physicalNum;
diff --git a/Geo/Homology.h b/Geo/Homology.h
index 24d8963f0d53add3954a8bfc63c4b1b730f79395..9c75225296750cce8da708684f609f19ede9df59 100644
--- a/Geo/Homology.h
+++ b/Geo/Homology.h
@@ -13,7 +13,6 @@
 #include "ChainComplex.h"
 #include "OS.h"
 #include "GModel.h"
-#include "PView.h"
 #include "Options.h"
 
 #if defined(HAVE_KBIPACK)