Index: issm/trunk/m4/analyses.m4
===================================================================
--- issm/trunk/m4/analyses.m4	(revision 25836)
+++ issm/trunk/m4/analyses.m4	(revision 26744)
@@ -10,535 +10,1069 @@
 [
 
+dnl with-HydrologyTws{{{
+
+AC_ARG_WITH([HydrologyTws],
+
+	AS_HELP_STRING([--with-HydrologyTws = YES], [compile with HydrologyTws capabilities (default is yes)]),
+
+	[HYDROLOGYTWS=$withval],[HYDROLOGYTWS=yes])
+
+AC_MSG_CHECKING(for HydrologyTws capability compilation)
+
+
+HAVE_HYDROLOGYTWS=no 
+
+if test "x$HYDROLOGYTWS" = "xyes"; then
+
+	HAVE_HYDROLOGYTWS=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYTWS_],[1],[with HydrologyTws capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYTWS], [test x$HAVE_HYDROLOGYTWS = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYTWS)
+
+dnl }}}
 dnl with-AdjointBalancethickness2{{{
+
 AC_ARG_WITH([AdjointBalancethickness2],
+
 	AS_HELP_STRING([--with-AdjointBalancethickness2 = YES], [compile with AdjointBalancethickness2 capabilities (default is yes)]),
+
 	[ADJOINTBALANCETHICKNESS2=$withval],[ADJOINTBALANCETHICKNESS2=yes])
+
 AC_MSG_CHECKING(for AdjointBalancethickness2 capability compilation)
 
+
 HAVE_ADJOINTBALANCETHICKNESS2=no 
+
 if test "x$ADJOINTBALANCETHICKNESS2" = "xyes"; then
+
 	HAVE_ADJOINTBALANCETHICKNESS2=yes
+
 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS2_],[1],[with AdjointBalancethickness2 capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ADJOINTBALANCETHICKNESS2], [test x$HAVE_ADJOINTBALANCETHICKNESS2 = xyes])
+
 AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS2)
+
 dnl }}}
 dnl with-AdjointBalancethickness{{{
+
 AC_ARG_WITH([AdjointBalancethickness],
+
 	AS_HELP_STRING([--with-AdjointBalancethickness = YES], [compile with AdjointBalancethickness capabilities (default is yes)]),
+
 	[ADJOINTBALANCETHICKNESS=$withval],[ADJOINTBALANCETHICKNESS=yes])
+
 AC_MSG_CHECKING(for AdjointBalancethickness capability compilation)
 
+
 HAVE_ADJOINTBALANCETHICKNESS=no 
+
 if test "x$ADJOINTBALANCETHICKNESS" = "xyes"; then
+
 	HAVE_ADJOINTBALANCETHICKNESS=yes
+
 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS_],[1],[with AdjointBalancethickness capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ADJOINTBALANCETHICKNESS], [test x$HAVE_ADJOINTBALANCETHICKNESS = xyes])
+
 AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS)
