Index: issm/trunk/autom4te.cache/traces.0
===================================================================
--- issm/trunk/autom4te.cache/traces.0	(revision 132)
+++ issm/trunk/autom4te.cache/traces.0	(revision 1378)
@@ -1,18 +1,16 @@
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/amversion.m4:20: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
+m4trace:/usr/share/aclocal-1.10/amversion.m4:20: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10.2], [],
+m4_if([$1], [1.10], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/amversion.m4:37: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.2])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
-  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
+m4trace:/usr/share/aclocal-1.10/amversion.m4:35: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+m4trace:/usr/share/aclocal-1.10/auxdir.m4:52: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly.
 AC_PREREQ([2.50])dnl
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/cond.m4:34: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
+m4trace:/usr/share/aclocal-1.10/cond.m4:34: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl
  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
 	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
@@ -33,5 +31,5 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/depend.m4:132: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
+m4trace:/usr/share/aclocal-1.10/depend.m4:132: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl
 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
@@ -137,8 +135,8 @@
   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/depend.m4:142: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+m4trace:/usr/share/aclocal-1.10/depend.m4:142: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/depend.m4:158: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
+m4trace:/usr/share/aclocal-1.10/depend.m4:158: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking,
 [  --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors])
@@ -151,14 +149,5 @@
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/depout.m4:63: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [# Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
+m4trace:/usr/share/aclocal-1.10/depout.m4:54: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do
   # Strip MF so we end up with the name of the file.
   mf=`echo "$mf" | sed -e 's/:.*$//'`
@@ -170,5 +159,5 @@
   # Grep'ing the whole file is not good either: AIX grep has a line
   # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
     dirpart=`AS_DIRNAME("$mf")`
   else
@@ -200,13 +189,13 @@
 done
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/depout.m4:77: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
+m4trace:/usr/share/aclocal-1.10/depout.m4:68: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
+m4trace:/usr/share/aclocal-1.10/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+m4trace:/usr/share/aclocal-1.10/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
 You should run autoupdate.])dnl
 AC_CONFIG_HEADERS($@)])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/init.m4:103: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
+m4trace:/usr/share/aclocal-1.10/init.m4:103: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
@@ -285,10 +274,9 @@
 ])
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/init.m4:125: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
-_am_arg=$1
+m4trace:/usr/share/aclocal-1.10/init.m4:124: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers.
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
-    $_am_arg | $_am_arg:* )
+    $1 | $1:* )
       break ;;
     * )
@@ -296,9 +284,9 @@
   esac
 done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+m4trace:/usr/share/aclocal-1.10/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
 AC_SUBST(install_sh)])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
+m4trace:/usr/share/aclocal-1.10/lead-dot.m4:21: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null
 mkdir .tst 2>/dev/null
 if test -d .tst; then
@@ -309,5 +297,5 @@
 rmdir .tst 2>/dev/null
 AC_SUBST([am__leading_dot])])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
+m4trace:/usr/share/aclocal-1.10/make.m4:51: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
@@ -346,5 +334,5 @@
 rm -f confinc confmf
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/minuso.m4:35: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
+m4trace:/usr/share/aclocal-1.10/minuso.m4:34: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl
 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([compile])dnl
@@ -352,7 +340,6 @@
 # there is no other way.
 set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
+ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
    # Losing compiler, so override with the script.
    # FIXME: It is wrong to rewrite CC.
@@ -367,8 +354,8 @@
           [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
+m4trace:/usr/share/aclocal-1.10/missing.m4:17: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN])
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/missing.m4:35: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+m4trace:/usr/share/aclocal-1.10/missing.m4:35: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
@@ -381,5 +368,5 @@
 fi
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/mkdirp.m4:26: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
+m4trace:/usr/share/aclocal-1.10/mkdirp.m4:26: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
@@ -396,14 +383,14 @@
 esac
 ])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+m4trace:/usr/share/aclocal-1.10/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+m4trace:/usr/share/aclocal-1.10/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+m4trace:/usr/share/aclocal-1.10/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+m4trace:/usr/share/aclocal-1.10/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+m4trace:/usr/share/aclocal-1.10/runlog.m4:17: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
    ac_status=$?
    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    (exit $ac_status); }])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
+m4trace:/usr/share/aclocal-1.10/sanity.m4:51: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane])
 # Just in case
 sleep 1
@@ -442,5 +429,5 @@
 fi
 AC_MSG_RESULT(yes)])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+m4trace:/usr/share/aclocal-1.10/strip.m4:28: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 # Installed binaries are usually stripped using `strip' when the user
 # run `make install-strip'.  However `strip' might not be the right
@@ -453,6 +440,6 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
-m4trace:/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
+m4trace:/usr/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE])
+m4trace:/usr/share/aclocal-1.10/tar.m4:95: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility.
 AM_MISSING_PROG([AMTAR], [tar])
 m4_if([$1], [v7],
@@ -525,5 +512,5 @@
 AC_SUBST([am__untar])
 ])
