diff -ur /Users/dan/src/M2/M2-DanGrayson/M2/BUILD/dan/builds.tmp/mac64-pull-126-factory-4-0-0.production/libraries/mpir/tmp/mpir-2.6.0/configure.in mpir-2.6.0/configure.in
--- /Users/dan/src/M2/M2-DanGrayson/M2/BUILD/dan/builds.tmp/mac64-pull-126-factory-4-0-0.production/libraries/mpir/tmp/mpir-2.6.0/configure.in	2012-11-08 17:10:45.000000000 -0500
+++ mpir-2.6.0/configure.in	2014-05-27 08:37:31.000000000 -0400
@@ -69,7 +69,7 @@
 dnl  Note that there's a copy of these options in the top-level Makefile.am,
 dnl  so update there too if changing anything.
 dnl
-AM_INIT_AUTOMAKE([1.11 gnu no-dependencies parallel-tests dist-bzip2 no-dist-gzip dist-lzma])
+AM_INIT_AUTOMAKE([1.11 gnu no-dependencies parallel-tests dist-bzip2 no-dist-gzip])
 AM_CONFIG_HEADER(config.h:config.in)
 AM_MAINTAINER_MODE
 
diff -ur /Users/dan/src/M2/master/M2/BUILD/dan/builds.tmp/mac64.production/libraries/mpir/tmp/mpir-2.6.0/acinclude.m4 mpir-2.6.0/acinclude.m4
--- /Users/dan/src/M2/master/M2/BUILD/dan/builds.tmp/mac64.production/libraries/mpir/tmp/mpir-2.6.0/acinclude.m4	2012-10-23 10:56:46.000000000 -0400
+++ mpir-2.6.0/acinclude.m4	2013-11-13 12:59:36.000000000 -0500
@@ -480,28 +480,28 @@
 # first see a simple "main()" works, then go on to other checks
 GMP_PROG_CC_WORKS_PART([$1], [])
 
