Index: /issm/trunk-jpl/etc/environment.sh
===================================================================
--- /issm/trunk-jpl/etc/environment.sh	(revision 24652)
+++ /issm/trunk-jpl/etc/environment.sh	(revision 24653)
@@ -223,7 +223,9 @@
 
 DAKOTA_DIR="${ISSM_DIR}/externalpackages/dakota/install"
-path_append "$DAKOTA_DIR/bin"
-ld_library_path_append "$DAKOTA_DIR/lib"
-dyld_library_path_prepend "$DAKOTA_DIR/lib"
+if [ -d "${DAKOTA_DIR}" ]; then
+	path_prepend "${DAKOTA_DIR}/bin"
+	ld_library_path_prepend "${DAKOTA_DIR}/lib"
+	dyld_library_path_prepend "${DAKOTA_DIR}/lib"
+fi
 
 DOXYGEN_DIR="${ISSM_DIR}/externalpackages/doxygen/install"
@@ -256,10 +258,11 @@
 BOOST_DIR="${ISSM_DIR}/externalpackages/boost/install"
 BOOSTROOT="${ISSM_DIR}/externalpackages/boost/install"
-if [ -d "$BOOST_DIR" ]; then
+if [ -d "${BOOST_DIR}" ]; then
 	export BOOSTROOT
 	export BOOST_DIR
-	ld_library_path_prepend   "$BOOST_DIR/lib"
-	dyld_library_path_prepend "$BOOST_DIR/lib"
-	path_prepend      "$BOOST_DIR/bin"
+	library_path_prepend "${BOOST_DIR}/lib"
+	ld_library_path_prepend "${BOOST_DIR}/lib"
+	dyld_library_path_prepend "${BOOST_DIR}/lib"
+	path_prepend "${BOOST_DIR}/bin"
 fi
 
Index: /issm/trunk-jpl/externalpackages/boost/install-1.55-linux-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.55-linux-static.sh	(revision 24652)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.55-linux-static.sh	(revision 24653)
@@ -2,13 +2,4 @@
 #set -eu # Do not `run set -eu` because it causes some targets to fail
 
-
-# NOTE:
-# - Stop after bootstrap step and run `bjam --debug-configuration` to figure
-#	out which paths Boost is using to include Python. Make sure that each of
-#	the listed paths is covered by Python. If not, you must create a symbolic
-#	link from $ISSM_DIR/externalpackages/python to the location of the file
-#	that Boost is expecting. There is no way to get the Boost to compile with
-#	Python otherwise.
-#
 
 ## Constants
@@ -18,4 +9,5 @@
 ## Environment
 #
+export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
 export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
 
@@ -40,5 +32,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${ISSM_DIR}/externalpackages/boost/install" \
+	--prefix=${BOOST_ROOT}/install \
 	--with-python=python2.7
 
@@ -50,4 +42,4 @@
 
 # Copy binary to install directory
-mkdir ../install/bin
-cp bjam ../install/bin
+mkdir ${BOOST_ROOT}/install/bin
+cp bjam ${BOOST_ROOT}/install/bin
Index: /issm/trunk-jpl/externalpackages/boost/install-1.55-linux.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.55-linux.sh	(revision 24652)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.55-linux.sh	(revision 24653)
@@ -2,13 +2,4 @@
 #set -eu # Do not `run set -eu` because it causes some targets to fail
 
-
-# NOTE:
-# - Stop after bootstrap step and run `bjam --debug-configuration` to figure
-#	out which paths Boost is using to include Python. Make sure that each of
-#	the listed paths is covered by Python. If not, you must create a symbolic
-#	link from $ISSM_DIR/externalpackages/python to the location of the file
-#	that Boost is expecting. There is no way to get the Boost to compile with
-#	Python otherwise.
-#
 
 ## Constants
@@ -16,6 +7,7 @@
 VER="1_55_0"
 
-## Evnrionment
+## Environment
 #
+export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
 export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
 
@@ -40,5 +32,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${ISSM_DIR}/externalpackages/boost/install" \
+	--prefix=${BOOST_ROOT}/install \
 	--with-python=python2.7
 
@@ -50,4 +42,4 @@
 
 # Copy binary to install directory
-mkdir ../install/bin
-cp bjam ../install/bin
+mkdir ${BOOST_ROOT}/install/bin
+cp bjam ${BOOST_ROOT}/install/bin
Index: /issm/trunk-jpl/externalpackages/boost/install-1.55-mac-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.55-mac-static.sh	(revision 24652)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.55-mac-static.sh	(revision 24653)
@@ -2,13 +2,4 @@
 #set -eu # Do not `run set -eu` because it causes some targets to fail
 
