Index: /issm/trunk/externalpackages/chaco/chaco.h
===================================================================
--- /issm/trunk/externalpackages/chaco/chaco.h	(revision 4636)
+++ /issm/trunk/externalpackages/chaco/chaco.h	(revision 4636)
@@ -0,0 +1,39 @@
+/*!\file: chaco.h
+ * \brief prototypes for chaco library
+ */ 
+
+#ifndef _CHACO_INCLUDES_H_
+#define  _CHACO_INCLUDES_H_
+
+#include "./defs.h"
+#include "./params.h"
+
+extern "C" int       interface( int       nvtxs,		/* number of vertices in full graph */
+		int      *start,		/* start of edge list for each vertex */
+		int      *adjacency,		/* edge list data */
+		int      *vwgts,		/* weights for all vertices */
+		float    *ewgts,		/* weights for all edges */
+		float    *x, 
+		float    *y, 
+		float    *z,		/* coordinates for inertial method */
+		char     *outassignname,	/* name of assignment output file */
+		char     *outfilename,		/* output file name */
+		short    *assignment,		/* set number of each vtx (length n) */
+		int       architecture,		/* 0 => hypercube, d => d-dimensional mesh */
+		int       ndims_tot,		/* total number of cube dimensions to divide */
+		int       mesh_dims[3],		/* dimensions of mesh of processors */
+		double   *goal,			/* desired set sizes for each set */
+		int       global_method,	/* global partitioning algorithm */
+		int       local_method,		/* local partitioning algorithm */
+		int       rqi_flag,		/* should I use RQI/Symmlq eigensolver? */
+		int       vmax,			/* how many vertices to coarsen down to? */
+		int       ndims,		/* number of eigenvectors (2^d sets) */
+		double    eigtol,		/* tolerance on eigenvectors */
+		long      seed);			/* for random graph mutations */
+
+extern "C" void      read_params(FILE* pfile);	/* file with new user parameters */
+extern "C" void      smalloc_stats(void);
+extern "C" double*   smalloc(unsigned int n); /* number of bytes to be allocated */
+
+#endif //ifndef _CHACO_INCLUDES_H_
+
Index: /issm/trunk/externalpackages/chaco/chaco.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/chaco.patch	(revision 4635)
+++ /issm/trunk/externalpackages/chaco/chaco.patch	(revision 4636)
@@ -1,4 +1,4 @@
 diff -rc src/code/assign/assign_out.c old/code/assign/assign_out.c
-*** src/code/assign/assign_out.c	2010-07-16 15:20:47.342501437 -0700
+*** src/code/assign/assign_out.c	2010-07-16 16:13:13.106937437 -0700
 --- old/code/assign/assign_out.c	1995-08-08 14:32:10.000000000 -0700
 ***************
@@ -13,5 +13,5 @@
 --- 3,8 ----
 diff -rc src/code/eigen/get_extval.c old/code/eigen/get_extval.c
-*** src/code/eigen/get_extval.c	2010-07-16 15:20:47.344501453 -0700
+*** src/code/eigen/get_extval.c	2010-07-16 16:13:13.107937445 -0700
 --- old/code/eigen/get_extval.c	1995-08-08 14:32:20.000000000 -0700
 ***************
@@ -26,5 +26,5 @@
 --- 4,9 ----
 diff -rc src/code/klvspiff/matching.c old/code/klvspiff/matching.c
-*** src/code/klvspiff/matching.c	2010-07-16 15:20:47.347501477 -0700
+*** src/code/klvspiff/matching.c	2010-07-16 16:13:13.110937469 -0700
 --- old/code/klvspiff/matching.c	1996-03-11 10:24:25.000000000 -0800
 ***************
@@ -39,41 +39,61 @@
 --- 6,11 ----
 diff -rc src/code/main/defs.h old/code/main/defs.h
-*** src/code/main/defs.h	2010-07-16 15:22:43.944433523 -0700
+*** src/code/main/defs.h	2010-07-16 16:13:13.112937485 -0700
 --- old/code/main/defs.h	1995-08-08 14:32:41.000000000 -0700
 ***************
