Index: /issm/trunk/externalpackages/petsc3/configs/altix64/configure.sh
===================================================================
--- /issm/trunk/externalpackages/petsc3/configs/altix64/configure.sh	(revision 2068)
+++ /issm/trunk/externalpackages/petsc3/configs/altix64/configure.sh	(revision 2068)
@@ -0,0 +1,5 @@
+#After Plapack is fixed
+./config/configure.py  --prefix=$PETSC_DIR --with-batch=1  --PETSC_ARCH=$PETSC_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/$PETSC_ARCH --FFLAGS=-I/usr/include --with-cc=icc --with-fc=ifort
+
+#Before Plapack implodes
+#./config/configure.py  --prefix=$PETSC_DIR --with-batch=1  --PETSC_ARCH=$PETSC_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
Index: /issm/trunk/externalpackages/petsc3/configs/linux64/configure.sh
===================================================================
--- /issm/trunk/externalpackages/petsc3/configs/linux64/configure.sh	(revision 2068)
+++ /issm/trunk/externalpackages/petsc3/configs/linux64/configure.sh	(revision 2068)
@@ -0,0 +1,2 @@
+#!/bin/bash
+./config/configure.py  --prefix="$ISSM_DIR/externalpackages/petsc/install" --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install --PETSC_ARCH=linux-gnu-amd64 --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" --with-debugging=0 --with-shared=1 --download-mumps=yes --download-scalapack=yes --download-blacs=yes --download-blas=yes --download-f-blas-lapack=yes --FFLAGS=-I$ISSM_DIR/externalpackages/mpich2/install/include --download-plapack=yes --COPTFLAGS="-march=opteron -O2" --FOPTFLAGS="-march=opteron -O2" --CXXOPTFLAGS="-march=opteron -O2" --download-parmetis=yes
Index: /issm/trunk/externalpackages/petsc3/configs/macosx32/configure.sh
===================================================================
--- /issm/trunk/externalpackages/petsc3/configs/macosx32/configure.sh	(revision 2068)
+++ /issm/trunk/externalpackages/petsc3/configs/macosx32/configure.sh	(revision 2068)
@@ -0,0 +1,2 @@
+#!/bin/bash
+./config/configure.py  --prefix="$ISSM_DIR/externalpackages/petsc/install" --with-mpi-dir=$ISSM_DIR/externalpackages/mpich2/install --PETSC_ARCH=macosx-gnu --PETSC_DIR="$ISSM_DIR/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_DIR/externalpackages/mpich2/install/include -L$ISSM_DIR/externalpackages/mpich2/install/lib -L/usr/local/bin -lmpich -lpmpich -lgfortran" --download-plapack=yes
Index: /issm/trunk/externalpackages/petsc3/configs/winxp32/configure.sh
===================================================================
--- /issm/trunk/externalpackages/petsc3/configs/winxp32/configure.sh	(revision 2068)
+++ /issm/trunk/externalpackages/petsc3/configs/winxp32/configure.sh	(revision 2068)
@@ -0,0 +1,2 @@
+#!/bin/bash
+./config/configure.py  --with-parallel-no --prefix="$ISSM_DIR/externalpackages/petsc/install" --PETSC_ARCH=cygwin-intel --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install" --with-debugging=0 --with-mpi=0 --download-c-blas-lapack=1
Index: /issm/trunk/externalpackages/petsc3/install.sh
===================================================================
--- /issm/trunk/externalpackages/petsc3/install.sh	(revision 2068)
+++ /issm/trunk/externalpackages/petsc3/install.sh	(revision 2068)
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+#Get number of cpus on current platform
+NUMCPUS=$1;
+NUMCPUS=1;
+
+#version of petsc
+version=`echo *.tar.gz | sed 's/\.tar\.gz//g' | sed 's/petsc-//g'`
+
+#Some cleanup
+rm -rf install petsc-$version
+
+#Create install directories
+mkdir install
+
+#Untar 
+tar -zxvf  petsc-$version.tar.gz
+
+#Move petsc to install directory
+rm -rf install/*
+mv petsc-$version/* install/
+rm -rf petsc-$version
+
+#Configure petsc
+cd install
+../configure.sh
+
+#symlink some missing stuff.
+cd conf
+ln -s ../$ISSM_ARCH/conf/petscrules petscrules 
+ln -s ../$ISSM_ARCH/conf/petscvariables petscvariables 
+cd ../
+cd include
+ln -s ../$ISSM_ARCH/include/petscconf.h petscconf.h 
+cd ../
+
+#Compile petsc and install it
+if [ -z $NUMCPUS ];
+then
+	make
+else
+	make -j $NUMCPUS
+fi
+make install