-m4trace:m4/issm_options.m4:393: -1- AC_DEFUN([ISSM_OPTIONS], [
+m4trace:m4/issm_options.m4:474: -1- AC_DEFUN([ISSM_OPTIONS], [
 	dnl Debugging option check.
 	AC_ARG_ENABLE([debugging],AS_HELP_STRING([--enable-debugging],
@@ -591,4 +578,9 @@
 			fi
 			;;
+			*darwin9.6.0*)
+			MEXLIB=-L"$MATLAB_ROOT/bin/maci/ -lmex -lmx"
+			MEXLINK="-Wl,-twolevel_namespace -undefined error -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
+			;;
+
 		esac
 
@@ -659,5 +651,27 @@
 	fi
 	AC_MSG_RESULT(ok)
+
+	dnl Dakota directory
+	AC_ARG_WITH([dakota-dir],
+			  AS_HELP_STRING([--with-dakota-dir = DIR], [dakota root directory. necessary for serial build]),
+			 [DAKOTA_ROOT=$withval],[DAKOTA_ROOT=""]) 
+	AC_MSG_CHECKING(for Dakota )
 	
+	if test -d "$DAKOTA_ROOT"; then
+
+		dnl defaults
+		HAVE_DAKOTA=yes
+		DAKOTAINCL=-I$DAKOTA_ROOT/include
+		DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -lfftw3 -llhs  -levidence -lsurfpack -lconmin -lddace -lfsudace    -ljega -lcport -lopt -lpsuade -lnewmat    -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl     -lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver "
+
+		AC_DEFINE([_HAVE_DAKOTA_],[1],[with Dakota in ISSM src])
+		AC_SUBST([DAKOTAINCL])
+		AC_SUBST([DAKOTALIB])
+
+	else
+		HAVE_DAKOTA=no
+	fi
+	AC_MSG_RESULT($HAVE_DAKOTA)
+
 		
 	dnl Metis directory
@@ -716,4 +730,5 @@
 			
 			AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+			AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
 			AC_SUBST([MPIINCL])
 			AC_SUBST([MPILIB])
@@ -834,7 +849,8 @@
 		HAVE_BLASLAPACK=yes
 		BLASLAPACKINCL=""
-		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
-
-		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with Scalapack in ISSM src])
+		dnl BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
+		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack"
+
+		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with blas lapack in ISSM src])
 		AC_SUBST([BLASLAPACKLIB])
 		AC_SUBST([BLASLAPACKINCL])
@@ -844,4 +860,25 @@
 	AC_MSG_RESULT($HAVE_BLASLAPACK)
 
+	dnl mkl directory
+	AC_ARG_WITH([mkl-dir],
+			  AS_HELP_STRING([--with-mkl-dir = DIR],
+							 [mkl root directory]),
+			  [MKL_ROOT=$withval],[MKL_ROOT=""])
+			  
+	AC_MSG_CHECKING(for mkl headers and libraries in $MKL_ROOT)
+	if test -d "$MKL_ROOT"; then
+
+		dnl defaults
+		HAVE_MKL=yes
+		MKLINCL=""
+		MKLLIB=-L"$MKL_ROOT -lmkl_lapack -lmkl -lguide"
+
+		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)
 
 	dnl Plapack directory
@@ -912,6 +949,37 @@
 	AC_MSG_RESULT($HAVE_BLACS)
 
-
-
+	dnl math library  option
+	AC_MSG_CHECKING(for math library...)
+	AC_ARG_WITH([math-lib],
+			  AS_HELP_STRING([--with-math-lib = otions],
+							 [math options, for ex: "/usr/lib/libm.a]),
+			  [MATH_LIB=$withval],[MATH_LIB=""])
+
+	dnl check that --with-math-lib may have been provided
+	if test -n "$MATH_LIB" ; then
+		HAVE_MATH=yes
+		MATHLIB="$MATH_LIB"
+
+		AC_DEFINE([_HAVE_MATH_],[1],[with MATH in ISSM src])
+		AC_SUBST([MATHLIB])
+	fi
+	AC_MSG_RESULT(done)
+
+	dnl fortran library  option
+	AC_MSG_CHECKING(for fortran library...)
+	AC_ARG_WITH([fortran-lib],
+			  AS_HELP_STRING([--with-fortran-lib = options],
+							 [fortran options, for ex: "/usr/lib/gfortran.a]),
+			  [FORTRAN_LIB=$withval],[FORTRAN_LIB=""])
+
+	dnl check that --with-fortran-lib may have been provided
+	if test -n "$FORTRAN_LIB" ; then
+		HAVE_FORTRAN=yes
+		FORTRANLIB="$FORTRAN_LIB"
+
+		AC_DEFINE([_HAVE_FORTRAN_],[1],[with FORTRAN in ISSM src])
+		AC_SUBST([FORTRANLIB])
+	fi
+	AC_MSG_RESULT(done)
 
 ])
@@ -1664,5 +1732,5 @@
 m4trace:configure.ac:2: -1- AM_CONFIG_HEADER([config.h])
 m4trace:configure.ac:2: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
-You should run autoupdate.], [/u/astrid1/larour/issm/trunk/devpackages/automake/install/share/aclocal-1.10/header.m4:12: AM_CONFIG_HEADER is expanded from...
+You should run autoupdate.], [/usr/share/aclocal-1.10/header.m4:12: AM_CONFIG_HEADER is expanded from...
 configure.ac:2: the top level])
 m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