-*** 1,6 ****
-- #ifndef _CHACO_DEFS_H_
-- #define _CHACO_DEFS_H_
-- 
-  #define	max(A, B)	((A) > (B) ? (A) : (B))
-  #define	min(A, B)	((A) < (B) ? (A) : (B))
-  #define sign(A)		((A) <  0  ? -1  :  1)
---- 1,3 ----
-***************
-*** 12,32 ****
-  #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 exit(status) mexErrMsgTxt("exit=" #status)
-- 
-- #endif
-- #define check_graph chaco_check_graph
-- 
-- #endif //ifndef _CHACO_DEFS_H_
---- 9,11 ----
+*** 1,39 ****
+! #ifndef _CHACO_DEFS_H_
+! #define _CHACO_DEFS_H_
+! 
+  #define TRUE		1
+  #define FALSE		0
+  
+! #ifndef _HAVE_CHACO_ //protect ISSM compilation. This symbol is defined when we compile ISSM
+! 
+! 	#define	max(A, B)	((A) > (B) ? (A) : (B))
+! 	#define	min(A, B)	((A) < (B) ? (A) : (B))
+! 	#define sign(A)		((A) <  0  ? -1  :  1)
+! 	#define absval(A)	((A) <  0  ? -(A): (A))
+! 
+! 	/* Define constants that are needed in various places */
+! 	#define	PI	3.141592653589793
+! 	#define	TWOPI	6.283185307179586
+! 	#define HALFPI  1.570796326794896
+! 
+!     #define check_graph chaco_check_graph
+! 
+! 
+! 	#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 exit(status) mexErrMsgTxt("exit=" #status)
+! 
+! 	#endif
+! 
+! #endif  //#ifndef _HAVE_CHACO_ 
+! 
+! #endif //ifndef _CHACO_DEFS_H_
+--- 1,11 ----
+! #define	max(A, B)	((A) > (B) ? (A) : (B))
+! #define	min(A, B)	((A) < (B) ? (A) : (B))
+! #define sign(A)		((A) <  0  ? -1  :  1)
+! #define absval(A)	((A) <  0  ? -(A): (A))
+  #define TRUE		1
+  #define FALSE		0
+  
+! /* Define constants that are needed in various places */
+! #define	PI	3.141592653589793
+! #define	TWOPI	6.283185307179586
+! #define HALFPI  1.570796326794896
 diff -rc src/code/main/params.h old/code/main/params.h
-*** src/code/main/params.h	2010-07-16 15:23:11.519653477 -0700
+*** src/code/main/params.h	2010-07-16 16:13:13.115937510 -0700
 --- old/code/main/params.h	1995-08-08 14:32:43.000000000 -0700
 ***************
@@ -93,5 +113,5 @@
 --- 1,5 ----
 diff -rc src/code/Makefile old/code/Makefile
-*** src/code/Makefile	2010-07-16 15:20:47.351501509 -0700
+*** src/code/Makefile	2010-07-16 16:13:13.117937526 -0700
 --- old/code/Makefile	1997-10-02 10:23:22.000000000 -0700
 ***************
@@ -146,5 +166,5 @@
   		lint ${IFLAG} ${FILES.c} -lm
 diff -rc src/code/misc/timing.c old/code/misc/timing.c
-*** src/code/misc/timing.c	2010-07-16 15:20:47.354501533 -0700
+*** src/code/misc/timing.c	2010-07-16 16:13:13.119937542 -0700
 --- old/code/misc/timing.c	1997-01-03 09:10:52.000000000 -0800
 ***************
@@ -159,5 +179,5 @@
 --- 3,8 ----
 diff -rc src/code/util/bail.c old/code/util/bail.c
-*** src/code/util/bail.c	2010-07-16 15:20:47.356501549 -0700
+*** src/code/util/bail.c	2010-07-16 16:13:13.121937558 -0700
 --- old/code/util/bail.c	1995-08-08 14:33:01.000000000 -0700
 ***************
@@ -182,5 +202,5 @@
           printf("%s\n", msg);
 diff -rc src/code/util/checkpnt.c old/code/util/checkpnt.c
-*** src/code/util/checkpnt.c	2010-07-16 15:20:47.358501565 -0700
+*** src/code/util/checkpnt.c	2010-07-16 16:13:13.123937575 -0700
 --- old/code/util/checkpnt.c	1995-08-08 14:33:01.000000000 -0700
 ***************
@@ -195,5 +215,5 @@
 --- 4,9 ----
 diff -rc src/code/util/doubleout.c old/code/util/doubleout.c
-*** src/code/util/doubleout.c	2010-07-16 15:20:47.360501581 -0700
+*** src/code/util/doubleout.c	2010-07-16 16:13:13.124937583 -0700
 --- old/code/util/doubleout.c	1995-08-08 14:33:02.000000000 -0700
 ***************
@@ -208,5 +228,5 @@
 --- 3,8 ----
 diff -rc src/code/util/smalloc.c old/code/util/smalloc.c
-*** src/code/util/smalloc.c	2010-07-16 15:20:47.363501605 -0700
+*** src/code/util/smalloc.c	2010-07-16 16:13:13.126937599 -0700
 --- old/code/util/smalloc.c	1996-03-11 10:44:07.000000000 -0800
 ***************
@@ -221,5 +241,5 @@
 --- 4,9 ----
 diff -rc src/code/util/strout.c old/code/util/strout.c
-*** src/code/util/strout.c	2010-07-16 15:20:47.365501621 -0700
+*** src/code/util/strout.c	2010-07-16 16:13:13.128937615 -0700
 --- old/code/util/strout.c	1995-08-08 14:33:05.000000000 -0700
 ***************
Index: /issm/trunk/externalpackages/chaco/install.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install.sh	(revision 4635)
+++ /issm/trunk/externalpackages/chaco/install.sh	(revision 4636)
@@ -37,6 +37,7 @@
 cp -p src/exec/*.graph install
 mkdir install/include
-cp -p src/code/main/defs.h install/include/chaco_defs.h
-cp -p src/code/main/params.h install/include/chaco_params.h
+cp -p src/code/main/defs.h install/include/defs.h
+cp -p src/code/main/params.h install/include/params.h
+cp -p chaco.h install/include/chaco.h
 mkdir install/lib
 mv src/code/chaco.a install/lib/libchaco.a
