Ticket #11616: mpir-2.1.3.p9-2.4.0.p1.diff

File mpir-2.1.3.p9-2.4.0.p1.diff, 12.8 KB (added by leif, 4 years ago)

Diff between the previous spkg in Sage and my new p1 spkg. For reference / review only.

  • .hgtags

    diff --git a/.hgtags b/.hgtags
    a b  
    226c0000b82e9a27c7b6baeae6c68ee790e6b5a341 mpir-1.2.p3
    338910de51d3da6d9906c39cf8189486f176ed408c mpir-2.1.3.p1
    445cc6cee3d3d156416e5c4053f1479331baa3d5dd mpir-2.1.3.p2
    5 c7bccdf78798ca44893d002b5dc5ffd0d1995406 mpir-2.1.3.p3
    6 c7bccdf78798ca44893d002b5dc5ffd0d1995406 mpir-2.1.3.p3
    751ef781ef316a238a9fc4f28b19d0f2426a5196c0 mpir-2.1.3.p3
    868e43565fafb7d3211b4d91de7312744cfc34bf09 mpir-2.1.3.p4
    9757a991f5baeeaa9c19d1367ebac8dd071e554b78 mpir-2.1.3.p5
    1084f3644c720091f9a584e2c0cfab163f472d1c14e mpir-2.1.3.p6
    1193b33192c35c487a7c77c2d623096f1dc1d48695f mpir-2.1.3.p7
    1210ea29d1f05281a05c2664c8362dcc65e6f0bbb52a mpir-2.1.3.p9
     1199dba51e64053e990d9ade3be4e9b5aee69cb0ac mpir-2.1.3.p8
     12d76b39da03c3d84bf84bbf26533a6cc511a09e13 mpir-2.4.0.p1
  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2727         each upgrade.)
    2828 * Make sure the patches still apply; also, putting "-Wl,z,noexecstack"
    2929   into LDFLAGS might not be necessary for later versions.
    30  * There is a race condition in `make install`, supposed to be fixed in
    31    MPIR 2.1.4.  Currently we work around this by installing with -j1.
    3230 * Perhaps make sure we still delete the correct files on 32-bit MacOS X
    3331   on Intel hardware (x86) to not break PIC there.
    3432 * Remove some files / directories not needed for Sage from upstream:
     
    4240
    4341== Changelog ==
    4442
     43=== mpir-2.4.0.p1 (Leif Leonhardy, March 21st, 2012) ===
     44 * Upstream upgrade to MPIR 2.4.0 (#11616).
     45   The 2.4.0.p0 spkg isn't in this history, as it was based
     46   on the 2.1.3.p4 spkg, i.e., is "on another branch",
     47   and never got merged into Sage.
     48 * Remove forcing a sequential `make install` again, since
     49   the potential race condition was fixed in MPIR 2.1.4.
     50 * Fix `.hgtags`, which contained duplicate entries, and
     51   was missing others.
     52
    4553=== mpir-2.1.3.p9 (Simon King, 11 December 2011) ===
    4654 * #12131: Use --libdir, so that the package works on openSUSE
    4755
  • patches/gmp-h.in

    diff --git a/patches/gmp-h.in b/patches/gmp-h.in
    a b  
    4747#define GMP_NAIL_MASK     (~ GMP_NUMB_MASK)
    4848
    4949
    50 /* The following (everything under ifndef __GNU_MP__) must be identical in
    51    mpir.h and mp.h to allow both to be included in an application or during
    52    the library build.  */
    5350#ifndef __GNU_MP__
    5451#define __GNU_MP__ 4
    5552
     
    6764#define __GMP_LIBGMP_DLL  @LIBGMP_DLL@
    6865#endif
    6966
     67/*  #if defined(__GMP_WITHIN_CONFIGURE) && defined(_WIN64)   */
     68#ifdef __WIN64
     69#define _LONG_LONG_LIMB 1
     70#endif
    7071
    7172/* __STDC__ - some ANSI compilers define this only to 0, hence the use of
    7273       "defined" and not "__STDC__-0".  In particular Sun workshop C 5.0
     
    203204#endif
    204205#endif
    205206
    206 #if defined( _MSC_VER ) && defined( _WIN64 )
     207#ifdef _WIN64
    207208typedef unsigned long long int  mp_bitcnt_t;
     209#define __GMP_BITCNT_MAX  (~(unsigned long long) 0)
    208210#else
    209211typedef unsigned long int mp_bitcnt_t;
     212#define __GMP_BITCNT_MAX  (~(unsigned long) 0)
    210213#endif
    211214
    212215/* For reference, note that the name __mpz_struct gets into C++ mangled
     
    228231
    229232typedef mp_limb_t *             mp_ptr;
    230233typedef __gmp_const mp_limb_t * mp_srcptr;
    231 #if defined (_CRAY) && ! defined (_CRAYMPP)
    232 /* plain `int' is much faster (48 bits) */
    233 #define __GMP_MP_SIZE_T_INT     1
    234 typedef int                     mp_size_t;
    235 typedef int                     mp_exp_t;
    236 #elif defined( _WIN64)
     234#if defined( _WIN64)
    237235#define __GMP_MP_SIZE_T_INT     0
    238236typedef long long int   mp_size_t;
    239237typedef long int                mp_exp_t;
     
    294292typedef __mpq_struct *mpq_ptr;
    295293
    296294
    297 /* This is not wanted in mp.h, so put it outside the __GNU_MP__ common
    298    section. */
    299295#if __GMP_LIBGMP_DLL
    300296#if __GMP_WITHIN_GMPXX
    301297/* compiling to go into a DLL libmpirxx */
     
    334330  || defined (__STDIO_H)              /* Borland */             \
    335331  || defined (__STDIO_H__)            /* IRIX */                \
    336332  || defined (_STDIO_INCLUDED)        /* HPUX */                \
    337   || defined (__dj_include_stdio_h_)  /* DJGPP */               \
    338333  || defined (_FILE_DEFINED)          /* Microsoft */           \
    339334  || defined (__STDIO__)              /* Apple MPW MrC */       \
    340335  || defined (_MSL_STDIO_H)           /* Metrowerks */          \
     
    529524#define __GMP_UNLIKELY(cond)  (cond)
    530525#endif
    531526
    532 #ifdef _CRAY
    533 #define __GMP_CRAY_Pragma(str)  _Pragma (str)
    534 #else
    535 #define __GMP_CRAY_Pragma(str)
    536 #endif
    537 
    538 
    539527/* Allow direct user access to numerator and denominator of a mpq_t object.  */
    540528#define mpq_numref(Q) (&((Q)->_mp_num))
    541529#define mpq_denref(Q) (&((Q)->_mp_den))
     
    732720__GMP_DECLSPEC void mpz_cdiv_q __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
    733721
    734722#define mpz_cdiv_q_2exp __gmpz_cdiv_q_2exp
    735 __GMP_DECLSPEC void mpz_cdiv_q_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long));
     723__GMP_DECLSPEC void mpz_cdiv_q_2exp __GMP_PROTO ((mpz_ptr, mpz_srcptr, mp_bitcnt_t));
    736724
    737725#define mpz_cdiv_q_ui __gmpz_cdiv_q_ui
    738726__GMP_DECLSPEC unsigned long int mpz_cdiv_q_ui __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
     
    10691057__GMP_DECLSPEC void mpz_realloc2 __GMP_PROTO ((mpz_ptr, mp_bitcnt_t));
    10701058
    10711059#define mpz_remove __gmpz_remove
    1072 __GMP_DECLSPEC unsigned long int mpz_remove __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
     1060__GMP_DECLSPEC mp_bitcnt_t mpz_remove __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
    10731061
    10741062#define mpz_root __gmpz_root
    10751063__GMP_DECLSPEC int mpz_root __GMP_PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
     
    11971185__GMP_DECLSPEC void mpz_xor __GMP_PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
    11981186
    11991187
     1188/****** Integer (i.e. Z) routines for intmaax_t/uintmax_t types ******/
     1189
     1190#if defined( _STDINT_H ) || defined ( _STDINT_H_ ) || defined ( _STDINT )
     1191
     1192#define __GMP_BITS_PER_UINTMAX  (8*sizeof(uintmax_t))
     1193
     1194#define mpz_get_ux __gmpz_get_ux
     1195__GMP_DECLSPEC uintmax_t mpz_get_ux __GMP_PROTO ((mpz_srcptr));
     1196
     1197#define mpz_get_sx __gmpz_get_sx
     1198__GMP_DECLSPEC intmax_t mpz_get_sx __GMP_PROTO ((mpz_srcptr));
     1199
     1200#define mpz_set_ux __gmpz_set_ux
     1201__GMP_DECLSPEC void mpz_set_ux __GMP_PROTO ((mpz_ptr, uintmax_t));
     1202
     1203#define mpz_set_sx __gmpz_set_sx
     1204__GMP_DECLSPEC void mpz_set_sx __GMP_PROTO ((mpz_ptr, intmax_t));
     1205
     1206#define mpz_init_set_ux __gmpz_init_set_ux
     1207__GMP_DECLSPEC void mpz_init_set_ux __GMP_PROTO ((mpz_ptr, uintmax_t));
     1208
     1209#define mpz_init_set_sx __gmpz_init_set_sx
     1210__GMP_DECLSPEC void mpz_init_set_sx __GMP_PROTO ((mpz_ptr, intmax_t));
     1211
     1212#endif
     1213
     1214
    12001215/**************** Rational (i.e. Q) routines.  ****************/
    12011216
    12021217#define mpq_abs __gmpq_abs
     
    13541369__GMP_DECLSPEC void mpf_dump __GMP_PROTO ((mpf_srcptr));
    13551370
    13561371#define mpf_eq __gmpf_eq
    1357 __GMP_DECLSPEC int mpf_eq __GMP_PROTO ((mpf_srcptr, mpf_srcptr, unsigned long int)) __GMP_ATTRIBUTE_PURE;
     1372__GMP_DECLSPEC int mpf_eq __GMP_PROTO ((mpf_srcptr, mpf_srcptr, mp_bitcnt_t)) __GMP_ATTRIBUTE_PURE;
    13581373
    13591374#define mpf_fits_sint_p __gmpf_fits_sint_p
    13601375__GMP_DECLSPEC int mpf_fits_sint_p __GMP_PROTO ((mpf_srcptr)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
     
    15571572__GMP_DECLSPEC int mpn_cmp __GMP_PROTO ((mp_srcptr, mp_srcptr, mp_size_t)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
    15581573#endif
    15591574
     1575#define mpn_redc_1 __MPN(redc_1)
     1576__GMP_DECLSPEC void mpn_redc_1 __GMP_PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);)
     1577
    15601578#define mpn_divexact_by3(dst,src,size) \
    15611579  mpn_divexact_by3c (dst, src, size, __GMP_CAST (mp_limb_t, 0))
    15621580
     
    18771895     "__GMP_ULONG_MAX < GMP_NUMB_MASK".  */
    18781896#if GMP_NAIL_BITS == 0 || defined (_LONG_LONG_LIMB)
    18791897  /* limb==long and no nails, or limb==longlong, one limb is enough */
    1880   return (__gmp_n != 0 ? __gmp_l : 0);
     1898  return (unsigned long)(__gmp_n != 0 ? __gmp_l : 0);
    18811899#else
    18821900  /* limb==long and nails, need two limbs when available */
    18831901  __gmp_n = __GMP_ABS (__gmp_n);
     
    19421960  mp_bitcnt_t    __gmp_result;
    19431961
    19441962  __gmp_usize = __gmp_u->_mp_size;
    1945   __gmp_result = (__gmp_usize < 0 ? __GMP_ULONG_MAX : 0);
     1963  __gmp_result = (__gmp_usize < 0 ? __GMP_BITCNT_MAX : 0);
    19461964  if (__GMP_LIKELY (__gmp_usize > 0))
    19471965    __gmp_result =  mpn_popcount (__gmp_u->_mp_d, __gmp_usize);
    19481966  return __gmp_result;
     
    22112229    /* ASSERT ((start) >= 0); */                                \
    22122230    /* ASSERT ((start) <= (size)); */                           \
    22132231    /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size)); */     \
    2214     __GMP_CRAY_Pragma ("_CRI ivdep");                           \
    22152232    for (__gmp_j = (start); __gmp_j < (size); __gmp_j++)        \
    22162233      (dst)[__gmp_j] = (src)[__gmp_j];                          \
    22172234  } while (0)
     
    23782395/* Major version number is the value of __GNU_MP__ too, above and in mp.h. */
    23792396#define __GNU_MP_VERSION 5
    23802397#define __GNU_MP_VERSION_MINOR 0
    2381 #define __GNU_MP_VERSION_PATCHLEVEL 1
    2382 #define GMP_VERSION "5.0.1"
     2398#define __GNU_MP_VERSION_PATCHLEVEL 2
     2399#define GMP_VERSION "5.0.2"
    23832400
    23842401#define __MPIR_VERSION 2
    2385 #define __MPIR_VERSION_MINOR 1
    2386 #define __MPIR_VERSION_PATCHLEVEL 3
     2402#define __MPIR_VERSION_MINOR 4
     2403#define __MPIR_VERSION_PATCHLEVEL 0
    23872404#if defined( _MSC_VER )
    2388 #define _MSC_MPIR_VERSION "2.1.3"
     2405#define _MSC_MPIR_VERSION "2.4.0"
    23892406#endif
    23902407
    23912408/* These are for programs like MPFR to use the same CC and CFLAGS as MPIR */
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    7575        exit 1
    7676    fi
    7777    header_file=$1
     78    # We'll probably have to change the following patterns (conditionally) when we
     79    # upgrade to MPIR >=2.5.0(?), since MPIR's gmp.h was changed to define __GMP_CC
     80    # to (literally) __MPIR_CC, and likewise __GMP_CFLAGS to __MPIR_CFLAGS.
     81    # I.e., in later releases __MPIR_CC and __MPIR_CFLAGS will contain the real strings
     82    # we need (unless they again change this; I've already complained about that).
    7883    gmp_cc_pat='/^[     ]*#[    ]*define[       ]\+__GMP_CC[    ]\+/s/.*"\([^"]*\)"/\1/p'
    7984    gmp_cflags_pat='/^[         ]*#[    ]*define[       ]\+__GMP_CFLAGS[        ]\+/s/.*"\([^"]*\)"/\1/p'
    8085    if ! [ -f "$header_file" ]; then
     
    128133# The Yasm build uses PYTHON from the environment to find python, so unset
    129134# it since the setting from 'spkg/standard/newest_version' confuses it:
    130135unset PYTHON
     136# This can be removed once #10492 has been merged, which turns the "package
     137# version" environment variables into solely `make` variables, such that the
     138# (shell) environment does no longer get polluted.
    131139
    132140user_cflags=$CFLAGS # Save them. 'sage-env' sets CC, but not CFLAGS.
    133141required_cflags="" # Additional mandatory settings required by Sage, accumulated below.
    134142default_cflags="" # Spkg defaults that can and might get overridden.
     143
     144# Newer autotools may put libs into .../lib64 (on 64-bit systems):
    135145SAGE_CONF_OPTS=--libdir="$SAGE_LOCAL/lib"
     146# (Further options to `configure` are added below.)
    136147
    137148
    138149if [ -z "$CFLAG32" ]; then
     
    201212            # on both 64-bit and 32-bit, though this is likely to change.
    202213            case "`uname -m`" in
    203214            i[3456]86)
    204                 echo "** Building with FAT Binary Support (32-bit) **"
     215                echo "** Building with \"fat binary\" support for 32-bit CPUs **"
    205216                SAGE_CONF_OPTS="$SAGE_CONF_OPTS --enable-fat"
    206217                ;;
    207218            x86_64|amd64)
    208                 echo "** Building with FAT Binary Support (64-bit) **"
     219                echo "** Building with \"fat binary\" support for 64-bit CPUs **"
    209220                SAGE_CONF_OPTS="$SAGE_CONF_OPTS --enable-fat"
    210221                ;;
    211222            *) # e.g. ia64 (Itanium) or PPC (ppc, ppc64)
     
    251262        ;;
    252263    *) # e.g. AIX or HP-UX
    253264        echo "Warning: Your platform ($UNAME) isn't yet explicitly supported" \
    254             "in this spkg."
     265            "by this MPIR spkg, i.e., by Sage's part of it."
    255266esac
    256267
    257268export ABI CFLAGS CXXFLAGS # Partially redundant, but safe(r).
     
    382393    echo "    --prefix=\"$SAGE_LOCAL\" $SAGE_CONF_OPTS"
    383394    echo "You can set MPIR_EXTRA_OPTS to pass additional parameters."
    384395else
    385     echo "Using additional 'configure' options as specified with" \
     396    echo "Using additional 'configure' options as specified through" \
    386397        "MPIR_EXTRA_OPTS:"
    387398    echo "    $MPIR_EXTRA_OPTS"
    388399    echo "Configuring MPIR with the following options:"
     
    431442# Now install MPIR:
    432443###############################################################################
    433444
    434 # Serial make since parallel is broken (#12139).
    435 $MAKE -j1 install
     445# The potential race condition in `make install` was fixed in MPIR 2.1.4.
     446$MAKE install
    436447if [ $? -ne 0 ]; then
    437448    echo >&2 "Error installing MPIR."
    438449    if [ "$UNAME" != "CYGWIN" ]; then  # On Cygwin an error is not fatal.
     
    443454echo "Remember to rebuild the Sage library ('./sage -b') such that it"
    444455echo "will use the new MPIR."
    445456echo "You may also have to (or want to) rebuild other Sage packages"
    446 echo "that use MPIR. Provided that this MPIR spkg is in 'spkg/standard/',"
     457echo "that use MPIR.  Provided that this MPIR spkg is in 'spkg/standard/',"
    447458echo "you can rebuild all packages depending on MPIR by typing:"
    448459echo "    cd $SAGE_ROOT"
    449460echo "    env SAGE_UPGRADING=yes make"