@@ -1681,6 +1749,6 @@
 m4trace:configure.ac:4: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
 m4trace:configure.ac:4: -1- AM_SET_CURRENT_AUTOMAKE_VERSION
-m4trace:configure.ac:4: -1- AM_AUTOMAKE_VERSION([1.10.2])
-m4trace:configure.ac:4: -1- _AM_AUTOCONF_VERSION([2.63])
+m4trace:configure.ac:4: -1- AM_AUTOMAKE_VERSION([1.10])
+m4trace:configure.ac:4: -1- _AM_AUTOCONF_VERSION([2.61])
 m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
 m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
@@ -1690,4 +1758,9 @@
 m4trace:configure.ac:4: -1- m4_pattern_allow([^CYGPATH_W$])
 m4trace:configure.ac:4: -1- _AM_SET_OPTIONS([])
+m4trace:configure.ac:4: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete.
+You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~76/SRC/autoconf/lib/autoconf/general.m4:198: AC_FOREACH is expanded from...
+/usr/share/aclocal-1.10/options.m4:26: _AM_SET_OPTIONS is expanded from...
+/usr/share/aclocal-1.10/init.m4:103: AM_INIT_AUTOMAKE is expanded from...
+configure.ac:4: the top level])
 m4trace:configure.ac:4: -1- m4_pattern_allow([^PACKAGE$])
 m4trace:configure.ac:4: -1- m4_pattern_allow([^VERSION$])
@@ -1716,5 +1789,4 @@
 m4trace:configure.ac:4: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
 m4trace:configure.ac:4: -1- AM_PROG_MKDIR_P
-m4trace:configure.ac:4: -1- m4_pattern_allow([^MKDIR_P$])
 m4trace:configure.ac:4: -1- m4_pattern_allow([^mkdir_p$])
 m4trace:configure.ac:4: -1- m4_pattern_allow([^AWK$])
@@ -1837,8 +1909,8 @@
 m4trace:configure.ac:12: -1- AX_MATLAB
 m4trace:configure.ac:12: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [autoconf/general.m4:209: AC_HELP_STRING is expanded from...
+You should run autoupdate.], [/var/tmp/autoconf/autoconf-14~76/SRC/autoconf/lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from...
 m4/matlab.m4:469: AX_MATLAB is expanded from...
 m4/matlab.m4:323: AX_MATLAB_VERSION is expanded from...
-m4/issm_options.m4:393: ISSM_OPTIONS is expanded from...
+m4/issm_options.m4:474: ISSM_OPTIONS is expanded from...
 configure.ac:12: the top level])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^HAVE_MATLAB$])
@@ -1857,8 +1929,12 @@
 m4trace:configure.ac:12: -1- m4_pattern_allow([^TRIANGLEINCL$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^TRIANGLELIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_DAKOTA_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^DAKOTAINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^DAKOTALIB$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_METIS_$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^METISINCL$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^METISLIB$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MPI_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^HAVE_MPI$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^MPIINCL$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^MPILIB$])
@@ -1874,4 +1950,7 @@
 m4trace:configure.ac:12: -1- m4_pattern_allow([^BLASLAPACKLIB$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^BLASLAPACKINCL$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MKL_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MKLLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MKLINCL$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_PLAPACK_$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^PLAPACKINCL$])
@@ -1883,6 +1962,10 @@
 m4trace:configure.ac:12: -1- m4_pattern_allow([^BLACSINCL$])
 m4trace:configure.ac:12: -1- m4_pattern_allow([^BLACSLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_MATH_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^MATHLIB$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^_HAVE_FORTRAN_$])
+m4trace:configure.ac:12: -1- m4_pattern_allow([^FORTRANLIB$])
 m4trace:configure.ac:18: -1- m4_pattern_allow([^LIB@&t@OBJS$])
 m4trace:configure.ac:18: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.ac:18: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
+m4trace:configure.ac:18: -1- _AC_AM_CONFIG_HEADER_HOOK([$ac_file])
 m4trace:configure.ac:18: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
