Index: issm/branches/trunk-jpl-damage/m4/issm_options.m4
===================================================================
--- issm/branches/trunk-jpl-damage/m4/issm_options.m4	(revision 12004)
+++ issm/branches/trunk-jpl-damage/m4/issm_options.m4	(revision 12168)
@@ -13,31 +13,15 @@
 	fi
 	dnl }}}
-	dnl Serial build {{{
-	AC_ARG_WITH([serial],
-		AS_HELP_STRING([--with-serial = value],[serial compilation. ]),
-		[SERIAL_VALUE=$withval],[SERIAL_VALUE="yes"])
-	AC_MSG_CHECKING(for serial compilation)
-	AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
-	AM_CONDITIONAL([SERIAL], [test $SERIAL_VALUE = yes])
-	AC_MSG_RESULT($SERIAL_VALUE) 
-	dnl }}}
-	dnl Parallel build {{{
-	AC_ARG_WITH([parallel],
-		AS_HELP_STRING([--with-parallel = value], [parallel compilation. ]),
-		[PARALLEL_VALUE=$withval],[PARALLEL_VALUE="yes"])
-	AC_MSG_CHECKING(for parallel compilation)
-	AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
-	AM_CONDITIONAL([PARALLEL], [test $PARALLEL_VALUE = yes])
-	AC_MSG_RESULT($PARALLEL_VALUE) 
+	dnl Modules build {{{
+	AC_ARG_WITH([modules],
+		AS_HELP_STRING([--with-modules = value],[modules compilation. ]),
+		[MODULES_VALUE=$withval],[MODULES_VALUE="yes"])
+	AC_MSG_CHECKING(for modules compilation)
+	AM_CONDITIONAL([MODULES], [test $MODULES_VALUE = yes])
+	AC_MSG_RESULT($MODULES_VALUE) 
+	dnl }}}
+	dnl Extensions{{{
 	ISSMEXT=".exe"
 	AC_SUBST([ISSMEXT])
-	dnl }}}
-	dnl Serial or Parallel check {{{
-	dnl Check that at least serial or parallel builds have been requested!
-	if test "$SERIAL_VALUE" != "yes" ; then
-		if test "$PARALLEL_VALUE" != "yes"; then
-			AC_MSG_ERROR([cannot request --with-serial=no and --with-parallel=no at the same time!])
-		fi
-	fi
 	dnl }}}
 
@@ -81,4 +65,8 @@
 			export CXXFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
 			export CFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
+		elif test $VENDOR = arm-linux; then
+			export CC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-cc
+			export CXX=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-cc
+
 		else
 		AC_MSG_ERROR([unknow compiler vendor!])
@@ -92,8 +80,8 @@
 	dnl 1. See if matlab has been provided
 	AC_ARG_WITH([matlab-dir],
-		AS_HELP_STRING([--with-matlab-dir = DIR], [matlab root directory. necessary for serial build.]),
+		AS_HELP_STRING([--with-matlab-dir=DIR], [matlab root directory. necessary for serial build.]),
 		[MATLAB_ROOT=$withval],[MATLAB_ROOT=""]) 
 
-	AC_MSG_CHECKING([wether Matlab is enabled])
+	AC_MSG_CHECKING([whether matlab is enabled])
 	if test -d "$MATLAB_ROOT"; then
 		HAVE_MATLAB=yes
@@ -109,5 +97,5 @@
 	dnl 2. if matlab is provided, get version number
 	if test x$HAVE_MATLAB = xyes; then
-		AC_MSG_CHECKING([for Matlab version])
+		AC_MSG_CHECKING([for matlab version])
 		MATLAB_VERSION=""
 
@@ -172,5 +160,5 @@
 
 		dnl 3. Get Matlab libraries
-		AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT)
+		AC_MSG_CHECKING(for matlab headers and libraries in $MATLAB_ROOT)
 		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
 		
@@ -191,9 +179,9 @@
 			*darwin*)
 				dnl mex -v gives all the flags for compilation of mex files
-				dnl if matlab version is 7.10 or more, we must use mexmaci64 (64 bits)
+				dnl if matlab version is 7.9 or more, we must use mexmaci64 (64 bits)
 				MEXLINK="-O -Wl,-flat_namespace -undefined suppress -arch i386 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
 				MEXLIB=" -L$MATLAB_ROOT/bin/maci/ -lmx -lmex -lmat -lstdc++ -largeArrayDims"
 				if test $MATLAB_MAJOR -ge 7; then 
-					 if test $MATLAB_MINOR -ge 10; then 
+					 if test $MATLAB_MINOR -ge 9; then 
 						  MEXLINK="-O -Wl,-flat_namespace -undefined suppress -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci64/mexFunction.map"
 							 MEXLIB=" -L$MATLAB_ROOT/bin/maci64/ -lmx -lmex -lmat -lstdc++"
@@ -217,6 +205,6 @@
 		AC_SUBST([MATLABINCL])
 		AC_SUBST([MEX])
-		WRAPPEREXT=$MEXEXT
-		AC_SUBST([WRAPPEREXT])
+		MATLABWRAPPEREXT=$MEXEXT
+		AC_SUBST([MATLABWRAPPEREXT])
 		AC_SUBST([MEXLIB]) 
 		AC_SUBST([MEXLINK])
@@ -225,7 +213,7 @@
 	dnl triangle {{{
 	AC_ARG_WITH([triangle-dir],
-			  AS_HELP_STRING([--with-triangle-dir = DIR], [triangle root directory. necessary for serial build]),
+			  AS_HELP_STRING([--with-triangle-dir=DIR], [triangle root directory. necessary for serial build]),
 			 [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""]) 
-	AC_MSG_CHECKING(for Triangle headers and libraries)
+	AC_MSG_CHECKING(for triangle headers and libraries)
 
 	if test -d "$TRIANGLE_ROOT"; then
@@ -266,7 +254,7 @@
 	dnl dakota{{{
 	AC_ARG_WITH([dakota-dir],
-	  AS_HELP_STRING([--with-dakota-dir = DIR], [dakota root directory. necessary for serial build]),
+	  AS_HELP_STRING([--with-dakota-dir=DIR], [dakota root directory. necessary for serial build]),
 	  [DAKOTA_ROOT=$withval],[DAKOTA_ROOT=""]) 
-	AC_MSG_CHECKING(for Dakota)
+	AC_MSG_CHECKING(for dakota)
 	
 	if test -d "$DAKOTA_ROOT"; then
@@ -299,7 +287,7 @@
 	dnl boost{{{
 	AC_ARG_WITH([boost-dir],
-	  AS_HELP_STRING([--with-boost-dir = DIR], [boost root directory.]),
+	  AS_HELP_STRING([--with-boost-dir=DIR], [boost root directory.]),
 	  [BOOST_ROOT=$withval],[BOOST_ROOT=""]) 
-	AC_MSG_CHECKING(for Boost)
+	AC_MSG_CHECKING(for boost)
 	
 	if test -d "$BOOST_ROOT"; then
@@ -318,9 +306,29 @@
 	AC_MSG_RESULT($HAVE_BOOST)
 	dnl }}}
+	dnl python-version{{{
+	AC_ARG_WITH([python-version],
+	  AS_HELP_STRING([--with-python-version = PYTHONVERSION],[python version.]),
+	  [PYTHONVERSION=$withval],[PYTHONVERSION=""])
+	AC_MSG_CHECKING(for python version)
+
+	HAVE_PYTHON3="no"
+
+	dnl recover major: 
+	PYTHON_MAJOR=${PYTHONVERSION%.*}
+
+	if test x$PYTHON_MAJOR = x3; then
+		dnl are we running python 3?
+		HAVE_PYTHON3="yes"
+	fi
+	AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_],$PYTHON_MAJOR,[python version major])
+
+	AM_CONDITIONAL([PYTHON3], [test x$HAVE_PYTHON3 = xyes])
+	AC_MSG_RESULT($PYTHON_MAJOR)
+	dnl }}}
 	dnl python{{{
 	AC_ARG_WITH([python-dir],
-	  AS_HELP_STRING([--with-python-dir = DIR], [python root directory.]),
+	  AS_HELP_STRING([--with-python-dir=DIR], [python root directory.]),
 	  [PYTHON_ROOT=$withval],[PYTHON_ROOT=""]) 
-	AC_MSG_CHECKING(for Python)
+	AC_MSG_CHECKING(for python)
 	
 	if test -d "$PYTHON_ROOT"; then
@@ -328,5 +336,5 @@
 		HAVE_PYTHON=yes
 		PYTHONINCL=-I$PYTHON_ROOT/include
-		PYTHONLIB="-L$PYTHON_ROOT/lib -lpython3.2"
+		PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHONVERSION"
 		PYTHONEXT=.so
 		PYTHONLINK="-dynamiclib"
@@ -335,6 +343,6 @@
 		AC_SUBST([PYTHONINCL])
 		AC_SUBST([PYTHONLIB])
-		WRAPPEREXT=$PYTHONEXT
-		AC_SUBST([WRAPPEREXT])
+		PYTHONWRAPPEREXT=$PYTHONEXT
+		AC_SUBST([PYTHONWRAPPEREXT])
 		AC_SUBST([PYTHONLINK])
 	else
@@ -346,7 +354,7 @@
 	dnl python-numpy{{{
 	AC_ARG_WITH([python-numpy-dir],
-	  AS_HELP_STRING([--with-python-numpy-dir = DIR], [python-numpy root directory.]),
+	  AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory.]),
 	  [PYTHON_NUMPY_ROOT=$withval],[PYTHON_NUMPY_ROOT=""]) 
-	AC_MSG_CHECKING(for Python-Numpy)
+	AC_MSG_CHECKING(for python-numpy)
 	
 	if test -d "$PYTHON_NUMPY_ROOT"; then
@@ -364,7 +372,7 @@
 	dnl chaco{{{
 	AC_ARG_WITH([chaco-dir],
-	  AS_HELP_STRING([--with-chaco-dir = DIR], [chaco root directory.]),
+	  AS_HELP_STRING([--with-chaco-dir=DIR], [chaco root directory.]),
 	  [CHACO_ROOT=$withval],[CHACO_ROOT=""]) 
-	AC_MSG_CHECKING(for Chaco)
+	AC_MSG_CHECKING(for chaco)
 	
 	if test -d "$CHACO_ROOT"; then
@@ -386,7 +394,7 @@
 	dnl scotch{{{
 	AC_ARG_WITH([scotch-dir],
-	  AS_HELP_STRING([--with-scotch-dir = DIR], [scotch root directory.]),
+	  AS_HELP_STRING([--with-scotch-dir=DIR], [scotch root directory.]),
 	  [SCOTCH_ROOT=$withval],[SCOTCH_ROOT=""]) 
-	AC_MSG_CHECKING(for Scotch)
+	AC_MSG_CHECKING(for scotch)
 	
 	if test -d "$SCOTCH_ROOT"; then
@@ -408,7 +416,7 @@
 	dnl adolc{{{
 	AC_ARG_WITH([adolc-dir],
-		AS_HELP_STRING([--with-adolc-dir = DIR], [adolc root directory.]),
+		AS_HELP_STRING([--with-adolc-dir=DIR], [adolc root directory.]),
 		[ADOLC_ROOT=$withval],[ADOLC_ROOT="no"]) 
-	AC_MSG_CHECKING(for ADOLC)
+	AC_MSG_CHECKING(for adolc)
 
 	if test "x$ADOLC_ROOT" = "xno"; then
@@ -436,7 +444,7 @@
 	dnl adic2{{{
 	AC_ARG_WITH([adic2-dir],
-	  AS_HELP_STRING([--with-adic2-dir = DIR], [adic2 root directory.]),
+	  AS_HELP_STRING([--with-adic2-dir=DIR], [adic2 root directory.]),
 	  [ADIC2_ROOT=$withval],[ADIC2_ROOT="no"]) 
-	AC_MSG_CHECKING(for ADIC2)
+	AC_MSG_CHECKING(for adic2)
 
 	if test "x$ADIC2_ROOT" = "xno"; then
@@ -464,7 +472,7 @@
 	dnl gsl{{{
 	AC_ARG_WITH([gsl-dir],
-	  AS_HELP_STRING([--with-gsl-dir = DIR], [gsl root directory.]),
+	  AS_HELP_STRING([--with-gsl-dir=DIR], [gsl root directory.]),
 	  [GSL_ROOT=$withval],[GSL_ROOT=""]) 
-	AC_MSG_CHECKING(for Gsl)
+	AC_MSG_CHECKING(for gsl)
 	
 	if test -d "$GSL_ROOT"; then
@@ -487,7 +495,7 @@
 	dnl rose{{{
 	AC_ARG_WITH([rose-dir],
-	  AS_HELP_STRING([--with-rose-dir = DIR], [rose root directory.]),
+	  AS_HELP_STRING([--with-rose-dir=DIR], [rose root directory.]),
 	  [ROSE_ROOT=$withval],[ROSE_ROOT=""]) 
-	AC_MSG_CHECKING(for Rose)
+	AC_MSG_CHECKING(for rose)
 	
 	if test -d "$ROSE_ROOT"; then
@@ -510,10 +518,10 @@
 	dnl metis{{{
 	AC_ARG_WITH([metis-dir],
-	  AS_HELP_STRING([--with-metis-dir = DIR],[metis root directory. necessary for serial build]),
+	  AS_HELP_STRING([--with-metis-dir=DIR],[metis root directory. necessary for serial build]),
 	  [METIS_ROOT=$withval],[METIS_ROOT=""])
 
 	if test -d "$METIS_ROOT"; then
 
-		AC_MSG_CHECKING(for Metis headers and libraries in $METIS_ROOT)
+		AC_MSG_CHECKING(for metis headers and libraries in $METIS_ROOT)
 
 		dnl first figure out version of metis: does the VERSION file exist?
@@ -568,10 +576,5 @@
 		HAVE_METIS=no
 	fi
-
-	if test $HAVE_METIS = no; then
-		AC_MSG_ERROR([--with-metis-dir  missing. Metis is needed to run ISSM]);
-	else
-		AC_MSG_RESULT($HAVE_METIS)
-	fi
+	AM_CONDITIONAL([METIS], [test x$HAVE_METIS = xyes])
 	dnl }}}
 	dnl mpi{{{
@@ -582,5 +585,5 @@
 	
 	AC_ARG_WITH([mpi-include],
-	  AS_HELP_STRING([--with-mpi-include = DIR],[mpi include directory, necessary for parallel build]),
+	  AS_HELP_STRING([--with-mpi-include=DIR],[mpi include directory, necessary for parallel build]),
 	  [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])
 	
@@ -591,4 +594,5 @@
 			HAVE_MPI=no
 		else
+			HAVE_MPI=yes
 			MPIINCL=-I"$MPI_INCLUDE/"
 			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
@@ -598,13 +602,14 @@
 		fi
 	fi
-	AC_MSG_RESULT(done)
+	AM_CONDITIONAL([MPI], [test x$HAVE_MPI = xyes])
+	AC_MSG_RESULT($HAVE_MPI)
 	dnl }}}
 	dnl petsc{{{
 	AC_ARG_WITH([petsc-dir],
-	  AS_HELP_STRING([--with-petsc-dir = DIR],[PETSc root directory, necessary for parallel build]),
+	  AS_HELP_STRING([--with-petsc-dir=DIR],[PETSc root directory, necessary for parallel build]),
 	  [PETSC_ROOT=$withval],[PETSC_ROOT=""])
 		
 	if test -d "$PETSC_ROOT"; then
-		AC_MSG_CHECKING(for PETSc version)
+		AC_MSG_CHECKING(for petsc version)
 		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'`
@@ -614,5 +619,5 @@
 
 		PETSC_VERSION_DATE_HG=`cat $PETSC_ROOT/include/petscversion.h | grep "#define PETSC_VERSION_DATE_HG" | sed 's/#define PETSC_VERSION_DATE_HG//' | sed 's/ //g' | sed -e 's/\"//g' `
-		AC_MSG_CHECKING(wether PETSc is the development version)
+		AC_MSG_CHECKING(whether petsc is the development version)
 		if test x$PETSC_VERSION_DATE_HG = xunknown; then
 			AC_DEFINE([_HAVE_PETSCDEV_],[1],[with PETSc-dev])
@@ -624,8 +629,8 @@
 	
 	AC_ARG_WITH([petsc-arch],
-	  AS_HELP_STRING([--with-petsc-arch = DIR],[PETSc arch , necessary for parallel build]),
+	  AS_HELP_STRING([--with-petsc-arch=DIR],[PETSc arch , necessary for parallel build]),
 	  [PETSC_ARCH=$withval],[PETSC_ARCH=""])
 
-	AC_MSG_CHECKING(for PETSc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
+	AC_MSG_CHECKING(for petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
 	
 	if test -d "$PETSC_ROOT"; then
@@ -671,7 +676,7 @@
 	dnl tao{{{
 	AC_ARG_WITH([tao-dir],
-		AS_HELP_STRING([--with-tao-dir = DIR], [tao root directory.]),
+		AS_HELP_STRING([--with-tao-dir=DIR], [tao root directory.]),
 		[TAO_ROOT=$withval],[TAO_ROOT=""]) 
-	AC_MSG_CHECKING(for Tao)
+	AC_MSG_CHECKING(for tao)
 
 	if test -d "$TAO_ROOT"; then
@@ -689,33 +694,10 @@
 	AC_MSG_RESULT($HAVE_TAO)
 	dnl }}}
-	dnl mpiuni{{{
-	dnl when running in serial mode, MPI must be ignored, and set to internal petsc mpiuni: 
-	if test "$PARALLEL_VALUE" = "no" ; then
-		HAVE_MPI=yes
-		MPIINCL=-I"$PETSC_ROOT/include/mpiuni"
-
-		case "${host_os}" in
-			*cygwin*)
-			dnl MPILIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libmpiuni.lib"
-			;;
-			*linux*)
-			MPILIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
-			;;
-			*darwin*)
-			MPILIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
-			;;
-		esac
-								  
-		AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
-		AC_SUBST([MPIINCL])
-		AC_SUBST([MPILIB])
-	fi
-	dnl }}}
 	dnl slepc{{{
 	AC_ARG_WITH([slepc-dir],
-	  AS_HELP_STRING([--with-slepc-dir = DIR],[slepc root directory]),
+	  AS_HELP_STRING([--with-slepc-dir=DIR],[slepc root directory]),
 	  [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Slepc headers and libraries in $SLEPC_ROOT)
+	AC_MSG_CHECKING(for slepc headers and libraries in $SLEPC_ROOT)
 	if test -d "$SLEPC_ROOT"; then
 		HAVE_SLEPC=yes
@@ -733,8 +715,8 @@
 	dnl shapelib{{{
 	AC_ARG_WITH([shapelib-dir],
-	  AS_HELP_STRING([--with-shapelib-dir = DIR], [shapelib root directory]),
+	  AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
 	  [SHAPELIB_ROOT=$withval],[SHAPELIB_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Shapelib headers and libraries in $SHAPELIB_ROOT)
+	AC_MSG_CHECKING(for shapelib headers and libraries in $SHAPELIB_ROOT)
 	if test -d "$SHAPELIB_ROOT"; then
 
@@ -754,8 +736,8 @@
 	dnl scalapack{{{
 	AC_ARG_WITH([scalapack-dir],
-	  AS_HELP_STRING([--with-scalapack-dir = DIR],[scalapack root directory]),
+	  AS_HELP_STRING([--with-scalapack-dir=DIR],[scalapack root directory]),
 	  [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Scalapack headers and libraries in $SCALAPACK_ROOT)
+	AC_MSG_CHECKING(for scalapack headers and libraries in $SCALAPACK_ROOT)
 	if test -d "$SCALAPACK_ROOT"; then
 
@@ -773,8 +755,8 @@
 	dnl blas{{{
 	AC_ARG_WITH([blas-lapack-dir],
-	  AS_HELP_STRING([--with-blas-lapack-dir = DIR],[blas-lapack root directory]),
+	  AS_HELP_STRING([--with-blas-lapack-dir=DIR],[blas-lapack root directory]),
 	  [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Blas and Lapack headers and libraries in $BLASLAPACK_ROOT)
+	AC_MSG_CHECKING(for blas and lapack headers and libraries in $BLASLAPACK_ROOT)
 	if test -d "$BLASLAPACK_ROOT"; then
 
@@ -806,5 +788,5 @@
 	dnl mkl{{{
 	AC_ARG_WITH([mkl-dir],
-	  AS_HELP_STRING([--with-mkl-dir = DIR],[mkl root directory]),
+	  AS_HELP_STRING([--with-mkl-dir=DIR],[mkl root directory]),
 	  [MKL_ROOT=$withval],[MKL_ROOT=""])
 			  
@@ -825,8 +807,9 @@
 	dnl }}}
 	dnl plapack{{{
+	AC_MSG_CHECKING(for plapack)
+	
 	AC_ARG_WITH([plapack-lib],
 	  AS_HELP_STRING([--with-plapack-lib = lib],[plapack library]),
 	  [PLAPACK_LIB=$withval],[PLAPACK_LIB=""])
-	AC_MSG_CHECKING(for Plapack libraries)
 	
 	AC_ARG_WITH([plapack-include],
@@ -834,5 +817,4 @@
 							 [plapack include ]),
 			  [PLAPACK_INCLUDE=$withval],[PLAPACK_INCLUDE=""])
-	AC_MSG_CHECKING(for Plapack headers)
 	  
 	if test -n "$PLAPACK_LIB"; then
@@ -857,8 +839,8 @@
 	dnl mumps{{{
 	AC_ARG_WITH([mumps-dir],
-	  AS_HELP_STRING([--with-mumps-dir = DIR],[mumps root directory]),
+	  AS_HELP_STRING([--with-mumps-dir=DIR],[mumps root directory]),
 	  [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Mumps headers and libraries in $MUMPS_ROOT)
+	AC_MSG_CHECKING(for mumps headers and libraries in $MUMPS_ROOT)
 	if test -d "$MUMPS_ROOT"; then
 
@@ -882,8 +864,8 @@
 	dnl blacs{{{
 	AC_ARG_WITH([blacs-dir],
-		AS_HELP_STRING([--with-blacs-dir = DIR],[blacs root directory]),
+		AS_HELP_STRING([--with-blacs-dir=DIR],[blacs root directory]),
 			  [BLACS_ROOT=$withval],[BLACS_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Blacs headers and libraries in $BLACS_ROOT)
+	AC_MSG_CHECKING(for blacs headers and libraries in $BLACS_ROOT)
 	if test -d "$BLACS_ROOT"; then
 
@@ -903,8 +885,8 @@
 	dnl hypre{{{
 	AC_ARG_WITH([hypre-dir],
-	  AS_HELP_STRING([--with-hypre-dir = DIR],[hypre root directory]),
+	  AS_HELP_STRING([--with-hypre-dir=DIR],[hypre root directory]),
 			  [HYPRE_ROOT=$withval],[HYPRE_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Hypre headers and libraries in $HYPRE_ROOT)
+	AC_MSG_CHECKING(for hypre headers and libraries in $HYPRE_ROOT)
 	if test -d "$HYPRE_ROOT"; then
 
@@ -924,8 +906,8 @@
 	dnl ml{{{
 	AC_ARG_WITH([ml-dir],
-	  AS_HELP_STRING([--with-ml-dir = DIR],[ml root directory]),
+	  AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
 			  [ML_ROOT=$withval],[ML_ROOT=""])
 			  
-	AC_MSG_CHECKING(for Ml headers and libraries in $ML_ROOT)
+	AC_MSG_CHECKING(for ml headers and libraries in $ML_ROOT)
 	if test -d "$ML_ROOT"; then
 
@@ -1229,5 +1211,5 @@
 	AC_MSG_CHECKING(consistency between all libraries)
 	
-	dnl check that if petsc is requested in parallel, mpi should be specified
+	dnl check that if petsc is requested , mpi should be specified
 	if test "$HAVE_PETSC" = "yes" ; then
 		if test "$HAVE_MPI" = "NO";  then
@@ -1236,15 +1218,22 @@
 	fi
 
-	dnl check that we have either python or matlab support if we only compile serially
-	if test "$PARALLEL_VALUE" = "no"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
-		AC_MSG_ERROR([need at least python or matlab support to compile only in serial mode!]);
-	fi
-
-	dnl check that we don't have with-matlab and with-python at the same time
-	if test "$HAVE_PYTHON" = "yes" ; then
-		if test "$HAVE_MATLAB" = "yes";  then
-			AC_MSG_ERROR([cannot create matlab and python wrappers simultaneously! Please choose one or the other.]);
-		fi
-	fi
+	dnl check that we have either python or matlab support if we compile the modules
+	if test "$MODULES_VALUE" = "yes"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
+		AC_MSG_ERROR([need at least python or matlab support to compile modules (or use --with-modules=no)]);
+	fi
+
+	dnl check that we have python version if python compile is specified
+	if test "$HAVE_PYTHON" = "yes"  && test "$PYTHONVERSION" = "" ; then
+	AC_MSG_ERROR([need python-version if python compile is required!]);
+	fi
+
+	dnl check that if we have MPI, we have metis
+	if test "$HAVE_METIS" = "yes"  && test "$HAVE_MPI" = "no" ; then
+	AC_MSG_ERROR([need mpi if using the metis partitioner!]);
+	fi
+
+
+
+
 
 	AC_MSG_RESULT(done)
@@ -1257,5 +1246,5 @@
 	  AS_HELP_STRING([--with-cxxoptflags = CXXOPTFLAGS], [optimization using CXX flags, ex: --with-cxxoptflags=-march=opteron -O3]),
 	  [CXXOPTFLAGS=$withval],[CXXOPTFLAGS="-g -O2"]) 
-	AC_MSG_CHECKING(for C++ optimization flags)
+	AC_MSG_CHECKING(for c++ optimization flags)
 	AC_SUBST([CXXOPTFLAGS])
 	AC_MSG_RESULT(done)
