Index: sm/trunk/externalpackages/chaco/Makefile.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/Makefile.patch	(revision 3010)
+++ 	(revision )
@@ -1,8 +1,0 @@
-5c5,9
-< CFLAGS =	-O2
----
-> #IFLAG =		-Imain -I/usr/local/pkgs/matlab-7.8/extern/include
-> #CFLAGS =	-O2
-> #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
-> CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions
-> #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
Index: sm/trunk/externalpackages/chaco/assign_out.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/assign_out.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-5a6
-> #include	"defs.h"
Index: sm/trunk/externalpackages/chaco/bail.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/bail.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-6a7
-> #include	"defs.h"
Index: /issm/trunk/externalpackages/chaco/chaco.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/chaco.patch	(revision 3011)
+++ /issm/trunk/externalpackages/chaco/chaco.patch	(revision 3011)
@@ -0,0 +1,171 @@
+Only in /home/jschierm/Libs/Chaco-2.2: chaco_jes_notes.txt
+Only in /home/jschierm/Libs/Chaco-2.2: chaco_README.txt
+diff -rc src/code/assign/assign_out.c /home/jschierm/Libs/Chaco-2.2/code/assign/assign_out.c
+*** src/code/assign/assign_out.c	1995-08-08 14:32:10.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/assign/assign_out.c	2009-07-30 09:37:34.781348564 -0700
+***************
+*** 3,8 ****
+--- 3,9 ----
+   * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+  
+  #include	<stdio.h>
++ #include	"defs.h"
+  
+  static void assign_out_normal(), assign_out_inv();
+  
+diff -rc src/code/eigen/get_extval.c /home/jschierm/Libs/Chaco-2.2/code/eigen/get_extval.c
+*** src/code/eigen/get_extval.c	1995-08-08 14:32:20.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/eigen/get_extval.c	2009-07-30 09:43:00.511686903 -0700
+***************
+*** 4,9 ****
+--- 4,10 ----
+  
+  #include <math.h>
+  #include <stdio.h>
++ #include "defs.h"
+  
+  /* Finds first extended eigenpair of system corresponding to
+     tridiagonal T using using Rafael's bisection technique. */
+diff -rc src/code/klvspiff/matching.c /home/jschierm/Libs/Chaco-2.2/code/klvspiff/matching.c
+*** src/code/klvspiff/matching.c	1996-03-11 10:24:25.000000000 -0800
+--- /home/jschierm/Libs/Chaco-2.2/code/klvspiff/matching.c	2009-07-30 09:43:11.604702814 -0700
+***************
+*** 6,11 ****
+--- 6,12 ----
+     code provided by Ed Rothberg at SGI. */
+  
+  #include <stdio.h>
++ #include "defs.h"
+  
+  #define  TRUE  1
+  #define  FALSE 0
+diff -rc src/code/main/defs.h /home/jschierm/Libs/Chaco-2.2/code/main/defs.h
+*** src/code/main/defs.h	1995-08-08 14:32:41.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/main/defs.h	2009-08-25 10:02:57.088970763 -0700
+***************
+*** 9,11 ****
+--- 9,27 ----
+  #define	PI	3.141592653589793
+  #define	TWOPI	6.283185307179586
+  #define HALFPI  1.570796326794896
++ 
++ #ifdef MATLAB
++     #include "mat.h"
++     #include "mex.h"
++     #include "matrix.h"
++    
++     #define printf mexPrintf
++     #define fprintf(file,...) (file == stdout || file == stderr ? mexPrintf(__VA_ARGS__) : fprintf(file,__VA_ARGS__))
++     #define malloc mxMalloc
++     #define calloc mxCalloc
++     #define realloc mxRealloc
++     #define free mxFree
++ 
++     #define check_graph chaco_check_graph
++ #endif
++ 
+Only in /home/jschierm/Libs/Chaco-2.2/code/main: defs_old.h
+diff -rc src/code/Makefile /home/jschierm/Libs/Chaco-2.2/code/Makefile
+*** src/code/Makefile	1997-10-02 10:23:22.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/Makefile	2010-02-10 14:05:56.986149785 -0800
+***************
+*** 2,8 ****
+  DEST=		${DEST_DIR}/chaco
+  CC = 		gcc
+  IFLAG =		-Imain
+! CFLAGS =	-O2
+  OFLAGS =	-O2
+  
+  FILES.c=	main/user_params.c main/interface.c main/main.c \
+--- 2,13 ----
+  DEST=		${DEST_DIR}/chaco
+  CC = 		gcc
+  IFLAG =		-Imain
+! #IFLAG =		-Imain -I/usr/local/pkgs/matlab-7.6/extern/include
+! #CFLAGS =	-O2
+! #OFLAGS =	-O2
+! #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
+! CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions
+! #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
+  OFLAGS =	-O2
+  
+  FILES.c=	main/user_params.c main/interface.c main/main.c \
+Only in /home/jschierm/Libs/Chaco-2.2/code: Makefile_old
+diff -rc src/code/misc/timing.c /home/jschierm/Libs/Chaco-2.2/code/misc/timing.c
+*** src/code/misc/timing.c	1997-01-03 09:10:52.000000000 -0800
+--- /home/jschierm/Libs/Chaco-2.2/code/misc/timing.c	2009-07-30 09:43:19.954714766 -0700
+***************
+*** 3,8 ****
+--- 3,9 ----
+   * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+  
+  #include   <stdio.h>
++ #include   "defs.h"
+  
+  /* Timing parameters. */
+  
+diff -rc src/code/util/bail.c /home/jschierm/Libs/Chaco-2.2/code/util/bail.c
+*** src/code/util/bail.c	1995-08-08 14:33:01.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/util/bail.c	2009-07-30 09:43:24.495721262 -0700
+***************
+*** 4,9 ****
+--- 4,10 ----
+  
+  #include	<stdio.h>
+  #include	<string.h>
++ #include	"defs.h"
+  
+  /* Wrapper for exit() - print message and exit with status code. Exit code
+     of 0 indicates normal termination. Exit code of 1 indicates early 
+diff -rc src/code/util/checkpnt.c /home/jschierm/Libs/Chaco-2.2/code/util/checkpnt.c
+*** src/code/util/checkpnt.c	1995-08-08 14:33:01.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/util/checkpnt.c	2009-07-30 09:43:28.190726549 -0700
+***************
+*** 4,9 ****
+--- 4,10 ----
+  
+  #include	<stdio.h>
+  #include	<string.h>
++ #include	"defs.h"
+  
+  /* Debug break point. */
+  void      checkpnt(tag)
+diff -rc src/code/util/doubleout.c /home/jschierm/Libs/Chaco-2.2/code/util/doubleout.c
+*** src/code/util/doubleout.c	1995-08-08 14:33:02.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/util/doubleout.c	2009-07-30 09:43:34.192735135 -0700
+***************
+*** 3,8 ****
+--- 3,9 ----
+   * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+  
+  #include  <stdio.h>
++ #include  "defs.h"
+  
+  /* Print a double precision number with filtering format to screen. */
+  void      doubleout(number, mode)
+diff -rc src/code/util/smalloc.c /home/jschierm/Libs/Chaco-2.2/code/util/smalloc.c
+*** src/code/util/smalloc.c	1996-03-11 10:44:07.000000000 -0800
+--- /home/jschierm/Libs/Chaco-2.2/code/util/smalloc.c	2009-07-30 09:43:39.722743047 -0700
+***************
+*** 4,9 ****
+--- 4,10 ----
+  
+  #include <stdio.h>
+  #include <malloc.h>
++ #include "defs.h"
+  
+  static int nmalloc = 0;		/* number of calls to malloc */
+  static int nfree = 0;		/* number of calls to free */
+diff -rc src/code/util/strout.c /home/jschierm/Libs/Chaco-2.2/code/util/strout.c
+*** src/code/util/strout.c	1995-08-08 14:33:05.000000000 -0700
+--- /home/jschierm/Libs/Chaco-2.2/code/util/strout.c	2009-07-30 09:43:47.607754325 -0700
+***************
+*** 4,9 ****
+--- 4,10 ----
+  
+  #include	<stdio.h>
+  #include	<string.h>
++ #include	"defs.h"
+  
+  /* Wrapper for a printf statement with a string as only arg.
+     Prints to screen and to output file if there is one. */
Index: sm/trunk/externalpackages/chaco/checkpnt.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/checkpnt.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-6a7
-> #include	"defs.h"
Index: sm/trunk/externalpackages/chaco/defs.h.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/defs.h.patch	(revision 3010)
+++ 	(revision )
@@ -1,17 +1,0 @@
-11a12,27
-> 
-> #ifdef MATLAB
->     #include "mat.h"
->     #include "mex.h"
->     #include "matrix.h"
->    
->     #define printf mexPrintf
->     #define fprintf(file,...) (file == stdout || file == stderr ? mexPrintf(__VA_ARGS__) : fprintf(file,__VA_ARGS__))
->     #define malloc mxMalloc
->     #define calloc mxCalloc
->     #define realloc mxRealloc
->     #define free mxFree
-> 
->     #define check_graph chaco_check_graph
-> #endif
-> 
Index: sm/trunk/externalpackages/chaco/doubleout.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/doubleout.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-5a6
-> #include  "defs.h"
Index: sm/trunk/externalpackages/chaco/get_extval.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/get_extval.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-6a7
-> #include "defs.h"
Index: /issm/trunk/externalpackages/chaco/install.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install.sh	(revision 3010)
+++ /issm/trunk/externalpackages/chaco/install.sh	(revision 3011)
@@ -1,36 +1,27 @@
 #!/bin/bash
 
