Index: sm/trunk-jpl/externalpackages/dakota/README
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/README	(revision 14469)
+++ 	(revision )
@@ -1,9 +1,0 @@
-version 4.3 of dakota is not yet released. The 4.3 version 
-here refers to the VOTD release on May 12th 2009. While waiting 
-for 4.3, we consider the develpment version to be 4.3.
-4.2 is replaced by 4.3, to handle fnEvalId extra arguemnt to the Dakota 
-structure.
-
-Be sure to set FC and F77 variable names to point to your fortran compiler, otherwise, 
-	the LHS packages will pick up gfortran as its fortran compiler, which can create serious 
-	troubles.
Index: /issm/trunk-jpl/externalpackages/dakota/configs/5.2/Teuchos_ConfigDefs.hpp.patch
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/configs/5.2/Teuchos_ConfigDefs.hpp.patch	(revision 14470)
+++ /issm/trunk-jpl/externalpackages/dakota/configs/5.2/Teuchos_ConfigDefs.hpp.patch	(revision 14470)
@@ -0,0 +1,2 @@
+87a88
+> #include <stddef.h>
Index: sm/trunk-jpl/externalpackages/dakota/dakota_njs_notes_macos64.txt
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/dakota_njs_notes_macos64.txt	(revision 14469)
+++ 	(revision )
@@ -1,5 +1,0 @@
-Matlab might try to use its local /Applications/MATLAB_R2011b.app/sys/os/maci64/ fortran libraries
-instead of the gfortran package libraries.  Matlab library is missing some symbols, so you might
-need to link to the actual gfortran library 
-sudo cp /Applications/MATLAB_R2011b.app/sys/os/maci64/libgfortran.3.dynlib /Applications/MATLAB_R2011b.app/sys/os/maci64/libgfortran.3.dynlib.matlab
-sudo ln -s /usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/libgfortran.3.dylib libgfortran.3.dylib
Index: /issm/trunk-jpl/externalpackages/dakota/install-5.2-linux64-larsen.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-5.2-linux64-larsen.sh	(revision 14470)
+++ /issm/trunk-jpl/externalpackages/dakota/install-5.2-linux64-larsen.sh	(revision 14470)
@@ -0,0 +1,53 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf Dakota
+rm -rf src 
+rm -rf install 
+mkdir src install 
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
+
+#Untar 
+tar -zxvf Dakota_5_2.src.tar.gz
+
+#Move Dakota to src directory
+mv Dakota/* src
+rm -rf Dakota
+
+#Apply patches
+patch src/src/ParallelLibrary.C configs/5.2/ParallelLibrary.C.patch
+patch src/src/ParallelLibrary.H configs/5.2/ParallelLibrary.H.patch
+patch src/src/NonDSampling.C configs/5.2/NonDSampling.C.patch
+patch src/src/NonDLocalReliability.C configs/5.2/NonDLocalReliability.C.patch
+patch src/src/NonDUnilevelRBDO.C configs/5.2/NonDUnilevelRBDO.C.patch    #  source not even used?
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.2/pecos_global_defs.hpp.patch
+patch src/packages/teuchos/src/Teuchos_ConfigDefs.hpp configs/5.2/Teuchos_ConfigDefs.hpp.patch
+
+#Configure dakota
+cd src
+./configure \
+	--prefix="$ISSM_DIR/externalpackages/dakota/install" \
+	--without-graphics  \
+	--with-pic \
+	--disable-mpi \
+	--with-plugin \
+	--with-blas=/usr/lib/libblas.a \
+	--with-lapack=/usr/lib/liblapack.a
+
+/u/astrid-r1b/morlighe/issmjpl/cron/trunk-jpl/externalpackages/blas/install/lib/libblas.a
+cd ..
+
+#Compile and install dakota
+cd src 
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
