Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 22416)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 22417)
@@ -49,5 +49,6 @@
 					 ./modules/Bamgx/Bamgx.cpp\
 					 ./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
-					 ./modules/BamgTriangulatex/BamgTriangulatex.cpp
+					 ./modules/BamgTriangulatex/BamgTriangulatex.cpp\
+					 ./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
 
 #do not include AmrBamg with ADOLC
@@ -304,5 +305,4 @@
 					./modules/ModelProcessorx/CreateOutputDefinitions.cpp\
 					./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\
-					./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\
 					./classes/Inputs/PentaInput.cpp\
 					./classes/Inputs/TetraInput.cpp
Index: /issm/trunk-jpl/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 22416)
+++ /issm/trunk-jpl/src/c/classes/FemModel.cpp	(revision 22417)
@@ -2513,5 +2513,5 @@
 
 /*AMR*/
-#if !defined(_HAVE_ADOLC_)
+#if !defined(_HAVE_ADOLC_) 
 void FemModel::ReMesh(void){/*{{{*/
 
@@ -2628,5 +2628,9 @@
 
 	/*Finally: interpolate all inputs and insert them into the new elements.*/
+	#ifdef _HAVE_BAMG_
 	this->InterpolateInputs(new_vertices,new_elements);
+	#else
+	_error_("Cannot interpolate inputs without bamg");
+	#endif
 
 	/*Delete old structure and set new pointers*/
@@ -2867,4 +2871,5 @@
 }
 /*}}}*/
+#ifdef _HAVE_BAMG_
 void FemModel::InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements){/*{{{*/
 	
@@ -2981,4 +2986,5 @@
 }
 /*}}}*/
+#endif
 void FemModel::WriteMeshInResults(void){/*{{{*/
 
@@ -3421,7 +3427,11 @@
 
 	/*Interpolate spc values and flags in the new partition*/
+	#ifdef _HAVE_BAMG_
 	InterpFromMeshToMesh2dx(&newspc,elementslist,x,y,numberofvertices,numberofelements,
 								spc,numberofvertices,numberofcols,
 								newx,newy,newnumberofvertices,NULL);
+	#else
+	_error_("cannot interpolate without bamg");
+	#endif
 	
 	/*Now, insert the interpolated constraints in the data set (constraints)*/
Index: /issm/trunk-jpl/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 22416)
+++ /issm/trunk-jpl/src/c/classes/FemModel.h	(revision 22417)
@@ -176,5 +176,7 @@
 		void CreateConstraints(Vertices* newfemmodel_vertices,int nodecounter,int constraintcounter,int analysis_enum,Constraints* newfemmodel_constraints);
 		void GetInputs(int* pnumP0inputs,IssmDouble** pP0inputs,int** pP0input_enums,int** pP0input_interp,int* pnumP1inputs,IssmDouble** pP1inputs,int** pP1input_enums,int** pP1input_interp);
+		#ifdef _HAVE_BAMG_
 		void InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements);
+		#endif
 		void UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int nodecounter,int analysis_counter,Elements* newelements);
 		void ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices);
Index: /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 22416)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 22417)
@@ -71,4 +71,6 @@
 	}
 	else if(strcmp(output,"delaunay")==0){
+
+		#ifdef _HAVE_BAMG_
 		int nobs,nel;
 		double *x     = NULL;
@@ -89,4 +91,7 @@
 		xDelete<double>(data);
 		xDelete<int>(index);
+		#else
+		_error_("you did not compile ISSM with bamg");
+		#endif
 	}
 	else if(strcmp(output,"nearestneighbor")==0){
Index: /issm/trunk-jpl/src/c/modules/modules.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/modules.h	(revision 22416)
+++ /issm/trunk-jpl/src/c/modules/modules.h	(revision 22417)
@@ -6,10 +6,14 @@
 #define _ISSM_MODULES_H_
 
+#ifdef _HAVE_BAMG_
+#include "./Bamgx/Bamgx.h"
+#include "./BamgConvertMeshx/BamgConvertMeshx.h"
+#include "./BamgTriangulatex/BamgTriangulatex.h"
+#include "./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h"
+#endif
+
 /*Modules: */
 #include "./AllocateSystemMatricesx/AllocateSystemMatricesx.h"
 #include "./AverageOntoPartitionx/AverageOntoPartitionx.h"
-#include "./Bamgx/Bamgx.h"
-#include "./BamgConvertMeshx/BamgConvertMeshx.h"
-#include "./BamgTriangulatex/BamgTriangulatex.h"
 #include "./Calvingx/Calvingx.h"
 #include "./Chacox/Chacox.h"
@@ -40,5 +44,4 @@
 #include "./InterpFromMesh2dx/InterpFromMesh2dx.h"
 #include "./InterpFromGridToMeshx/InterpFromGridToMeshx.h"
-#include "./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h"
 #include "./InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h"
 #include "./InterpFromMeshToGridx/InterpFromMeshToGridx.h"
