Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 15679)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 15680)
@@ -1066,11 +1066,20 @@
 	AC_ARG_WITH([blacs-dir],
 		AS_HELP_STRING([--with-blacs-dir=DIR],[blacs root directory]),
-			  [BLACS_ROOT=$withval],[BLACS_ROOT=""])
+			  [BLACS_ROOT=$withval],[BLACS_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for blacs headers and libraries in $BLACS_ROOT)
-	if test -d "$BLACS_ROOT"; then
-
-		dnl defaults
+	dnl Check whether blacs is enabled
+	AC_MSG_CHECKING([for blacs])
+	if test "x$BLACS_ROOT" = "xno" ; then
+		HAVE_BLACS=no
+	else
 		HAVE_BLACS=yes
+		if ! test -d "$BLACS_ROOT"; then
+			AC_MSG_ERROR([blacs directory provided ($BLACS_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_BLACS)
+	
+	dnl blacs headers and libraries
+	if test "x$HAVE_BLACS" == "xyes"; then
 		BLACSINCL=""
 		if test x$VENDOR = xintel-discover; then
@@ -1079,180 +1088,216 @@
 		 BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
 		fi
-        
 		AC_DEFINE([_HAVE_BLACS_],[1],[with Blacs in ISSM src])
 		AC_SUBST([BLACSINCL])
 		AC_SUBST([BLACSLIB])
-	else
-		HAVE_BLACS=no
-	fi
-	AC_MSG_RESULT($HAVE_BLACS)
+	fi
 	dnl }}}
 	dnl hypre{{{
 	AC_ARG_WITH([hypre-dir],
 	  AS_HELP_STRING([--with-hypre-dir=DIR],[hypre root directory]),
-			  [HYPRE_ROOT=$withval],[HYPRE_ROOT=""])
+			  [HYPRE_ROOT=$withval],[HYPRE_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for hypre headers and libraries in $HYPRE_ROOT)
-	if test -d "$HYPRE_ROOT"; then
-
-		dnl defaults
+	dnl Check whether hypre is enabled
+	AC_MSG_CHECKING([for hypre])
+	if test "x$HYPRE_ROOT" = "xno" ; then
+		HAVE_HYPRE=no
+	else
 		HAVE_HYPRE=yes
+		if ! test -d "$HYPRE_ROOT"; then
+			AC_MSG_ERROR([hypre directory provided ($HYPRE_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_HYPRE)
+
+	dnl hypre headers and libraries
+	if test "x$HAVE_HYPRE" == "xyes"; then
 		HYPREINCL=""
 		HYPRELIB=-L"$HYPRE_ROOT/lib -lHYPRE"
-        
-		AC_DEFINE([_HAVE_HYPRE_],[1],[with Blacs in ISSM src])
+		AC_DEFINE([_HAVE_HYPRE_],[1],[with Hypre in ISSM src])
 		AC_SUBST([HYPREINCL])
 		AC_SUBST([HYPRELIB])
-	else
-		HAVE_HYPRE=no
-	fi
-	AC_MSG_RESULT($HAVE_HYPRE)
+	fi
 	dnl }}}
 	dnl prometheus{{{
-		AC_ARG_WITH([prometheus-dir],
-					AS_HELP_STRING([--with-prometheus-dir=DIR],[prometheus root directory]),
-					[PROMETHEUS_ROOT=$withval],[PROMETHEUS_ROOT=""])
-
-		  AC_MSG_CHECKING(for prometheus headers and libraries in $PROMETHEUS_ROOT)
-		  if test -d "$PROMETHEUS_ROOT"; then
-
-			dnl defaults
-			  HAVE_PROMETHEUS=yes
-			  PROMETHEUSINCL=-I"$PROMETHEUS_ROOT/include"
-			  PROMETHEUSLIB=-L"$PROMETHEUS_ROOT/lib -lpromfei -lprometheus -lparmetis"
-
-			  AC_DEFINE([_HAVE_PROMETHEUS_],[1],[with Prometheus in ISSM src])
-			  AC_SUBST([PROMETHEUSINCL])
-			  AC_SUBST([PROMETHEUSLIB])
-		  else
-				HAVE_PROMETHEUS=no
+	AC_ARG_WITH([prometheus-dir],
+				AS_HELP_STRING([--with-prometheus-dir=DIR],[prometheus root directory]),
+				[PROMETHEUS_ROOT=$withval],[PROMETHEUS_ROOT="no"])
+
+		dnl Check whether prometheus is enabled
+		AC_MSG_CHECKING([for prometheus])
+		if test "x$PROMETHEUS_ROOT" = "xno" ; then
+			HAVE_PROMETHEUS=no
+		else
+			HAVE_PROMETHEUS=yes
+			if ! test -d "$PROMETHEUS_ROOT"; then
+				AC_MSG_ERROR([prometheus directory provided ($PROMETHEUS_ROOT) does not exist]);
 			fi
-			AC_MSG_RESULT($HAVE_PROMETHEUS)
+		fi
+		AC_MSG_RESULT($HAVE_PROMETHEUS)
+
+		dnl prometheus headers and libraries
+		if test "x$HAVE_PROMETHEUS" == "xyes"; then
+			 PROMETHEUSINCL=-I"$PROMETHEUS_ROOT/include"
+			 PROMETHEUSLIB=-L"$PROMETHEUS_ROOT/lib -lpromfei -lprometheus -lparmetis"
+			 AC_DEFINE([_HAVE_PROMETHEUS_],[1],[with Prometheus in ISSM src])
+			 AC_SUBST([PROMETHEUSINCL])
+			 AC_SUBST([PROMETHEUSLIB])
+	   fi
 		dnl }}}
 dnl spai{{{
 	AC_ARG_WITH([spai-dir],
 				AS_HELP_STRING([--with-spai-dir=DIR],[spai root directory]),
-				[SPAI_ROOT=$withval],[SPAI_ROOT=""])
-
-	  AC_MSG_CHECKING(for spai headers and libraries in $SPAI_ROOT)
-	  if test -d "$SPAI_ROOT"; then
-
-		dnl defaults
-		  HAVE_SPAI=yes
-		  SPAIINCL=-I"$SPAI_ROOT/include"
-		  SPAILIB=-L"$SPAI_ROOT/lib -lspai"
-
-		  AC_DEFINE([_HAVE_SPAI_],[1],[with Spai in ISSM src])
-		  AC_SUBST([SPAIINCL])
-		  AC_SUBST([SPAILIB])
-	  else
-		HAVE_SPAI=no
-		  fi
-		  AC_MSG_RESULT($HAVE_SPAI)
-		  dnl }}}
+				[SPAI_ROOT=$withval],[SPAI_ROOT="no"])
+
+		dnl Check whether spai is enabled
+		AC_MSG_CHECKING([for spai])
+		if test "x$SPAI_ROOT" = "xno" ; then
+			HAVE_SPAI=no
+		else
+			HAVE_SPAI=yes
+			if ! test -d "$SPAI_ROOT"; then
+				AC_MSG_ERROR([spai directory provided ($SPAI_ROOT) does not exist]);
+			fi
+		fi
+		AC_MSG_RESULT($HAVE_SPAI)
+
+		dnl spai headers and libraries
+		if test "x$HAVE_SPAI" == "xyes"; then
+			SPAIINCL=-I"$SPAI_ROOT/include"
+			SPAILIB=-L"$SPAI_ROOT/lib -lspai"
+			AC_DEFINE([_HAVE_SPAI_],[1],[with Spai in ISSM src])
+			AC_SUBST([SPAIINCL])
+			AC_SUBST([SPAILIB])
+		fi
+	  dnl }}}
 dnl superlu{{{ 
 	AC_ARG_WITH([superlu-dir],
 				AS_HELP_STRING([--with-superlu-dir=DIR],[superlu root directory]),
-				[SUPERLU_ROOT=$withval],[SUPERLU_ROOT=""])
-
-	  AC_MSG_CHECKING(for superlu headers and libraries in $SUPERLU_ROOT)
-	  if test -d "$SUPERLU_ROOT"; then
-
-		dnl defaults
-		  HAVE_SUPERLU=yes
+				[SUPERLU_ROOT=$withval],[SUPERLU_ROOT="no"])
+
+	dnl Check whether superlu is enabled
+	AC_MSG_CHECKING([for superlu])
+	if test "x$SUPERLU_ROOT" = "xno" ; then
+		HAVE_SUPERLU=no
+	else
+		HAVE_SUPERLU=yes
+		if ! test -d "$SUPERLU_ROOT"; then
+			AC_MSG_ERROR([superlu directory provided ($SUPERLU_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_SUPERLU)
+	
+	dnl superlu headers and libraries
+	if test "x$HAVE_SUPERLU" == "xyes"; then
 		  SUPERLUINCL=-I"$SUPERLU_ROOT/include"
 		  SUPERLULIB=-L"$SUPERLU_ROOT/lib -lsuperlu_4.3"
-
 		  AC_DEFINE([_HAVE_SUPERLU_],[1],[with Superlu in ISSM src])
 		  AC_SUBST([SUPERLUINCL])
 		  AC_SUBST([SUPERLULIB])
-	  else
-		HAVE_SUPERLU=no
-		  fi
-		  AC_MSG_RESULT($HAVE_SUPERLU)
-		  dnl }}}
+	 fi
+	 dnl }}}
 dnl spooles{{{ 
 	AC_ARG_WITH([spooles-dir],
 				AS_HELP_STRING([--with-spooles-dir=DIR],[spooles root directory]),
-				[SPOOLES_ROOT=$withval],[SPOOLES_ROOT=""])
-
-	  AC_MSG_CHECKING(for spooles headers and libraries in $SPOOLES_ROOT)
-	  if test -d "$SPOOLES_ROOT"; then
-
-		dnl defaults
-		  HAVE_SPOOLES=yes
+				[SPOOLES_ROOT=$withval],[SPOOLES_ROOT="no"])
+
+	dnl Check whether spooles is enabled
+	AC_MSG_CHECKING([for spooles])
+	if test "x$SPOOLES_ROOT" = "xno" ; then
+		HAVE_SPOOLES=no
+	else
+		HAVE_SPOOLES=yes
+		if ! test -d "$SPOOLES_ROOT"; then
+			AC_MSG_ERROR([spooles directory provided ($SPOOLES_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_SPOOLES)
+	
+	dnl spooles headers and libraries
+	if test "x$HAVE_SPOOLES" == "xyes"; then
 		  SPOOLESINCL=-I"$SPOOLES_ROOT/include"
 		  SPOOLESLIB=-L"$SPOOLES_ROOT/lib -lspooles"
-
 		  AC_DEFINE([_HAVE_SPOOLES_],[1],[with Spooles in ISSM src])
 		  AC_SUBST([SPOOLESINCL])
 		  AC_SUBST([SPOOLESLIB])
-	  else
-		HAVE_SPOOLES=no
-		  fi
-		  AC_MSG_RESULT($HAVE_SPOOLES)
-		  dnl }}}
+	 fi
+	 dnl }}}
 dnl pastix{{{ 
 	AC_ARG_WITH([pastix-dir],
 				AS_HELP_STRING([--with-pastix-dir=DIR],[pastix root directory]),
-				[PASTIX_ROOT=$withval],[PASTIX_ROOT=""])
-
-	  AC_MSG_CHECKING(for pastix headers and libraries in $PASTIX_ROOT)
-	  if test -d "$PASTIX_ROOT"; then
-
-		dnl defaults
-		  HAVE_PASTIX=yes
+				[PASTIX_ROOT=$withval],[PASTIX_ROOT="no"])
+
+	dnl Check whether pastix is enabled
+	AC_MSG_CHECKING([for pastix])
+	if test "x$PASTIX_ROOT" = "xno" ; then
+		HAVE_PASTIX=no
+	else
+		HAVE_PASTIX=yes
+		if ! test -d "$PASTIX_ROOT"; then
+			AC_MSG_ERROR([pastix directory provided ($PASTIX_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_PASTIX)
+	
+	dnl pastix headers and libraries
+	if test "x$HAVE_PASTIX" == "xyes"; then
 		  PASTIXINCL=-I"$PASTIX_ROOT/include"
 		  PASTIXLIB=-L"$PASTIX_ROOT/lib -lpastix_XXbit_mpi_smp_nobubble_int32_simple_real_scotch_i686_pc_linux -lptscotch -lptscotcherr -lpastix"
-
 		  AC_DEFINE([_HAVE_PASTIX_],[1],[with Pastix in ISSM src])
 		  AC_SUBST([PASTIXINCL])
 		  AC_SUBST([PASTIXLIB])
-	  else
-		HAVE_PASTIX=no
-		  fi
-		  AC_MSG_RESULT($HAVE_PASTIX)
-		  dnl }}}
+  fi
+  dnl }}}
 	dnl ml{{{
 	AC_ARG_WITH([ml-dir],
 	  AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
-			  [ML_ROOT=$withval],[ML_ROOT=""])
+			  [ML_ROOT=$withval],[ML_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for ml headers and libraries in $ML_ROOT)
-	if test -d "$ML_ROOT"; then
-
-		dnl defaults
+	dnl Check whether ml is enabled
+	AC_MSG_CHECKING([for ml])
+	if test "x$ML_ROOT" = "xno" ; then
+		HAVE_ML=no
+	else
 		HAVE_ML=yes
+		if ! test -d "$ML_ROOT"; then
+			AC_MSG_ERROR([ml directory provided ($ML_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_ML)
+	
+	dnl ml headers and libraries
+	if test "x$HAVE_ML" == "xyes"; then
 		MLINCL=-I"$ML_ROOT/include"
 		MLLIB=-L"$ML_ROOT/lib -lml"
-        
 		AC_DEFINE([_HAVE_ML_],[1],[with Blacs in ISSM src])
 		AC_SUBST([MLINCL])
 		AC_SUBST([MLLIB])
-	else
-		HAVE_ML=no
-	fi
-	AC_MSG_RESULT($HAVE_ML)
+	fi
 	dnl }}}
 	dnl umfpack{{{
 		AC_ARG_WITH([umfpack-dir],
 		  AS_HELP_STRING([--with-umfpack-dir=DIR],[UMFPACK root directory]),
-					[UMFPACK_ROOT=$withval],[UMFPACK_ROOT=""])
-
-		AC_MSG_CHECKING(for UMFPACK headers and libraries in $UMFPACK_ROOT)
-		if test -d "$UMFPACK_ROOT"; then
-
-			dnl defaults
-			HAVE_UMFPACK=yes
-			UMFPACKINCL=""
-			UMFPACKLIB=-L"$UMFPACK_ROOT/lib -lumfpack -lumfpack.5.5.1"
-
-			AC_DEFINE([_HAVE_UMFPACK_],[1],[with UMFPACK in ISSM src])
-			AC_SUBST([UMFPACKINCL])
-			AC_SUBST([UMFPACKLIB])
-		else
-			HAVE_UMFPACK=no
-		fi
-		AC_MSG_RESULT($HAVE_UMFPACK)
+					[UMFPACK_ROOT=$withval],[UMFPACK_ROOT="no"])
+			  
+	dnl Check whether umfpack is enabled
+	AC_MSG_CHECKING([for umfpack])
+	if test "x$UMFPACK_ROOT" = "xno" ; then
+		HAVE_UMFPACK=no
+	else
+		HAVE_UMFPACK=yes
+		if ! test -d "$UMFPACK_ROOT"; then
+			AC_MSG_ERROR([umfpack directory provided ($UMFPACK_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_UMFPACK)
+	
+	dnl umfpack headers and libraries
+	if test "x$HAVE_UMFPACK" == "xyes"; then
+		UMFPACKINCL=""
+		UMFPACKLIB=-L"$UMFPACK_ROOT/lib -lumfpack -lumfpack.5.5.1"
+		AC_DEFINE([_HAVE_UMFPACK_],[1],[with UMFPACK in ISSM src])
+		AC_SUBST([UMFPACKINCL])
+		AC_SUBST([UMFPACKLIB])
+	fi
 	dnl }}}
 dnl math{{{
@@ -1266,5 +1311,4 @@
 		HAVE_MATH=yes
 		MATHLIB="$MATH_LIB"
-
 		AC_DEFINE([_HAVE_MATH_],[1],[with MATH in ISSM src])
 		AC_SUBST([MATHLIB])
@@ -1275,19 +1319,25 @@
 		AC_ARG_WITH([math77-dir],
 					AS_HELP_STRING([--with-math77-dir=DIR], [math77 root directory.]),
-					[MATH77_ROOT=$withval],[MATH77_ROOT=""]) 
-		  AC_MSG_CHECKING(for math77)
-
-		  if test -d "$MATH77_ROOT"; then
-
-			HAVE_MATH77=yes
-			  MATH77LIB="-L$MATH77_ROOT/ -lmath77"
-
-			  AC_DEFINE([_HAVE_MATH77_],[1],[with math77 in ISSM src])
-			  AC_SUBST([MATH77LIB])
-		  else
-			HAVE_MATH77=no
-			  fi
-			  AC_MSG_RESULT($HAVE_MATH77)
-			  dnl }}}
+					[MATH77_ROOT=$withval],[MATH77_ROOT="no"]) 
+		  
+	dnl Check whether math77 is enabled
+	AC_MSG_CHECKING([for math77])
+	if test "x$MATH77_ROOT" = "xno" ; then
+		HAVE_MATH77=no
+	else
+		HAVE_MATH77=yes
+		if ! test -d "$MATH77_ROOT"; then
+			AC_MSG_ERROR([math77 directory provided ($MATH77_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_MATH77)
+	
+	dnl math77 headers and libraries
+	if test "x$HAVE_MATH77" == "xyes"; then
+		MATH77LIB="-L$MATH77_ROOT/ -lmath77"
+		AC_DEFINE([_HAVE_MATH77_],[1],[with math77 in ISSM src])
+		AC_SUBST([MATH77LIB])
+   fi
+	dnl }}}
 	dnl fortran{{{
 	AC_ARG_WITH([fortran],
@@ -1298,5 +1348,4 @@
 		dnl defaults
 		HAVE_FORTRAN=yes
-
 		AC_DEFINE([_HAVE_FORTRAN_],[1],[with fortran capability])
 	else
@@ -1341,5 +1390,4 @@
 
 	dnl check that --with-graphics-lib may have been provided
-	
 	if test -n "$GRAPHICS_LIB" ; then
 		dnl check that library provided EXISTS!