-#Some cleanup
+# Some cleanup
 rm -rf Chaco-2.2
 rm -rf src 
 rm -rf install 
 
-#Create src and install directories
+# Create src and install directories
 mkdir src install 
 
-#Untar 
+# Untar 
 tar -xvzf Chaco-2.2.tar.gz
 
-#Move chaco to src directory
+# Move chaco to src directory
 mv Chaco-2.2/* src
 rm -rf Chaco-2.2
 
-#Apply patches
-patch src/code/main/defs.h defs.h.patch
-patch src/code/assign/assign_out.c assign_out.c.patch
-patch src/code/eigen/get_extval.c get_extval.c.patch
-patch src/code/klvspiff/matching.c matching.c.patch
-patch src/code/misc/timing.c timing.c.patch
-patch src/code/util/bail.c bail.c.patch
-patch src/code/util/checkpnt.c checkpnt.c.patch
-patch src/code/util/doubleout.c doubleout.c.patch
-patch src/code/util/smalloc.c smalloc.c.patch
-patch src/code/util/strout.c strout.c.patch
-patch src/code/Makefile Makefile.patch
+# Apply patches (all at once)
+# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
+patch -p0 < chaco.patch
 
-#Build chaco
+# Build chaco
 cd src/code
 make
-#Clean up, so that meshpart creates its own objects for mlchaco
+# Clean up, so that meshpart creates its own objects for mlchaco
 make clean
 cd ../..
Index: sm/trunk/externalpackages/chaco/matching.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/matching.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-8a9
-> #include "defs.h"
Index: sm/trunk/externalpackages/chaco/smalloc.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/smalloc.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-6a7
-> #include "defs.h"
Index: sm/trunk/externalpackages/chaco/strout.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/strout.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-6a7
-> #include	"defs.h"
Index: sm/trunk/externalpackages/chaco/timing.c.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/timing.c.patch	(revision 3010)
+++ 	(revision )
@@ -1,2 +1,0 @@
-5a6
-> #include   "defs.h"