-
-# NOTE:
-# - Stop after bootstrap step and run `bjam --debug-configuration` to figure
-#	out which paths Boost is using to include Python. Make sure that each of
-#	the listed paths is covered by Python. If not, you must create a symbolic
-#	link from $ISSM_DIR/externalpackages/python to the location of the file
-#	that Boost is expecting. There is no way to get the Boost to compile with
-#	Python otherwise.
-#
 
 ## Constants
@@ -16,6 +7,7 @@
 VER="1_55_0"
 
-## Evnrionment
+## Environment
 #
+export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
 export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
 
@@ -40,5 +32,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${ISSM_DIR}/externalpackages/boost/install" \
+	--prefix=${BOOST_ROOT}/install \
 	--with-python=python2.7
 
@@ -47,7 +39,7 @@
 
 # Compile and install
-./bjam link=static install
+./bjam toolset=darwin link=static install
 
 # Copy binary to install directory
-mkdir ../install/bin
-cp bjam ../install/bin
+mkdir ${BOOST_ROOT}/install/bin
+cp bjam ${BOOST_ROOT}/install/bin
Index: /issm/trunk-jpl/externalpackages/boost/install-1.55-mac.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.55-mac.sh	(revision 24652)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.55-mac.sh	(revision 24653)
@@ -2,13 +2,4 @@
 #set -eu # Do not `run set -eu` because it causes some targets to fail
 
-
-# NOTE:
-# - Stop after bootstrap step and run `bjam --debug-configuration` to figure
-#	out which paths Boost is using to include Python. Make sure that each of
-#	the listed paths is covered by Python. If not, you must create a symbolic
-#	link from $ISSM_DIR/externalpackages/python to the location of the file
-#	that Boost is expecting. There is no way to get the Boost to compile with
-#	Python otherwise.
-#
 
 ## Constants
@@ -16,6 +7,7 @@
 VER="1_55_0"
 
-## Evnrionment
+## Environment
 #
+export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
 export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
 
@@ -40,5 +32,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${ISSM_DIR}/externalpackages/boost/install" \
+	--prefix=${BOOST_ROOT}/install \
 	--with-python=python2.7
 
@@ -47,7 +39,19 @@
 
 # Compile and install
-./bjam install
+./bjam toolset=darwin install
 
 # Copy binary to install directory
