Index: /issm/trunk-jpl/jenkins/ross-debian_linux-binaries-solid_earth
===================================================================
--- /issm/trunk-jpl/jenkins/ross-debian_linux-binaries-solid_earth	(revision 24941)
+++ /issm/trunk-jpl/jenkins/ross-debian_linux-binaries-solid_earth	(revision 24942)
@@ -33,4 +33,5 @@
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+	--with-gmsh-dir=${ISSM_DIR}/externalpackages/gmsh/install
 '
 
Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 24941)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 24942)
@@ -515,8 +515,8 @@
 
 		AC_MSG_CHECKING(for Dakota version)
-		dnl TODO:	Check if this method applies to all other versions of
-		dnl 		(it should as long as the Dakota binaries have been
-		dnl 		compiled). If so, we can remove the other methods of
-		dnl 		getting the version.
+		dnl TODO:	Check if this method applies to all other versions of 
+		dnl			Dakota (it should as long as the Dakota binaries have been
+		dnl 		compiled). If so, we can remove the other methods of 
+		dnl			getting the version.
 		dnl
 		DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
@@ -2299,4 +2299,32 @@
 	AM_CONDITIONAL([NEOPZ], [test "x${HAVE_NEOPZ}" == "xyes"])
 	dnl }}}
+	dnl Gmsh{{{
+	AC_MSG_CHECKING([for Gmsh])
+	AC_ARG_WITH(
+		[gmsh-dir],
+		AS_HELP_STRING([--with-gmsh-dir=DIR], [Gmsh root directory]),
+		[GMSH_ROOT=${withval}],
+		[GMSH_ROOT="no"]
+	)
+	if test "x${GMSH_ROOT}" == "xno"; then
+		HAVE_GMSH=no
+	else
+		HAVE_GMSH=yes
+		if ! test -d "${GMSH_ROOT}"; then
+			AC_MSG_ERROR([Gmsh directory provided (${GMSH_ROOT}) does not exist!]);
+		fi
+	fi
+	AC_MSG_RESULT([${HAVE_GMSH}])
+	AM_CONDITIONAL([GMSH], [test "x${HAVE_GMSH}" == "xyes"])
+
+	if test "x${HAVE_GMSH}" == "xyes"; then
+		AC_DEFINE([_HAVE_GMSH_], [1], [with Gmsh in ISSM src])
+
+		AC_MSG_CHECKING(for Gmsh version)
+		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f1`
+		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
+		AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
+	fi	
+	dnl }}}
 	dnl Capabilities
 	dnl with-bamg{{{
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(revision 24941)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(revision 24942)
@@ -35,4 +35,12 @@
 else
 	echo "MPICH not found"
+	exit 1
+fi
+
+echo "Moving Gmsh binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+else
+	echo "Gmsh not found"
 	exit 1
 fi
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 24941)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 24942)
@@ -16,19 +16,5 @@
 
 	% Get Gmsh version
-	%
-	% NOTE:
-	% - The output of `gmsh -version` does not follow a consistent format 
-	%	across major versions.
-	% - Under Gmsh 3.*, output of `gmsh -info` needs to be explicitly 
-	%	redirected to console in order to be grep'ped.
-	% - May need to modify the regex supplied to `sed` for future Gmsh versions.
-	%
-	% TODO:
-	% - Move this so we can retrieve like we do with 
-	%	`IssmConfig(_DAKOTA_VERSION_)`.
-	%
-	[status,gmshmajorversion]=system('gmsh -info 2>&1 | grep "Version" | sed -e "s/Version[[:blank:]]*:[[:blank:]]//" | cut -d "." -f1');
-
-	gmshmajorversion=str2int(gmshmajorversion);
+    gmshmajorversion = IssmConfig('_GMSH_VERSION_MAJOR_');
 
 	if ~ismember([3,4],gmshmajorversion),
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 24941)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 24942)
@@ -1,7 +1,8 @@
-import commands
+import os
 import subprocess
 
 import numpy as np
 
+from IssmConfig import IssmConfig
 from MatlabFuncs import *
 from mesh3dsurface import *
@@ -27,19 +28,5 @@
 
     # Get Gmsh version
-    #
-    # NOTE:
-    # - The output of `gmsh -version` does not follow a consistent format 
-    #   across major versions.
-    # - Under Gmsh 3.*, output of `gmsh -info` needs to be explicitly 
-    #   redirected to console in order to be grep'ped.
-    # - May need to modify the regex supplied to `sed` for future Gmsh versions.
-    #
-    # TODO:
-    # - Move this so we can retrieve like we do with 
-    #   `IssmConfig(_DAKOTA_VERSION_)`.
-    #
-    gmshmajorversion = commands.getoutput('gmsh -info 2>&1 | grep "Version" | sed -e "s/Version[[:blank:]]*:[[:blank:]]//" | cut -d "." -f1')
-
-    gmshmajorversion = int(gmshmajorversion)
+    gmshmajorversion = IssmConfig('_GMSH_VERSION_MAJOR_')[0] # Stored as IssmDouble, which gets instantiated as a tuple in Python
 
     if gmshmajorversion not in [3, 4]:
@@ -56,5 +43,4 @@
     #initialize mesh:
     mesh = mesh3dsurface()
-
     #create .geo file:  {{{
     fid = open('sphere.geo', 'w')
Index: /issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp	(revision 24941)
+++ /issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp	(revision 24942)
@@ -107,4 +107,11 @@
 		#endif
 	}
+	else if(strcmp(name,"_GMSH_VERSION_MAJOR_")==0){
+		#ifdef _GMSH_VERSION_MAJOR_
+		value = IssmDouble(_GMSH_VERSION_MAJOR_);
+		#else
+		_error_("_GMSH_VERSION_MAJOR_ not found in config.h");
+		#endif
+	}
 	else if(strcmp(name,"ISSM_PREFIX")==0){
 		isstring = true;
