Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 11735)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 11736)
@@ -375,4 +375,27 @@
 	AC_MSG_RESULT($HAVE_ADIC2)
 	dnl }}}
+	dnl gsl{{{1
+	AC_ARG_WITH([gsl-dir],
+			  AS_HELP_STRING([--with-gsl-dir = DIR], [gsl root directory.]),
+			 [GSL_ROOT=$withval],[GSL_ROOT=""]) 
+	AC_MSG_CHECKING(for Gsl)
+	
+	if test -d "$GSL_ROOT"; then
+
+		dnl defaults
+		HAVE_GSL=yes
+		GSLINCL="-I$GSL_ROOT/include"
+		GSLLIB="-L$GSL_ROOT/lib/ -lgsl -lgslcblas -lm"
+
+		AC_DEFINE([_HAVE_GSL_],[1],[with gsl in ISSM src])
+		AC_SUBST([GSLINCL])
+		AC_SUBST([GSLLIB])
+
+	else
+		HAVE_GSL=no
+	fi
+	AM_CONDITIONAL([GSL], [test x$HAVE_GSL = xyes])
+	AC_MSG_RESULT($HAVE_GSL)
+	dnl }}}
 	dnl rose{{{1
 	AC_ARG_WITH([rose-dir],
@@ -479,19 +502,12 @@
 							 [mpi include directory, necessary for parallel build]),
 			  [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])
-
-	dnl check that --with-mpi-include and --with-mpi-lib have been provided
+	
 	if test -z "$MPILIB" ; then
-		if test "$PARALLEL_VALUE" = "yes" ; then
-			AC_MSG_ERROR([empty --with-mpi-lib options! MPI is needed to run ISSM in parallel!])
-		fi
+		HAVE_MPI=no
 	else
 		if test -z "$MPI_INCLUDE" ; then
-			if test "$PARALLEL_VALUE" = "yes" ; then
-				AC_MSG_ERROR([empty --with-mpi-include directory! MPI is needed to run ISSM in parallel!])
-			fi
+			HAVE_MPI=no
 		else
-			HAVE_MPI=yes
 			MPIINCL=-I"$MPI_INCLUDE/"
-			
 			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
 			AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
@@ -1142,4 +1158,15 @@
 	AM_CONDITIONAL([THREED], [test x$HAVE_THREED = xyes])
 	AC_MSG_RESULT($HAVE_THREED)
+	dnl }}}
+	dnl checks{{{1
+	AC_MSG_CHECKING(checking consistency between all libraries)
+	
+	dnl check that if petsc is requested in parallel, mpi should be specified
+	if test "$HAVE_PETSC" = "yes" ; then
+		if test "$HAVE_MPI" = "NO";  then
+			AC_MSG_ERROR([petsc requires mpi!]);
+		fi
+	fi
+	AC_MSG_RESULT(done)
 	dnl }}}
 