-mkdir ../install/bin
-cp bjam ../install/bin
+mkdir ${BOOST_ROOT}/install/bin
+cp bjam ${BOOST_ROOT}/install/bin
+
+# Set install_name for all shared libraries
+cd ${BOOST_ROOT}/install/lib
+for name in *.dylib; do
+	install_name_tool -id ${BOOST_ROOT}/install/lib/${name} ${name}
+done
+
+## Patch install names for certain libraries
+#
+# TODO: Figure out how to reconfigure source to apply these install names at compile time
+#
+install_name_tool -change libboost_system.dylib ${BOOST_ROOT}/install/lib/libboost_system.dylib libboost_filesystem.dylib
Index: /issm/trunk-jpl/externalpackages/dakota/configs/6.2/mac/cmake/InstallDarwinDylibs.cmake
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/configs/6.2/mac/cmake/InstallDarwinDylibs.cmake	(revision 24653)
+++ /issm/trunk-jpl/externalpackages/dakota/configs/6.2/mac/cmake/InstallDarwinDylibs.cmake	(revision 24653)
@@ -0,0 +1,132 @@
+# Find the Darwin dylib dependencies of dakota, excluding system libraries,
+# and install to ${CMAKE_INSTALL_PREFIX}/bin
+
+# NOTE: This script will only work for make install from top of build tree
+# TODO: Review string quoting conventions and test with spaces in filename
+
+# Function to install a single Dakota dll dependency
+# (used by multiple platforms)
+function(dakota_install_dll dakota_dll)
+  if (EXISTS "${dakota_dll}")
+    get_filename_component(dll_filename "${dakota_dll}" NAME)
+    message("-- Installing: ${CMAKE_INSTALL_PREFIX}/bin/${dll_filename}")
+    execute_process(
+      COMMAND
+        ${CMAKE_COMMAND} -E copy "${dakota_dll}" "${CMAKE_INSTALL_PREFIX}/bin"
+      )
+  else()
+    message(WARNING "Install couldn't find dynamic dependency ${dakota_dll}")
+  endif()
+endfunction()
+
+if ( DEFINED ENV{DAK_BUILD} )
+  set ( CMAKE_CURRENT_BINARY_DIR $ENV{DAK_BUILD} )
+elseif ( DAKOTA_JENKINS_BUILD OR DEFINED ENV{WORKSPACE} )
+  # By convention, all Dakota, jenkins-driven build jobs use a 'build'
+  # subdir for clear separation of source and build trees in the WORKSPACE
+  set( CMAKE_CURRENT_BINARY_DIR $ENV{WORKSPACE}/build )
+elseif ( NOT CMAKE_CURRENT_BINARY_DIR )
+  set( CMAKE_CURRENT_BINARY_DIR $ENV{PWD} )
+endif()
+
+message( "CMAKE_SHARED_LIBRARY_SUFFIX: ${CMAKE_SHARED_LIBRARY_SUFFIX}" )
+#message( "... If NOT .dylib, then CMake cache is not respected" )
+
+# otool may resolve symlinks, do the same for the build tree location
+get_filename_component(resolved_build_dir ${CMAKE_CURRENT_BINARY_DIR} REALPATH)
+
+# Get the dylibs excluding system libraries as a semicolon-separated list
+execute_process(
+  COMMAND otool -L "${CMAKE_CURRENT_BINARY_DIR}/src/dakota"
+  # Omit the header and get the library only
+  COMMAND awk "FNR > 1 {print $1}"
+  # Omit system libraries
+  COMMAND egrep -v "(^/System|^/usr/lib|^/usr/X11)"
+  COMMAND tr "\\n" ";"
+  OUTPUT_VARIABLE dakota_darwin_dylibs
+  )
+
+# Probe the CMakeCache.txt for location of the known Boost dynlib dependency
+
+file( STRINGS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt
+      Boost_LIBRARY_DIRS_PAIR REGEX "^Boost_LIBRARY_DIRS:FILEPATH=(.*)$" )
+string( REGEX REPLACE "^Boost_LIBRARY_DIRS:FILEPATH=(.*)$" "\\1"
+        Cached_Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS_PAIR}" )
+
+#message("Boost rpath=${Cached_Boost_LIBRARY_DIRS}")
+
+# Modify dakota_darwin_dylibs for "special case" of Boost
+#   otool DOES NOT return absolute path to Boost libs, so workaround the issue
+
+set(dakota_boost_dylibs "")
+
+# Ignore empty list elements:
+cmake_policy(PUSH)
+cmake_policy(SET CMP0007 OLD)
+
+foreach(pri_lib ${dakota_darwin_dylibs})
+  string(REGEX REPLACE "^libboost_(.*)$"
+    "${Cached_Boost_LIBRARY_DIRS}/libboost_\\1"
+    boost_dylib_fullpath "${pri_lib}")
+
+  if( ${pri_lib} MATCHES libboost_ )
+    # REMOVE boost entries if NOT absolute path
+    list(REMOVE_ITEM dakota_darwin_dylibs ${pri_lib})
+    list(APPEND dakota_boost_dylibs ${boost_dylib_fullpath})
+  endif()
+endforeach()
+
+# Get the secondary dylibs of the dylibs
+foreach(pri_lib ${dakota_darwin_dylibs})
+  execute_process(
+    COMMAND otool -L "${pri_lib}"
+    COMMAND awk "FNR > 1 {print $1}"
+    # Omit system libraries
+    COMMAND egrep -v "(^/System|^/usr/lib|^/usr/X11)"
+    COMMAND tr "\\n" ";"
+    OUTPUT_VARIABLE dakota_secondary_dylibs
+    )
+  list(APPEND dakota_darwin_dylibs ${dakota_secondary_dylibs})
+endforeach()
+
+# Make a second pass over the list to prepend paths to boost libs that were
+# discovered while looking for dakota_secondary_dylibs. Any duplicates
+# will be removed below.
+foreach(pri_lib ${dakota_darwin_dylibs})
+  string(REGEX REPLACE "^libboost_(.*)$"
+    "${Cached_Boost_LIBRARY_DIRS}/libboost_\\1"
+    boost_dylib_fullpath "${pri_lib}")
+
+  if( ${pri_lib} MATCHES libboost_ )
+    # REMOVE boost entries if NOT absolute path
+    list(REMOVE_ITEM dakota_darwin_dylibs ${pri_lib})
+    list(APPEND dakota_boost_dylibs ${boost_dylib_fullpath})
+  endif()
+endforeach()
+
+# otool finished proccessing dylibs -
+# OK to "re-insert" Boost dylibs into the list (ABSOLUTE PATH!)
+
+#message("Boost dylibs=${dakota_boost_dylibs}")
+list(APPEND dakota_darwin_dylibs ${dakota_boost_dylibs})
+
+list(REMOVE_DUPLICATES dakota_darwin_dylibs)
+cmake_policy(POP)
+
+# Process each DLL and install, excluding anything in the build tree
+foreach(dakota_dll ${dakota_darwin_dylibs})
+  string(REGEX REPLACE "^${CMAKE_CURRENT_BINARY_DIR}(.*)$"
+    "dak_omit/\\1" omit_btree_dll "${dakota_dll}")
+  string(REGEX REPLACE "^${resolved_build_dir}(.*)$"
+    "dak_omit/\\1" omit_resolved_btree_dll "${dakota_dll}")
+
+  if( ${omit_btree_dll} MATCHES dak_omit )
+    #message("-- EXCLUDE: ${omit_btree_dll} - OK, already installed in lib")
+    message("-- EXCLUDE: ${dakota_dll} - OK, already installed in lib")
+  elseif( ${omit_resolved_btree_dll} MATCHES dak_omit )
+    message("-- EXCLUDE: ${dakota_dll} - OK, already installed in lib")
+  else()
+    dakota_install_dll("${dakota_dll}")
+  endif()
+endforeach()
+
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 24652)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 24653)
@@ -42,4 +42,5 @@
 cp configs/${VER}/mac/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
 cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
+cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
 cp configs/${VER}/mac/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 
@@ -73,2 +74,23 @@
 # avoid conflict with our definition
 sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
+
+## Patch install names for certain libraries
+#
+# TODO: Figure out how to reconfigure source to apply these install names at compile time
+#
+install_name_tool -change libdakota_src_fortran.dylib ${DAK_INSTALL}/lib/libdakota_src_fortran.dylib lib/libdakota_src.dylib
+install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib lib/liblhs.dylib
+install_name_tool -change liblhs_mods.dylib ${DAK_INSTALL}/lib/liblhs_mods.dylib lib/liblhs.dylib
+install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib lib/liblhs_mods.dylib
+install_name_tool -change libteuchos.dylib ${DAK_INSTALL}/lib/libteuchos.dylib lib/liboptpp.dylib
+install_name_tool -change libdfftpack.dylib ${DAK_INSTALL}/lib/libdfftpack.dylib lib/libpecos.dylib
+install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib lib/libpecos.dylib
+install_name_tool -change liblhs_mods.dylib ${DAK_INSTALL}/lib/liblhs_mods.dylib lib/libpecos.dylib
+install_name_tool -change libpecos_src.dylib ${DAK_INSTALL}/lib/libpecos_src.dylib lib/libpecos.dylib
+install_name_tool -change libteuchos.dylib ${DAK_INSTALL}/lib/libteuchos.dylib lib/libpecos.dylib
+install_name_tool -change libdfftpack.dylib ${DAK_INSTALL}/lib/libdfftpack.dylib lib/libpecos_src.dylib
+install_name_tool -change liblhs.dylib ${DAK_INSTALL}/lib/liblhs.dylib lib/libpecos_src.dylib
+install_name_tool -change liblhs_mod.dylib ${DAK_INSTALL}/lib/liblhs_mod.dylib lib/libpecos_src.dylib
+install_name_tool -change liblhs_mods.dylib ${DAK_INSTALL}/lib/liblhs_mods.dylib lib/libpecos_src.dylib
+install_name_tool -change libteuchos.dylib ${DAK_INSTALL}/lib/libteuchos.dylib lib/libpecos_src.dylib
+install_name_tool -change li
Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 24652)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 24653)
@@ -707,12 +707,24 @@
 endif
 
-if VERSION
+
 AM_LDFLAGS =
-else
-AM_LDFLAGS = -avoid-version
-endif
-
+
+if !VERSION
+AM_LDFLAGS += -avoid-version
+endif
+
+# NOTE:
+# - On Linux, We probably do not need the -static flag as long as we only
+#	generate static libraries for external packages. Dynamic system libraries
+#	will be linked to, whether we like it or not, if no static version is
+#	available.
+# - On macOC, static linking of binaries is not supported.
+#
 if STANDALONE_EXECUTABLES
-AM_LDFLAGS += -static -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN/../lib'
+if MAC
+AM_LDFLAGS += -Wl,-rpath,'$$ORIGIN'
+else
+AM_LDFLAGS += -static -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN'
+endif
 endif
 
