Index: /issm/trunk-jpl/externalpackages/boost/install-1.72-mac-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/boost/install-1.72-mac-static.sh	(revision 24675)
+++ /issm/trunk-jpl/externalpackages/boost/install-1.72-mac-static.sh	(revision 24676)
@@ -40,2 +40,8 @@
 mkdir ${BOOST_ROOT}/install/bin
 cp bjam ${BOOST_ROOT}/install/bin
+
+# Remove any dynamic libraries that may have been compiled
+#
+# TODO: Reconfigure so that dynamic libraries are not compiled at all
+#
+rm -f $(ls ${BOOST_ROOT}/install/lib/*.dylib)
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 24675)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 24676)
@@ -10,10 +10,10 @@
 ## Environment
 #
-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/local/gfortran/lib -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libgfortran.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libquadmath.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/gcc/x86_64-apple-darwin15/9.3.0/libgcc.a" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
 export DAK_BUILD=${DAK_ROOT}/build
 export DAK_INSTALL=${DAK_ROOT}/install
 export DAK_SRC=${DAK_ROOT}/src
-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/local/gfortran/lib -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libgfortran.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libquadmath.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/gcc/x86_64-apple-darwin15/9.3.0/libgcc.a" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 
 # Cleanup
Index: /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 24675)
+++ /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 24676)
@@ -10,10 +10,10 @@
 ## Environment
 #
-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/local/gfortran/lib -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/local/Cellar/gcc/9.3.0/lib/gcc/9 -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
 export DAK_BUILD=${DAK_ROOT}/build
 export DAK_INSTALL=${DAK_ROOT}/install
 export DAK_SRC=${DAK_ROOT}/src
-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/local/gfortran/lib -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/local/Cellar/gcc/9.3.0/lib/gcc/9 -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 
 # Cleanup
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh	(revision 24675)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh	(revision 24676)
@@ -36,5 +36,5 @@
 	--CFLAGS="-fPIC" \
 	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC" \
+	--FFLAGS="-fPIC -static-libgfortran" \
 	--with-debugging=0 \
 	--with-valgrind=0 \
Index: /issm/trunk-jpl/jenkins/pine_island-mac
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac	(revision 24675)
+++ /issm/trunk-jpl/jenkins/pine_island-mac	(revision 24676)
@@ -14,5 +14,5 @@
 	--with-numthreads=4 \
 	--with-matlab-dir=${MATLAB_PATH} \
-	--with-fortran-lib="-L/usr/local/gfortran/lib -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/9.3.0/lib/gcc/9 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
@@ -69,6 +69,6 @@
 #
 # NOTE:
-#	- test701.m is skipped because it uses full Stokes equations
+# - test701 is skipped because it uses full Stokes equations
 #
-MATLAB_NROPTIONS="'exclude',[701,702,703,435,IdFromString('Dakota')]"
-PYTHON_NROPTIONS="--exclude_name 'Dakota'"
+MATLAB_NROPTIONS="'exclude',[435,701,702,703,IdFromString('Dakota')]"
+PYTHON_NROPTIONS=""
Index: /issm/trunk-jpl/jenkins/pine_island-mac-binaries
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac-binaries	(revision 24675)
+++ /issm/trunk-jpl/jenkins/pine_island-mac-binaries	(revision 24676)
@@ -9,10 +9,9 @@
 # - We can disable dependency tracking in the Autotools because the binaries
 #	should always be a one-time build.
-# - libgfortran is copied to $ISSM_DIR/lib by packaging script.
 #
+
 # ISSM CONFIGURATION
 ISSM_CONFIG='\
 	--prefix=${ISSM_DIR} \
-	--disable-static \
 	--enable-standalone-executables \
 	--enable-standalone-modules \
@@ -20,5 +19,5 @@
 	--disable-dependency-tracking \
 	--with-matlab-dir=${MATLAB_PATH} \
-	--with-fortran-lib="-L/usr/local/gfortran/lib -lgfortran" \
+	--with-fortran-lib="/usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libgfortran.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libquadmath.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/gcc/x86_64-apple-darwin15/9.3.0/libgcc.a" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
Index: /issm/trunk-jpl/jenkins/pine_island-mac-binaries-with_dakota
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac-binaries-with_dakota	(revision 24675)
+++ /issm/trunk-jpl/jenkins/pine_island-mac-binaries-with_dakota	(revision 24676)
@@ -9,10 +9,9 @@
 # - We can disable dependency tracking in the Autotools because the binaries
 #	should always be a one-time build.
-# - libgfortran is copied to $ISSM_DIR/lib by packaging script.
 #
+
 # ISSM CONFIGURATION
 ISSM_CONFIG='\
 	--prefix=${ISSM_DIR} \
-	--disable-static \
 	--enable-standalone-executables \
 	--enable-standalone-modules \
@@ -22,5 +21,5 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/gfortran/lib -lgfortran" \
+	--with-fortran-lib="/usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libgfortran.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/libquadmath.a /usr/local/Cellar/gcc/9.3.0/lib/gcc/9/gcc/x86_64-apple-darwin15/9.3.0/libgcc.a" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
Index: /issm/trunk-jpl/jenkins/pine_island-mac-dakota
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac-dakota	(revision 24675)
+++ /issm/trunk-jpl/jenkins/pine_island-mac-dakota	(revision 24676)
@@ -16,5 +16,5 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/gfortran/lib -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/9.3.0/lib/gcc/9 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
@@ -38,7 +38,7 @@
 EXAMPLES_TEST=0
 
-#-----------------------------------#
-# 3: External packages installation #
-#-----------------------------------#
+#-------------------#
+# External Packages #
+#-------------------#
 
 #List of external pakages to be installed and their installation scripts
@@ -56,7 +56,7 @@
 "
 
-#-----------------#
-# 4: test options #
-#-----------------#
+#---------#
+# Testing #
+#---------#
 
 # Number of CPUs used in ISSM compilation
@@ -75,7 +75,7 @@
 #
 # NOTE:
-# - See test418.py for reason why it is excluded for now.
-# - Error is large for test420.
+# - See test418.py for reason why it is excluded for now
+# - test701 is skipped because it uses full Stokes equations
 #
-MATLAB_NROPTIONS="'exclude',[234,235,243,418,420,435,444,445,701,702],'id',[IdFromString('Dakota')]"
-PYTHON_NROPTIONS="--exclude 234 235 243 418 420 435 444 445 701 702 --include_name 'Dakota'"
+MATLAB_NROPTIONS="'exclude',[243 435 701 702 703,'id',[IdFromString('Dakota')]"
+PYTHON_NROPTIONS="--exclude 243 418 435 701 702 703 --include_name 'Dakota'"
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(revision 24675)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(revision 24676)
@@ -6,5 +6,5 @@
 LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
 LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,244,250,417,444,445]" # Exclude any tests with transient solutions that require a restart
+MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,243,244,250,417,444,445,701,702]" # Exclude any tests with transient solutions that require a restart
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
@@ -16,5 +16,5 @@
 # - 418 fails with "malloc(): invalid next size (unsorted)""
 #
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 244 250 417 418 444 445"
+PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 243 244 250 417 418 435 444 445 701 702"
 TARBALL_NAME="issm-linux-with_dakota"
 TARBALL="${TARBALL_NAME}.tar.gz"
Index: /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-with_dakota.sh	(revision 24675)
+++ /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-with_dakota.sh	(revision 24676)
@@ -4,8 +4,6 @@
 ## Constants
 #
-LIBGFORTRAN="/usr/local/gfortran/lib/libgfortran.3.dylib" # Important that this is the library itself
-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.3.dylib" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,244,250,417,444,445]" # Exclude any tests with transient solutions that require a restart
-MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,244,250,417,435,444,445,701,702,703]" # Exclude any tests with transient solutions that require a restart, and any tests that are excluded in the standard build
+MATLAB_PATH="/Applications/MATLAB_R2018a.app"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
 
@@ -13,8 +11,7 @@
 #
 # NOTE:
-# - All non-excluded tests were running until recent changes to QMU
 # - 418 fails with "malloc(): invalid next size (unsorted)""
 #
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 244 250 417 418 444 445"
+PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 244 250 417 418 435 444 445 701 702 703"
 TARBALL_NAME="issm-mac-with_dakota"
 TARBALL="${TARBALL_NAME}.tar.gz"
@@ -44,8 +41,4 @@
 	exit 1
 fi
-
-# Add/modify required libraries
-echo "Moving libgfortran to lib/"
-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
 
 # Run tests
Index: /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries.sh
===================================================================
--- /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries.sh	(revision 24675)
+++ /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries.sh	(revision 24676)
@@ -4,8 +4,6 @@
 ## Constants
 #
-LIBGFORTRAN="/usr/local/gfortran/lib/libgfortran.3.dylib" # Important that this is the library itself
-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.3.dylib" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126]" # Exclude Dakota tests and any tests with transient solutions that require a restart
-MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126,435,701,702,703]" # Exclude Dakota tests, any tests with transient solutions that require a restart, and any tests that are excluded in the standard build
+MATLAB_PATH="/Applications/MATLAB_R2018a.app"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
 TARBALL_NAME="issm-mac"
@@ -35,7 +33,4 @@
 	exit 1
 fi
-
-echo "Moving libgfortran to lib/"
-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
 
 # Run tests
Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 24675)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 24676)
@@ -723,7 +723,7 @@
 if STANDALONE_EXECUTABLES
 if MAC
-AM_LDFLAGS += -Wl,-rpath,'$$ORIGIN'
-else
-AM_LDFLAGS += -static -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN'
+AM_LDFLAGS += -Wl,-rpath,'@loader_path/../lib'
+else
+AM_LDFLAGS += -static -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN/../lib'
 endif
 endif
Index: /issm/trunk-jpl/src/wrappers/matlab/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 24675)
+++ /issm/trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 24676)
@@ -93,13 +93,13 @@
 #	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.
+# - On macOS, static linking of binaries is not supported.
 #
 if STANDALONE_MODULES
-#if MAC
-#AM_LDFLAGS += -Wl,-rpath,'$$ORIGIN'
-#else
+if MAC
+AM_LDFLAGS += -Wl,-rpath,'@rpath'
+else
 AM_LDFLAGS += -Wl,-static -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN'
 endif
-#endif
+endif
 
 AM_CXXFLAGS += -D_HAVE_MATLAB_MODULES_ -fPIC
Index: /issm/trunk-jpl/src/wrappers/python/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/wrappers/python/Makefile.am	(revision 24675)
+++ /issm/trunk-jpl/src/wrappers/python/Makefile.am	(revision 24676)
@@ -69,13 +69,13 @@
 #	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.
+# - On macOS, static linking of binaries is not supported.
 #
 if STANDALONE_MODULES
-#if MAC
-#AM_LDFLAGS += -Wl,-rpath,'$$ORIGIN'
-#else
+if MAC
+AM_LDFLAGS += -Wl,-rpath,'@rpath'
+else
 AM_LDFLAGS += -Wl,-static -Wl,--disable-new-dtags -Wl,-rpath,'$$ORIGIN'
 endif
-#endif
+endif
 
 AM_LDFLAGS 	+= --no-warnings
