Index: /issm/trunk-jpl/examples/Pig2/runme.m
===================================================================
--- /issm/trunk-jpl/examples/Pig2/runme.m	(revision 24310)
+++ /issm/trunk-jpl/examples/Pig2/runme.m	(revision 24311)
@@ -1,5 +1,5 @@
-steps=[1:8];
-
-if any(steps==1)   %Mesh Generation #1
+steps=1;
+
+if any(steps==1) %Mesh Generation #1
 
 	%Mesh parameters
@@ -158,5 +158,5 @@
 if any(steps==6) %Transient Run #1
 
-	md = loadmodel('../Pig/Models/PIG_Control_drag');	
+	md = loadmodel('./Models/PIG_Control_drag');	
 
 	md.inversion.iscontrol=0;
Index: /issm/trunk-jpl/externalpackages/adjoinablempi/install-macosx64.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/adjoinablempi/install-macosx64.sh	(revision 24310)
+++ /issm/trunk-jpl/externalpackages/adjoinablempi/install-macosx64.sh	(revision 24311)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk-jpl/externalpackages/boost/install-1.55-linux64-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.55-linux64-static.sh	(revision 24311)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.55-linux64-static.sh	(revision 24311)
@@ -0,0 +1,39 @@
+#!/bin/bash
+#set -eu
+#unhook set -eu because some target do fail and it is not a big deal
+
+#Note of caution:  stop after boostrap phase, and run
+#bjam --debug-configuration, to figure out which paths boost is using to include
+#python. make sure everyone of these paths is covered by python. If not, just make
+#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY
+#to get the boost library to include python support without doing that.
+
+#Some cleanup
+rm -rf install boost_1_55_0 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz boost_1_55_0.tar.gz
+
+#Untar
+tar -zxvf boost_1_55_0.tar.gz
+
+#Move boost into install directory
+mv boost_1_55_0/* src
+rm -rf boost_1_55_0
+
+#Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
+export CXXFLAGS='-std=c++98'
+
+#Configure and compile
+cd src
+./bootstrap.sh \
+	--prefix="$ISSM_DIR/externalpackages/boost/install" \
+	--with-python=python
+
+#Compile boost
+./bjam toolset=gcc link=static install
+
+#put bjam into install also
+mkdir ../install/bin
+cp bjam ../install/bin
Index: /issm/trunk-jpl/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh	(revision 24311)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh	(revision 24311)
@@ -0,0 +1,47 @@
+#!/bin/bash
+set -eu
+
+# NOTE: Stop after boostrap phase, and run
+#
+#	bjam --debug-configuration
+#
+# to figure out which paths boost is using to include python. Make sure everyone
+# of these paths is covered by python. If not, just make symlinks in
+# externalpackages/python to what boost is expecting. There is NO WAY to get the
+# boost library to include python support without doing that.
+
+#Some cleanup
+rm -rf install boost_1_55_0 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+
+#Untar
+tar -zxvf  boost_1_55_0.tar.gz
+
+#Move boost into install directory
+mv boost_1_55_0/* src
+rm -rf boost_1_55_0
+
+patch src/boost/atomic/detail/cas128strong.hpp ./configs/1.55/cas128strong.hpp.patch
+patch src/boost/atomic/detail/gcc-atomic.hpp ./configs/1.55/gcc-atomic.hpp.patch
+patch src/tools/build/v2/user-config.jam ./configs/1.55/user-config.jam.patch
+patch src/tools/build/v2/tools/darwin.jam ./configs/1.55/darwin.jam.patch
+patch src/tools/build/v2/tools/darwin.py ./configs/1.55/darwin.py.patch
+
+#Configure and compile
+cd src
+./bootstrap.sh \
+	--prefix="$ISSM_DIR/externalpackages/boost/install" \
+	--with-python=python
+
+#Compile boost
+# Need gcc with iconv installed in a location that has been added to your path
+# export CC=/usr/local/gfortan/bin/gcc
+# export CXX=/usr/local/gfortran/bin/g++
+./bjam toolset=darwin link=static runtime-link=static install
+
+#put bjam into install also:
+mkdir ../install/bin
+cp bjam ../install/bin
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux64-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux64-static.sh	(revision 24311)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux64-static.sh	(revision 24311)
@@ -0,0 +1,81 @@
+#!/bin/bash
+set -eu
+
+# Constants
+DAK_VER="6.2"
+
+#Some cleanup
+rm -rf Dakota
+rm -rf src
+rm -rf build
+rm -rf install
+mkdir src build install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/dakota-${DAK_VER}-public.src.tar.gz dakota-${DAK_VER}-public-src.tar.gz
+
+#Untar
+tar -zxvf dakota-${DAK_VER}-public-src.tar.gz
+
+#Move Dakota to src directory
+mv dakota-${DAK_VER}.0.src/* src
+rm -rf dakota-${DAK_VER}.0.src
+
+#Set up Dakota cmake variables and config
+DAK_PATH=$ISSM_DIR/externalpackages/dakota
+
+export DAK_BUILD=$DAK_PATH/build
+export DAK_INSTALL=$DAK_PATH/install
+export DAK_SRC=$DAK_PATH/src
+export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+export BOOST_ROOT=$ISSM_DIR/externalpackages/boost/install
+
+cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/${DAK_VER}/BuildDakotaCustom.cmake.patch
+patch $DAK_SRC/cmake/DakotaDev.cmake configs/${DAK_VER}/DakotaDev.cmake.patch
+patch $DAK_SRC/CMakeLists.txt configs/${DAK_VER}/CMakeLists.txt.petsclibs.patch
+
+#Apply patches
+patch src/src/NonDSampling.cpp configs/${DAK_VER}/NonDSampling.cpp.patch
+patch src/src/NonDLocalReliability.cpp configs/${DAK_VER}/NonDLocalReliability.cpp.patch
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/${DAK_VER}/pecos_global_defs.hpp.patch
+
+#Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
+export CXXFLAGS='-std=c++98'
+
+#Configure dakota
+cd $DAK_BUILD
+
+cmake -C$DAK_SRC/cmake/BuildDakotaCustom.cmake \
+		-C$DAK_SRC/cmake/DakotaDev.cmake \
+		-DBUILD_STATIC_LIBS=ON \
+		-DBUILD_SHARED_LIBS=OFF \
+		-DBOOST_ROOT=$BOOST_ROOT \
+		-DBoost_LIBRARY_DIRS=$BOOST_ROOT/lib \
+		-DBoost_NO_BOOST_CMAKE=TRUE \
+		-DBoost_NO_SYSTEM_PATHS=TRUE \
+		-DBoost_INSTALL_PREFIX=$DAK_INSTALL \
+		-DCMAKE_C_FLAGS="-O2 -g -fPIC" \
+		-DCMAKE_CXX_FLAGS="-O2 -g -fPIC" \
+		-DCMAKE_Fortran_FLAGS="-O2 -g -fPIC" \
+		-DCMAKE_C_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpicc \
+		-DCMAKE_CXX_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpicxx \
+		-DCMAKE_Fortran_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpif77 \
+		-DHAVE_ACRO=off \
+		-DHAVE_JEGA=off \
+		$DAK_SRC
+cd ..
+
+#Compile and install dakota
+cd $DAK_BUILD
+
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+cd ..
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-macosx64-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-macosx64-static.sh	(revision 24311)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-macosx64-static.sh	(revision 24311)
@@ -0,0 +1,80 @@
+#!/bin/bash
+set -eu
+
+# Constants
+DAK_VER="6.2"
+
+# Some cleanup
+rm -rf build
+rm -rf install
+rm -rf tests
+rm -rf src
+mkdir build install src
+
+# Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${DAK_VER}-public.src.tar.gz" "dakota-${DAK_VER}-public-src.tar.gz"
+
+# Untar
+tar -zxvf dakota-${DAK_VER}-public-src.tar.gz
+
+# Move Dakota to src directory
+mv dakota-${DAK_VER}.0.src/* src
+rm -rf dakota-${DAK_VER}.0.src
+
+# Set up Dakota and CMake variables
+DAK_PATH=$ISSM_DIR/externalpackages/dakota
+
+export DAK_BUILD=$DAK_PATH/build
+export DAK_INSTALL=$DAK_PATH/install
+export DAK_SRC=$DAK_PATH/src
+export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+
+
+# Apply patches
+cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/$DAK_VER/BuildDakotaCustom.cmake.mac.patch
+patch $DAK_SRC/cmake/DakotaDev.cmake configs/$DAK_VER/DakotaDev.cmake.patch
+patch $DAK_SRC/cmake/InstallDarwinDylibs.cmake configs/$DAK_VER/InstallDarwinDylibs.cmake.patch
+patch $DAK_SRC/CMakeLists.txt configs/$DAK_VER/CMakeLists.txt.patch
+patch src/src/NonDSampling.cpp configs/$DAK_VER/NonDSampling.cpp.patch
+patch src/src/NonDLocalReliability.cpp configs/$DAK_VER/NonDLocalReliability.cpp.patch
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/$DAK_VER/pecos_global_defs.hpp.patch
+
+# Configure and build Dakota
+cd $DAK_BUILD
+cmake \
+	-C$DAK_SRC/cmake/BuildDakotaCustom.cmake \
+	-C$DAK_SRC/cmake/DakotaDev.cmake \
+	-DBUILD_STATIC_LIBS=ON \
+	-DBUILD_SHARED_LIBS=OFF \
+	-DBOOST_ROOT=$BOOST_ROOT \
+	-DBoost_LIBRARY_DIRS=$BOOST_ROOT/lib \
+	-DBoost_NO_BOOST_CMAKE=TRUE \
+	-DBoost_NO_SYSTEM_PATHS=TRUE \
+	-DCMAKE_INSTALL_PREFIX=$DAK_INSTALL \
+	-DCMAKE_C_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpicc \
+	-DCMAKE_CXX_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpicxx \
+	-DCMAKE_Fortran_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpif77 \
+	-DCMAKE_CXX_FLAGS=-fdelayed-template-parsing \
+	-DHAVE_ACRO=off \
+	-DHAVE_JEGA=off \
+	$DAK_SRC
+
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Set paths and library paths
+export PATH=$DAK_INSTALL/bin:$DAK_INSTALL/test:$PATH
+
+if [ -z ${DYLD_LIBRARY_PATH+x} ]
+then
+	export DYLD_LIBRARY_PATH=$DAK_INSTALL/lib:$DAK_INSTALL/bin
+else
+	export DYLD_LIBRARY_PATH=$DAK_INSTALL/lib:$DAK_INSTALL/bin:$DYLD_LIBRARY_PATH
+fi
Index: /issm/trunk-jpl/jenkins/linux64_ross_dakota_static
===================================================================
--- /issm/trunk-jpl/jenkins/linux64_ross_dakota_static	(revision 24311)
+++ /issm/trunk-jpl/jenkins/linux64_ross_dakota_static	(revision 24311)
@@ -0,0 +1,67 @@
+
+#-------------------------------#
+# 1: ISSM general configuration #
+#-------------------------------#
+
+#MATLAB path
+MATLAB_PATH="/usr/local/MATLAB/R2015a"
+
+#ISSM CONFIGURATION
+ISSM_CONFIG='--prefix=$ISSM_DIR\
+	--enable-standalone-executables \
+	--enable-standalone-modules \
+	--enable-standalone-libraries \
+	--with-matlab-dir=$MATLAB_PATH \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+	--with-mpi-libflags="$ISSM_DIR/externalpackages/mpich/install/lib/libmpifort.a $ISSM_DIR/externalpackages/mpich/install/lib/libmpi.a -lrt -lpthread" \
+	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
+	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
+	--with-boost-dir=$ISSM_DIR/externalpackages/boost/install \
+	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu -lgfortran" \
+	--with-numthreads=4 \
+	--with-pic'
+
+#PYTHON and MATLAB testing
+MATLAB_TEST=0
+PYTHON_TEST=0
+
+#-----------------------------------#
+# 3: External packages installation #
+#-----------------------------------#
+
+#List of external pakages to be installed and their installation scripts
+EXTERNALPACKAGES="autotools     install.sh
+						cmake        install.sh
+						chaco         install.sh
+						mpich         install-3.2-linux64-static.sh
+						m1qn3         install.sh
+						petsc         install-3.7-linux64-static.sh
+						triangle      install-linux64.sh
+						boost         install-1.55-linux64-static.sh
+						dakota        install-6.2-linux64-static.sh
+						shell2junit   install.sh"
+
+#-----------------#
+# 4: test options #
+#-----------------#
+
+#number of cpus used in ISSM installation and compilation (one is usually
+#safer as some packages are very sensitive to parallel compilation)
+NUMCPUS_INSTALL=4
+
+#number of cpus used in the nightly runs.
+NUMCPUS_RUN=4
+
+#Nightly run options. The matlab routine runme.m will be called
+#as follows: runme($MATLAB_NROPTIONS). The options must be understandable
+#by Matlab and runme.m
+#ex: "'id',[101 102 103]"
+#PYTHON_NROPTIONS=""
+#MATLAB_NROPTIONS=""
Index: /issm/trunk-jpl/jenkins/linux64_ross_static
===================================================================
--- /issm/trunk-jpl/jenkins/linux64_ross_static	(revision 24310)
+++ /issm/trunk-jpl/jenkins/linux64_ross_static	(revision 24311)
@@ -23,7 +23,7 @@
 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
 	--with-math77-dir=$ISSM_DIR/externalpackages/math77/install \
-	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
-	--with-pic \
-	--with-numthreads=4'
+	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu -lgfortran" \
+	--with-numthreads=4 \
+	--with-pic'
 
 #PYTHON and MATLAB testing
@@ -52,8 +52,8 @@
 #number of cpus used in ISSM installation and compilation (one is usually
 #safer as some packages are very sensitive to parallel compilation)
-NUMCPUS_INSTALL=10
+NUMCPUS_INSTALL=4
 
 #number of cpus used in the nightly runs.
-NUMCPUS_RUN=10
+NUMCPUS_RUN=4
 
 #Nightly run options. The matlab routine runme.m will be called
@@ -62,4 +62,4 @@
 #ex: "'id',[101 102 103]"
 ##                           FS
-#PYTHON_NROPTIONS="--exclude_name 'Dakota'"
-#MATLAB_NROPTIONS="'exclude',[243,701,702,703,435,IdFromString('Dakota')]"
+#PYTHON_NROPTIONS=""
+#MATLAB_NROPTIONS=""
Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 24310)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 24311)
@@ -396,5 +396,4 @@
 				;;
 				*linux*)
-				TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
 				if test "x$HAVE_JAVASCRIPT" = "xyes"; then
 					dnl go to the bit code, not the library.
@@ -483,4 +482,5 @@
 
 		DAKOTAFLAGS=""
+		dnl TODO: Should we also be checking if HAVE_BOOST before adding boost libs?
 		case "${host_os}" in
 			*cygwin*)
@@ -507,5 +507,9 @@
 				else if test x$DAKOTA_VERSION = x6.1 || test x$DAKOTA_VERSION = x6.2; then
 				   DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-					DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+					if test "x$enable_standalone_executables" = "xyes"; then
+						DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid $BOOST_ROOT/lib/libboost_serialization.a $BOOST_ROOT/lib/libboost_signals.a $BOOST_ROOT/lib/libboost_regex.a $BOOST_ROOT/lib/libboost_filesystem.a $BOOST_ROOT/lib/libboost_system.a"
+					else
+						DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+					fi
 					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H])
 					AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI])
@@ -526,6 +530,10 @@
 					AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI])
 				else if test x$DAKOTA_VERSION = x6.1 || test x$DAKOTA_VERSION = x6.2; then
-				   DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-					DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+					DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
+					if test "x$enable_standalone_executables" = "xyes"; then
+						DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid $BOOST_ROOT/lib/libboost_serialization.a $BOOST_ROOT/lib/libboost_signals.a $BOOST_ROOT/lib/libboost_regex.a $BOOST_ROOT/lib/libboost_filesystem.a $BOOST_ROOT/lib/libboost_system.a"
+					else
+						DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+					fi
 					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H])
 					AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI])
Index: /issm/trunk-jpl/packagers/macosx-dakota/package.sh
===================================================================
--- /issm/trunk-jpl/packagers/macosx-dakota/package.sh	(revision 24310)
+++ /issm/trunk-jpl/packagers/macosx-dakota/package.sh	(revision 24311)
@@ -1,15 +1,33 @@
 #!/bin/bash
 
-echo "modify generic" 
+MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+PACKAGE="ISSM" # Name of directory to copy distributable files to
+TARBALL_NAME="issm-mac-dakota"
+TARBALL=$TARBALL_NAME.tar.gz
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd $ISSM_DIR
+rm -rf $PACKAGE
+mkdir $PACKAGE
+
+# Add/modify required binaries
 cd $ISSM_DIR/bin
+
+echo "Modifying generic"
 cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-echo "move mpiexec to bin" 
-cp ../externalpackages/mpich/install/bin/mpiexec .
-cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
 
-#Check that test101 runs
+echo "Moving mpiexec to bin"
+if [ -f ../externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ../externalpackages/mpich/install/bin/mpiexec .
+	cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "mpich not found"
+fi
+
+# Check that test101 runs
 cd $ISSM_DIR/test/NightlyRun
 rm matlab.log
-/Applications/MATLAB_R2015b.app/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
+$MATLAB_PATH/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
 
 if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
@@ -17,21 +35,13 @@
 	exit 1;
 else
-	echo "test101 passed"
+	echo "test101 PASSED"
 fi
 
-#Package using the Package Maker from OSX, driven by command line.
-tarball_name='issm-mac-dakota-static_build.tar.gz'
-
-echo "Cleanup first" 
+echo "Creating tarball: ${TARBALL_NAME}"
 cd $ISSM_DIR
-rm $tarball_name
-
-echo "Creating tarball: ${tarball_name}"
-cd $ISSM_DIR
-rm -rf trunk
-mkdir trunk
-cp -rf bin lib test examples trunk/
-tar -czf $tarball_name trunk
-ls -lah $tarball_name
+rm -f $TARBALL
+cp -rf bin lib test examples scripts $PACKAGE/
+tar -czf $TARBALL $PACKAGE
+ls -lah $TARBALL
 
 echo "Shipping binaries to website"
@@ -51,5 +61,5 @@
 ssh-add ~/.ssh/macosx-bins_richese-to-ross
 
-scp $tarball_name ross.ics.uci.edu:/var/www/html/$tarball_name
+scp $TARBALL ross.ics.uci.edu:/var/www/html/$TARBALL
 
 if [ $? -ne 0 ]; then
Index: /issm/trunk-jpl/packagers/macosx/package.sh
===================================================================
--- /issm/trunk-jpl/packagers/macosx/package.sh	(revision 24310)
+++ /issm/trunk-jpl/packagers/macosx/package.sh	(revision 24311)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
-TARBALL_NAME='issm-mac-static_build'
+MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+PACKAGE="ISSM" # Name of directory to copy distributable files to
+TARBALL_NAME="issm-mac"
 TARBALL=$TARBALL_NAME.tar.gz
 
@@ -7,6 +9,6 @@
 echo "Cleaning up existing assets"
 cd $ISSM_DIR
-rm -rf trunk
-mkdir trunk
+rm -rf $PACKAGE
+mkdir $PACKAGE
 
 # Add/modify required binaries
@@ -31,11 +33,11 @@
 fi
 
-# Copy gmt to trunk
+# Copy gmt to package
 # NOTE: The following assumes the precompiled version of gmt
 echo "Moving gmt to externalpackages"
 if [ -f $ISSM_DIR/externalpackages/gmt/install/bin/gmt ]; then
-	mkdir $ISSM_DIR/trunk/externalpackages
-	mkdir $ISSM_DIR/trunk/externalpackages/gmt
-	cp -a $ISSM_DIR/externalpackages/gmt/install/. $ISSM_DIR/trunk/externalpackages/gmt
+	mkdir $ISSM_DIR/$PACKAGE/externalpackages
+	mkdir $ISSM_DIR/$PACKAGE/externalpackages/gmt
+	cp -a $ISSM_DIR/externalpackages/gmt/install $ISSM_DIR/$PACKAGE/externalpackages/gmt/install
 else
 	echo "gmt not found"
@@ -45,5 +47,5 @@
 cd $ISSM_DIR/test/NightlyRun
 rm matlab.log
-/Applications/MATLAB_R2015b.app/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
+$MATLAB_PATH/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
 
 if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
@@ -57,15 +59,15 @@
 cd $ISSM_DIR
 rm -f $TARBALL
-cp -rf bin lib test examples scripts trunk/
+cp -rf bin lib test examples scripts $PACKAGE/
 
 # Create link to gmt from bin
 # NOTE: It is important that we are in the destination dir when sym linking so that the path is relative
-if [ -f $ISSM_DIR/trunk/externalpackages/gmt/bin/gmt ]; then
-	cd $ISSM_DIR/trunk/bin
-	ln -s ../externalpackages/gmt/bin/gmt ./gmt
+if [ -f $ISSM_DIR/$PACKAGE/externalpackages/gmt/install/bin/gmt ]; then
+	cd $ISSM_DIR/$PACKAGE/bin
+	ln -s ../externalpackages/gmt/install/bin/gmt ./gmt
 fi
 
 cd $ISSM_DIR
-tar -czf $TARBALL trunk
+tar -czf $TARBALL $PACKAGE
 ls -lah $TARBALL
 
Index: /issm/trunk-jpl/packagers/ubuntu-dakota/package.sh
===================================================================
--- /issm/trunk-jpl/packagers/ubuntu-dakota/package.sh	(revision 24311)
+++ /issm/trunk-jpl/packagers/ubuntu-dakota/package.sh	(revision 24311)
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+MATLAB_PATH="/usr/local/MATLAB/R2015a"
+PACKAGE="ISSM" # Name of directory to copy distributable files to
+TARBALL_NAME="issm-ubuntu-dakota"
+TARBALL=$TARBALL_NAME.tar.gz
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd $ISSM_DIR
+rm -rf $PACKAGE
+mkdir $PACKAGE
+
+# Add/modify required binaries
+cd $ISSM_DIR/bin
+
+echo "Modify generic"
+cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+
+echo "Moving mpiexec to bin"
+if [ -f ../externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ../externalpackages/mpich/install/bin/mpiexec .
+	cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "mpich not found"
+fi
+
+echo "Moving gmsh to bin"
+if [ -f ../externalpackages/gmsh/install/gmsh ]; then
+	cp ../externalpackages/gmsh/install/gmsh .
+else
+	echo "gmsh not found"
+fi
+
+# Check that test101 runs
+cd $ISSM_DIR/test/NightlyRun
+rm matlab.log
+$MATLAB_PATH/bin/matlab -nojvm -nosplash -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
+
+if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
+	echo "test101 FAILED"
+	exit 1;
+else
+	echo "test101 PASSED"
+fi
+
+echo "Creating tarball: ${TARBALL_NAME}"
+cd $ISSM_DIR
+rm -f $TARBALL
+cp -rf bin lib test examples scripts $PACKAGE/
+tar -czf $TARBALL $PACKAGE
+ls -lah $TARBALL
+
+echo "Shipping binaries to website"
+
+# We're using public key authentication method to upload the tarball The
+# following lines check to see if the SSH Agent is running. If not, then it is
+# started and relevant information is forwarded to a script.
+pgrep "ssh-agent" > /dev/null
+if [ $? -ne 0 ]; then
+	echo "SSH Agent is not running. Starting it..."
+	ssh-agent > ~/.ssh/agent.sh
+else
+	echo "SSH Agent is running..."
+fi
+
+source ~/.ssh/agent.sh
+ssh-add ~/.ssh/ubuntu-bins_jenkins-to-ross
+
+scp $TARBALL ross.ics.uci.edu:/var/www/html/$TARBALL
+
+if [ $? -ne 0 ]; then
+	echo "The upload failed."
+	echo "Perhaps the SSH Agent was started by some other means."
+	echo "Try killing the agent and running again."
+fi
Index: /issm/trunk-jpl/packagers/ubuntu/package.sh
===================================================================
--- /issm/trunk-jpl/packagers/ubuntu/package.sh	(revision 24310)
+++ /issm/trunk-jpl/packagers/ubuntu/package.sh	(revision 24311)
@@ -1,11 +1,30 @@
 #!/bin/bash
 
-echo "modify generic" 
+MATLAB_PATH="/usr/local/MATLAB/R2015a"
+PACKAGE="ISSM" # Name of directory to copy distributable files to
+TARBALL_NAME="issm-ubuntu"
+TARBALL=$TARBALL_NAME.tar.gz
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd $ISSM_DIR
+rm -rf $PACKAGE
+mkdir $PACKAGE
+
+# Add/modify required binaries
 cd $ISSM_DIR/bin
+
+echo "Modify generic"
 cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-echo "move mpiexec to bin" 
-cp ../externalpackages/mpich/install/bin/mpiexec .
-cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
-echo "move gmsh to bin" 
+
+echo "Moving mpiexec to bin"
+if [ -f ../externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ../externalpackages/mpich/install/bin/mpiexec .
+	cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "mpich not found"
+fi
+
+echo "Moving gmsh to bin"
 if [ -f ../externalpackages/gmsh/install/gmsh ]; then
 	cp ../externalpackages/gmsh/install/gmsh .
@@ -14,8 +33,8 @@
 fi
 
-#Check that test101 runs
+# Check that test101 runs
 cd $ISSM_DIR/test/NightlyRun
 rm matlab.log
-/usr/local/MATLAB/R2015a/bin/matlab -nojvm -nosplash -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
+$MATLAB_PATH/bin/matlab -nojvm -nosplash -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
 
 if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
@@ -23,20 +42,13 @@
 	exit 1;
 else
-	echo "test101 passed"
+	echo "test101 PASSED"
 fi
 
-tarball_name='issm-ubuntu-static_build.tar.gz'
-
-echo "Cleanup first" 
+echo "Creating tarball: ${TARBALL_NAME}"
 cd $ISSM_DIR
-rm $tarball_name
-
-echo "Creating tarball: ${tarball_name}"
-cd $ISSM_DIR
-rm -rf trunk
-mkdir trunk
-cp -rf bin lib test examples scripts trunk/
-tar -czf $tarball_name trunk
-ls -lah $tarball_name
+rm -f $TARBALL
+cp -rf bin lib test examples scripts $PACKAGE/
+tar -czf $TARBALL $PACKAGE
+ls -lah $TARBALL
 
 echo "Shipping binaries to website"
@@ -56,5 +68,5 @@
 ssh-add ~/.ssh/ubuntu-bins_jenkins-to-ross
 
-scp $tarball_name ross.ics.uci.edu:/var/www/html/$tarball_name
+scp $TARBALL ross.ics.uci.edu:/var/www/html/$TARBALL
 
 if [ $? -ne 0 ]; then
Index: /issm/trunk-jpl/packagers/win10/package64.sh
===================================================================
--- /issm/trunk-jpl/packagers/win10/package64.sh	(revision 24310)
+++ /issm/trunk-jpl/packagers/win10/package64.sh	(revision 24311)
@@ -1,7 +1,8 @@
 #!/bin/bash
 
+MATLAB_PATH="/cygdrive/c/Programs/MATLAB/R2015a"
+PACKAGE="ISSM" # Name of directory to copy distributable files to
 TARBALL_NAME='ISSM-Win10-64'
 TARBALL=$TARBALL_NAME.tar.gz
-MATLAB_PATH="/cygdrive/c/Programs/MATLAB/R2015a"
 
 # Source Windows environment
@@ -11,6 +12,6 @@
 echo "Cleaning up existing assets"
 cd $ISSM_DIR
-rm -rf trunk
-mkdir trunk
+rm -rf $PACKAGE
+mkdir $PACKAGE
 
 # Add/modify required binaries
@@ -26,16 +27,16 @@
 echo "Copying gmsh to bin"
 if [ -f ../externalpackages/gmsh/install/gmsh.exe ]; then
-	cp ../externalpackages/gmsh/install/gmsh.exe .
+	cp ../externalpackages/gmsh/install/gmsh.exe ./gmsh.exe
 else
 	echo "gmsh not found"
 fi
 
-# Copy gmt to trunk
+# Copy gmt to package
 # NOTE: The following assumes the precompiled version of gmt
 echo "Moving gmt to externalpackages"
 if [ -f $ISSM_DIR/externalpackages/gmt/install/bin/gmt ]; then
-	mkdir $ISSM_DIR/trunk/externalpackages
-	mkdir $ISSM_DIR/trunk/externalpackages/gmt
-	cp -a $ISSM_DIR/externalpackages/gmt/install/. $ISSM_DIR/trunk/externalpackages/gmt
+	mkdir $ISSM_DIR/$PACKAGE/externalpackages
+	mkdir $ISSM_DIR/$PACKAGE/externalpackages/gmt
+	cp -a $ISSM_DIR/externalpackages/gmt/install $ISSM_DIR/$PACKAGE/externalpackages/gmt/install
 else
 	echo "gmt not found"
@@ -67,15 +68,15 @@
 cd $ISSM_DIR
 rm -f $TARBALL
-cp -rf bin lib test examples scripts trunk/
+cp -rf bin lib test examples scripts $PACKAGE/
 
 # Create link to gmt from bin
 # NOTE: It is important that we are in the destination dir when sym linking so that the path is relative
-if [ -f $ISSM_DIR/trunk/externalpackages/gmt/bin/gmt ]; then
-	cd $ISSM_DIR/trunk/bin
-	ln -s ../externalpackages/gmt/bin/gmt.exe ./gmt
+if [ -f $ISSM_DIR/$PACKAGE/externalpackages/gmt/bin/gmt ]; then
+	cd $ISSM_DIR/$PACKAGE/bin
+	ln -s ../externalpackages/gmt/bin/gmt.exe ./gmt.exe
 fi
 
 cd $ISSM_DIR
-tar -czf $TARBALL trunk
+tar -czf $TARBALL $PACKAGE
 ls -lah $TARBALL
 
