diff -crB install/Lib/kmetis.c install2/Lib/kmetis.c
*** install/Lib/kmetis.c	1998-11-30 08:26:47.000000000 -0800
--- install2/Lib/kmetis.c	2011-06-08 15:47:33.911358942 -0700
***************
*** 66,72 ****
      ctrl.dbglvl = options[OPTION_DBGLVL];
    }
    ctrl.optype = OP_KMETIS;
!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2(*nparts)), 20*(*nparts));
    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
  
    InitRandom(-1);
--- 66,72 ----
      ctrl.dbglvl = options[OPTION_DBGLVL];
    }
    ctrl.optype = OP_KMETIS;
!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2_function(*nparts)), 20*(*nparts));
    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
  
    InitRandom(-1);
diff -crB install/Lib/kvmetis.c install2/Lib/kvmetis.c
*** install/Lib/kvmetis.c	1998-11-30 08:26:47.000000000 -0800
--- install2/Lib/kvmetis.c	2011-06-08 15:47:33.916358976 -0700
***************
*** 66,72 ****
      ctrl.dbglvl = options[OPTION_DBGLVL];
    }
    ctrl.optype = OP_KVMETIS;
!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2(*nparts)), 20*(*nparts));
    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
  
    InitRandom(-1);
--- 66,72 ----
      ctrl.dbglvl = options[OPTION_DBGLVL];
    }
    ctrl.optype = OP_KVMETIS;
!   ctrl.CoarsenTo = amax((*nvtxs)/(40*log2_function(*nparts)), 20*(*nparts));
    ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt) : (*nvtxs))/ctrl.CoarsenTo);
  
    InitRandom(-1);
diff -crB install/Lib/Makefile install2/Lib/Makefile
*** install/Lib/Makefile	1998-09-22 05:08:29.000000000 -0700
--- install2/Lib/Makefile	2011-06-08 15:19:00.551540482 -0700
***************
*** 6,31 ****
  LD = $(CC) -L. 
  
  
! OBJS = coarsen.o fm.o initpart.o match.o ccgraph.o memory.o \
!        pmetis.o pqueue.o refine.o util.o timing.o debug.o \
!        bucketsort.o graph.o stat.o kmetis.o kwayrefine.o \
!        kwayfm.o balance.o ometis.o srefine.o sfm.o separator.o \
!        mincover.o mmd.o mesh.o meshpart.o frename.o fortran.o \
!        myqsort.o compress.o parmetis.o estmem.o \
!        mpmetis.o mcoarsen.o mmatch.o minitpart.o mbalance.o \
!        mrefine.o mutil.o mfm.o mkmetis.o mkwayrefine.o mkwayfmh.o \
!        mrefine2.o minitpart2.o mbalance2.o mfm2.o \
!        kvmetis.o kwayvolrefine.o kwayvolfm.o subdomains.o
  
! .c.o:
! 	$(CC) $(CFLAGS) -c $*.c
  
! ../libmetis.a: $(OBJS)
  	$(AR) $@ $(OBJS)
  	$(RANLIB) $@
  
  clean:
! 	rm -f *.o
  
  realclean:
! 	rm -f *.o ; rm -f ../libmetis.a
--- 6,31 ----
  LD = $(CC) -L. 
  
  
! OBJS = coarsen.$(OBJ_EXT) fm.$(OBJ_EXT) initpart.$(OBJ_EXT) match.$(OBJ_EXT) ccgraph.$(OBJ_EXT) memory.$(OBJ_EXT) \
!        pmetis.$(OBJ_EXT) pqueue.$(OBJ_EXT) refine.$(OBJ_EXT) util.$(OBJ_EXT) timing.$(OBJ_EXT) debug.$(OBJ_EXT) \
!        bucketsort.$(OBJ_EXT) graph.$(OBJ_EXT) stat.$(OBJ_EXT) kmetis.$(OBJ_EXT) kwayrefine.$(OBJ_EXT) \
!        kwayfm.$(OBJ_EXT) balance.$(OBJ_EXT) ometis.$(OBJ_EXT) srefine.$(OBJ_EXT) sfm.$(OBJ_EXT) separator.$(OBJ_EXT) \
!        mincover.$(OBJ_EXT) mmd.$(OBJ_EXT) mesh.$(OBJ_EXT) meshpart.$(OBJ_EXT) frename.$(OBJ_EXT) fortran.$(OBJ_EXT) \
!        myqsort.$(OBJ_EXT) compress.$(OBJ_EXT) parmetis.$(OBJ_EXT) estmem.$(OBJ_EXT) \
!        mpmetis.$(OBJ_EXT) mcoarsen.$(OBJ_EXT) mmatch.$(OBJ_EXT) minitpart.$(OBJ_EXT) mbalance.$(OBJ_EXT) \
!        mrefine.$(OBJ_EXT) mutil.$(OBJ_EXT) mfm.$(OBJ_EXT) mkmetis.$(OBJ_EXT) mkwayrefine.$(OBJ_EXT) mkwayfmh.$(OBJ_EXT) \
!        mrefine2.$(OBJ_EXT) minitpart2.$(OBJ_EXT) mbalance2.$(OBJ_EXT) mfm2.$(OBJ_EXT) \
!        kvmetis.$(OBJ_EXT) kwayvolrefine.$(OBJ_EXT) kwayvolfm.$(OBJ_EXT) subdomains.$(OBJ_EXT)
  