-GMP_PROG_CC_WORKS_PART_MAIN([$1], [gcc-4.3.2 on 64bit is bad , try -O1 or -fno-strict-aliasing for the flags],
-[/* The following aborts with gcc-4.3.2 on a 64bit system which is an unusable compiler */
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-int __attribute__((noinline))
-foo(int i)
-{
-  int *p = __builtin_malloc (4 * sizeof(int));
-  *p = 0;
-  p[i] = 1;
-  return *p;
-}
-extern void abort (void);
-int main()
-{
-   if (foo(0) != 1)
-        abort ();
-        return 0;
-}
-#else
-int main(){return 0;}
-#endif
-])
+dnl GMP_PROG_CC_WORKS_PART_MAIN([$1], [gcc-4.3.2 on 64bit is bad , try -O1 or -fno-strict-aliasing for the flags],
+dnl [/* The following aborts with gcc-4.3.2 on a 64bit system which is an unusable compiler */
+dnl #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+dnl int __attribute__((noinline))
+dnl foo(int i)
+dnl {
+dnl   int *p = __builtin_malloc (4 * sizeof(int));
+dnl   *p = 0;
+dnl   p[i] = 1;
+dnl   return *p;
+dnl }
+dnl extern void abort (void);
+dnl int main()
+dnl {
+dnl    if (foo(0) != 1)
+dnl         abort ();
+dnl         return 0;
+dnl }
+dnl #else
+dnl int main(){return 0;}
+dnl #endif
+dnl ])
 
 GMP_PROG_CC_WORKS_PART([$1], [function pointer return],
 [/* The following provokes an internal error from gcc 2.95.2 -mpowerpc64
@@ -563,22 +563,22 @@
 }
 ])])
 
-GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
-[/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
-   Extracted from tests/mpn/t-iord_u.c.  Causes Apple's gcc 3.3 build 1640 and
-   1666 to segfault with e.g., -O2 -mpowerpc64.  */
-
-#ifdef __GNUC__
-typedef unsigned long long t1;typedef t1*t2;
-__inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
-{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
-f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
-for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
-h(){}g(){}
-#else
-int dummy;
-#endif
-])
+dnl GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
+dnl [/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
+dnl    Extracted from tests/mpn/t-iord_u.c.  Causes Apple's gcc 3.3 build 1640 and
+dnl    1666 to segfault with e.g., -O2 -mpowerpc64.  */
+dnl 
+dnl #ifdef __GNUC__
+dnl typedef unsigned long long t1;typedef t1*t2;
+dnl __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
+dnl {t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
+dnl f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
+dnl for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
+dnl h(){}g(){}
+dnl #else
+dnl int dummy;
+dnl #endif
+dnl ])
 
 GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 2],
 [/* The following provokes an internal compiler error on powerpc-apple-darwin.
diff -ur /Users/mike/src/M2-git-linalg/M2/BUILD/mike/builds.tmp/opt64-all/libraries/mpir/tmp/mpir-2.6.0/mpirxx.h mpir-2.6.0/mpirxx.h
--- /Users/mike/src/M2-git-linalg/M2/BUILD/mike/builds.tmp/opt64-all/libraries/mpir/tmp/mpir-2.6.0/mpirxx.h	2012-10-13 07:34:22.000000000 -0400
+++ mpir-2.6.0/mpirxx.h	2014-01-06 00:37:37.000000000 -0500
@@ -668,7 +668,7 @@
 
 // Max allocations for plain types when converted to mpz_t
 #define __GMP_DBL_LIMBS (2 + DBL_MAX_EXP / GMP_NUMB_BITS)
-#define __GMP_ULI_LIMBS (1 + (8 * sizeof (mpir_ui) - 1) / GMP_NUMB_BITS)
+#define __GMP_ULI_LIMBS (1 + (8 * (int)(sizeof (mpir_ui)) - 1) / GMP_NUMB_BITS)
 
 #define __GMPXX_TMP_UI							\
   mpz_t temp;								    \
@@ -1707,8 +1707,8 @@
   mpir_si get_si() const { return mpz_get_si(mp); }
   mpir_ui get_ui() const { return mpz_get_ui(mp); }
 #if defined( _STDINT_H ) || defined ( _STDINT_H_ ) || defined ( _STDINT )
-  intmax_t get_sx() const { return mpz_get_sx(mp); }
-  uintmax_t get_ux() const { return mpz_get_ux(mp); }
+//  intmax_t get_sx() const { return mpz_get_sx(mp); }
+//  uintmax_t get_ux() const { return mpz_get_ux(mp); }
 #endif
   double get_d() const { return mpz_get_d(mp); }
 
diff -ur /Users/mike/src/M2-git-linalg/M2/BUILD/mike/builds.tmp/opt64-all/libraries/mpir/tmp/mpir-2.6.0/tests/mpz/t-scan.c mpir-2.6.0/tests/mpz/t-scan.c
--- /Users/mike/src/M2-git-linalg/M2/BUILD/mike/builds.tmp/opt64-all/libraries/mpir/tmp/mpir-2.6.0/tests/mpz/t-scan.c	2012-10-03 16:07:32.000000000 -0400
+++ mpir-2.6.0/tests/mpz/t-scan.c	2014-01-05 16:29:44.000000000 -0500
@@ -84,7 +84,7 @@
 
               for (isize = 0; isize <= size; isize++)
                 {
-                  for (oindex = 0; oindex <= numberof (offset); oindex++)
+                  for (oindex = 0; oindex < numberof (offset); oindex++)
                     {
                       o = offset[oindex];
                       if ((int) isize*GMP_NUMB_BITS < -o)
diff -ur /home/dan/src/M2/Macaulay2-master/M2/BUILD/dan/builds.tmp/scientific-64/libraries/mpir/tmp/mpir-2.6.0/mp_set_fns.c mpir-2.6.0/mp_set_fns.c
--- /home/dan/src/M2/Macaulay2-master/M2/BUILD/dan/builds.tmp/scientific-64/libraries/mpir/tmp/mpir-2.6.0/mp_set_fns.c	2012-10-03 16:07:32.000000000 -0400
+++ mpir-2.6.0/mp_set_fns.c	2014-06-12 22:42:29.848829756 -0400
@@ -28,14 +28,4 @@
 			 void *(*realloc_func) (void *, size_t, size_t),
 			 void (*free_func) (void *, size_t))
 {
-  if (alloc_func == 0)
-    alloc_func = __gmp_default_allocate;
-  if (realloc_func == 0)
-    realloc_func = __gmp_default_reallocate;
-  if (free_func == 0)
-    free_func = __gmp_default_free;
-
-  __gmp_allocate_func = alloc_func;
-  __gmp_reallocate_func = realloc_func;
-  __gmp_free_func = free_func;
 }
diff -ur /home/bapike/git/M2/M2/libraries/mpir/tmp/mpir-2.6.0/mpn/generic/mulmod_2expp1_basecase.c mpir-2.6.0/mpn/generic/mulmod_2expp1_basecase.c
--- /home/bapike/git/M2/M2/libraries/mpir/tmp/mpir-2.6.0/mpn/generic/mulmod_2expp1_basecase.c	2012-10-03 16:07:20.000000000 -0400
+++ mpir-2.6.0/mpn/generic/mulmod_2expp1_basecase.c	2015-11-19 12:11:49.344734735 -0500
@@ -48,8 +48,10 @@
   ASSERT_MPN (zp, n);
   ASSERT (!MPN_OVERLAP_P (tp, 2 * n, yp, n));
   ASSERT (!MPN_OVERLAP_P (tp, 2 * n, zp, n));
+  /*
+    Backport a fix from MPIR commit 691f114d92c3448d0d6d725faede4f97d6323b85 that fixes MPIR issue #12
   ASSERT (!MPN_OVERLAP_P (xp, n, yp, n));
-  ASSERT (!MPN_OVERLAP_P (xp, n, zp, n));
+  ASSERT (!MPN_OVERLAP_P (xp, n, zp, n));*/
   ASSERT (MPN_SAME_OR_SEPARATE_P (xp, tp, n));
   ASSERT (MPN_SAME_OR_SEPARATE_P (xp, tp + n, n));
   ASSERT (k == 0 || yp[n - 1] >> (GMP_NUMB_BITS - k) == 0);
