Index: /issm/trunk-jpl/src/m/os/dakotaversion.m
===================================================================
--- /issm/trunk-jpl/src/m/os/dakotaversion.m	(revision 14251)
+++ /issm/trunk-jpl/src/m/os/dakotaversion.m	(revision 14251)
@@ -0,0 +1,26 @@
+function DAKOTA_VERSION=dakotaversion()
+%DAKOTAVERSION - recover dakota version number, inside config.h file
+%
+%   Usage:
+%       DAKOTA_VERSION=dakotaversion();
+
+%default
+DAKOTA_VERSION=0;
+
+configfile=[issmdir() '/externalpackages/dakota/install/include/dakota_config.h'];
+if ~exist(configfile,'file'),
+	error(['File ' configfile ' not found. Dakota has not been configured yet!']);
+end
+
+%go through the file, and recover the line we want
+fid=fopen(configfile,'r');
+if(fid==-1), error(['could not open file: ' configfile]); end
+
+while(true),
+	tline=fgets(fid);
+	if ~ischar(tline), break, end
+	if  strncmp(tline,'#define PACKAGE_VERSION',23),
+		DAKOTA_VERSION=strtrim(strrep(tline(25:end),'"',''));
+	end
+end
+fclose(fid);
Index: /issm/trunk-jpl/src/m/os/dakotaversion.py
===================================================================
--- /issm/trunk-jpl/src/m/os/dakotaversion.py	(revision 14251)
+++ /issm/trunk-jpl/src/m/os/dakotaversion.py	(revision 14251)
@@ -0,0 +1,34 @@
+import os
+from issmdir import *
+from MatlabFuncs import *
+
+def dakotaversion():
+	"""
+	DAKOTAVERSION - recover dakota version number, inside dakota_config.h file
+ 
+	   Usage:
+	      DAKOTA_VERSION=dakotaversion();
+	"""
+
+	#default
+	DAKOTA_VERSION=0
+
+	configfile=os.path.join(issmdir(),'externalpackages','dakota','install','include','dakota_config.h')
+	if not os.path.exists(configfile):
+		raise RuntimeError("File '%s' not found. Dakota has not been configured yet!" % configfile)
+
+	#go through the file, and recover the line we want
+	try:
+		fid=open(configfile,'r')
+	except IOError as e:
+		raise IOerror("could not open file: '%s'" % configfile)
+
+	for tline in fid:
+		if strncmp(tline,'#define PACKAGE_VERSION',23):
+			DAKOTA_VERSION=tline[24:].replace('"','').strip()
+			break
+
+	fid.close()
+
+	return DAKOTA_VERSION
+