! %.$(OBJ_EXT) : %.c
! 	$(CC) -c $(CFLAGS) -o $@ $<
  
! ../libmetis.$(LIB_EXT): $(OBJS)
  	$(AR) $@ $(OBJS)
  	$(RANLIB) $@
  
  clean:
! 	rm -f *.$(OBJ_EXT)
  
  realclean:
! 	rm -f *.$(OBJ_EXT) ; rm -f ../libmetis.$(LIB_EXT)
diff -crB install/Lib/metis.h install2/Lib/metis.h
*** install/Lib/metis.h	1998-11-30 08:26:50.000000000 -0800
--- install2/Lib/metis.h	2011-06-08 15:19:00.544540433 -0700
***************
*** 18,24 ****
--- 18,26 ----
  #else
  #include <malloc.h>
  #endif
+ #ifndef WIN32
  #include <strings.h>
+ #endif
  #include <string.h>
  #include <ctype.h>
  #include <math.h>
diff -crB install/Lib/mkmetis.c install2/Lib/mkmetis.c
*** install/Lib/mkmetis.c	1998-11-30 08:26:48.000000000 -0800
--- install2/Lib/mkmetis.c	2011-06-08 15:47:33.921359010 -0700
***************
*** 47,53 ****
      ctrl.dbglvl = options[OPTION_DBGLVL];
    }
    ctrl.optype = OP_KMETIS;
!   ctrl.CoarsenTo = amax((*nvtxs)/(20*log2(*nparts)), 30*(*nparts));
  
    ctrl.nmaxvwgt = 1.5/(1.0*ctrl.CoarsenTo);
  
--- 47,53 ----
      ctrl.dbglvl = options[OPTION_DBGLVL];
    }
    ctrl.optype = OP_KMETIS;
!   ctrl.CoarsenTo = amax((*nvtxs)/(20*log2_function(*nparts)), 30*(*nparts));
  
    ctrl.nmaxvwgt = 1.5/(1.0*ctrl.CoarsenTo);
  
diff -crB install/Lib/proto.h install2/Lib/proto.h
*** install/Lib/proto.h	1998-11-30 08:26:50.000000000 -0800
--- install2/Lib/proto.h	2011-06-08 15:47:34.009359613 -0700
***************
*** 230,237 ****
--- 230,243 ----
  void QUADNODALMETIS(int, int, idxtype *, idxtype *, idxtype *adjncy);
  
  /* meshpart.c */
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
  void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
  void METIS_PartMeshDual(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
+ #ifdef __cplusplus
+ }
+ #endif
  
  /* mfm.c */
  void MocFM_2WayEdgeRefine(CtrlType *, GraphType *, float *, int);
***************
*** 459,465 ****
  void srand48(long);
  int ispow2(int);
  void InitRandom(int);
! int log2(int);
  
  
  
--- 465,471 ----
  void srand48(long);
  int ispow2(int);
  void InitRandom(int);
! int log2_function(int);
  
  
  
diff -crB install/Lib/rename.h install2/Lib/rename.h
*** install/Lib/rename.h	1998-11-30 08:26:50.000000000 -0800
--- install2/Lib/rename.h	2011-06-08 15:47:34.014359647 -0700
***************
*** 410,416 ****
  #define RandomPermute			__RandomPermute
  #define ispow2				__ispow2
  #define InitRandom			__InitRandom
! #define log2				__log2
  
  
  
--- 410,417 ----
  #define RandomPermute			__RandomPermute
  #define ispow2				__ispow2
  #define InitRandom			__InitRandom
! /* Correction bug Nadir SOUALEM*/
! #define log2_function				__log2_function
  
  
  
diff -crB install/Lib/util.c install2/Lib/util.c
*** install/Lib/util.c	1998-11-30 08:26:50.000000000 -0800
--- install2/Lib/util.c	2011-06-08 15:47:34.018359675 -0700
***************
*** 507,515 ****
  }
  
  /*************************************************************************
! * This function returns the log2(x)
  **************************************************************************/
! int log2(int a)
  {
    int i;
  
--- 507,515 ----
  }
  
  /*************************************************************************
! * This function returns the log2_function(x)
  **************************************************************************/
! int log2_function(int a)
  {
    int i;
  
diff -crB install/Makefile install2/Makefile
*** install/Makefile	1998-09-20 11:15:31.000000000 -0700
--- install2/Makefile	2011-06-08 15:19:00.511540204 -0700
***************
*** 2,9 ****
  
  default:
  	(cd Lib ; make ) 
! 	(cd Programs ; make ) 
! 	(cd Test ; make ) 
  
  clean:
  	(cd Lib ; make clean )
--- 2,9 ----
  
  default:
  	(cd Lib ; make ) 
! #	(cd Programs ; make ) 
! #	(cd Test ; make ) 
  
  clean:
  	(cd Lib ; make clean )
