Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 661)
+++ /issm/trunk/src/c/Makefile.am	(revision 662)
@@ -295,4 +295,6 @@
 					./objects/Friction.h\
 					./objects/Friction.cpp\
+					./objects/DakotaPlugin.h\
+					./objects/DakotaPlugin.cpp\
 					./objects/Node.h\
 					./objects/Node.cpp\
@@ -542,4 +544,6 @@
 					./parallel/SpawnCore.cpp\
 					./parallel/ProcessResults.cpp\
+					./parallel/qmu.cpp\
+					./parallel/DakotaResponses.cpp\
 					./parallel/OutputResults.cpp
 
Index: /issm/trunk/src/c/objects/DakotaPlugin.cpp
===================================================================
--- /issm/trunk/src/c/objects/DakotaPlugin.cpp	(revision 661)
+++ /issm/trunk/src/c/objects/DakotaPlugin.cpp	(revision 662)
@@ -2,15 +2,4 @@
  */ 
 
-#include "DakotaResponse.H"
-#include "ParamResponsePair.H"
-#include "DakotaPlugin.h"
-#include "system_defs.h"
-#include "ProblemDescDB.H"
-#include "ParallelLibrary.H"
-
-#include "../shared/shared.h"
-#include "../include/macros.h"
-#include "../objects/objects.h"
-#include "../parallel/parallel.h"
 
 #ifdef HAVE_CONFIG_H
@@ -20,6 +9,22 @@
 #endif
 
+/*Standard ISSM includes: */
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "../objects/objects.h"
+#include "../parallel/parallel.h"
+
+/*Standard includes: */
 #include <string>
 
+#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
+
+//Dakota headers
+#include "DakotaResponse.H"
+#include "ParamResponsePair.H"
+#include "DakotaPlugin.h"
+#include "system_defs.h"
+#include "ProblemDescDB.H"
+#include "ParallelLibrary.H"
 
 namespace SIM {
@@ -91,2 +96,5 @@
 
 } // namespace SIM
+
+
+#endif //only works if dakota library has been compiled in.
Index: /issm/trunk/src/c/objects/DakotaPlugin.h
===================================================================
--- /issm/trunk/src/c/objects/DakotaPlugin.h	(revision 661)
+++ /issm/trunk/src/c/objects/DakotaPlugin.h	(revision 662)
@@ -8,4 +8,7 @@
 #ifndef DAKOTAPLUGIN_H
 #define DAKOTAPLUGIN_H
+
+
+#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
 
 #include "DirectApplicInterface.H"
@@ -43,4 +46,6 @@
 } // namespace SIM
 
+#endif //only works if dakota library has been compiled in.
+
 
 #endif
Index: /issm/trunk/src/c/parallel/diagnostic.cpp
===================================================================
--- /issm/trunk/src/c/parallel/diagnostic.cpp	(revision 661)
+++ /issm/trunk/src/c/parallel/diagnostic.cpp	(revision 662)
@@ -103,6 +103,10 @@
 		/*run qmu analysis: */
 		_printf_("calling qmu analysis on diagnostic core:\n");
-		
-		//qmu(qmuinname,qmuoutname,qmuerrname,&femmodels[0],inputs,DiagnosticAnalysisEnum(),NoneAnalysisEnum());
+	
+		#ifdef _HAVE_DAKOTA_ 
+		qmu(qmuinname,qmuoutname,qmuerrname,&femmodels[0],inputs,DiagnosticAnalysisEnum(),NoneAnalysisEnum());
+	 	#else
+		throw ErrorException(__FUNCT__," Dakota not present, cannot do qmu!");
+		#endif
 	}
 
Index: /issm/trunk/src/c/parallel/qmu.cpp
===================================================================
--- /issm/trunk/src/c/parallel/qmu.cpp	(revision 661)
+++ /issm/trunk/src/c/parallel/qmu.cpp	(revision 662)
@@ -12,4 +12,12 @@
 #define __FUNCT__ "qmu"
 
+#include "../objects/DakotaPlugin.h"
+#include "../shared/shared.h"
+#include "../include/macros.h"
+#include "parallel.h"
+
+
+#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
+
 #include "ParallelLibrary.H"
 #include "ProblemDescDB.H"
@@ -18,8 +26,4 @@
 #include "DakotaInterface.H"
 
-#include "../objects/DakotaPlugin.h"
-#include "../shared/shared.h"
-#include "../include/macros.h"
-#include "parallel.h"
 
 void qmu(const char* dakota_input_file,const char* dakota_output_file,const char* dakota_error_file, FemModel* femmodels,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
@@ -94,2 +98,5 @@
 	}
 }
+
+#endif //only works if dakota library has been compiled in.
+
