Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 15677)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 15678)
@@ -854,9 +854,20 @@
 	AC_ARG_WITH([slepc-dir],
 	  AS_HELP_STRING([--with-slepc-dir=DIR],[slepc root directory]),
-	  [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
+	  [SLEPC_ROOT=$withval],[SLEPC_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for slepc headers and libraries in $SLEPC_ROOT)
-	if test -d "$SLEPC_ROOT"; then
+	dnl Check whether slepc is enabled
+	AC_MSG_CHECKING([for slepc])
+	if test "x$SLEPC_ROOT" = "xno" ; then
+		HAVE_SLEPC=no
+	else
 		HAVE_SLEPC=yes
+		if ! test -d "$SLEPC_ROOT"; then
+			AC_MSG_ERROR([slepc directory provided ($SLEPC_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_SLEPC)
+	
+	dnl slepc headers and libraries
+	if test "x$HAVE_SLEPC" == "xyes"; then
 		SLEPCINCL=-I"$SLEPC_ROOT/include"
 		SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"
@@ -864,40 +875,51 @@
 		AC_SUBST([SLEPCINCL])
 		AC_SUBST([SLEPCLIB])
-	else
-		HAVE_SLEPC=no
-	fi
-	AC_MSG_RESULT($HAVE_SLEPC)
+	fi
 	dnl }}}
 	dnl shapelib{{{
 	AC_ARG_WITH([shapelib-dir],
 	  AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
-	  [SHAPELIB_ROOT=$withval],[SHAPELIB_ROOT=""])
+	  [SHAPELIB_ROOT=$withval],[SHAPELIB_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for shapelib headers and libraries in $SHAPELIB_ROOT)
-	if test -d "$SHAPELIB_ROOT"; then
-
-		dnl defaults
+	dnl Check whether shapelib is enabled
+	AC_MSG_CHECKING([for shapelib])
+	if test "x$SHAPELIB_ROOT" = "xno" ; then
+		HAVE_SHAPELIB=no
+	else
 		HAVE_SHAPELIB=yes
+		if ! test -d "$SHAPELIB_ROOT"; then
+			AC_MSG_ERROR([shapelib directory provided ($SHAPELIB_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_SHAPELIB)
+	
+	dnl shapelib headers and libraries
+	if test "x$HAVE_SHAPELIB" == "xyes"; then
 		SHAPELIBINCL=-I"$SHAPELIB_ROOT/include"
 		SHAPELIBLIB=-L"$SHAPELIB_ROOT/lib/ -lshape"
-
 		AC_DEFINE([_HAVE_SHAPELIB_],[1],[with Shapelib in ISSM src])
 		AC_SUBST([SHAPELIBINCL])
 		AC_SUBST([SHAPELIBLIB])
-	else
-		HAVE_SHAPELIB=no
-	fi
-	AC_MSG_RESULT($HAVE_SHAPELIB)
+	fi
 	dnl }}}
 	dnl scalapack{{{
 	AC_ARG_WITH([scalapack-dir],
 	  AS_HELP_STRING([--with-scalapack-dir=DIR],[scalapack root directory]),
-	  [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
+	  [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for scalapack headers and libraries in $SCALAPACK_ROOT)
-	if test -d "$SCALAPACK_ROOT"; then
-
-		dnl defaults
+	dnl Check whether scalapack is enabled
+	AC_MSG_CHECKING([for scalapack])
+	if test "x$SCALAPACK_ROOT" = "xno" ; then
+		HAVE_SCALAPACK=no
+	else
 		HAVE_SCALAPACK=yes
+		if ! test -d "$SCALAPACK_ROOT"; then
+			AC_MSG_ERROR([scalapack directory provided ($SCALAPACK_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_SCALAPACK)
+	
+	dnl scalapack headers and libraries
+	if test "x$HAVE_SCALAPACK" == "xyes"; then
 		if test x$VENDOR = xintel-discover; then
 		 SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lmkl_scalapack_lp64"
@@ -905,72 +927,78 @@
 		 SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
 		fi
-
 		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
 		AC_SUBST([SCALAPACKLIB])
-	else
-		HAVE_SCALAPACK=no
-	fi
-	AC_MSG_RESULT($HAVE_SCALAPACK)
+	fi
 	dnl }}}
 	dnl blas-lapack{{{
 	AC_ARG_WITH([blas-lapack-dir],
 	  AS_HELP_STRING([--with-blas-lapack-dir=DIR],[blas-lapack root directory]),
-	  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
+	  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for blas and lapack headers and libraries in $BLASLAPACK_ROOT)
-	if test -d "$BLASLAPACK_ROOT"; then
-
-		dnl defaults
+	dnl Check whether blas-lapack is enabled
+	AC_MSG_CHECKING([for blas-lapack])
+	if 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]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_BLASLAPACK)
+	
+	dnl blas-lapack headers and libraries
+	if test "x$HAVE_BLASLAPACK" == "xyes"; then
 		BLASLAPACKINCL=""
-	
 		if test x$VENDOR = xintel-discover; then
-		 BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide -lpthread"
+			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide -lpthread"
 		else
-		dnl: branch on whether we are running on windows or linux.
-		case "${host_os}" in
-			*cygwin*)
-			BLASLAPACKLIB="-L`cygpath -m $BLASLAPACK_ROOT` -Wl,libf2cblas.lib  -Wl,libf2clapack.lib"
-			;;
-			*linux*)
-			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas " 
-			;;
-			*darwin*)
-			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas " 
-			;;
-		esac
-		fi
-
+			dnl: branch on whether we are running on windows or linux.
+			case "${host_os}" in
+				*cygwin*)
+				BLASLAPACKLIB="-L`cygpath -m $BLASLAPACK_ROOT` -Wl,libf2cblas.lib  -Wl,libf2clapack.lib"
+				;;
+				*linux*)
+				BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas " 
+				;;
+				*darwin*)
+				BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas " 
+				;;
+			esac
+		fi
 		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with blas lapack in ISSM src])
 		AC_SUBST([BLASLAPACKLIB])
 		AC_SUBST([BLASLAPACKINCL])
