Index: /issm/trunk-jpl/externalpackages/adolc/install.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/adolc/install.sh	(revision 11736)
+++ /issm/trunk-jpl/externalpackages/adolc/install.sh	(revision 11737)
@@ -1,3 +1,5 @@
 #!/bin/bash
+
+#some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
 
 #Some cleanup
@@ -16,9 +18,12 @@
 #Compile ADOL-C
 cd src 
+
 ./configure \
 	--prefix=$ISSM_TIER/externalpackages/adolc/install \
 	--enable-sparse \
 	--enable-docexa \
-	--enable-addexa          
+	--enable-addexa \
+	--disable-shave
+
 if [ -z $1 ]; then
 	make
Index: /issm/trunk-jpl/externalpackages/chaco/chaco.patch
===================================================================
--- /issm/trunk-jpl/externalpackages/chaco/chaco.patch	(revision 11736)
+++ /issm/trunk-jpl/externalpackages/chaco/chaco.patch	(revision 11737)
@@ -241,5 +241,5 @@
   DEST=		${DEST_DIR}/chaco
   CC = 		gcc
-  IFLAG =		-Imain
+  IFLAG =		-Imain 
 ! #IFLAG =		-Imain -I/usr/local/pkgs/matlab-7.6/extern/include
 ! #CFLAGS =	-O2
@@ -259,5 +259,5 @@
   DEST=		${DEST_DIR}/chaco
   CC = 		gcc
-  IFLAG =		-Imain
+  IFLAG =		-Imain -I/usr/include/sys 
 ! CFLAGS =	-O2
 ! OFLAGS =	-O2
Index: /issm/trunk-jpl/externalpackages/matlab/install.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/matlab/install.sh	(revision 11736)
+++ /issm/trunk-jpl/externalpackages/matlab/install.sh	(revision 11737)
@@ -1,18 +1,4 @@
 #!/bin/bash
-
-#Erase symlink
 rm -rf install
 
-#Select or create a new simlink
-ln -s /usr/local/pkgs/matlab-7.6/ install
-#ln -s /usr/local/matlab704/ install
-#ln -s /usr/local/matlab711/ install
-#ln -s /usr/local/matlab712/ install
-#ln -s /usr/local/pkgs/matlab-7.6/ install
-
-# Macintosh (OSX) simlink 
-#ln -s /Applications/MATLAB_R2008a/ install
-#ln -s /Applications/MATLAB_R2009a.app/ install
-#ln -s /Applications/MATLAB_R2010a.app/ install
-#ln -s /Applications/MATLAB_R2011b.app/ install
-#ln -s /Applications/MATLAB*.app/ install
+ln -s /Applications/MATLAB_R2010a.app/ install
Index: /issm/trunk-jpl/externalpackages/mitgcm/install.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/mitgcm/install.sh	(revision 11736)
+++ /issm/trunk-jpl/externalpackages/mitgcm/install.sh	(revision 11737)
@@ -15,4 +15,5 @@
 
 #Download code from server
+cvs login
 cvs co -P MITgcm
 
Index: /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh
===================================================================
--- /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh	(revision 11737)
+++ /issm/trunk-jpl/externalpackages/petsc/install-2.3.2-macosx64.sh	(revision 11737)
@@ -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/* src/
+rm -rf petsc-2.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
+make install
Index: /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 11736)
+++ /issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp	(revision 11737)
@@ -20,5 +20,5 @@
 
 	/*output: */
-	Vector *uf=new Vector();
+	Vector *uf=NULL;
 
 	/*In debugging mode, check that stiffness matrix and load vectors are not NULL (they can be empty)*/
@@ -29,4 +29,5 @@
 		Vec uf0_vector = NULL;
 		Vec df_vector  = NULL;
+		Vec uf_vector  = NULL;
 		if(uf0) uf0_vector = uf0->vector;
 		if(df)  df_vector  = df->vector;
@@ -38,11 +39,8 @@
 		#endif
 
-		SolverxPetsc(&uf->vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters);
-		if(uf->vector == NULL){
-			uf->M = 0;
-		}
-		else{
-			VecGetSize(uf->vector,&uf->M);
-		}
+		SolverxPetsc(&uf_vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters);
+
+		/*Create vector out of petsc vector: */
+		uf=new Vector(uf_vector);
 	#else
 		#ifdef _HAVE_GSL_
Index: /issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp	(revision 11736)
+++ /issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp	(revision 11737)
@@ -79,7 +79,12 @@
 Vector::Vector(Vec petsc_vec){
 
-	/*copy vector*/
-	VecDuplicate(petsc_vec,&this->vector);
-	VecCopy(petsc_vec,this->vector);
+	if(petsc_vec==NULL){
+		this->vector=NULL;
+	}
+	else{
+		/*copy vector*/
+		VecDuplicate(petsc_vec,&this->vector);
+		VecCopy(petsc_vec,this->vector);
+	}
 
 }
