Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-altix64-castor.sh	(revision 11106)
@@ -0,0 +1,61 @@
+#!/bin/bash
+#Step 1: unzip and install
+#Step 2: After Plapack implodes
+STEP=0
+
+if [ $STEP -eq 1 ]; then
+	#Some cleanup
+	rm -rf install petsc-2.3.2-p3 src
+	mkdir install src
+
+	#Untar and move petsc to install directory
+	tar -zxvf  petsc-2.3.2-p3.tar.gz
+	mv petsc-2.3.2-p3/* install/
+	rm -rf petsc-2.3.2-p3
+
+	#configure
+	cd install
+	./config/configure.py \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--ISSM_ARCH=$ISSM_ARCH \
+		--PETSC_DIR=$PETSC_DIR   \
+		--with-debugging=no \
+		--with-shared=0 COPTFLAGS=-O3 FOPTFLAGS=-O3 \
+		--with-blas-lapack-dir=/opt/intel/mkl/9.1.023 \
+		--with-mpi-lib=/usr/lib/libmpi.so \
+		--with-mpi-include=/usr/include  \
+		--with-mpi-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--download-plapack=yes \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort
+
+	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/installation/compilationtroubleshooting/petsc232/) =="
+	echo "== Then run STEP=2 =="
+fi
+if [ $STEP -eq 2 ]; then
+	cd install
+	./config/configure.py  \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--ISSM_ARCH=$ISSM_ARCH \
+		--PETSC_DIR=$PETSC_DIR   \
+		--with-debugging=no \
+		--with-shared=0 COPTFLAGS=-O3 FOPTFLAGS=-O3 \
+		--with-blas-lapack-dir=/opt/intel/mkl/9.1.023 \
+		--with-mpi-lib=/usr/lib/libmpi.so \
+		--with-mpi-include=/usr/include  \
+		--with-mpi-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--with-plapack-dir=$PETSC_DIR/externalpackages/PLAPACKR32-hg/$ISSM_ARCH \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort
+	echo "== Follow PETSc's instructions"
+fi
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-cosmos.sh	(revision 11106)
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-2.3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-2.3.2-p3.tar.gz
+mv petsc-2.3.2-p3/* install/
+rm -rf petsc-2.3.2-p3
+
+#configure
+cd install
+PETSC_DIR=$ISSM_TIER/externalpackages/petsc/install
+./config/configure.py  \
+	--prefix=$PETSC_DIR \
+	--with-batch=1  \
+	--ISSM_ARCH=$ISSM_ARCH \
+	--PETSC_DIR=$PETSC_DIR   \
+	--with-debugging=no COPTFLAGS=-O3 FOPTFLAGS=-O3 \
+	--with-blas-lapack-dir=/opt/intel/mkl/10.0.5.025/ \
+	--with-mpi-dir=/opt/mpich/gm/intel10.1/  \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes  \
+	--download-plapack=yes \
+	--FFLAGS=-I/usr/include  \
+	--with-mpi-shared=0
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-linux64-astrid.sh	(revision 11106)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-2.3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-2.3.2-p3.tar.gz
+mv petsc-2.3.2-p3/* install/
+rm -rf petsc-2.3.2-p3
+
+#configure
+cd install
+./config/configure.py  \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+	--PETSC_ARCH=linux-gnu-amd64 \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-fc=gfortran \
+	--with-debugging=1 \
+	--with-shared=0 \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes \
+	--download-blas=yes \
+	--download-f-blas-lapack=yes \
+	--FFLAGS=-I$ISSM_TIER/externalpackages/mpich2/install/include \
+	--download-plapack=yes \
+	--COPTFLAGS="-march=opteron -O2" \
+	--FOPTFLAGS="-march=opteron -O2" \
+	--CXXOPTFLAGS="-march=opteron -O2" 
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-eric.sh	(revision 11106)
@@ -0,0 +1,68 @@
+#!/bin/bash
+#Step 1: unzip and install
+#Step 2: After MUMPS Crashes
+STEP=0
+
+if [ $STEP -eq 1 ]; then
+	#Some cleanup
+	rm -rf install petsc-2.3.2-p3 src
+	mkdir install src
+
+	#Untar and move petsc to install directory
+	tar -zxvf  petsc-2.3.2-p3.tar.gz
+	mv petsc-2.3.2-p3/* install/
+	rm -rf petsc-2.3.2-p3
+
+	#configure
+	cd install
+	./config/configure.py  \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+		--PETSC_ARCH=macosx-gnu \
+		--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-fc=/usr/local/bin/gfortran \
+		--with-debugging=0 \
+		--with-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes \
+		--download-blas=yes \
+		--download-f-blas-lapack=yes \
+		--FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran  -fPIC -arch i386" \
+		--download-plapack=yes \
+		--CXXFLAGS=" -fPIC -arch i386" \
+		--CFLAGS=" -fPIC -arch i386" \
+		--with-pic \
+		--with-fc="gfortran -arch i386 " \
+		--LDFLAGS="-arch i386"
+	echo "== Fix MUMPS compilation manually (http://issm.jpl.nasa.gov/installation/compilationtroubleshooting/petsc232/) =="
+	echo "== Then run STEP=2 =="
+fi
+
+if [ $STEP -eq 2 ]; then
+	cd install
+	./config/configure.py  \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+		--PETSC_ARCH=macosx-gnu \
+		--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-fc=/usr/local/bin/gfortran \
+		--with-debugging=0 \
+		--with-shared=0 \
+		--with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3  \
+		--download-scalapack=yes \
+		--download-blacs=yes \
+		--download-blas=yes \
+		--download-f-blas-lapack=yes \
+		--FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran  -fPIC -arch i386" \
+		--download-plapack=yes \
+		--CXXFLAGS=" -fPIC -arch i386" \
+		--CFLAGS=" -fPIC -arch i386" \
+		--with-pic \
+		--with-fc="gfortran -arch i386 " \
+		--LDFLAGS="-arch i386"
+
+	#Compile petsc and install it
+	make -j $1
+	make install
+fi
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx32-ogive.sh	(revision 11106)
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-2.3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-2.3.2-p3.tar.gz
+mv petsc-2.3.2-p3/* install/
+rm -rf petsc-2.3.2-p3
+
+#configure
+cd install
+./config/configure.py  --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+	--PETSC_ARCH=macosx-gnu \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-fc=/usr/local/bin/gfortran \
+	--with-debugging=0 \
+	--with-shared=0 \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes \
+	--download-blas=yes \
+	--download-f-blas-lapack=yes \
+	--FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran" \
+	--download-plapack=yes
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-pleiades.sh	(revision 11106)
@@ -0,0 +1,67 @@
+#!/bin/bash
+#Step 1: unzip and install
+#Step 2: After Plapack implodes
+STEP=0
+
+if [ $STEP -eq 1 ]; then
+	#Some cleanup
+	rm -rf install petsc-2.3.2-p3 src
+	mkdir install src
+
+	#Untar and move petsc to install directory
+	tar -zxvf  petsc-2.3.2-p3.tar.gz
+	mv petsc-2.3.2-p3/* install/
+	rm -rf petsc-2.3.2-p3
+
+	#configure
+	cd install
+	./config/configure.py  \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--PETSC_ARCH=$ISSM_ARCH \
+		--PETSC_DIR=$PETSC_DIR   \
+		--with-debugging=no \
+		--with-shared=0 \
+		--with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+		--with-mpi-lib=/nasa/sgi/mpt/1.23.nas/lib64/libmpi.so \
+		--with-mpi-include=/nasa/sgi/mpt/1.23.nas/include  \
+		--with-mpi-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--download-plapack=yes \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort \
+		--COPTFLAGS=" -O3 -xS" \
+		--FOPTFLAGS=" -O3 -xS" \
+		--CXXOPTFLAGS=" -O3 -xS"
+
+	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/installation/compilationtroubleshooting/petsc232/) =="
+	echo "== Then run STEP=2 =="
+fi
+if [ $STEP -eq 2 ]; then
+	cd install
+	./config/configure.py  \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--PETSC_ARCH=$ISSM_ARCH \
+		--PETSC_DIR=$PETSC_DIR   \
+		--with-debugging=no \
+		--with-shared=0 \
+		--with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+		--with-mpi-lib=/nasa/sgi/mpt/1.23.nas/lib64/libmpi.so \
+		--with-mpi-include=/nasa/sgi/mpt/1.23.nas/include  \
+		--with-mpi-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--with-plapack-dir=$PETSC_DIR/externalpackages/PLAPACKR32-hg/$ISSM_ARCH \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort \
+		--COPTFLAGS=" -O3 -xS" \
+		--FOPTFLAGS=" -O3 -xS" \
+		--CXXOPTFLAGS=" -O3 -xS"
+	echo "== Follow PETSc's instructions"
+fi
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-win32-eric.sh	(revision 11106)
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-2.3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-2.3.2-p3.tar.gz
+mv petsc-2.3.2-p3/* install/
+rm -rf petsc-2.3.2-p3
+
+#configure
+cd install
+./config/configure.py  \
+	--with-parallel-no \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--PETSC_ARCH=cygwin-intel \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-debugging=0 \
+	--with-mpi=0 \
+	--download-c-blas-lapack=1
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.1-altix64-castor.sh	(revision 11106)
@@ -0,0 +1,62 @@
+#!/bin/bash
+#Step 1: unzip and install
+#Step 2: After Plapack implodes
+STEP=0
+
+if [ $STEP -eq 1 ]; then
+	#Some cleanup
+	rm -rf install petsc-3.1-p7 src
+	mkdir install src
+
+	#Untar and move petsc to install directory
+	tar -zxvf  petsc-3.1-p7.tar.gz
+	mv petsc-3.1-p7/* install/
+	rm -rf petsc-3.1-p7
+
+	#configure
+	cd src
+	./config/configure.py \
+	  --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	  --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	  --ISSM_ARCH=$ISSM_ARCH \
+	  --with-debugging=no \
+	  --with-shared=0 COPTFLAGS=-O3 FOPTFLAGS=-O3 \
+	  --with-blas-lapack-dir=/opt/intel/mkl/9.1.023 \
+	  --with-mpi-lib=/usr/lib/libmpi.so \
+	  --with-mpi-include=/usr/include  \
+	  --with-mpi-shared=0 \
+	  --download-mumps=yes \
+	  --download-scalapack=yes \
+	  --download-blacs=yes  \
+	  --download-plapack=yes \
+	  --FFLAGS=-I/usr/include \
+	  --with-cc=icc \
+	  --with-fc=ifort  \
+	  --download-parmetis=yes
+
+	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/installation/compilationtroubleshooting/petsc31/) =="
+	echo "== Then run STEP=2 =="
+fi
+if [ $STEP -eq 2 ]; then
+	cd src
+	./config/configure.py \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+		--with-batch=1  \
+		--ISSM_ARCH=$ISSM_ARCH \
+		--with-debugging=no \
+		--with-shared=0 COPTFLAGS=-O3 FOPTFLAGS=-O3 \
+		--with-blas-lapack-dir=/opt/intel/mkl/9.1.023 \
+		--with-mpi-lib=/usr/lib/libmpi.so \
+		--with-mpi-include=/usr/include  \
+		--with-mpi-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--with-plapack-dir=$PETSC_DIR/externalpackages/PLAPACKR32-hg/$ISSM_ARCH \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort  \
+		--download-parmetis=yes
+	echo "== Follow PETSc's instructions"
+fi
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.1-cosmos.sh	(revision 11106)
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.1-p7 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.1-p7.tar.gz
+mv petsc-3.1-p7/* src/
+rm -rf petsc-3.1-p7
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	--with-batch=1  \
+	--ISSM_ARCH=$ISSM_ARCH \
+	--with-debugging=no COPTFLAGS=-O3 FOPTFLAGS=-O3 \
+	--with-blas-lapack-dir=/opt/intel/mkl/10.0.5.025/ \
+	--with-mpi-dir=/opt/mpich/gm/intel10.1/  \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes  \
+	--download-plapack=yes \
+	--FFLAGS=-I/usr/include  \
+	--with-mpi-shared=0  \
+	--download-parmetis=yes
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.1-linux64-astrid.sh	(revision 11106)
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.1-p7 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.1-p7.tar.gz
+mv petsc-3.1-p7/* src/
+rm -rf petsc-3.1-p7
+
+#configure
+cd src
+./config/configure.py \
+ --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+ --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+ --PETSC_ARCH=linux-gnu-amd64 \
+ --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+ --with-debugging=0 \
+ --with-shared=0 \
+ --download-mumps=yes \
+ --download-scalapack=yes \
+ --download-blacs=yes \
+ --download-blas=yes \
+ --download-f-blas-lapack=yes \
+ --download-parmetis=yes \
+ --FFLAGS=-I$ISSM_TIER/externalpackages/mpich2/install/include \
+ --download-plapack=yes \
+ --COPTFLAGS="-march=opteron -O2" \
+ --FOPTFLAGS="-march=opteron -O2" \
+ --CXXOPTFLAGS="-march=opteron -O2" \
+ --with-pic=1
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-mathieu.sh	(revision 11106)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.1-p7 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.1-p7.tar.gz
+mv petsc-3.1-p7/* src/
+rm -rf petsc-3.1-p7
+
+#configure
+cd src
+./config/configure.py  \
+ --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+ --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+ --PETSC_ARCH=macosx-gnu \
+ --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+ --with-debugging=0 \
+ --with-shared=0 \
+ --download-mumps=yes \
+ --download-scalapack=yes \
+ --download-blacs=yes \
+ --download-blas=yes \
+ --download-f-blas-lapack=yes \
+ --download-plapack=yes \
+ --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -arch i386" \
+ --COPTFLAGS="-march=opteron -O2 -arch i386" \
+ --FOPTFLAGS="-march=opteron -O2 -arch i386" \
+ --CXXOPTFLAGS="-march=opteron -O2 -arch i386" \
+ --download-parmetis=yes
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.1-macosx32-ogive.sh	(revision 11106)
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.1-p7 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.1-p7.tar.gz
+mv petsc-3.1-p7/* src/
+rm -rf petsc-3.1-p7
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	--with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+	--PETSC_ARCH=macosx-gnu \
+	--with-fc=/usr/local/bin/gfortran \
+	--with-debugging=0 \
+	--with-shared=0 \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes \
+	--download-blas=yes \
+	--download-plapack=yes  \
+	--download-parmetis=yes \
+	--download-f-blas-lapack=yes \
+	--COPTFLAGS="-march=opteron -O2 " \
+	--FOPTFLAGS="-march=opteron -O2 " \
+	--CXXOPTFLAGS="-march=opteron -O2 " \
+	--FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -L$ISSM_TIER/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran " 
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.1-pleiades.sh	(revision 11106)
@@ -0,0 +1,69 @@
+#!/bin/bash
+#Step 1: unzip and install
+#Step 2: After Plapack implodes
+STEP=0
+
+if [ $STEP -eq 1 ]; then
+	#Some cleanup
+	rm -rf install petsc-3.1-p7 src
+	mkdir install src
+
+	#Untar and move petsc to install directory
+	tar -zxvf  petsc-3.1-p7.tar.gz
+	mv petsc-3.1-p7/* install/
+	rm -rf petsc-3.1-p7
+
+	#configure
+	cd src
+	./config/configure.py \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--PETSC_ARCH="$ISSM_ARCH" \
+		--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+		--with-debugging=no \
+		--with-shared=0 \
+		--with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+		--with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
+		--with-mpi-include=/nasa/sgi/mpt/1.25/include  \
+		--known-mpi-shared=0 \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--download-plapack=yes \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort \
+		--COPTFLAGS=" -O3 -xS" \
+		--FOPTFLAGS=" -O3 -xS" \
+		--CXXOPTFLAGS=" -O3 -xS" \
+		--with-pic=1
+	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/installation/compilationtroubleshooting/petsc31/) =="
+	echo "== Then run STEP=2 =="
+fi
+if [ $STEP -eq 2 ]; then
+	cd src
+	./config/configure.py \
+	 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	 --with-batch=1  \
+	 --PETSC_ARCH="$ISSM_ARCH" \
+	 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	 --with-debugging=no \
+	 --with-shared=0 \
+	 --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+	 --with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
+	 --with-mpi-include=/nasa/sgi/mpt/1.25/include  \
+	 --known-mpi-shared=0 \
+	 --download-mumps=yes \
+	 --download-scalapack=yes \
+	 --download-blacs=yes  \
+	 --with-plapack-dir=$ISSM_TIER/externalpackages/petsc/src/$ISSM_ARCH \
+	 --download-parmetis=yes \
+	 --FFLAGS=-I/usr/include \
+	 --with-cc=icc \
+	 --with-fc=ifort \
+	 --COPTFLAGS=" -O3 -xS" \
+	 --FOPTFLAGS=" -O3 -xS" \
+	 --CXXOPTFLAGS=" -O3 -xS" \
+	 --with-pic=1
+	echo "== Follow PETSc's instructions"
+fi
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.2-linux64.sh	(revision 11106)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.2-p3.tar.gz
+mv petsc-3.2-p3/* src/
+rm -rf petsc-3.2-p3
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+	--with-clanguage=C++ \
+	--PETSC_ARCH=linux-gnu-amd64 \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	--with-debugging=0 \
+	--with-shared-libraries=0 \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes \
+	--download-blas=yes \
+	--download-f-blas-lapack=yes \
+	--download-plapack=yes \
+	--download-parmetis=yes \
+	--with-pic=1 \
+	--FFLAGS=-I$ISSM_TIER/externalpackages/mpich2/install/include \
+	--COPTFLAGS="-march=opteron -O2" \
+	--FOPTFLAGS="-march=opteron -O2" \
+	--CXXOPTFLAGS="-march=opteron -O2"
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.2-macosx64.sh	(revision 11106)
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.2-p3.tar.gz
+mv petsc-3.2-p3/* src/
+rm -rf petsc-3.2-p3
+
+#configure
+cd src
+./config/configure.py \
+  --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+  --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+  --PETSC_ARCH=macosx-gnu \
+  --with-mpi-dir="$ISSM_TIER/externalpackages/mpich2/install" \
+  --with-debugging=0 \
+  --with-shared-libraries=0 \
+  --download-mumps=yes \
+  --download-scalapack=yes \
+  --download-blacs=yes \
+  --download-blas=yes \
+  --download-plapack=yes  \
+  --download-parmetis=yes \
+  --download-f-blas-lapack=yes 
+
+#Compile petsc and install it
+make -j $1
+make install
Index: /issm/trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh	(revision 11106)
+++ /issm/trunk-jpl/externalpackages/petsc/install-3.2-pleiades.sh	(revision 11106)
@@ -0,0 +1,69 @@
+#!/bin/bash
+#Step 1: unzip and install
+#Step 2: After Plapack implodes
+STEP=0
+
+if [ $STEP -eq 1 ]; then
+	#Some cleanup
+	rm -rf install petsc-3.1-p7 src
+	mkdir install src
+
+	#Untar and move petsc to install directory
+	tar -zxvf  petsc-3.1-p7.tar.gz
+	mv petsc-3.1-p7/* install/
+	rm -rf petsc-3.1-p7
+
+	#configure
+	cd src
+	./config/configure.py \
+		--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--PETSC_ARCH="$ISSM_ARCH" \
+		--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+		--with-debugging=0 \
+		--with-shared-libraries=0 \
+		--with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+		--known-mpi-shared-libraries=1 \
+		--with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
+		--with-mpi-include=/nasa/sgi/mpt/1.25/include  \
+		--download-mumps=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--download-plapack=yes \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort \
+		--COPTFLAGS=" -O3 -xS" \
+		--FOPTFLAGS=" -O3 -xS" \
+		--CXXOPTFLAGS=" -O3 -xS" \
+		--with-pic=1
+	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/installation/compilationtroubleshooting/petsc31/) =="
+	echo "== Then run STEP=2 =="
+fi
+if [ $STEP -eq 2 ]; then
+	cd src
+	./config/configure.py \
+	 --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	 --with-batch=1  \
+	 --PETSC_ARCH="$ISSM_ARCH" \
+	 --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	 --with-debugging=0 \
+	 --with-shared-libraries=0 \
+	 --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+	 --with-mpi-lib=/nasa/sgi/mpt/1.25/lib/libmpi.so \
+	 --with-mpi-include=/nasa/sgi/mpt/1.25/include  \
+	 --known-mpi-shared-libraries=1 \
+	 --download-mumps=yes \
+	 --download-scalapack=yes \
+	 --download-blacs=yes  \
+	 --with-plapack-dir=$ISSM_TIER/externalpackages/petsc/src/$ISSM_ARCH \
+	 --download-parmetis=yes \
+	 --FFLAGS=-I/usr/include \
+	 --with-cc=icc \
+	 --with-fc=ifort \
+	 --COPTFLAGS=" -O3 -xS" \
+	 --FOPTFLAGS=" -O3 -xS" \
+	 --CXXOPTFLAGS=" -O3 -xS" \
+	 --with-pic=1
+	echo "== Follow PETSc's instructions"
+fi