-	else
-		HAVE_BLASLAPACK=no
-	fi
-	AC_MSG_RESULT($HAVE_BLASLAPACK)
+	fi
 	dnl }}}
 	dnl mkl{{{
 	AC_ARG_WITH([mkl-dir],
 	  AS_HELP_STRING([--with-mkl-dir=DIR],[mkl root directory]),
-	  [MKL_ROOT=$withval],[MKL_ROOT=""])
+	  [MKL_ROOT=$withval],[MKL_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for mkl headers and libraries in $MKL_ROOT)
-	if test -d "$MKL_ROOT"; then
-
-		dnl defaults
+	dnl Check whether mkl is enabled
+	AC_MSG_CHECKING([for mkl])
+	if test "x$MKL_ROOT" = "xno" ; then
+		HAVE_MKL=no
+	else
 		HAVE_MKL=yes
+		if ! test -d "$MKL_ROOT"; then
+			AC_MSG_ERROR([mkl directory provided ($MKL_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_MKL)
+	
+	dnl mkl headers and libraries
+	if test "x$HAVE_MKL" == "xyes"; then
 		MKLINCL=""
 		if test x$VENDOR = xintel-pleiades; then
-		 MKLLIB=-L"$MKL_ROOT -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread"
+			MKLLIB=-L"$MKL_ROOT -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread"
 		else
-		 MKLLIB=-L"$MKL_ROOT -lmkl -lmkl_lapack -lmkl_scalapack_ilp64 -lmkl_blacs_sgimpt_ilp64 -lguide -lpthread"
+			MKLLIB=-L"$MKL_ROOT -lmkl -lmkl_lapack -lmkl_scalapack_ilp64 -lmkl_blacs_sgimpt_ilp64 -lguide -lpthread"
 		fi
 		AC_DEFINE([_HAVE_MKL_],[1],[with mkl in ISSM src])
 		AC_SUBST([MKLLIB])
 		AC_SUBST([MKLINCL])
-	else
-		HAVE_MKL=no
-	fi
-	AC_MSG_RESULT($HAVE_MKL)
+	fi
 	dnl }}}
 	dnl plapack{{{
@@ -989,9 +1017,7 @@
 		if test -n "$PLAPACK_INCLUDE"; then
 		
-			dnl defaults
 			HAVE_PLAPACK=yes
 			PLAPACKINCL="$PLAPACK_INCLUDE"
 			PLAPACKLIB="$PLAPACK_LIB"
-
 			AC_DEFINE([_HAVE_PLAPACK_],[1],[with Plapack in ISSM src])
 			AC_SUBST([PLAPACKINCL])
@@ -1008,27 +1034,32 @@
 	AC_ARG_WITH([mumps-dir],
 	  AS_HELP_STRING([--with-mumps-dir=DIR],[mumps root directory]),
-	  [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
+	  [MUMPS_ROOT=$withval],[MUMPS_ROOT="no"])
 			  
-	AC_MSG_CHECKING(for mumps headers and libraries in $MUMPS_ROOT)
-	if test -d "$MUMPS_ROOT"; then
-
-		dnl defaults
+	dnl Check whether mumps is enabled
+	AC_MSG_CHECKING([for mumps])
+	if test "x$MUMPS_ROOT" = "xno" ; then
+		HAVE_MUMPS=no
+	else
 		HAVE_MUMPS=yes
+		if ! test -d "$MUMPS_ROOT"; then
+			AC_MSG_ERROR([mumps directory provided ($MUMPS_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_MUMPS)
+	
+	dnl mumps headers and libraries
+	if test "x$HAVE_MUMPS" == "xyes"; then
 		MUMPSINCL=-I"$MUMPS_ROOT/include"
 		if test "$PETSC_MAJOR" = "2" ; then
-		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lpord "
+			MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lpord "
 		else
-		dnl MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lmumps_common -lpord -lparmetis -lzmumps"
-		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lmumps_common -lpord -lparmetis"
-		fi
-
+			dnl MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lmumps_common -lpord -lparmetis -lzmumps"
+			MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lmumps_common -lpord -lparmetis"
+		fi
 		AC_DEFINE([_HAVE_MUMPS_],[1],[with Mumps in ISSM src])
 		AC_SUBST([MUMPSINCL])
 		AC_SUBST([MUMPSLIB])
-	else
-		HAVE_MUMPS=no
 	fi
 	AM_CONDITIONAL([MUMPS], [test x$HAVE_MUMPS = xyes])
-	AC_MSG_RESULT($HAVE_MUMPS)
 	dnl }}}
 	dnl blacs{{{