+
 dnl }}}
 dnl with-AdjointHoriz{{{
+
 AC_ARG_WITH([AdjointHoriz],
+
 	AS_HELP_STRING([--with-AdjointHoriz = YES], [compile with AdjointHoriz capabilities (default is yes)]),
+
 	[ADJOINTHORIZ=$withval],[ADJOINTHORIZ=yes])
+
 AC_MSG_CHECKING(for AdjointHoriz capability compilation)
 
+
 HAVE_ADJOINTHORIZ=no 
+
 if test "x$ADJOINTHORIZ" = "xyes"; then
+
 	HAVE_ADJOINTHORIZ=yes
+
 	AC_DEFINE([_HAVE_ADJOINTHORIZ_],[1],[with AdjointHoriz capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ADJOINTHORIZ], [test x$HAVE_ADJOINTHORIZ = xyes])
+
 AC_MSG_RESULT($HAVE_ADJOINTHORIZ)
+
 dnl }}}
 dnl with-Balancethickness2{{{
+
 AC_ARG_WITH([Balancethickness2],
+
 	AS_HELP_STRING([--with-Balancethickness2 = YES], [compile with Balancethickness2 capabilities (default is yes)]),
+
 	[BALANCETHICKNESS2=$withval],[BALANCETHICKNESS2=yes])
+
 AC_MSG_CHECKING(for Balancethickness2 capability compilation)
 
+
 HAVE_BALANCETHICKNESS2=no 
+
 if test "x$BALANCETHICKNESS2" = "xyes"; then
+
 	HAVE_BALANCETHICKNESS2=yes
+
 	AC_DEFINE([_HAVE_BALANCETHICKNESS2_],[1],[with Balancethickness2 capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCETHICKNESS2], [test x$HAVE_BALANCETHICKNESS2 = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCETHICKNESS2)
+
 dnl }}}
 dnl with-Balancethickness{{{
+
 AC_ARG_WITH([Balancethickness],
+
 	AS_HELP_STRING([--with-Balancethickness = YES], [compile with Balancethickness capabilities (default is yes)]),
+
 	[BALANCETHICKNESS=$withval],[BALANCETHICKNESS=yes])
+
 AC_MSG_CHECKING(for Balancethickness capability compilation)
 
+
 HAVE_BALANCETHICKNESS=no 
+
 if test "x$BALANCETHICKNESS" = "xyes"; then
+
 	HAVE_BALANCETHICKNESS=yes
+
 	AC_DEFINE([_HAVE_BALANCETHICKNESS_],[1],[with Balancethickness capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCETHICKNESS], [test x$HAVE_BALANCETHICKNESS = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCETHICKNESS)
+
 dnl }}}
 dnl with-BalancethicknessSoft{{{
+
 AC_ARG_WITH([BalancethicknessSoft],
+
 	AS_HELP_STRING([--with-BalancethicknessSoft = YES], [compile with BalancethicknessSoft capabilities (default is yes)]),
+
 	[BALANCETHICKNESSSOFT=$withval],[BALANCETHICKNESSSOFT=yes])
+
 AC_MSG_CHECKING(for BalancethicknessSoft capability compilation)
 
+
 HAVE_BALANCETHICKNESSSOFT=no 
+
 if test "x$BALANCETHICKNESSSOFT" = "xyes"; then
+
 	HAVE_BALANCETHICKNESSSOFT=yes
+
 	AC_DEFINE([_HAVE_BALANCETHICKNESSSOFT_],[1],[with BalancethicknessSoft capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCETHICKNESSSOFT], [test x$HAVE_BALANCETHICKNESSSOFT = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCETHICKNESSSOFT)
+
 dnl }}}
 dnl with-Balancevelocity{{{
+
 AC_ARG_WITH([Balancevelocity],
+
 	AS_HELP_STRING([--with-Balancevelocity = YES], [compile with Balancevelocity capabilities (default is yes)]),
+
 	[BALANCEVELOCITY=$withval],[BALANCEVELOCITY=yes])
+
 AC_MSG_CHECKING(for Balancevelocity capability compilation)
 
+
 HAVE_BALANCEVELOCITY=no 
+
 if test "x$BALANCEVELOCITY" = "xyes"; then
+
 	HAVE_BALANCEVELOCITY=yes
+
 	AC_DEFINE([_HAVE_BALANCEVELOCITY_],[1],[with Balancevelocity capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCEVELOCITY], [test x$HAVE_BALANCEVELOCITY = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCEVELOCITY)
+
 dnl }}}
 dnl with-DamageEvolution{{{
+
 AC_ARG_WITH([DamageEvolution],
+
 	AS_HELP_STRING([--with-DamageEvolution = YES], [compile with DamageEvolution capabilities (default is yes)]),
+
 	[DAMAGEEVOLUTION=$withval],[DAMAGEEVOLUTION=yes])
+
 AC_MSG_CHECKING(for DamageEvolution capability compilation)
 
+
 HAVE_DAMAGEEVOLUTION=no 
+
 if test "x$DAMAGEEVOLUTION" = "xyes"; then
+
 	HAVE_DAMAGEEVOLUTION=yes
+
 	AC_DEFINE([_HAVE_DAMAGEEVOLUTION_],[1],[with DamageEvolution capability])
-fi
+
+fi
+
 AM_CONDITIONAL([DAMAGEEVOLUTION], [test x$HAVE_DAMAGEEVOLUTION = xyes])
+
 AC_MSG_RESULT($HAVE_DAMAGEEVOLUTION)
+
 dnl }}}
 dnl with-DepthAverage{{{
+
 AC_ARG_WITH([DepthAverage],
+
 	AS_HELP_STRING([--with-DepthAverage = YES], [compile with DepthAverage capabilities (default is yes)]),
+
 	[DEPTHAVERAGE=$withval],[DEPTHAVERAGE=yes])
+
 AC_MSG_CHECKING(for DepthAverage capability compilation)
 
+
 HAVE_DEPTHAVERAGE=no 
+
 if test "x$DEPTHAVERAGE" = "xyes"; then
+
 	HAVE_DEPTHAVERAGE=yes
+
 	AC_DEFINE([_HAVE_DEPTHAVERAGE_],[1],[with DepthAverage capability])
-fi
+
+fi
+
 AM_CONDITIONAL([DEPTHAVERAGE], [test x$HAVE_DEPTHAVERAGE = xyes])
+
 AC_MSG_RESULT($HAVE_DEPTHAVERAGE)
+
 dnl }}}
 dnl with-Enthalpy{{{
+
 AC_ARG_WITH([Enthalpy],
+
 	AS_HELP_STRING([--with-Enthalpy = YES], [compile with Enthalpy capabilities (default is yes)]),
+
 	[ENTHALPY=$withval],[ENTHALPY=yes])
+
 AC_MSG_CHECKING(for Enthalpy capability compilation)
 
+
 HAVE_ENTHALPY=no 
+
 if test "x$ENTHALPY" = "xyes"; then
+
 	HAVE_ENTHALPY=yes
+
 	AC_DEFINE([_HAVE_ENTHALPY_],[1],[with Enthalpy capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ENTHALPY], [test x$HAVE_ENTHALPY = xyes])
+
 AC_MSG_RESULT($HAVE_ENTHALPY)
+
 dnl }}}
 dnl with-Esa{{{
+
 AC_ARG_WITH([Esa],
+
 	AS_HELP_STRING([--with-Esa = YES], [compile with Esa capabilities (default is yes)]),
+
 	[ESA=$withval],[ESA=yes])
+
 AC_MSG_CHECKING(for Esa capability compilation)
 
+
 HAVE_ESA=no 
+
 if test "x$ESA" = "xyes"; then
+
 	HAVE_ESA=yes
+
 	AC_DEFINE([_HAVE_ESA_],[1],[with Esa capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ESA], [test x$HAVE_ESA = xyes])
+
 AC_MSG_RESULT($HAVE_ESA)
+
 dnl }}}
 dnl with-Extrapolation{{{
+
 AC_ARG_WITH([Extrapolation],
+
 	AS_HELP_STRING([--with-Extrapolation = YES], [compile with Extrapolation capabilities (default is yes)]),
+
 	[EXTRAPOLATION=$withval],[EXTRAPOLATION=yes])
+
 AC_MSG_CHECKING(for Extrapolation capability compilation)
 
+
 HAVE_EXTRAPOLATION=no 
+
 if test "x$EXTRAPOLATION" = "xyes"; then
+
 	HAVE_EXTRAPOLATION=yes
+
 	AC_DEFINE([_HAVE_EXTRAPOLATION_],[1],[with Extrapolation capability])
-fi
+
+fi
+
 AM_CONDITIONAL([EXTRAPOLATION], [test x$HAVE_EXTRAPOLATION = xyes])
+
 AC_MSG_RESULT($HAVE_EXTRAPOLATION)
+
 dnl }}}
 dnl with-ExtrudeFromBase{{{
+
 AC_ARG_WITH([ExtrudeFromBase],
+
 	AS_HELP_STRING([--with-ExtrudeFromBase = YES], [compile with ExtrudeFromBase capabilities (default is yes)]),
+
 	[EXTRUDEFROMBASE=$withval],[EXTRUDEFROMBASE=yes])
+
 AC_MSG_CHECKING(for ExtrudeFromBase capability compilation)
 
+
 HAVE_EXTRUDEFROMBASE=no 
+
 if test "x$EXTRUDEFROMBASE" = "xyes"; then
+
 	HAVE_EXTRUDEFROMBASE=yes
+
 	AC_DEFINE([_HAVE_EXTRUDEFROMBASE_],[1],[with ExtrudeFromBase capability])
-fi
+
+fi
+
 AM_CONDITIONAL([EXTRUDEFROMBASE], [test x$HAVE_EXTRUDEFROMBASE = xyes])
+
 AC_MSG_RESULT($HAVE_EXTRUDEFROMBASE)
+
 dnl }}}
 dnl with-ExtrudeFromTop{{{
+
 AC_ARG_WITH([ExtrudeFromTop],
+
 	AS_HELP_STRING([--with-ExtrudeFromTop = YES], [compile with ExtrudeFromTop capabilities (default is yes)]),
+
 	[EXTRUDEFROMTOP=$withval],[EXTRUDEFROMTOP=yes])
+
 AC_MSG_CHECKING(for ExtrudeFromTop capability compilation)
 
+
 HAVE_EXTRUDEFROMTOP=no 
+
 if test "x$EXTRUDEFROMTOP" = "xyes"; then
+
 	HAVE_EXTRUDEFROMTOP=yes
+
 	AC_DEFINE([_HAVE_EXTRUDEFROMTOP_],[1],[with ExtrudeFromTop capability])
-fi
+
+fi
+
 AM_CONDITIONAL([EXTRUDEFROMTOP], [test x$HAVE_EXTRUDEFROMTOP = xyes])
+
 AC_MSG_RESULT($HAVE_EXTRUDEFROMTOP)
+
 dnl }}}
 dnl with-FreeSurfaceBase{{{
+
 AC_ARG_WITH([FreeSurfaceBase],
+
 	AS_HELP_STRING([--with-FreeSurfaceBase = YES], [compile with FreeSurfaceBase capabilities (default is yes)]),
+
 	[FREESURFACEBASE=$withval],[FREESURFACEBASE=yes])
+
 AC_MSG_CHECKING(for FreeSurfaceBase capability compilation)
 
+
 HAVE_FREESURFACEBASE=no 
+
 if test "x$FREESURFACEBASE" = "xyes"; then
+
 	HAVE_FREESURFACEBASE=yes
+
 	AC_DEFINE([_HAVE_FREESURFACEBASE_],[1],[with FreeSurfaceBase capability])
-fi
+
+fi
+
 AM_CONDITIONAL([FREESURFACEBASE], [test x$HAVE_FREESURFACEBASE = xyes])
+
 AC_MSG_RESULT($HAVE_FREESURFACEBASE)
+
 dnl }}}
 dnl with-FreeSurfaceTop{{{
+
 AC_ARG_WITH([FreeSurfaceTop],
+
 	AS_HELP_STRING([--with-FreeSurfaceTop = YES], [compile with FreeSurfaceTop capabilities (default is yes)]),
+
 	[FREESURFACETOP=$withval],[FREESURFACETOP=yes])
+
 AC_MSG_CHECKING(for FreeSurfaceTop capability compilation)
 
+
 HAVE_FREESURFACETOP=no 
+
 if test "x$FREESURFACETOP" = "xyes"; then
+
 	HAVE_FREESURFACETOP=yes
+
 	AC_DEFINE([_HAVE_FREESURFACETOP_],[1],[with FreeSurfaceTop capability])
-fi
+
+fi
+
 AM_CONDITIONAL([FREESURFACETOP], [test x$HAVE_FREESURFACETOP = xyes])
+
 AC_MSG_RESULT($HAVE_FREESURFACETOP)
+
 dnl }}}
 dnl with-GLheightadvection{{{
+
 AC_ARG_WITH([GLheightadvection],
+
 	AS_HELP_STRING([--with-GLheightadvection = YES], [compile with GLheightadvection capabilities (default is yes)]),
+
 	[GLHEIGHTADVECTION=$withval],[GLHEIGHTADVECTION=yes])
+
 AC_MSG_CHECKING(for GLheightadvection capability compilation)
 
+
 HAVE_GLHEIGHTADVECTION=no 
+
 if test "x$GLHEIGHTADVECTION" = "xyes"; then
+
 	HAVE_GLHEIGHTADVECTION=yes
+
 	AC_DEFINE([_HAVE_GLHEIGHTADVECTION_],[1],[with GLheightadvection capability])
-fi
+
+fi
+
 AM_CONDITIONAL([GLHEIGHTADVECTION], [test x$HAVE_GLHEIGHTADVECTION = xyes])
+
 AC_MSG_RESULT($HAVE_GLHEIGHTADVECTION)
-dnl }}}
-dnl with-Gia{{{
-AC_ARG_WITH([Gia],
-	AS_HELP_STRING([--with-Gia= YES], [compile with Gia capabilities (default is yes)]),
-	[GIA=$withval],[GIA=yes])
-AC_MSG_CHECKING(for Gia capability compilation)
-
-HAVE_GIA=no 
-if test "x$GIA" = "xyes"; then
-	HAVE_GIA=yes
-	AC_DEFINE([_HAVE_GIA_],[1],[with Giacapability])
-fi
-AM_CONDITIONAL([GIA], [test x$HAVE_GIA = xyes])
-AC_MSG_RESULT($HAVE_GIA)
+
 dnl }}}
 dnl with-HydrologyDCEfficient{{{
+
 AC_ARG_WITH([HydrologyDCEfficient],
+
 	AS_HELP_STRING([--with-HydrologyDCEfficient = YES], [compile with HydrologyDCEfficient capabilities (default is yes)]),
+
 	[HYDROLOGYDCEFFICIENT=$withval],[HYDROLOGYDCEFFICIENT=yes])
+
 AC_MSG_CHECKING(for HydrologyDCEfficient capability compilation)
 
+
 HAVE_HYDROLOGYDCEFFICIENT=no 
+
 if test "x$HYDROLOGYDCEFFICIENT" = "xyes"; then
+
 	HAVE_HYDROLOGYDCEFFICIENT=yes
+
 	AC_DEFINE([_HAVE_HYDROLOGYDCEFFICIENT_],[1],[with HydrologyDCEfficient capability])
-fi
+
+fi
+
 AM_CONDITIONAL([HYDROLOGYDCEFFICIENT], [test x$HAVE_HYDROLOGYDCEFFICIENT = xyes])
+
 AC_MSG_RESULT($HAVE_HYDROLOGYDCEFFICIENT)
+
 dnl }}}
 dnl with-HydrologyDCInefficient{{{
+
 AC_ARG_WITH([HydrologyDCInefficient],
+
 	AS_HELP_STRING([--with-HydrologyDCInefficient = YES], [compile with HydrologyDCInefficient capabilities (default is yes)]),
+
 	[HYDROLOGYDCINEFFICIENT=$withval],[HYDROLOGYDCINEFFICIENT=yes])
+
 AC_MSG_CHECKING(for HydrologyDCInefficient capability compilation)
 
+
 HAVE_HYDROLOGYDCINEFFICIENT=no 
+
 if test "x$HYDROLOGYDCINEFFICIENT" = "xyes"; then
+
 	HAVE_HYDROLOGYDCINEFFICIENT=yes
+
 	AC_DEFINE([_HAVE_HYDROLOGYDCINEFFICIENT_],[1],[with HydrologyDCInefficient capability])
-fi
+
+fi
+
 AM_CONDITIONAL([HYDROLOGYDCINEFFICIENT], [test x$HAVE_HYDROLOGYDCINEFFICIENT = xyes])
+
 AC_MSG_RESULT($HAVE_HYDROLOGYDCINEFFICIENT)
+
+dnl }}}
+dnl with-HydrologyGlaDS{{{
+
+AC_ARG_WITH([HydrologyGlaDS],
+
+	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
+
+	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
+
+AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
+
+
+HAVE_HYDROLOGYGLADS=no 
+
+if test "x$HYDROLOGYGLADS" = "xyes"; then
+
+	HAVE_HYDROLOGYGLADS=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
+
+dnl }}}
+dnl with-HydrologyPism{{{
+
+AC_ARG_WITH([HydrologyPism],
+
+	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
+
+	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
+
+AC_MSG_CHECKING(for HydrologyPism capability compilation)
+
+
+HAVE_HYDROLOGYPISM=no 
+
+if test "x$HYDROLOGYPISM" = "xyes"; then
+
+	HAVE_HYDROLOGYPISM=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
+
+dnl }}}
+dnl with-HydrologyShakti{{{
+
+AC_ARG_WITH([HydrologyShakti],
+
+	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
+
+	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
+
+AC_MSG_CHECKING(for HydrologyShakti capability compilation)
+
+
+HAVE_HYDROLOGYSHAKTI=no 
+
+if test "x$HYDROLOGYSHAKTI" = "xyes"; then
+
+	HAVE_HYDROLOGYSHAKTI=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
+
 dnl }}}
 dnl with-HydrologyShreve{{{
+
 AC_ARG_WITH([HydrologyShreve],
+
 	AS_HELP_STRING([--with-HydrologyShreve = YES], [compile with HydrologyShreve capabilities (default is yes)]),
+
 	[HYDROLOGYSHREVE=$withval],[HYDROLOGYSHREVE=yes])
+
 AC_MSG_CHECKING(for HydrologyShreve capability compilation)
 
+
 HAVE_HYDROLOGYSHREVE=no 
+
 if test "x$HYDROLOGYSHREVE" = "xyes"; then
+
 	HAVE_HYDROLOGYSHREVE=yes
+
 	AC_DEFINE([_HAVE_HYDROLOGYSHREVE_],[1],[with HydrologyShreve capability])
-fi
+
+fi
+
 AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
+
 AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
-dnl }}}
-dnl with-HydrologyGlaDS{{{
-AC_ARG_WITH([HydrologyGlaDS],
-	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
-	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
-AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
-
-HAVE_HYDROLOGYGLADS=no 
-if test "x$HYDROLOGYGLADS" = "xyes"; then
-	HAVE_HYDROLOGYGLADS=yes
-	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
-fi
-AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
-dnl }}}
-dnl with-HydrologyShakti{{{
-AC_ARG_WITH([HydrologyShakti],
-	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
-	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
-AC_MSG_CHECKING(for HydrologyShakti capability compilation)
-
-HAVE_HYDROLOGYSHAKTI=no 
-if test "x$HYDROLOGYSHAKTI" = "xyes"; then
-	HAVE_HYDROLOGYSHAKTI=yes
-	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
-fi
-AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
-dnl }}}
-dnl with-HydrologyPism{{{
-AC_ARG_WITH([HydrologyPism],
-	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
-	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
-AC_MSG_CHECKING(for HydrologyPism capability compilation)
-
-HAVE_HYDROLOGYPISM=no 
-if test "x$HYDROLOGYPISM" = "xyes"; then
-	HAVE_HYDROLOGYPISM=yes
-	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
-fi
-AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
+
 dnl }}}
 dnl with-L2ProjectionBase{{{
+
 AC_ARG_WITH([L2ProjectionBase],
+
 	AS_HELP_STRING([--with-L2ProjectionBase = YES], [compile with L2ProjectionBase capabilities (default is yes)]),
+
 	[L2PROJECTIONBASE=$withval],[L2PROJECTIONBASE=yes])
+
 AC_MSG_CHECKING(for L2ProjectionBase capability compilation)
 
+
 HAVE_L2PROJECTIONBASE=no 
+
 if test "x$L2PROJECTIONBASE" = "xyes"; then
+
 	HAVE_L2PROJECTIONBASE=yes
+
 	AC_DEFINE([_HAVE_L2PROJECTIONBASE_],[1],[with L2ProjectionBase capability])
-fi
+
+fi
+
 AM_CONDITIONAL([L2PROJECTIONBASE], [test x$HAVE_L2PROJECTIONBASE = xyes])
+
 AC_MSG_RESULT($HAVE_L2PROJECTIONBASE)
+
 dnl }}}
 dnl with-L2ProjectionEPL{{{
+
 AC_ARG_WITH([L2ProjectionEPL],
+
 	AS_HELP_STRING([--with-L2ProjectionEPL = YES], [compile with L2ProjectionEPL capabilities (default is yes)]),
+
 	[L2PROJECTIONEPL=$withval],[L2PROJECTIONEPL=yes])
+
 AC_MSG_CHECKING(for L2ProjectionEPL capability compilation)
 
+
 HAVE_L2PROJECTIONEPL=no 
+
 if test "x$L2PROJECTIONEPL" = "xyes"; then
+
 	HAVE_L2PROJECTIONEPL=yes
+
 	AC_DEFINE([_HAVE_L2PROJECTIONEPL_],[1],[with L2ProjectionEPL capability])
-fi
+
+fi
+
 AM_CONDITIONAL([L2PROJECTIONEPL], [test x$HAVE_L2PROJECTIONEPL = xyes])
+
 AC_MSG_RESULT($HAVE_L2PROJECTIONEPL)
+
 dnl }}}
 dnl with-Levelset{{{
+
 AC_ARG_WITH([Levelset],
+
 	AS_HELP_STRING([--with-Levelset = YES], [compile with Levelset capabilities (default is yes)]),
+
 	[LEVELSET=$withval],[LEVELSET=yes])
+
 AC_MSG_CHECKING(for Levelset capability compilation)
 
+
 HAVE_LEVELSET=no 
+
 if test "x$LEVELSET" = "xyes"; then
+
 	HAVE_LEVELSET=yes
+
 	AC_DEFINE([_HAVE_LEVELSET_],[1],[with Levelset capability])
-fi
+
+fi
+
 AM_CONDITIONAL([LEVELSET], [test x$HAVE_LEVELSET = xyes])
+
 AC_MSG_RESULT($HAVE_LEVELSET)
+
 dnl }}}
 dnl with-Love{{{
+
 AC_ARG_WITH([Love],
+
 	AS_HELP_STRING([--with-Love = YES], [compile with Love capabilities (default is yes)]),
+
 	[LOVE=$withval],[LOVE=yes])
+
 AC_MSG_CHECKING(for Love capability compilation)
 
+
 HAVE_LOVE=no 
+
 if test "x$LOVE" = "xyes"; then
+
 	HAVE_LOVE=yes
+
 	AC_DEFINE([_HAVE_LOVE_],[1],[with Love capability])
-fi
+
+fi
+
 AM_CONDITIONAL([LOVE], [test x$HAVE_LOVE = xyes])
+
 AC_MSG_RESULT($HAVE_LOVE)
+
 dnl }}}
 dnl with-Masstransport{{{
+
 AC_ARG_WITH([Masstransport],
+
 	AS_HELP_STRING([--with-Masstransport = YES], [compile with Masstransport capabilities (default is yes)]),
+
 	[MASSTRANSPORT=$withval],[MASSTRANSPORT=yes])
+
 AC_MSG_CHECKING(for Masstransport capability compilation)
 
+
 HAVE_MASSTRANSPORT=no 
+
 if test "x$MASSTRANSPORT" = "xyes"; then
+
 	HAVE_MASSTRANSPORT=yes
+
 	AC_DEFINE([_HAVE_MASSTRANSPORT_],[1],[with Masstransport capability])
-fi
+
+fi
+
 AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
+
 AC_MSG_RESULT($HAVE_MASSTRANSPORT)
+
 dnl }}}
 dnl with-Melting{{{
+
 AC_ARG_WITH([Melting],
+
 	AS_HELP_STRING([--with-Melting = YES], [compile with Melting capabilities (default is yes)]),
+
 	[MELTING=$withval],[MELTING=yes])
+
 AC_MSG_CHECKING(for Melting capability compilation)
 
+
 HAVE_MELTING=no 
+
 if test "x$MELTING" = "xyes"; then
+
 	HAVE_MELTING=yes
+
 	AC_DEFINE([_HAVE_MELTING_],[1],[with Melting capability])
-fi
+
+fi
+
 AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
+
 AC_MSG_RESULT($HAVE_MELTING)
-dnl }}}
-dnl with-Sealevelrise{{{
-AC_ARG_WITH([Sealevelrise],
-	AS_HELP_STRING([--with-Sealevelrise = YES], [compile with Sealevelrise capabilities (default is yes)]),
-	[SEALEVELRISE=$withval],[SEALEVELRISE=yes])
-AC_MSG_CHECKING(for Sealevelrise capability compilation)
-
-HAVE_SEALEVELRISE=no 
-if test "x$SEALEVELRISE" = "xyes"; then
-	HAVE_SEALEVELRISE=yes
-	AC_DEFINE([_HAVE_SEALEVELRISE_],[1],[with Sealevelrise capability])
-fi
-AM_CONDITIONAL([SEALEVELRISE], [test x$HAVE_SEALEVELRISE = xyes])
-AC_MSG_RESULT($HAVE_SEALEVELRISE)
+
+dnl }}}
+dnl with-Oceantransport{{{
+
+AC_ARG_WITH([Oceantransport],
+
+	AS_HELP_STRING([--with-Oceantransport = YES], [compile with Oceantransport capabilities (default is yes)]),
+
+	[OCEANTRANSPORT=$withval],[OCEANTRANSPORT=yes])
+
+AC_MSG_CHECKING(for Oceantransport capability compilation)
+
+
+HAVE_OCEANTRANSPORT=no 
+
+if test "x$OCEANTRANSPORT" = "xyes"; then
+
+	HAVE_OCEANTRANSPORT=yes
+
+	AC_DEFINE([_HAVE_OCEANTRANSPORT_],[1],[with Oceantransport capability])
+
+fi
+
+AM_CONDITIONAL([OCEANTRANSPORT], [test x$HAVE_OCEANTRANSPORT = xyes])
+
+AC_MSG_RESULT($HAVE_OCEANTRANSPORT)
+
+dnl }}}
+dnl with-Recovery{{{
+
+AC_ARG_WITH([Recovery],
+
+	AS_HELP_STRING([--with-Recovery = YES], [compile with Recovery capabilities (default is yes)]),
+
+	[RECOVERY=$withval],[RECOVERY=yes])
+
+AC_MSG_CHECKING(for Recovery capability compilation)
+
+
+HAVE_RECOVERY=no 
+
+if test "x$RECOVERY" = "xyes"; then
+
+	HAVE_RECOVERY=yes
+
+	AC_DEFINE([_HAVE_RECOVERY_],[1],[with Recovery capability])
+
+fi
+
+AM_CONDITIONAL([RECOVERY], [test x$HAVE_RECOVERY = xyes])
+
+AC_MSG_RESULT($HAVE_RECOVERY)
+
+dnl }}}
+dnl with-Sampling{{{
+
+AC_ARG_WITH([Sampling],
+
+	AS_HELP_STRING([--with-Sampling = YES], [compile with Sampling capabilities (default is yes)]),
+
+	[SAMPLING=$withval],[SAMPLING=yes])
+
+AC_MSG_CHECKING(for Sampling capability compilation)
+
+
+HAVE_SAMPLING=no 
+
+if test "x$SAMPLING" = "xyes"; then
+
+	HAVE_SAMPLING=yes
+
+	AC_DEFINE([_HAVE_SAMPLING_],[1],[with Sampling capability])
+
+fi
+
+AM_CONDITIONAL([SAMPLING], [test x$HAVE_SAMPLING = xyes])
+
+AC_MSG_RESULT($HAVE_SAMPLING)
+
+dnl }}}
+dnl with-Sealevelchange{{{
+
+AC_ARG_WITH([Sealevelchange],
+
+	AS_HELP_STRING([--with-Sealevelchange = YES], [compile with Sealevelchange capabilities (default is yes)]),
+
+	[SEALEVELCHANGE=$withval],[SEALEVELCHANGE=yes])
+
+AC_MSG_CHECKING(for Sealevelchange capability compilation)
+
+
+HAVE_SEALEVELCHANGE=no 
+
+if test "x$SEALEVELCHANGE" = "xyes"; then
+
+	HAVE_SEALEVELCHANGE=yes
+
+	AC_DEFINE([_HAVE_SEALEVELCHANGE_],[1],[with Sealevelchange capability])
+
+fi
+
+AM_CONDITIONAL([SEALEVELCHANGE], [test x$HAVE_SEALEVELCHANGE = xyes])
+
+AC_MSG_RESULT($HAVE_SEALEVELCHANGE)
+
 dnl }}}
 dnl with-Smb{{{
+
 AC_ARG_WITH([Smb],
+
 	AS_HELP_STRING([--with-Smb = YES], [compile with Smb capabilities (default is yes)]),
+
 	[SMB=$withval],[SMB=yes])
+
 AC_MSG_CHECKING(for Smb capability compilation)
 
+
 HAVE_SMB=no 
+
 if test "x$SMB" = "xyes"; then
+
 	HAVE_SMB=yes
+
 	AC_DEFINE([_HAVE_SMB_],[1],[with Smb capability])
-fi
+
+fi
+
 AM_CONDITIONAL([SMB], [test x$HAVE_SMB = xyes])
+
 AC_MSG_RESULT($HAVE_SMB)
+
 dnl }}}
 dnl with-Smooth{{{
+
 AC_ARG_WITH([Smooth],
+
 	AS_HELP_STRING([--with-Smooth = YES], [compile with Smooth capabilities (default is yes)]),
+
 	[SMOOTH=$withval],[SMOOTH=yes])
+
 AC_MSG_CHECKING(for Smooth capability compilation)
 
+
 HAVE_SMOOTH=no 
+
 if test "x$SMOOTH" = "xyes"; then
+
 	HAVE_SMOOTH=yes
+
 	AC_DEFINE([_HAVE_SMOOTH_],[1],[with Smooth capability])
-fi
+
+fi
+
 AM_CONDITIONAL([SMOOTH], [test x$HAVE_SMOOTH = xyes])
+
 AC_MSG_RESULT($HAVE_SMOOTH)
+
 dnl }}}
 dnl with-Stressbalance{{{
+
 AC_ARG_WITH([Stressbalance],
+
 	AS_HELP_STRING([--with-Stressbalance = YES], [compile with Stressbalance capabilities (default is yes)]),
+
 	[STRESSBALANCE=$withval],[STRESSBALANCE=yes])
+
 AC_MSG_CHECKING(for Stressbalance capability compilation)
 
+
 HAVE_STRESSBALANCE=no 
+
 if test "x$STRESSBALANCE" = "xyes"; then
+
 	HAVE_STRESSBALANCE=yes
+
 	AC_DEFINE([_HAVE_STRESSBALANCE_],[1],[with Stressbalance capability])
-fi
+
+fi
+
 AM_CONDITIONAL([STRESSBALANCE], [test x$HAVE_STRESSBALANCE = xyes])
+
 AC_MSG_RESULT($HAVE_STRESSBALANCE)
+
 dnl }}}
 dnl with-StressbalanceSIA{{{
+
 AC_ARG_WITH([StressbalanceSIA],
+
 	AS_HELP_STRING([--with-StressbalanceSIA = YES], [compile with StressbalanceSIA capabilities (default is yes)]),
+
 	[STRESSBALANCESIA=$withval],[STRESSBALANCESIA=yes])
+
 AC_MSG_CHECKING(for StressbalanceSIA capability compilation)
 
+
 HAVE_STRESSBALANCESIA=no 
+
 if test "x$STRESSBALANCESIA" = "xyes"; then
+
 	HAVE_STRESSBALANCESIA=yes
+
 	AC_DEFINE([_HAVE_STRESSBALANCESIA_],[1],[with StressbalanceSIA capability])
-fi
+
+fi
+
 AM_CONDITIONAL([STRESSBALANCESIA], [test x$HAVE_STRESSBALANCESIA = xyes])
+
 AC_MSG_RESULT($HAVE_STRESSBALANCESIA)
+
 dnl }}}
 dnl with-StressbalanceVertical{{{
+
 AC_ARG_WITH([StressbalanceVertical],
+
 	AS_HELP_STRING([--with-StressbalanceVertical = YES], [compile with StressbalanceVertical capabilities (default is yes)]),
+
 	[STRESSBALANCEVERTICAL=$withval],[STRESSBALANCEVERTICAL=yes])
+
 AC_MSG_CHECKING(for StressbalanceVertical capability compilation)
 
+
 HAVE_STRESSBALANCEVERTICAL=no 
+
 if test "x$STRESSBALANCEVERTICAL" = "xyes"; then
+
 	HAVE_STRESSBALANCEVERTICAL=yes
+
 	AC_DEFINE([_HAVE_STRESSBALANCEVERTICAL_],[1],[with StressbalanceVertical capability])
-fi
+
+fi
+
 AM_CONDITIONAL([STRESSBALANCEVERTICAL], [test x$HAVE_STRESSBALANCEVERTICAL = xyes])
+
 AC_MSG_RESULT($HAVE_STRESSBALANCEVERTICAL)
+
 dnl }}}
 dnl with-Thermal{{{
+
 AC_ARG_WITH([Thermal],
+
 	AS_HELP_STRING([--with-Thermal = YES], [compile with Thermal capabilities (default is yes)]),
+
 	[THERMAL=$withval],[THERMAL=yes])
+
 AC_MSG_CHECKING(for Thermal capability compilation)
 
+
 HAVE_THERMAL=no 
+
 if test "x$THERMAL" = "xyes"; then
+
 	HAVE_THERMAL=yes
+
 	AC_DEFINE([_HAVE_THERMAL_],[1],[with Thermal capability])
-fi
+
+fi
+
 AM_CONDITIONAL([THERMAL], [test x$HAVE_THERMAL = xyes])
+
 AC_MSG_RESULT($HAVE_THERMAL)
+
 dnl }}}
 dnl with-UzawaPressure{{{
+
 AC_ARG_WITH([UzawaPressure],
+
 	AS_HELP_STRING([--with-UzawaPressure = YES], [compile with UzawaPressure capabilities (default is yes)]),
+
 	[UZAWAPRESSURE=$withval],[UZAWAPRESSURE=yes])
+
 AC_MSG_CHECKING(for UzawaPressure capability compilation)
 
+
 HAVE_UZAWAPRESSURE=no 
+
 if test "x$UZAWAPRESSURE" = "xyes"; then
+
 	HAVE_UZAWAPRESSURE=yes
+
 	AC_DEFINE([_HAVE_UZAWAPRESSURE_],[1],[with UzawaPressure capability])
-fi
+
+fi
+
 AM_CONDITIONAL([UZAWAPRESSURE], [test x$HAVE_UZAWAPRESSURE = xyes])
+
 AC_MSG_RESULT($HAVE_UZAWAPRESSURE)
+
 dnl }}}
 
Index: issm/trunk/m4/issm_options.m4
===================================================================
--- issm/trunk/m4/issm_options.m4	(revision 25836)
+++ issm/trunk/m4/issm_options.m4	(revision 26744)
@@ -31,5 +31,5 @@
 		PACKAGE_DATE="unknown"
 	fi
-	AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE, "$PACKAGE_DATE", [build date])
+	AC_DEFINE_UNQUOTED([PACKAGE_BUILD_DATE], "${PACKAGE_DATE}", [build date])
 	AC_MSG_RESULT([${PACKAGE_DATE}])
 
@@ -46,5 +46,5 @@
 		fi
 	fi
-	AC_DEFINE_UNQUOTED(USER_NAME, "$user_name", [user name])
+	AC_DEFINE_UNQUOTED([USER_NAME], "${user_name}", [user name])
 	AC_MSG_RESULT([${user_name}])
 
@@ -55,13 +55,13 @@
 		linux-gnu* | lignux* )	host_os=linux ;;
 	esac
-	AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", [host full OS name and version])
+	AC_DEFINE_UNQUOTED([HOST_OS], "${host_os}", [host full OS name and version])
 	AC_MSG_RESULT([${host_os}])
 
 	AC_MSG_CHECKING([host cpu])
-	AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [host CPU])
+	AC_DEFINE_UNQUOTED([HOST_CPU], "${host_cpu}", [host CPU])
 	AC_MSG_RESULT([${host_cpu}])
 
 	AC_MSG_CHECKING([vendor])
-	AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor", [host vendor])
+	AC_DEFINE_UNQUOTED([HOST_VENDOR], "${host_vendor}", [host vendor])
 	AC_MSG_RESULT([${host_vendor}])
 
@@ -73,5 +73,5 @@
 		linux-gnu* | lignux* )	host_os_name=linux ;;
 	esac
-	AC_DEFINE_UNQUOTED(HOST_OS_NAME, "$host_os_name", [host OS name])
+	AC_DEFINE_UNQUOTED([HOST_OS_NAME], "${host_os_name}", [host OS name])
 	AC_MSG_RESULT([${host_os_name}])
 
@@ -82,5 +82,5 @@
 		host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
 	fi
-	AC_DEFINE_UNQUOTED(HOST_OS_VERSION, "$host_os_version", [host OS version])
+	AC_DEFINE_UNQUOTED([HOST_OS_VERSION], "${host_os_version}", [host OS version])
 	AC_MSG_RESULT([${host_os_version}])
 
@@ -95,5 +95,5 @@
 		i?86 )	host_arch=i386 ;; # all x86 should show up as i386
 	esac
-	AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_arch", [host archictecture])
+	AC_DEFINE_UNQUOTED([HOST_ARCH], "${host_arch}", [host archictecture])
 	AC_MSG_RESULT([${host_arch}])
 
@@ -219,7 +219,8 @@
 		AC_MSG_RESULT([no])
 	fi
-	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], $SYSTEM_FMEMOPEN, [does system copy of libc have fmemopen])
+	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], ${SYSTEM_FMEMOPEN}, [does system copy of libc have fmemopen])
 	AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
 
+	IS_MSYS2=no
 	IS_WINDOWS=no
 	AC_MSG_CHECKING([for vendor compilers])
@@ -290,7 +291,7 @@
 			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
 		elif test "${VENDOR}" == "intel-discover"; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
+		   export CC=mpicc
+		   export CXX=mpicxx
+			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK -std=c++11"
 			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
 		elif test "${VENDOR}" == "intel-pleiades"; then
@@ -309,22 +310,42 @@
 			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
 			export CFLAGS="-O3 -march=corei7-avx"
+		elif test "${VENDOR}" == "intel-pleiades-mpi"; then
+			export CC=mpicc
+			export CXX=mpicxx
+			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
+			export CFLAGS="-O3 -march=corei7-avx"
 		elif test "${VENDOR}" == "intel-pleiades-icpc"; then
 			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
 			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
+		elif test "${VENDOR}" == "win-msys2"; then
+			export CXXFLAGS="-D_MSYS2_"
+			export LDFLAGS="${LDFLAGS} -no-undefined"
+			export OSLIBS="-Wl,-L/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Wl,-L/mingw64/x86_64-w64-mingw32/lib -Wl,-lstdc++ -Wl,-lgfortran -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lquadmath -Wl,-lstdc++ -Wl,-lgcc"
+			IS_MSYS2=yes
 		else
 			AC_MSG_ERROR([unknown compiler vendor!])
 		fi
 	fi
+	dnl Set default standard for C++
+	if test "${CXXFLAGS}" == ""; then
+		export CXXFLAGS="-std=C++11"
+	fi
 	AC_SUBST([OSLIBS])
 	AC_MSG_RESULT([done])
 
-	AC_MSG_CHECKING([if this is a Windows build])
+	AC_MSG_CHECKING([if this is a MSVC (Windows) build])
 	AM_CONDITIONAL([WINDOWS], [test "x${IS_WINDOWS}" == "xyes"])
 	AC_MSG_RESULT([${IS_WINDOWS}])
+
+	AC_MSG_CHECKING([if this is a MSYS2 (Windows) build])
+	AM_CONDITIONAL([MSYS2], [test "x${IS_MSYS2}" == "xyes"])
+	AC_MSG_RESULT([${IS_MSYS2}])
+	AC_DEFINE([_IS_MSYS2_], [1], [is a MSYS2 (Windows) build])
 	dnl }}}
 	dnl MATLAB{{{
 
 	dnl See if MATLAB has been provided
+	AC_MSG_CHECKING([for MATLAB])
 	AC_ARG_WITH(
 		[matlab-dir],														dnl feature
@@ -333,9 +354,7 @@
 		[MATLAB_ROOT="no"]													dnl action if not given
 	)
-	AC_MSG_CHECKING([for MATLAB])
 	if test "x${MATLAB_ROOT}" == "xno"; then
 		HAVE_MATLAB=no
 	else
-		HAVE_MATLAB=yes
 		if ! test -d "${MATLAB_ROOT}"; then
 			AC_MSG_ERROR([MATLAB directory provided (${MATLAB_ROOT}) does not exist!]);
@@ -344,4 +363,5 @@
 			AC_MSG_ERROR([Couldn't find mex.h... check your installation of MATLAB])
 		fi
+		HAVE_MATLAB=yes
 	fi
 	AC_MSG_RESULT([${HAVE_MATLAB}])
@@ -352,5 +372,5 @@
 		AC_DEFINE([_HAVE_MATLAB_], [1], [with MATLAB in ISSM src])
 
-		dnl Set MEXLIB, MEXLINK, and MEXEXT
+		dnl Set MEX* variable
 		AC_MSG_CHECKING([MATLAB's mex compilation flags])
 
@@ -362,24 +382,47 @@
 				if test "${VENDOR}" == "intel-win7-32"; then
 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
 					MEXEXT=`${MATLAB_ROOT}/bin/mexext.bat`
 					MEXEXT=".${MEXEXT}"
 				elif test "${VENDOR}" == "intel-win7-64"; then
 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
 					MEXEXT=".mexw64"
 				elif test "${VENDOR}" == "MSVC-Win64" || test "${VENDOR}" == "MSVC-Win64-par"; then
 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
-					MEXLINK="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+					MEXLINKFLAGS="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
 					MATLABINCL="-I`cygpath -m ${MATLAB_ROOT}/extern/include`"
 					MEXEXT=".mexw64"
 				fi
 			;;
+			*mingw*)
+				if test "${IS_MSYS2}" == "yes"; then
+					dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
+					MEXEXT=".mexw64"
+					MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+					MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
+					MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
+					MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
+					MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
+					MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
+					MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
+				fi
+			;;
+			*msys*)
+				dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
+				MEXEXT=".mexw64"
+				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+				MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
+				MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
+				MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
+				MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
+				MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
+				MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
+			;;
 			*)
+				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
 				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
-				MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
+				MEXLINKFLAGS=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
 				MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
-				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
-				dnl version 2014 and up
 				if test -z "${MEXEXT}"; then
 					echo "#include <mex.h>" > conftest.cpp
@@ -387,5 +430,5 @@
 					${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
 					rm -f conftest.cpp
-					MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
+					MEXLINKFLAGS=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
 					MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
 					MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
@@ -397,6 +440,6 @@
 
 				dnl Make sure mexFunction.map is not in MEXLIB to avoid problems with global variables
-				dnl MEXLINK=$(echo ${MEXLINK} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
-				MEXLINK="" dnl We actually don't need MEXLINK????
+				dnl MEXLINKFLAGS=$(echo ${MEXLINKFLAGS} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
+				MEXLINKFLAGS="" dnl We actually don't need MEXLINK????
 			;;
 		esac
@@ -406,12 +449,15 @@
 		fi
 
+		AC_SUBST([MEXEXT])
+		AC_SUBST([MEXOPTFLAGS])
+		AC_SUBST([MEXCFLAGS])
+		AC_SUBST([MEXCXXFLAGS])
 		AC_SUBST([MATLABINCL])
-		MATLABWRAPPEREXT=${MEXEXT}
-		AC_SUBST([MATLABWRAPPEREXT])
+		AC_SUBST([MEXLINKFLAGS])
 		AC_SUBST([MEXLIB])
-		AC_SUBST([MEXLINK])
 	fi
 	dnl }}}
 	dnl JavaScript{{{
+	AC_MSG_CHECKING([for JavaScript])
 	AC_ARG_WITH(
 		[javascript],
@@ -420,5 +466,4 @@
 		[JAVASCRIPT="no"]
 	)
-	AC_MSG_CHECKING([for JavaScript])
 	if test "x${JAVASCRIPT}" == "xno"; then
 		HAVE_JAVASCRIPT=no
@@ -433,4 +478,5 @@
 	dnl }}}
 	dnl Triangle {{{
+	AC_MSG_CHECKING([for triangle])
 	AC_ARG_WITH(
 		[triangle-dir],
@@ -439,5 +485,4 @@
 		[TRIANGLE_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for triangle])
 	if test "x${TRIANGLE_ROOT}" == "xno"; then
 		HAVE_TRIANGLE=no
@@ -478,4 +523,20 @@
 				fi
 			;;
+			*mingw*)
+				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
+					dnl Link to the object file, not the library
+					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
+				else
+					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+				fi
+			;;
+			*msys*)
+				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
+					dnl Link to the object file, not the library
+					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
+				else
+					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+				fi
+			;;
 		esac
 		AC_DEFINE([_HAVE_TRIANGLE_], [1], [with Triangle in ISSM src])
@@ -485,4 +546,5 @@
 	dnl }}}
 	dnl Boost{{{
+	AC_MSG_CHECKING([for Boost])
 	AC_ARG_WITH(
 		[boost-dir],
@@ -491,5 +553,4 @@
 		[BOOST_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Boost])
 	if test "x${BOOST_ROOT}" == "xno"; then
 		HAVE_BOOST=no
@@ -518,4 +579,5 @@
 	dnl }}}
 	dnl Dakota{{{
+	AC_MSG_CHECKING([for Dakota])
 	AC_ARG_WITH(
 		[dakota-dir],
@@ -524,5 +586,4 @@
 		[DAKOTA_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Dakota])
 	if test "x${DAKOTA_ROOT}" == "xno"; then
 		HAVE_DAKOTA=no
@@ -541,20 +602,27 @@
 
 		AC_MSG_CHECKING(for Dakota 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 TODO:
+		dnl - Check if this method applies to all other versions of Dakota (it 
+		dnl   should as long as the Dakota binaries have been compiled). If so, 
+		dnl   we can remove the other methods of getting the version.
+		dnl - Modify src/wrappers/IssmConfig/IssmConfig.cpp so that strlen is 
+		dnl   not called with _DAKOTA_VERSION_ as an argument so that we can 
+		dnl   do,
 		dnl
-		DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
-		if test -n "${DAKOTA_VERSION_OUTPUT}"; then
-			DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
-		elif test -f "${DAKOTA_ROOT}/VERSION"; then
+		dnl   	AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
+		dnl
+		if test -f "${DAKOTA_ROOT}/VERSION"; then
 			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`
-		elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
-		elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
 		else
-			AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
+			DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
+			if test -n "${DAKOTA_VERSION_OUTPUT}"; then
+				DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
+			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
+				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
+			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
+				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
+			else
+				AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
+			fi
 		fi
 		AC_MSG_RESULT([${DAKOTA_VERSION}])
@@ -674,11 +742,11 @@
 		AC_MSG_CHECKING(for Dakota major version)
 		AC_MSG_RESULT(${DAKOTA_MAJOR})
-		AC_DEFINE_UNQUOTED(_DAKOTA_MAJOR_, $DAKOTA_MAJOR, [Dakota major version number])
+		AC_DEFINE_UNQUOTED([_DAKOTA_MAJOR_], ${DAKOTA_MAJOR}, [Dakota major version number])
 		AC_MSG_CHECKING(for Dakota minor version)
 		AC_MSG_RESULT(${DAKOTA_MINOR})
-		AC_DEFINE_UNQUOTED(_DAKOTA_MINOR_, $DAKOTA_MINOR, [Dakota minor version number])
+		AC_DEFINE_UNQUOTED([_DAKOTA_MINOR_], ${DAKOTA_MINOR}, [Dakota minor version number])
 		AC_MSG_CHECKING(for Dakota build version)
 		AC_MSG_RESULT(${DAKOTA_BUILD})
-		AC_DEFINE_UNQUOTED(_DAKOTA_BUILD_, $DAKOTA_BUILD, [Dakota build version number])
+		AC_DEFINE_UNQUOTED([_DAKOTA_BUILD_], ${DAKOTA_BUILD}, [Dakota build version number])
 
 		AC_DEFINE([_HAVE_DAKOTA_], [1], [with Dakota in ISSM src])
@@ -690,4 +758,5 @@
 	dnl }}}
 	dnl Python{{{
+	AC_MSG_CHECKING([for Python])
 	AC_ARG_WITH(
 		[python-dir],
@@ -703,5 +772,4 @@
 		[PYTHON_VERSION="no"]
 	)
-	AC_MSG_CHECKING([for Python])
 	if test "x${PYTHON_ROOT}" == "xno"; then
 		HAVE_PYTHON=no
@@ -730,5 +798,5 @@
 		dnl Determine major version
 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
-		AC_DEFINE_UNQUOTED(_PYTHON_MAJOR_, $PYTHON_MAJOR, [Python version major])
+		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_], ${PYTHON_MAJOR}, [Python version major])
 		if test "x${PYTHON_MAJOR}" == "x3"; then
 			HAVE_PYTHON3="yes"
@@ -746,8 +814,12 @@
 			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
 		else
-			AC_MSG_ERROR([Python.h not found, locate this file and contact ISSM developers]);
+			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
 		fi
 		AC_MSG_RESULT([found])
-		if test "x${PYTHON_MAJOR}" == "x3"; then
+		if ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
+			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}m"
+		elif ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}.* 1> /dev/null 2>&1; then
+			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}"
+		elif ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
 			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}m"
 		else
@@ -759,9 +831,15 @@
 				PYTHONLINK="-shared"
 			;;
+			*darwin*)
+				PYTHONLINK="-dynamiclib"
+			;;
 			*linux*)
 				PYTHONLINK="-shared"
 			;;
-			*darwin*)
-				PYTHONLINK="-dynamiclib"
+			*mingw*)
+				PYTHONLINK="-shared"
+			;;
+			*msys*)
+				PYTHONLINK="-shared"
 			;;
 		esac
@@ -776,15 +854,4 @@
 	dnl }}}
 	dnl NumPy{{{
-	dnl TODO:
-	dnl - Replace references to python-numpy with numpy (and similar terms)
-	dnl	  project-wide
-	dnl
-	AC_ARG_WITH(
-		[python-numpy-dir],
-		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
-		[PYTHON_NUMPY_ROOT=${withval}],
-		[PYTHON_NUMPY_ROOT="no"]
-	)
-
 	dnl NOTE: You can find NumPy by running,
 	dnl
@@ -792,6 +859,15 @@
 	dnl		>>> numpy.__file__
 	dnl
-
+	dnl TODO:
+	dnl - Replace references to python-numpy with numpy (and similar terms)
+	dnl	  project-wide
+	dnl
 	AC_MSG_CHECKING(for python-numpy)
+	AC_ARG_WITH(
+		[python-numpy-dir],
+		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
+		[PYTHON_NUMPY_ROOT=${withval}],
+		[PYTHON_NUMPY_ROOT="no"]
+	)
 	if test "x${PYTHON_NUMPY_ROOT}" == "xno"; then
 		HAVE_PYTHON_NUMPY=no
@@ -812,4 +888,5 @@
 	dnl }}}
 	dnl Chaco{{{
+	AC_MSG_CHECKING([for Chaco])
 	AC_ARG_WITH(
 		[chaco-dir],
@@ -818,5 +895,4 @@
 		[CHACO_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Chaco])
 	if test "x${CHACO_ROOT}" == "xno"; then
 		HAVE_CHACO=no
@@ -832,6 +908,10 @@
 	dnl Chaco libraries and header files
 	if test "x${HAVE_CHACO}" == "xyes"; then
-		CHACOINCL=-I${CHACO_ROOT}/include
-		CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
+		CHACOINCL="-I${CHACO_ROOT}/include"
+		if test "${IS_MSYS2}" == "yes"; then
+			CHACOLIB="-Wl,-L${CHACO_ROOT}/lib -Wl,-lchacominusblas"
+		else
+			CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
+		fi
 		AC_DEFINE([_HAVE_CHACO_], [1], [with Chaco in ISSM src])
 		AC_SUBST([CHACOINCL])
@@ -840,4 +920,5 @@
 	dnl }}}
 	dnl ESMF{{{
+	AC_MSG_CHECKING([for ESMF])
 	AC_ARG_WITH(
 		[esmf-dir],
@@ -846,5 +927,4 @@
 		[ESMF_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ESMF])
 	if test "x${ESMF_ROOT}" == "xno"; then
 		HAVE_ESMF=no
@@ -860,5 +940,5 @@
 	if test "x${HAVE_ESMF}" == "xyes"; then
 		ESMFINCL="-I${ESMF_ROOT}/include"
-		ESMFLIB="-L${ESMF_ROOT}/lib -lesmf"
+		ESMFLIB="-L${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/ -lesmf"
 		AC_DEFINE([_HAVE_ESMF_], [1], [with ESMF in ISSM src])
 		AC_SUBST([ESMFINCL])
@@ -868,4 +948,5 @@
 	dnl }}}
 	dnl CoDiPack{{{
+	AC_MSG_CHECKING([for CoDiPack])
 	AC_ARG_WITH(
 		[codipack-dir],
@@ -874,5 +955,4 @@
 		[CODIPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for CoDiPack])
 	if test "x${CODIPACK_ROOT}" == "xno"; then
 		HAVE_CODIPACK=no
@@ -887,4 +967,19 @@
 	dnl CoDiPack libraries and header files
 	if test "x${HAVE_CODIPACK}" == "xyes"; then
+
+		AC_MSG_CHECKING(for CoDiPack version)
+		CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
+		CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
+		if test -z "${CODIPACK_MAJOR}"; then
+			 CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
+			 CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
+		fi
+		if test -z "${CODIPACK_MAJOR}"; then
+			AC_MSG_ERROR([Couldn't determine CoDiPack version])
+		fi
+		AC_DEFINE_UNQUOTED([_CODIPACK_MAJOR_], ${CODIPACK_MAJOR}, [CoDiPack version major])
+		AC_DEFINE_UNQUOTED([_CODIPACK_MINOR_], ${CODIPACK_MINOR}, [CoDiPack version minor])
+		AC_MSG_RESULT([${CODIPACK_MAJOR}.${CODIPACK_MINOR}])
+
 		CODIPACKINCL="-I${CODIPACK_ROOT}/include"
 		AC_DEFINE([_HAVE_CODIPACK_], [1], [with CoDiPack in ISSM src])
@@ -896,4 +991,5 @@
 	dnl }}}
 	dnl Tape Allocation {{{
+	AC_MSG_CHECKING(for tape allocation)
 	AC_ARG_ENABLE(
 		[tape-alloc],																dnl feature
@@ -902,5 +998,4 @@
 		[enable_tape_alloc=no]
 	)
-	AC_MSG_CHECKING(for tape allocation)
 	if test "x${enable_tape_alloc}" == "xyes"; then
 		AC_DEFINE([_AD_TAPE_ALLOC_], [1], [enable a priori tape allocation for AD])
@@ -909,4 +1004,5 @@
 	dnl }}}
 	dnl ADOL-C {{{
+	AC_MSG_CHECKING([for ADOL-C])
 	AC_ARG_WITH(
 		[adolc-dir],
@@ -915,5 +1011,4 @@
 		[ADOLC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ADOL-C])
 	if test "x${ADOLC_ROOT}" == "xno"; then
 		HAVE_ADOLC=no
@@ -940,4 +1035,5 @@
 	dnl }}}
 	dnl ADOL-C version{{{
+	AC_MSG_CHECKING(for ADOL-C version)
 	AC_ARG_WITH(
 		[adolc-version],
@@ -946,10 +1042,9 @@
 		[ADOLC_VERSION=2]
 	)
-	AC_MSG_CHECKING(for ADOL-C version)
-
-	AC_DEFINE_UNQUOTED(_ADOLC_VERSION_, $ADOLC_VERSION, [ADOL-C version])
+	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_], ${ADOLC_VERSION}, [ADOL-C version])
 	AC_MSG_RESULT(${ADOLC_VERSION})
 	dnl }}}
 	dnl ADIC2 {{{
+	AC_MSG_CHECKING([for ADIC2])
 	AC_ARG_WITH(
 		[adic2-dir],
@@ -958,5 +1053,4 @@
 		[ADIC2_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ADIC2])
 	if test "x${ADIC2_ROOT}" == "xno"; then
 		HAVE_ADIC2=no
@@ -980,4 +1074,5 @@
 	dnl }}}
 	dnl ATLAS {{{
+	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
 	AC_ARG_WITH(
 		[atlas-dir],
@@ -986,5 +1081,4 @@
 		[ATLAS_ROOT="no"]
 	)
-	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
 	if test "x${ATLAS_ROOT}" == "xno"; then
 		HAVE_ATLAS=no
@@ -1003,9 +1097,15 @@
 				ATLASLIB="-L`cygpath -m ${ATLAS_ROOT}` -Wl,libatlas.lib  -Wl,libcblas.lib"
 			;;
+			*darwin*)
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+			;;
 			*linux*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
-			;;
-			*darwin*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+			;;
+			*mingw*)
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+			;;
+			*msys*)
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
 			;;
 		esac
@@ -1015,4 +1115,5 @@
 	dnl }}}
 	dnl GSL{{{
+	AC_MSG_CHECKING([for GSL])
 	AC_ARG_WITH(
 		[gsl-dir],
@@ -1021,5 +1122,4 @@
 		[GSL_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for GSL])
 	if test "x${GSL_ROOT}" == "xno"; then
 		HAVE_GSL=no
@@ -1047,4 +1147,5 @@
 	dnl }}}
 	dnl AMPI (ADOL-C){{{
+	AC_MSG_CHECKING([for AMPI])
 	AC_ARG_WITH(
 		[ampi-dir],
@@ -1053,5 +1154,4 @@
 		[AMPI_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for AMPI])
 	if test "x${AMPI_ROOT}" == "xno"; then
 		HAVE_AMPI=no
@@ -1083,4 +1183,5 @@
 	dnl }}}
 	dnl Adjoint MPI (CoDiPack){{{
+	AC_MSG_CHECKING([for Adjoint MPI])
 	AC_ARG_WITH(
 		[adjointmpi-dir],
@@ -1089,5 +1190,4 @@
 		[ADJOINTMPI_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Adjoint MPI])
 	if test "x${ADJOINTMPI_ROOT}" == "xno"; then
 		HAVE_ADJOINTMPI=no
@@ -1117,4 +1217,5 @@
 	dnl }}}
 	dnl MeDiPack (CoDiPack, ADOL-C dev){{{
+	AC_MSG_CHECKING([for MeDiPack])
 	AC_ARG_WITH(
 		[medipack-dir],
@@ -1123,5 +1224,4 @@
 		[MEDIPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MeDiPack])
 	if test "x${MEDIPACK_ROOT}" == "xno"; then
 		HAVE_MEDIPACK=no
@@ -1149,4 +1249,5 @@
 	dnl }}}
 	dnl HDF5 {{{
+	AC_MSG_CHECKING(for HDF5 libraries)
 	AC_ARG_WITH(
 		[hdf5-dir],
@@ -1155,5 +1256,4 @@
 		[HDF5_ROOT="no"]
 	)
-	AC_MSG_CHECKING(for HDF5 libraries)
 	if test "x${HDF5_ROOT}" == "xno"; then
 		HAVE_HDF5=no
@@ -1176,8 +1276,14 @@
 				HDF5LIB="-L`cygpath -m ${HDF5_ROOT}` -Wl,libhdf5.lib  -Wl,libhdf5_hl.lib"
 			;;
+			*darwin*)
+				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+			;;
 			*linux*)
 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
 			;;
-			*darwin*)
+			*mingw*)
+				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+			;;
+			*msys*)
 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
 			;;
@@ -1188,4 +1294,5 @@
 	dnl }}}
 	dnl PETSc{{{
+	AC_MSG_CHECKING([for PETSc])
 	AC_ARG_WITH(
 		[petsc-dir],
@@ -1194,5 +1301,4 @@
 		[PETSC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for PETSc])
 	if test "x${PETSC_ROOT}" == "xno"; then
 		HAVE_PETSC=no
@@ -1215,6 +1321,6 @@
 		PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
 		PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
-		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major])
-		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor])
+		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], ${PETSC_MAJOR}, [PETSc version major])
+		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], ${PETSC_MINOR}, [PETSc version minor])
 		AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}])
 
@@ -1257,4 +1363,14 @@
 					PETSCLIB="/link -Wl,/LIBPATH:`cygpath -m ${PETSC_ROOT}/lib` -Wl,libpetsc.lib"
 					PETSCINCL="/I`cygpath -m ${PETSC_ROOT}/include`"
+				fi
+			;;
+			*darwin*)
+				if test ${PETSC_MAJOR} -lt 3; then
+					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
+				else
+					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
+					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
+						PETSCLIB+=" -lmetis"
+					fi
 				fi
 			;;
@@ -1275,13 +1391,9 @@
 				fi
 			;;
-			*darwin*)
-				if test ${PETSC_MAJOR} -lt 3; then
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
-				else
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
-						PETSCLIB+=" -lmetis"
-					fi
-				fi
+			*mingw*)
+				PETSCLIB="-Wl,${PETSC_ROOT}/lib/libpetsc.a"
+			;;
+			*msys*)
+				PETSCLIB="${PETSC_ROOT}/lib -lpetsc"
 			;;
 		esac
@@ -1294,5 +1406,4 @@
 	dnl MPI{{{
 	AC_MSG_CHECKING(for MPI)
-
 	AC_ARG_WITH(
 		[mpi-include],
@@ -1301,5 +1412,4 @@
 		[MPI_INCLUDE=""]
 	)
-
 	AC_ARG_WITH(
 		[mpi-libdir],
@@ -1308,5 +1418,4 @@
 		[MPI_LIBDIR=""]
 	)
-
 	AC_ARG_WITH(
 		[mpi-libflags],
@@ -1315,5 +1424,4 @@
 		[MPI_LIBFLAGS=""]
 	)
-
 	if test -z "${MPI_INCLUDE}"; then
 		HAVE_MPI=no
@@ -1358,4 +1466,5 @@
 	dnl }}}
 	dnl SCOTCH{{{
+	AC_MSG_CHECKING([for SCOTCH])
 	AC_ARG_WITH(
 		[scotch-dir],
@@ -1364,5 +1473,4 @@
 		[SCOTCH_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SCOTCH])
 	if test "x${SCOTCH_ROOT}" == "xno"; then
 		HAVE_SCOTCH=no
@@ -1397,82 +1505,136 @@
 	dnl }}}
 	dnl METIS{{{
-
-	dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
-	dnl		  check again in the following conditionals
-	dnl
-	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 3 && test "${VENDOR}" != "MSVC-Win64" && test "${VENDOR}" != "MSVC-Win64-par"; then
-		dnl In PETSc >=3.3, METIS is provided
-		HAVE_METIS="yes"
-		AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
+	AC_MSG_CHECKING([for METIS])
+	AC_ARG_WITH(
+		[metis-dir],
+		AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
+		[METIS_ROOT=${withval}],
+		[METIS_ROOT="no"]
+	)
+	HAVE_METIS=no
+	if test "x${METIS_ROOT}" == "xno"; then
+		dnl Check if METIS was installed via PETSc
+		if test -f ${PETSC_ROOT}/install/include/metis.h; then
+			HAVE_METIS=yes
+			METIS_ROOT="${PETSC_ROOT}"
+		fi
+	else
+		if ! test -d "${METIS_ROOT}"; then
+			AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
+		fi
+		HAVE_METIS=yes
+	fi
+	if test "${HAVE_METIS}" = "yes"; then
+		METIS_VERSION=$(grep "#define METIS_VER_MAJOR" ${METIS_ROOT}/include/metis.h | sed 's|.*METIS_VER_MAJOR[[:space:]]*||')
+		dnl METIS libraries and header files
+		if test "x${METIS_VERSION}" == "x4"; then
+			METISINCL="-I${METIS_ROOT}/Lib"
+			case "${host_os}" in
+				*cygwin*)
+					METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
+					METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
+				;;
+				*darwin*)
+					METISLIB="-L${METIS_ROOT} -lmetis"
+				;;
+				*linux*)
+					METISLIB="-L${METIS_ROOT} -lmetis"
+				;;
+				*mingw*)
+					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
+				;;
+				*msys*)
+					METISLIB="-L${METIS_ROOT} -lmetis"
+				;;
+			esac
+		elif test "x${METIS_VERSION}" == "x5"; then
+			METISINCL="-I${METIS_ROOT}/include"
+			case "${host_os}" in
+				*cygwin*)
+					METISLIB="-L${METIS_ROOT} libmetis.lib"
+				;;
+				*darwin*)
+					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+				;;
+				*linux*)
+					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+				;;
+				*mingw*)
+					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
+				;;
+				*msys*)
+					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+				;;
+			esac
+		else
+			AC_MSG_ERROR([METIS version ${METIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+		fi
 		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
-	else
-		AC_ARG_WITH(
-			[metis-dir],
-			AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
-			[METIS_ROOT=${withval}],
-			[METIS_ROOT="no"]
-		)
-		AC_MSG_CHECKING([for METIS])
-		if test "x${METIS_ROOT}" == "xno"; then
-			HAVE_METIS=no
-		else
-			HAVE_METIS=yes
-			if ! test -d "${METIS_ROOT}"; then
-				AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
-			fi
-		fi
-		AC_MSG_RESULT([${HAVE_METIS}])
-		AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
-
+		AC_DEFINE_UNQUOTED([_METIS_VERSION_], ${METIS_VERSION}, [METIS version number])
+		AC_SUBST([METISINCL])
+		AC_SUBST([METISLIB])
+	fi
+	AC_MSG_RESULT([${HAVE_METIS}])
+	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" = "xyes"])
+	dnl }}}
+	dnl ParMETIS{{{
+	AC_MSG_CHECKING([for ParMETIS])
+	AC_ARG_WITH(
+		[parmetis-dir],
+		AS_HELP_STRING([--with-parmetis-dir=DIR], [ParMETIS root directory, necessary for parallel build]),
+		[PARMETIS_ROOT=${withval}],
+		[PARMETIS_ROOT="no"]
+	)
+	HAVE_PARMETIS=no
+	if test "x${PARMETIS_ROOT}" == "xno"; then
+		dnl Check if ParMETIS was installed via PETSc
+		if test -f ${PETSC_ROOT}/install/include/parmetis.h; then
+			HAVE_PARMETIS="yes"
+			PARMETIS_ROOT="${PETSC_ROOT}"
+		fi
+	else
+		if ! test -d "${PARMETIS_ROOT}"; then
+			AC_MSG_ERROR([ParMETIS directory provided (${PARMETIS_ROOT}) does not exist!]);
+		fi
+		if ! test -d "${METIS_ROOT}"; then
+			AC_MSG_ERROR([If supplying path to ParMETIS with option --with-parmetis-dir, must also supply path to METIS with option --with-metis-dir]);
+		fi
+		HAVE_PARMETIS="yes"
+	fi
+	if test "${HAVE_PARMETIS}" == "yes"; then
+		#PARMETIS_VERSION=$(grep "#define PARMETIS_MAJOR_VERSION" ${PARMETIS_ROOT}/include/parmetis.h | sed 's|.*PARMETIS_MAJOR_VERSION[[:space:]]*||')
 		dnl METIS libraries and header files
-		if test "x${HAVE_METIS}" == "xyes"; then
-			dnl Retrieve METIS version (does the VERSION file exist?)
-			if test -f "${METIS_ROOT}/VERSION"; then
-				METIS_VERSION=4
-			else
-				METIS_VERSION=5
-			fi
-
-			if test "x${METIS_VERSION}" == "x4"; then
-				METISINCL="-I${METIS_ROOT}/Lib"
-				case "${host_os}" in
-					*cygwin*)
-						METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
-						METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
-					;;
-					*linux*)
-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
-					;;
-					*darwin*)
-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
-					;;
-				esac
-				AC_DEFINE([_METIS_VERSION_], [4], [ METIS version number])
-			fi
-
-			if test "x${METIS_VERSION}" == "x5"; then
-				case "${host_os}" in
-					*cygwin*)
-						METISLIB="-L${METIS_ROOT} libmetis.lib"
-					;;
-					*linux*)
-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
-					;;
-					*darwin*)
-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
-					;;
-				esac
-				METISINCL="-I${METIS_ROOT}/include"
-				AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
-			fi
-
-			AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
-			AC_SUBST([METISINCL])
-			AC_SUBST([METISLIB])
-		fi
-	fi
-	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
+		#if test "x${PARMETIS_VERSION}" == "x4"; then
+			PARMETISINCL="-I${PARMETIS_ROOT}/include"
+			case "${host_os}" in
+				*cygwin*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+				*darwin*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+				*linux*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+				*mingw*)
+					PARMETISLIB="-Wl,${PARMETIS_ROOT}/lib/libparmetis.a"
+				;;
+				*msys*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+			esac
+		#else
+		#	AC_MSG_ERROR([ParMETIS version ${PARMETIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+		#fi
+		AC_DEFINE([_HAVE_PARMETIS_], [1], [with ParMETIS in ISSM src])
+		#AC_DEFINE([_PARMETIS_VERSION_], [${PARMETIS_VERSION}], [ParMETIS version number])
+		AC_SUBST([PARMETISINCL])
+		AC_SUBST([PARMETISLIB])
+	fi
+	AC_MSG_RESULT([${HAVE_PARMETIS}])
+	AM_CONDITIONAL([PARMETIS], [test "x${HAVE_PARMETIS}" = "xyes"])
 	dnl }}}
 	dnl Toolkit for Advanced Optimization (TAO){{{
+	AC_MSG_CHECKING([for TAO])
 	AC_ARG_WITH(
 		[tao-dir],
@@ -1481,6 +1643,4 @@
 		[TAO_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for TAO])
-
 	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 5; then
 		dnl In PETSc >= 3.5, TAO is provided
@@ -1510,4 +1670,5 @@
 	dnl }}}
 	dnl M1QN3{{{
+	AC_MSG_CHECKING([for M1QN3])
 	AC_ARG_WITH(
 		[m1qn3-dir],
@@ -1516,5 +1677,4 @@
 		[M1QN3_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for M1QN3])
 	if test "x${M1QN3_ROOT}" == "xno"; then
 		HAVE_M1QN3=no
@@ -1529,5 +1689,9 @@
 	dnl M1QN3 libraries and header files
 	if test "x${HAVE_M1QN3}" == "xyes"; then
-		M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
+		if test "${IS_MSYS2}" == "yes"; then
+			M1QN3LIB="-Wl,${M1QN3_ROOT}/libm1qn3.a -Wl,${M1QN3_ROOT}/libddot.a"
+		else
+			M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
+		fi
 		AC_DEFINE([_HAVE_M1QN3_], [1], [with M1QN3 in ISSM src])
 		AC_SUBST([M1QN3LIB])
@@ -1535,4 +1699,5 @@
 	dnl }}}
 	dnl PROJ{{{
+	AC_MSG_CHECKING([for PROJ])
 	AC_ARG_WITH(
 		[proj-dir],
@@ -1541,5 +1706,4 @@
 		[PROJ_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for PROJ])
 	if test "x${PROJ_ROOT}" == "xno"; then
 		HAVE_PROJ=no
@@ -1563,4 +1727,5 @@
 	dnl }}}
 	dnl SLEPc{{{
+	AC_MSG_CHECKING([for SLEPc])
 	AC_ARG_WITH(
 		[slepc-dir],
@@ -1569,5 +1734,4 @@
 		[SLEPC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SLEPc])
 	if test "x${SLEPC_ROOT}" == "xno"; then
 		HAVE_SLEPC=no
@@ -1590,4 +1754,5 @@
 	dnl }}}
 	dnl shapelib{{{
+	AC_MSG_CHECKING([for shapelib])
 	AC_ARG_WITH(
 		[shapelib-dir],
@@ -1596,5 +1761,4 @@
 		[SHAPELIB_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for shapelib])
 	if test "x${SHAPELIB_ROOT}" == "xno"; then
 		HAVE_SHAPELIB=no
@@ -1615,8 +1779,10 @@
 		AC_SUBST([SHAPELIBLIB])
 	fi
+	AM_CONDITIONAL([SHP], [test "x${HAVE_SHAPELIB}" == "xyes"])
 	dnl }}}
 	dnl ScaLAPACK{{{
-
 	dnl NOTE: User should supply path to root directory or libraries, but not both
+	dnl
+	AC_MSG_CHECKING([for ScaLAPACK])
 	AC_ARG_WITH(
 		[scalapack-dir],
@@ -1631,5 +1797,4 @@
 		[SCALAPACKLIB="no"]
 	)
-	AC_MSG_CHECKING([for ScaLAPACK])
 	if test "x${SCALAPACK_ROOT}" == "xno" && test "x${SCALAPACKLIB}" == "xno"; then
 		HAVE_SCALAPACK=no
@@ -1640,5 +1805,9 @@
 		fi
 		HAVE_SCALAPACK=yes
-		SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
+		if test "${VENDOR}" == "win-msys2"; then
+			SCALAPACKLIB="-Wl,${SCALAPACK_ROOT}/lib/libscalapack.a"
+		else
+			SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
+		fi
 	elif test "x${SCALAPACKLIB}" != "xno"; then
 		dnl Value of SCALAPACKLIB should be valid here, so no need to set it (as above)
@@ -1656,4 +1825,17 @@
 	dnl }}}
 	dnl BLAS/LAPACK{{{
+	AC_MSG_CHECKING([for BLAS/LAPACK])
+	AC_ARG_WITH(
+		[blas-dir],
+		[AS_HELP_STRING([--with-blas-dir=DIR], [BLAS root directory])],
+		[BLAS_ROOT=$withval],
+		[BLAS_ROOT="no"]
+	)
+	AC_ARG_WITH(
+		[lapack-dir],
+		[AS_HELP_STRING([--with-lapack-dir=DIR], [LAPACK root directory])],
+		[LAPACK_ROOT=$withval],
+		[LAPACK_ROOT="no"]
+	)
 	AC_ARG_WITH(
 		[blas-lapack-dir],
@@ -1662,11 +1844,12 @@
 		[BLASLAPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for BLAS/LAPACK])
-	if test "x${BLASLAPACK_ROOT}" == "xno" ; then
+	if (test "x${BLAS_ROOT}" = "xno" || test "x${LAPACK_ROOT}" = "xno") && test "x${BLASLAPACK_ROOT}" = "xno"; then
 		HAVE_BLASLAPACK=no
 	else
 		HAVE_BLASLAPACK=yes
-		if ! test -d "${BLASLAPACK_ROOT}"; then
-			AC_MSG_ERROR([BLAS/LAPACK directory provided (${BLASLAPACK_ROOT}) does not exist!]);
+		if ! test -d "${BLAS_ROOT}" || ! test -d "${LAPACK_ROOT}"; then
+			if ! test -d "${BLASLAPACK_ROOT}"; then
+				AC_MSG_ERROR([Use either --with-blas-dir and --with-lapack-dir *or* --with-blaslapack-dir]);
+			fi
 		fi
 	fi
@@ -1675,5 +1858,4 @@
 	dnl BLAS/LAPACK libraries and header files
 	if test "x${HAVE_BLASLAPACK}" == "xyes"; then
-		BLASLAPACKINCL=""
 		case "${host_os}" in
 			*cygwin*)
@@ -1704,11 +1886,42 @@
 				fi
 			;;
+			*mingw*)
+				if test -d "${BLASLAPACK_ROOT}"; then
+					BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
+					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB+=" -lopenblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB="-Wl,${BLASLAPACK_ROOT}/lib/libflapack.a -Wl,${BLASLAPACK_ROOT}/lib/libfblas.a"
+					else
+						BLASLAPACKLIB+=" -llapack -lblas"
+					fi
+				else
+					BLASLAPACKLIB="-Wl,${LAPACK_ROOT}/lib/liblapack.a -Wl,${BLAS_ROOT}/lib/libblas.a"
+				fi
+			;;
+			*msys*)
+				if test -d "${BLASLAPACK_ROOT}"; then
+					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB=" -lopenblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB=" -lf2clapack -lf2cblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB+=" -lflapack -lfblas"
+					else
+						BLASLAPACKLIB=" -llapack -lblas"
+					fi
+				else
+					BLASLAPACKLIB="-L${LAPACK_ROOT}/lib -llapack -L${BLAS_ROOT}/lib -lblas"
+				fi
+			;;
 		esac
 		AC_DEFINE([_HAVE_BLASLAPACK_], [1], [with BLAS/LAPACK in ISSM src])
 		AC_SUBST([BLASLAPACKLIB])
-		AC_SUBST([BLASLAPACKINCL])
 	fi
 	dnl }}}
 	dnl Math Kernel Library (MKL){{{
+	AC_MSG_CHECKING([for MKL])
 	AC_ARG_WITH(
 		[mkl-libflags],
@@ -1717,5 +1930,4 @@
 		[MKL_LIBFLAGS="no"]
 	)
-	AC_MSG_CHECKING([for MKL])
 	if test "x${MKL_LIBFLAGS}" == "xno"; then
 		HAVE_MKL=no
@@ -1730,5 +1942,4 @@
 	dnl }}}
 	dnl PlaLAPACK{{{
-
 	dnl TODO: 	Handle user supplying path to root directory *or* individual
 	dnl 		arguments (like ScaLAPACK)
@@ -1765,4 +1976,5 @@
 	dnl }}}
 	dnl MUMPS{{{
+	AC_MSG_CHECKING([for MUMPS])
 	AC_ARG_WITH(
 		[mumps-dir],
@@ -1771,5 +1983,4 @@
 		[MUMPS_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MUMPS])
 	if test "x${MUMPS_ROOT}" == "xno"; then
 		HAVE_MUMPS=no
@@ -1786,11 +1997,11 @@
 		MUMPSINCL="-I${MUMPS_ROOT}/include"
 		if test "x${MUMPS_ROOT}" == "x${PETSC_ROOT}"; then
-			if test "x${PETSC_MAJOR}" == "x2"; then
-				MUMPSLIB="-L${MUMPS_ROOT}/lib "
+			if test "${VENDOR}" == "win-msys2"; then
+				MUMPSLIB="-Wl,${MUMPS_ROOT}/lib/libcmumps.a -Wl,${MUMPS_ROOT}/lib/libdmumps.a -Wl,${MUMPS_ROOT}/lib/libsmumps.a -Wl,${MUMPS_ROOT}/lib/libzmumps.a -Wl,${MUMPS_ROOT}/lib/libmumps_common.a -Wl,${MUMPS_ROOT}/lib/libpord.a"
 			else
 				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
 			fi
 		else
-			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord"
+			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord -lparmetis"
 		fi
 		AC_DEFINE([_HAVE_MUMPS_], [1], [with MUMPS in ISSM src])
@@ -1836,4 +2047,5 @@
 	dnl }}}
 	dnl BLACS{{{
+	AC_MSG_CHECKING([for BLACS])
 	AC_ARG_WITH(
 		[blacs-dir],
@@ -1842,5 +2054,4 @@
 		[BLACS_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for BLACS])
 	if test "x${BLACS_ROOT}" == "xno"; then
 		HAVE_BLACS=no
@@ -1863,4 +2074,5 @@
 	dnl }}}
 	dnl HYPRE{{{
+	AC_MSG_CHECKING([for HYPRE])
 	AC_ARG_WITH(
 		[hypre-dir],
@@ -1869,5 +2081,4 @@
 		[HYPRE_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for HYPRE])
 	if test "x${HYPRE_ROOT}" == "xno"; then
 		HAVE_HYPRE=no
@@ -1890,4 +2101,5 @@
 	dnl }}}
 	dnl Prometheus{{{
+	AC_MSG_CHECKING([for Prometheus])
 	AC_ARG_WITH(
 		[prometheus-dir],
@@ -1896,5 +2108,4 @@
 		[PROMETHEUS_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Prometheus])
 	if test "x${PROMETHEUS_ROOT}" == "xno"; then
 		HAVE_PROMETHEUS=no
@@ -1917,4 +2128,5 @@
 	dnl }}}
 	dnl SEMIC{{{
+	AC_MSG_CHECKING([for SEMIC])
 	AC_ARG_WITH(
 		[semic-dir],
@@ -1923,5 +2135,4 @@
 		[SEMIC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SEMIC])
 	if test "x${SEMIC_ROOT}" == "xno"; then
 		HAVE_SEMIC=no
@@ -1937,6 +2148,10 @@
 	if test "x${HAVE_SEMIC}" == "xyes"; then
 		SEMICINCL="-I${SEMIC_ROOT}"
+		if test "${IS_MSYS2}" == "yes"; then
+			SEMICLIB="-Wl,-L${SEMIC_ROOT}/lib -Wl,-lsurface_physics -Wl,-lutils"
+		else
+			SEMICLIB="-L${SEMIC_ROOT}/lib -lsurface_physics -lutils"
+		fi
 		AC_DEFINE([_HAVE_SEMIC_], [1], [with SEMIC in ISSM src])
-		SEMICLIB="-L${SEMIC_ROOT} -lsurface_physics -lutils"
 		AC_SUBST([SEMICLIB])
 		AC_SUBST([SEMICINCL])
@@ -1945,4 +2160,5 @@
 	dnl }}}
 	dnl SPAI{{{
+	AC_MSG_CHECKING([for SPAI])
 	AC_ARG_WITH(
 		[spai-dir],
@@ -1951,5 +2167,4 @@
 		[SPAI_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SPAI])
 	if test "x${SPAI_ROOT}" == "xno"; then
 		HAVE_SPAI=no
@@ -1972,4 +2187,5 @@
 	dnl }}}
 	dnl SuperLU{{{
+	AC_MSG_CHECKING([for SuperLU])
 	AC_ARG_WITH(
 		[superlu-dir],
@@ -1978,5 +2194,4 @@
 		[SUPERLU_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SuperLU])
 	if test "x${SUPERLU_ROOT}" == "xno"; then
 		HAVE_SUPERLU=no
@@ -1999,4 +2214,5 @@
 	dnl }}}
 	dnl SPOOLES{{{
+	AC_MSG_CHECKING([for SPOOLES])
 	AC_ARG_WITH(
 		[spooles-dir],
@@ -2005,5 +2221,4 @@
 		[SPOOLES_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SPOOLES])
 	if test "x${SPOOLES_ROOT}" == "xno"; then
 		HAVE_SPOOLES=no
@@ -2026,4 +2241,5 @@
 	dnl }}}
 	dnl PaStiX{{{
+	AC_MSG_CHECKING([for PaStiX])
 	AC_ARG_WITH(
 		[pastix-dir],
@@ -2032,5 +2248,4 @@
 		[PASTIX_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for PaStiX])
 	if test "x${PASTIX_ROOT}" == "xno"; then
 		HAVE_PASTIX=no
@@ -2054,4 +2269,5 @@
 	dnl }}}
 	dnl ml{{{
+	AC_MSG_CHECKING([for ml])
 	AC_ARG_WITH(
 		[ml-dir],
@@ -2060,5 +2276,4 @@
 		[ML_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ml])
 	if test "x${ML_ROOT}" == "xno"; then
 		HAVE_ML=no
@@ -2081,4 +2296,5 @@
 	dnl }}}
 	dnl UMFPACK{{{
+	AC_MSG_CHECKING([for UMFPACK])
 	AC_ARG_WITH(
 		[umfpack-dir],
@@ -2087,5 +2303,4 @@
 		[UMFPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for UMFPACK])
 	if test "x${UMFPACK_ROOT}" == "xno"; then
 		HAVE_UMFPACK=no
@@ -2124,4 +2339,5 @@
 	dnl }}}
 	dnl MATH77{{{
+	AC_MSG_CHECKING([for MATH77])
 	AC_ARG_WITH(
 		[math77-dir],
@@ -2130,5 +2346,4 @@
 		[MATH77_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MATH77])
 	if test "x${MATH77_ROOT}" == "xno"; then
 		HAVE_MATH77=no
@@ -2149,4 +2364,5 @@
 	dnl }}}
 	dnl Fortran{{{
+	AC_MSG_CHECKING(for Fortran compilation)
 	AC_ARG_WITH(
 		[fortran],
@@ -2155,5 +2371,4 @@
 		[FORTRAN=yes]
 	)
-	AC_MSG_CHECKING(for Fortran compilation)
 	if test "x${FORTRAN}" == "xyes"; then
 		HAVE_FORTRAN=yes
@@ -2219,4 +2434,5 @@
 	dnl }}}
 	dnl MeteoIO{{{
+	AC_MSG_CHECKING([for MeteoIO])
 	AC_ARG_WITH(
 		[meteoio-dir],
@@ -2225,5 +2441,4 @@
 		[METEOIO_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MeteoIO])
 	if test "x${METEOIO_ROOT}" == "xno"; then
 		HAVE_METEOIO=no
@@ -2248,4 +2463,5 @@
 	dnl }}}
 	dnl SNOWPACK{{{
+	AC_MSG_CHECKING([for SNOWPACK])
 	AC_ARG_WITH(
 		[snowpack-dir],
@@ -2254,5 +2470,4 @@
 		[SNOWPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SNOWPACK])
 	if test "x${SNOWPACK_ROOT}" == "xno"; then
 		HAVE_SNOWPACK=no
@@ -2276,4 +2491,5 @@
 	dnl }}}
 	dnl NeoPZ{{{
+	AC_MSG_CHECKING([for NeoPZ])
 	AC_ARG_WITH(
 		[neopz-dir],
@@ -2282,5 +2498,4 @@
 		[NEOPZ_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for NeoPZ])
 	if test "x${NEOPZ_ROOT}" == "xno"; then
 		HAVE_NEOPZ=no
@@ -2351,9 +2566,10 @@
 		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
 		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
-		AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
+		AC_DEFINE_UNQUOTED([_GMSH_VERSION_MAJOR_], ${GMSH_VERSION_MAJOR}, [Gmsh major version])
 	fi	
 	dnl }}}
 	dnl Capabilities
 	dnl with-bamg{{{
+	AC_MSG_CHECKING([for BAMG capability compilation])
 	AC_ARG_WITH(
 		[bamg],
@@ -2362,5 +2578,4 @@
 		[BAMG=yes]
 	)
-	AC_MSG_CHECKING([for BAMG capability compilation])
 	HAVE_BAMG=no
 	if test "x${BAMG}" == "xyes"; then
@@ -2372,4 +2587,5 @@
 	dnl }}}
 	dnl with-ocean{{{
+	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
 	AC_ARG_WITH(
 		[ocean],
@@ -2378,6 +2594,4 @@
 		[OCEAN=no]
 	)
-	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
-
 	HAVE_OCEAN=no
 	if test "x${OCEAN}" == "xyes"; then
@@ -2389,4 +2603,5 @@
 	dnl }}}
 	dnl with-kml{{{
+	AC_MSG_CHECKING(for kml capability compilation)
 	AC_ARG_WITH(
 		[kml],
@@ -2395,6 +2610,4 @@
 		[KML=no]
 	)
-	AC_MSG_CHECKING(for kml capability compilation)
-
 	HAVE_KML=no
 	if test "x${KML}" == "xyes"; then
@@ -2406,4 +2619,5 @@
 	dnl }}}
 	dnl with-kriging{{{
+	AC_MSG_CHECKING(for kriging capability compilation)
 	AC_ARG_WITH(
 		[kriging],
@@ -2412,6 +2626,4 @@
 		[KRIGING=yes]
 	)
-	AC_MSG_CHECKING(for kriging capability compilation)
-
 	HAVE_KRIGING=no
 	if test "x${KRIGING}" == "xyes"; then
@@ -2428,4 +2640,5 @@
 	dnl Platform specifics
 	dnl with-ios{{{
+	AC_MSG_CHECKING(for iOS compilation)
 	AC_ARG_WITH(
 		[ios],
@@ -2434,6 +2647,4 @@
 		[IOS=no]
 	)
-	AC_MSG_CHECKING(for iOS compilation)
-
 	HAVE_IOS=no
 	if test "x${IOS}" == "xyes"; then
@@ -2445,11 +2656,11 @@
 	dnl }}}
 	dnl with-android{{{
+	AC_MSG_CHECKING([for Android capability compilation])
 	AC_ARG_WITH(
 		[android],
 		AS_HELP_STRING([--with-android=EXE], [compile with Android capabilities (default: "no"; alternatives: "exe", "jni")]),
 		[ANDROID=${withval}],
-		[ANDROID=no])
-	AC_MSG_CHECKING([for Android capability compilation])
-
+		[ANDROID=no]
+	)
 	if test "x${ANDROID}" == "xjni"; then
 		HAVE_ANDROID=jni
@@ -2470,4 +2681,5 @@
 	dnl }}}
 	dnl with-android-ndk{{{
+	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
 	AC_ARG_WITH(
 		[android-ndk],
@@ -2476,6 +2688,4 @@
 		[ANDROID_NDK_ROOT=""]
 	)
-	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
-
 	if test -d "${ANDROID_NDK_ROOT}"; then
 		HAVE_ANDROID_NDK=yes
@@ -2491,5 +2701,6 @@
 	dnl other options
 	dnl optimization{{{
-	dnl -- bypass standard optimization -g -O2 -fPIC -std=c++11?
+	dnl -- bypass standard optimization -g -O2 -fPIC?
+	AC_MSG_CHECKING(for C++ optimization flags)
 	AC_ARG_WITH(
 		[cxxoptflags],
@@ -2498,9 +2709,9 @@
 		[CXXOPTFLAGS="-g -O2 -fPIC -std=c++11"]
 	)
-	AC_MSG_CHECKING(for C++ optimization flags)
 	AC_SUBST([CXXOPTFLAGS])
-	AC_MSG_RESULT([done])
+	AC_MSG_RESULT([${CXXOPTFLAGS}])
 	dnl }}}
 	dnl multithreading{{{
+	AC_MSG_CHECKING(for number of threads)
 	AC_ARG_WITH(
 		[numthreads],
@@ -2509,5 +2720,4 @@
 		[NUMTHREADS_VALUE=1]
 	)
-	AC_MSG_CHECKING(for number of threads)
 	dnl Check that supplied value is an integer
 	if [[ "${NUMTHREADS_VALUE}" != "${NUMTHREADS_VALUE}" 2> /dev/null ]]; then
@@ -2524,18 +2734,25 @@
 				MULTITHREADINGLIB="-lpthread -lrt"
 			;;
+			*darwin*)
+				MULTITHREADINGLIB="-lpthread"
+			;;
 			*linux*)
 				MULTITHREADINGLIB="-lpthread -lrt"
 			;;
-			*darwin*)
-				MULTITHREADINGLIB="-lpthread"
+			*mingw*)
+				MULTITHREADINGLIB=""
+			;;
+			*msys*)
+				MULTITHREADINGLIB=""
 			;;
 		esac
 		AC_DEFINE([_MULTITHREADING_], [1], [with multithreading enabled])
 	fi
-	AC_DEFINE_UNQUOTED(_NUMTHREADS_, $NUMTHREADS_VALUE, [number of threads])
+	AC_DEFINE_UNQUOTED([_NUMTHREADS_], ${NUMTHREADS_VALUE}, [number of threads])
 	AC_SUBST([MULTITHREADINGLIB])
 	AC_MSG_RESULT([${NUMTHREADS_VALUE}])
 	dnl }}}
 	dnl 64-bit indices{{{
+	AC_MSG_CHECKING([for 64-bit indices])
 	AC_ARG_WITH(
 		[64bit-indices],
@@ -2544,6 +2761,4 @@
 		[USE_64BIT_INDICES=0]
 	)
-	AC_MSG_CHECKING([for 64-bit indices])
-
 	if test "x${USE_64BIT_INDICES}" == "x1"; then
 		AC_DEFINE([ISSM_USE_64BIT_INDICES], [1], [with 64-bit indices])
@@ -2555,5 +2770,5 @@
 
 	dnl Checks {{{
-	AC_MSG_CHECKING(consistency between all libraries)
+	AC_MSG_CHECKING(consistency between all external packages)
 
 	dnl Check that if PETSc is requested, MPI is specified
@@ -2585,5 +2800,5 @@
 
 	dnl Check that if we run ADOL-C, we don't compile kriging.exe
-	if test "x$HAVE_ADOLC" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
+	if test "x${HAVE_ADOLC}" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
 		AC_MSG_ERROR([cannot compile kriging.exe under ADOL-C conditions!]);
 	fi
