Ticket #12173: flint-2.3.p0.diff

File flint-2.3.p0.diff, 45.9 KB (added by jpflori, 9 years ago)

Spkg diff, for review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    22
    33== Description ==
    44
    5 FLINT is a C library for doing number theory, written by William Hart and David Harvey.
     5FLINT is a C library for doing number theory, maintained by William Hart.
    66
    77Website: www.flintlib.org
    88
    99== License ==
    1010
    11 GPL V2+
     11FLINT is licensed GPL v2+.
    1212
    1313== SPKG Maintainers ==
    1414
    15  * Burcin Erocal
    16  * Mike Hansen
    17  * William Stein
     15 * Fredrik Johansson
     16 * Jean-Pierre Flori
    1817
    1918== Upstream Contact ==
    2019
    21  * Bill Hart
    22  * Development list for FLINT <flint-devel@lists.sourceforge.net> (moderated)
     20 * flint-devel Gougle Group (http://groups.google.co.uk/group/flint-devel)
     21 * William Hart
    2322
    2423== Dependencies ==
    2524
    26  * gmp
     25 * MPIR
     26 * MPFR
    2727 * NTL
    2828
    29 == Special Update/Build Instructions ==
     29== Patches ==
    3030
    31  * We patch the makefile slightly to add 64 bit OSX build support and also change
    32    LIBS such that the NTL interface is linked into the flint library.
    33    This is not an officially supported option because flint is pure C
    34    and the NTL interface requires C++.
    35  * Remove the '.svn' directories from upstream ('src/') if present.
    36  * Remove the 'src/zn_poly/demo/bernoulli/.DS_Store' file
     31 * dylib.patch: patch configure so that the shared library is called
     32   libflint.dylib on Darwin.
     33 * ulong.patch: replace the #define ulong by a typedef which is compatible
     34   with glibc's <sys/types.h> in -std=gnu99 mode.
    3735
    3836== Changelog ==
    3937
     38=== flint-2.3.p0 (Jean-Pierre Flori, 26 March 2013) ===
     39  * Trac #12173: add dylib.patch to make sure the shared library is called
     40    libflint.dylib on Darwin and port ulong.patch to FLINT 2.3.
     41
     42=== flint-2.3 (Mike Hansen, Fredrik Johansson, Jean-Pierre Flori, May 2012-March 2013) ===
     43  * Trac #12173: Update FLINT to version 2.3.
     44  * Removed obsolete patches.
     45  * Cleanup spkg-install and spkg-check scripts.
     46  * Removed Cygwin hack for libntl.a made useless by #9050.
     47  * Removed now useless patch --binary flag on Cygwin.
     48  * Only build shared library on Cygwin.
     49
    4050=== flint-1.5.2.p4 (Jeroen Demeyer, 14 March 2013) ===
    4151  * #14268: ulong.patch: replace the #define ulong by a typedef which
    4252    is compatible with glibc's <sys/types.h> in -std=gnu99 mode.
     
    94104 * #9277 Add -m64 flag when building the Flint test suite
    95105   if SAGE64 is set to "yes". Otherwise it builds 32-bit
    96106   objects and so the test files are not built, but instead
    97    generating the usual "WRONG ELF CLASS" error. 
    98  * Remove a couple of lines which call spkg-check from 
    99    spkg-install if SAGE_CHECK is set to "yes". Otherwise, 
    100    spkg-check gets called twice, which is a waste of time. 
     107   generating the usual "WRONG ELF CLASS" error.
     108 * Remove a couple of lines which call spkg-check from
     109   spkg-install if SAGE_CHECK is set to "yes". Otherwise,
     110   spkg-check gets called twice, which is a waste of time.
    101111   I'm afraid to say it was probably me that put those couple
    102    of lines in a year or two ago, before I realised how 
    103    spkg-check was supposed to be called. 
     112   of lines in a year or two ago, before I realised how
     113   spkg-check was supposed to be called.
    104114
    105115=== flint-1.5.0.p4 (Jaap Spies, Feb 23th, 2010) ===
    106116 * #8112 Pass CFLAG64 to FLINT_TUNE if set for a 64 bit build.
    107117
    108118=== flint-1.5.0.p3 (David Kirkby, January  2nd, 2010) ===
    109  * #7815 Changed makes and spkg-install so that the flag -m64 got 
    110    added with a 64-bit build. 
     119 * #7815 Changed makes and spkg-install so that the flag -m64 got
     120   added with a 64-bit build.
    111121
    112122=== flint-1.5.0.p1 (William Stein, September 25th, 2009) ===
    113123 * Included a cygwin fix that involves naming the library .dll instead of .so.
     
    117127
    118128=== flint-1.3.0p3 (Ondrej Certik, September 20th, 2009) ===
    119129 *  Move libntl.a out of the way temporarily on CYGWIN (this makes the package
    120     built, because it will link to the .so lib instead) 
     130    built, because it will link to the .so lib instead)
    121131
    122132=== flint-1.3.0p2 (David Kirkby, June 30th, 2009) ===
    123133 *  Change '-a' to '-p' option spkg-install so flint installs
    124134    on Solaris too. The usual GNUism. Only one byte is changed!
    125  
     135
    126136=== flint-1.3.0 (Nick Alexander, June 9th, 2009) ===
    127137 * Update to latest upstream FLINT, 1.3.0.
    128138
     
    173183
    174184=== flint-1.0.20 (Michael Abshoff, December 23rd, 2008) ===
    175185 * Upgrade to latest upstream (#4861)
    176  * clean up SPKG.txt 
     186 * clean up SPKG.txt
    177187
    178188=== flint-1.0.13.p0 (Michael Abshoff, August 18th, 2008) ===
    179189 * Add 64 bit OSX support
     
    193203 * Only check major and minor gcc release number, not tiny (fixes #3528)
    194204
    195205=== flint-1.010 (William Stein and Craig Citro, June 30, 2008) ===
    196  * upgrade to version 1.0.10 
     206 * upgrade to version 1.0.10
    197207
    198208=== flint-1.06.p3 (Michael Abshoff, April 1st, 2008) ===
    199209 * import shared library versioning for flint (Tim Abbott, #3259)
  • new file patches/dylib.patch

    diff --git a/patches/dylib.patch b/patches/dylib.patch
    new file mode 100644
    - +  
     1diff -druN src.orig/configure src/configure
     2--- src.orig/configure  2012-11-09 21:42:47.000000000 +0100
     3+++ src/configure       2013-03-06 18:21:03.644037750 +0100
     4@@ -225,12 +225,7 @@
     5 if [ -z "$FLINT_LIB" ]; then
     6    case $OS in
     7       Darwin)
     8-         case $MACHINE in
     9-            *64)
     10-               FLINT_LIB="libflint.dylib64";;
     11-            *)
     12-               FLINT_LIB="libflint.dylib";;
     13-         esac;;
     14+         FLINT_LIB="libflint.dylib";;
     15       CYGWIN | MINGW*)
     16          FLINT_LIB="libflint.dll";;
     17       *)
  • deleted file patches/longlong.patch

    diff --git a/patches/longlong.patch b/patches/longlong.patch
    deleted file mode 100644
    + -  
    1 diff -ur flint-1.5.2.orig/longlong.h flint-1.5.2/longlong.h
    2 --- flint-1.5.2.orig/longlong.h 2009-09-23 12:03:27.000000000 +0200
    3 +++ flint-1.5.2/longlong.h      2010-11-25 07:00:41.000000000 +0100
    4 @@ -411,46 +411,6 @@
    5    __asm__ ("adds\t%1, %4, %5\n\tadc\t%0, %2, %3"                       \
    6            : "=r" (sh), "=&r" (sl)                                      \
    7            : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
    8 -#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
    9 -  do {                                                                 \
    10 -    if (__builtin_constant_p (al))                                     \
    11 -      {                                                                        \
    12 -       if (__builtin_constant_p (ah))                                  \
    13 -         __asm__ ("rsbs\t%1, %5, %4\n\trsc\t%0, %3, %2"                \
    14 -                  : "=r" (sh), "=&r" (sl)                              \
    15 -                  : "rI" (ah), "r" (bh), "rI" (al), "r" (bl) __CLOBBER_CC); \
    16 -       else                                                            \
    17 -         __asm__ ("rsbs\t%1, %5, %4\n\tsbc\t%0, %2, %3"                \
    18 -                  : "=r" (sh), "=&r" (sl)                              \
    19 -                  : "r" (ah), "rI" (bh), "rI" (al), "r" (bl) __CLOBBER_CC); \
    20 -      }                                                                        \
    21 -    else if (__builtin_constant_p (ah))                                        \
    22 -      {                                                                        \
    23 -       if (__builtin_constant_p (bl))                                  \
    24 -         __asm__ ("subs\t%1, %4, %5\n\trsc\t%0, %3, %2"                \
    25 -                  : "=r" (sh), "=&r" (sl)                              \
    26 -                  : "rI" (ah), "r" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
    27 -       else                                                            \
    28 -         __asm__ ("rsbs\t%1, %5, %4\n\trsc\t%0, %3, %2"                \
    29 -                  : "=r" (sh), "=&r" (sl)                              \
    30 -                  : "rI" (ah), "r" (bh), "rI" (al), "r" (bl) __CLOBBER_CC); \
    31 -      }                                                                        \
    32 -    else if (__builtin_constant_p (bl))                                        \
    33 -      {                                                                        \
    34 -       if (__builtin_constant_p (bh))                                  \
    35 -         __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3"                \
    36 -                  : "=r" (sh), "=&r" (sl)                              \
    37 -                  : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
    38 -       else                                                            \
    39 -         __asm__ ("subs\t%1, %4, %5\n\trsc\t%0, %3, %2"                \
    40 -                  : "=r" (sh), "=&r" (sl)                              \
    41 -                  : "rI" (ah), "r" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
    42 -      }                                                                        \
    43 -    else /* only bh might be a constant */                             \
    44 -      __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3"                   \
    45 -              : "=r" (sh), "=&r" (sl)                                  \
    46 -              : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC);\
    47 -    } while (0)
    48  #if 1 || defined (__arm_m__)   /* `M' series has widening multiply support */
    49  #define umul_ppmm(xh, xl, a, b) \
    50    __asm__ ("umull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
  • deleted file patches/makefile.patch

    diff --git a/patches/makefile.patch b/patches/makefile.patch
    deleted file mode 100644
    + -  
    1 --- src/makefile        2009-09-23 12:03:27.000000000 +0200
    2 +++ patches/makefile    2010-01-02 07:00:32.000000000 +0100
    3 @@ -1,3 +1,5 @@
    4 +# sage depends on the NTL interface, so we include it in the flint library
    5 +
    6  LIBDIR=$(PREFIX)/lib
    7  INCLUDEDIR=$(PREFIX)/include
    8  DOCDIR=$(PREFIX)/doc
    9 @@ -22,7 +24,8 @@
    10  
    11  CPP = $(FLINT_CPP)
    12  
    13 -LIBS = -L$(FLINT_GMP_LIB_DIR) $(FLINT_LINK_OPTIONS) -lgmp -lpthread -lm
    14 +# add NTL options so that NTL interface links properly
    15 +LIBS = -L$(FLINT_GMP_LIB_DIR) -L$(FLINT_NTL_LIB_DIR) $(FLINT_LINK_OPTIONS) -lgmp -lpthread -lntl -lm
    16  
    17  LIBS2 = -L$(FLINT_GMP_LIB_DIR) -L$(FLINT_NTL_LIB_DIR) $(FLINT_LINK_OPTIONS) -lgmp -lpthread -lntl -lm
    18  
    19 @@ -66,7 +69,8 @@
    20         theta.h \
    21         zmod_mat.h \
    22         F_mpz.h \
    23 -       QS/tinyQS.h
    24 +       QS/tinyQS.h \
    25 +       NTL-interface.h
    26  
    27  ####### library object files
    28  
    29 @@ -109,13 +113,14 @@
    30         poly.o \
    31         sieve.o \
    32         linear_algebra.o \
    33 -       block_lanczos.o
    34 +       block_lanczos.o \
    35 +       NTL-interface.o
    36  
    37  QS: mpQS
    38  
    39  tune: ZmodF_mul-tune mpz_poly-tune
    40  
    41 -test: F_mpz-test mpn_extras-test fmpz_poly-test fmpz-test ZmodF-test ZmodF_poly-test mpz_poly-test ZmodF_mul-test long_extras-test zmod_poly-test zmod_mat-test
    42 +test: F_mpz-test mpn_extras-test fmpz_poly-test fmpz-test ZmodF-test ZmodF_poly-test mpz_poly-test ZmodF_mul-test long_extras-test zmod_poly-test zmod_mat-test NTL-interface-test
    43  
    44  check: test
    45         ./F_mpz-test
    46 @@ -139,16 +144,20 @@
    47  library: $(FLINT_LIB)
    48  
    49  libflint.dylib: $(FLINTOBJ)
    50 -       $(CC) -single_module -fPIC -dynamiclib -o libflint.dylib $(FLINTOBJ) $(LIBS)
    51 +       $(CPP) -single_module -fPIC -dynamiclib -o libflint.dylib $(FLINTOBJ) $(LIBS)
    52  
    53  libflint.dylib64: $(FLINTOBJ)
    54 -       $(CC) -m64 -single_module -fPIC -dynamiclib -o libflint.dylib $(FLINTOBJ) $(LIBS)
    55 +       $(CPP) -m64 -single_module -fPIC -dynamiclib -o libflint.dylib $(FLINTOBJ) $(LIBS)
    56  
    57  libflint.dll: $(FLINTOBJ)
    58 -       $(CC) -fPIC -shared -o libflint.dll $(FLINTOBJ) $(LIBS)
    59 +       $(CPP) -fPIC -shared -o libflint.dll $(FLINTOBJ) $(LIBS)
    60 +
    61 +# Since this code uses the C++ compiler as a linker to produce
    62 +# a library, the -m64 (or equivalent) option must be provided, as it
    63 +# it is in the line above where the target is libflint.dylib64
    64  
    65  libflint.so: $(FLINTOBJ)
    66 -       $(CC) -fPIC -shared -o libflint.so $(FLINTOBJ) $(LIBS)
    67 +       $(CPP) $(CXXFLAG64) -fPIC -shared -o libflint.so $(FLINTOBJ) $(LIBS)
    68  
    69  ##### zn_poly object files
    70  
    71 @@ -345,55 +354,56 @@
    72  ####### test program targets
    73  
    74  mpn_extras-test: mpn_extras-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    75 -       $(CC) $(CFLAGS) mpn_extras-test.o test-support.o -o mpn_extras-test $(FLINTOBJ) $(LIBS)
    76 +       $(CPP) $(CFLAGS) mpn_extras-test.o test-support.o -o mpn_extras-test $(FLINTOBJ) $(LIBS)
    77  
    78  fmpz_poly-test: fmpz_poly-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    79 -       $(CC) $(CFLAGS) fmpz_poly-test.o test-support.o -o fmpz_poly-test $(FLINTOBJ) $(LIBS)
    80 +       $(CPP) $(CFLAGS) fmpz_poly-test.o test-support.o -o fmpz_poly-test $(FLINTOBJ) $(LIBS)
    81  
    82  fmpz-test: fmpz-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    83 -       $(CC) $(CFLAGS) fmpz-test.o test-support.o -o fmpz-test $(FLINTOBJ) $(LIBS)
    84 +       $(CPP) $(CFLAGS) fmpz-test.o test-support.o -o fmpz-test $(FLINTOBJ) $(LIBS)
    85  
    86  F_mpz-test: F_mpz-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    87 -       $(CC) $(CFLAGS) F_mpz-test.o test-support.o -o F_mpz-test $(FLINTOBJ) $(LIBS)
    88 +       $(CPP) $(CFLAGS) F_mpz-test.o test-support.o -o F_mpz-test $(FLINTOBJ) $(LIBS)
    89  
    90  ZmodF-test: ZmodF-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    91 -       $(CC) $(CFLAGS) ZmodF-test.o test-support.o -o ZmodF-test $(FLINTOBJ) $(LIBS)
    92 +       $(CPP) $(CFLAGS) ZmodF-test.o test-support.o -o ZmodF-test $(FLINTOBJ) $(LIBS)
    93  
    94  ZmodF_poly-test: ZmodF_poly-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    95 -       $(CC) $(CFLAGS) ZmodF_poly-test.o test-support.o -o ZmodF_poly-test $(FLINTOBJ) $(LIBS)
    96 +       $(CPP) $(CFLAGS) ZmodF_poly-test.o test-support.o -o ZmodF_poly-test $(FLINTOBJ) $(LIBS)
    97  
    98  mpz_poly-test: mpz_poly-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    99 -       $(CC) $(CFLAGS) mpz_poly-test.o test-support.o -o mpz_poly-test $(FLINTOBJ) $(LIBS)
    100 +       $(CPP) $(CFLAGS) mpz_poly-test.o test-support.o -o mpz_poly-test $(FLINTOBJ) $(LIBS)
    101  
    102  F_mpz_mat-test: F_mpz_mat-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    103 -       $(CC) $(CFLAGS) F_mpz_mat-test.o test-support.o -o F_mpz_mat-test $(FLINTOBJ) $(LIBS)
    104 +       $(CPP) $(CFLAGS) F_mpz_mat-test.o test-support.o -o F_mpz_mat-test $(FLINTOBJ) $(LIBS)
    105  
    106  F_mpz_LLL_fast_d-test: F_mpz_LLL_fast_d-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    107 -       $(CC) $(CFLAGS) F_mpz_LLL_fast_d-test.o test-support.o -o F_mpz_LLL_fast_d-test $(FLINTOBJ) $(LIBS)
    108 +       $(CPP) $(CFLAGS) F_mpz_LLL_fast_d-test.o test-support.o -o F_mpz_LLL_fast_d-test $(FLINTOBJ) $(LIBS)
    109        
    110  ZmodF_mul-test: ZmodF_mul-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    111 -       $(CC) $(CFLAGS) ZmodF_mul-test.o test-support.o -o ZmodF_mul-test $(FLINTOBJ) $(LIBS)
    112 +       $(CPP) $(CFLAGS) ZmodF_mul-test.o test-support.o -o ZmodF_mul-test $(FLINTOBJ) $(LIBS)
    113  
    114  long_extras-test: long_extras-test.o test-support.o $(FLINTOBJ)
    115 -       $(CC) $(CFLAGS) long_extras-test.o test-support.o -o long_extras-test $(FLINTOBJ) $(LIBS)
    116 +       $(CPP) $(CFLAGS) long_extras-test.o test-support.o -o long_extras-test $(FLINTOBJ) $(LIBS)
    117  
    118  packed_vec-test: packed_vec-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    119 -       $(CC) $(CFLAGS) packed_vec-test.o test-support.o -o packed_vec-test $(FLINTOBJ) $(LIBS)
    120 +       $(CPP) $(CFLAGS) packed_vec-test.o test-support.o -o packed_vec-test $(FLINTOBJ) $(LIBS)
    121  
    122  zmod_poly-test: zmod_poly-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    123 -       $(CC) $(CFLAGS) zmod_poly-test.o test-support.o -o zmod_poly-test $(FLINTOBJ) $(LIBS)
    124 +       $(CPP) $(CFLAGS) zmod_poly-test.o test-support.o -o zmod_poly-test $(FLINTOBJ) $(LIBS)
    125  
    126  zmod_mat-test: zmod_mat-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    127 -       $(CC) $(CFLAGS) zmod_mat-test.o test-support.o -o zmod_mat-test $(FLINTOBJ) $(LIBS)
    128 +       $(CPP) $(CFLAGS) zmod_mat-test.o test-support.o -o zmod_mat-test $(FLINTOBJ) $(LIBS)
    129  
    130  F_zmod_mat-test: F_zmod_mat-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    131 -       $(CC) $(CFLAGS) F_zmod_mat-test.o test-support.o -o F_zmod_mat-test $(FLINTOBJ) $(LIBS)
    132 +       $(CPP) $(CFLAGS) F_zmod_mat-test.o test-support.o -o F_zmod_mat-test $(FLINTOBJ) $(LIBS)
    133  
    134  F_mpz_poly-test: F_mpz_poly-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    135 -       $(CC) $(CFLAGS) F_mpz_poly-test.o test-support.o -o F_mpz_poly-test $(FLINTOBJ) $(LIBS)
    136 +       $(CPP) $(CFLAGS) F_mpz_poly-test.o test-support.o -o F_mpz_poly-test $(FLINTOBJ) $(LIBS)
    137  
    138 +# NTL interface is linked in the library
    139  NTL-interface-test: NTL-interface.o NTL-interface-test.o test-support.o $(FLINTOBJ) $(HEADERS)
    140 -       $(CPP) $(CFLAGS) NTL-interface-test.o NTL-interface.o test-support.o $(FLINTOBJ) -o NTL-interface-test $(LIBS2)
    141 +       $(CPP) $(CFLAGS) NTL-interface-test.o test-support.o $(FLINTOBJ) -o NTL-interface-test $(LIBS2)
    142  
    143  ####### tuning program object files
    144  
    145 @@ -489,70 +499,70 @@
    146  PROFOBJ = $(FLINTOBJ) profiler.o profiler-main.o
    147  
    148  fmpz_poly-profile: fmpz_poly-profile.o fmpz_poly-profile-tables.o test-support.o $(PROFOBJ)
    149 -       $(CC) $(CFLAGS) -o fmpz_poly-profile fmpz_poly-profile.o fmpz_poly-profile-tables.o test-support.o $(PROFOBJ) $(LIBS)
    150 +       $(CPP) $(CFLAGS) -o fmpz_poly-profile fmpz_poly-profile.o fmpz_poly-profile-tables.o test-support.o $(PROFOBJ) $(LIBS)
    151  
    152  F_mpz_poly-profile: F_mpz_poly-profile.o F_mpz_poly-profile-tables.o test-support.o $(PROFOBJ)
    153 -       $(CC) $(CFLAGS) -o F_mpz_poly-profile F_mpz_poly-profile.o F_mpz_poly-profile-tables.o test-support.o $(PROFOBJ) $(LIBS)
    154 +       $(CPP) $(CFLAGS) -o F_mpz_poly-profile F_mpz_poly-profile.o F_mpz_poly-profile-tables.o test-support.o $(PROFOBJ) $(LIBS)
    155  
    156  mpz_poly-profile: mpz_poly-profile.o mpz_poly-profile-tables.o test-support.o $(PROFOBJ)
    157 -       $(CC) $(CFLAGS) -o mpz_poly-profile mpz_poly-profile.o mpz_poly-profile-tables.o test-support.o $(PROFOBJ) $(LIBS)
    158 +       $(CPP) $(CFLAGS) -o mpz_poly-profile mpz_poly-profile.o mpz_poly-profile-tables.o test-support.o $(PROFOBJ) $(LIBS)
    159  
    160  ZmodF_mul-profile: ZmodF_mul-profile.o ZmodF_mul-profile-tables.o $(PROFOBJ)
    161 -       $(CC) $(CFLAGS) -o ZmodF_mul-profile ZmodF_mul-profile.o ZmodF_mul-profile-tables.o $(PROFOBJ) $(LIBS)
    162 +       $(CPP) $(CFLAGS) -o ZmodF_mul-profile ZmodF_mul-profile.o ZmodF_mul-profile-tables.o $(PROFOBJ) $(LIBS)
    163  
    164  ZmodF_poly-profile: ZmodF_poly-profile.o ZmodF_poly-profile-tables.o $(PROFOBJ)
    165 -       $(CC) $(CFLAGS) -o ZmodF_poly-profile ZmodF_poly-profile.o ZmodF_poly-profile-tables.o $(PROFOBJ) $(LIBS)
    166 +       $(CPP) $(CFLAGS) -o ZmodF_poly-profile ZmodF_poly-profile.o ZmodF_poly-profile-tables.o $(PROFOBJ) $(LIBS)
    167  
    168  
    169  kara-profile: kara-profile.c profiler.o test-support.o $(FLINTOBJ)
    170 -       $(CC) $(CFLAGS) -o kara-profile kara-profile.c profiler.o test-support.o $(FLINTOBJ) $(LIBS)
    171 +       $(CPP) $(CFLAGS) -o kara-profile kara-profile.c profiler.o test-support.o $(FLINTOBJ) $(LIBS)
    172  
    173  NTL-profile: NTL-profile.c test-support.o NTL-profile-tables.o $(PROFOBJ)
    174         $(CPP) $(CFLAGS) -o NTL-profile NTL-profile.c NTL-profile-tables.o test-support.o $(PROFOBJ) $(LIB) -lntl
    175  
    176  zmod_poly-profile: zmod_poly-profile.o zmod_poly-profile-tables.o $(PROFOBJ)
    177 -       $(CC) $(CFLAGS) -o zmod_poly-profile zmod_poly.o zmod_poly-profile.o zmod_poly-profile-tables.o $(PROFOBJ) $(LIBS)
    178 +       $(CPP) $(CFLAGS) -o zmod_poly-profile zmod_poly.o zmod_poly-profile.o zmod_poly-profile-tables.o $(PROFOBJ) $(LIBS)
    179  
    180  bernoulli-profile: bernoulli-profile.o bernoulli-profile-tables.o $(PROFOBJ)
    181 -       $(CC) $(CFLAGS) -o bernoulli-profile zmod_poly.o bernoulli-profile.o bernoulli-profile-tables.o $(PROFOBJ) $(LIBS)
    182 +       $(CPP) $(CFLAGS) -o bernoulli-profile zmod_poly.o bernoulli-profile.o bernoulli-profile-tables.o $(PROFOBJ) $(LIBS)
    183  
    184  ####### example programs
    185  
    186  delta_qexp.o: delta_qexp.c $(HEADERS)
    187 -       $(CC) $(CFLAGS) -c delta_qexp.c -o delta_qexp.o
    188 +       $(CPP) $(CFLAGS) -c delta_qexp.c -o delta_qexp.o
    189  
    190  delta_qexp: delta_qexp.o $(FLINTOBJ)
    191 -       $(CC) $(CFLAGS) -o delta_qexp delta_qexp.o $(FLINTOBJ) $(LIBS)
    192 +       $(CPP) $(CFLAGS) -o delta_qexp delta_qexp.o $(FLINTOBJ) $(LIBS)
    193  
    194  expmod: expmod.c $(FLINTOBJ)
    195 -       $(CC) $(CFLAGS) -o expmod expmod.c $(FLINTOBJ) $(LIBS)
    196 +       $(CPP) $(CFLAGS) -o expmod expmod.c $(FLINTOBJ) $(LIBS)
    197  
    198  BPTJCubes: BPTJCubes.c $(FLINTOBJ)
    199 -       $(CC) $(CFLAGS) -o BPTJCubes BPTJCubes.c $(FLINTOBJ) $(LIBS)
    200 +       $(CPP) $(CFLAGS) -o BPTJCubes BPTJCubes.c $(FLINTOBJ) $(LIBS)
    201  
    202  bernoulli.o: bernoulli.c $(HEADERS)
    203 -       $(CC) $(CFLAGS) -c bernoulli.c -o bernoulli.o
    204 +       $(CPP) $(CFLAGS) -c bernoulli.c -o bernoulli.o
    205  
    206  bernoulli: bernoulli.o $(FLINTOBJ)
    207 -       $(CC) $(CFLAGS) -o bernoulli bernoulli.o $(FLINTOBJ) $(LIBS)
    208 +       $(CPP) $(CFLAGS) -o bernoulli bernoulli.o $(FLINTOBJ) $(LIBS)
    209  
    210  bernoulli_fmpz.o: bernoulli_fmpz.c $(HEADERS)
    211 -       $(CC) $(CFLAGS) -c bernoulli_fmpz.c -o bernoulli_fmpz.o
    212 +       $(CPP) $(CFLAGS) -c bernoulli_fmpz.c -o bernoulli_fmpz.o
    213  
    214  bernoulli_fmpz: bernoulli_fmpz.o $(FLINTOBJ)
    215 -       $(CC) $(CFLAGS) -o bernoulli_fmpz bernoulli_fmpz.o $(FLINTOBJ) $(LIBS)
    216 +       $(CPP) $(CFLAGS) -o bernoulli_fmpz bernoulli_fmpz.o $(FLINTOBJ) $(LIBS)
    217  
    218  bernoulli_zmod.o: bernoulli_zmod.c $(HEADERS)
    219 -       $(CC) $(CFLAGS) -c bernoulli_zmod.c -o bernoulli_zmod.o
    220 +       $(CPP) $(CFLAGS) -c bernoulli_zmod.c -o bernoulli_zmod.o
    221  
    222  bernoulli_zmod: bernoulli_zmod.o $(FLINTOBJ)
    223 -       $(CC) $(CFLAGS) -o bernoulli_zmod bernoulli_zmod.o $(FLINTOBJ) $(LIBS)
    224 +       $(CPP) $(CFLAGS) -o bernoulli_zmod bernoulli_zmod.o $(FLINTOBJ) $(LIBS)
    225  
    226  thetaproduct.o: thetaproduct.c $(HEADERS)
    227 -       $(CC) $(CFLAGS2) $(WITH_ZNPOLY) -c thetaproduct.c -o thetaproduct.o
    228 +       $(CPP) $(CFLAGS2) $(WITH_ZNPOLY) -c thetaproduct.c -o thetaproduct.o
    229  
    230  thetaproduct: thetaproduct.o $(FLINTOBJ)
    231 -       $(CC) $(CFLAGS2) -o thetaproduct thetaproduct.o $(FLINTOBJ) $(LIBS)
    232 +       $(CPP) $(CFLAGS2) -o thetaproduct thetaproduct.o $(FLINTOBJ) $(LIBS)
    233  
    234  ####### Quadratic sieve
    235  
    236 @@ -590,12 +600,12 @@
    237         $(CC) $(CFLAGS) -c QS/mp_factor_base.c -o mp_factor_base.o
    238  
    239  mpQS: QS/mpQS.c QS/mpQS.h QS/tinyQS.h mp_factor_base.o mp_poly.o mp_sieve.o mp_linear_algebra.o mp_lprels.o $(FLINTOBJ)
    240 -       $(CC) $(CFLAGS) -o mpQS QS/mpQS.c mp_factor_base.o mp_poly.o mp_sieve.o mp_linear_algebra.o mp_lprels.o $(FLINTOBJ) $(LIBS)
    241 +       $(CPP) $(CFLAGS) -o mpQS QS/mpQS.c mp_factor_base.o mp_poly.o mp_sieve.o mp_linear_algebra.o mp_lprels.o $(FLINTOBJ) $(LIBS)
    242  
    243  ####### Integer multiplication timing
    244  
    245  ZMULOBJ = zn_mod.o misc.o mul_ks.o pack.o mul.o mulmid.o mulmid_ks.o ks_support.o mpn_mulmid.o nuss.o pmf.o pmfvec_fft.o tuning.o mul_fft.o mul_fft_dft.o array.o invert.o zmod_mat.o zmod_poly.o memory-manager.o fmpz.o ZmodF_mul-tuning.o mpz_poly.o mpz_poly-tuning.o fmpz_poly.o ZmodF_poly.o mpz_extras.o profiler.o ZmodF_mul.o ZmodF.o mpn_extras.o F_mpz_mul-timing.o long_extras.o factor_base.o poly.o sieve.o linear_algebra.o block_lanczos.o
    246  
    247  F_mpz_mul-timing: $(FLINTOBJ)
    248 -       $(CC) $(CFLAGS) F_mpz_mul-timing.c profiler.o -o Zmul $(FLINTOBJ) $(LIBS)
    249 +       $(CPP) $(CFLAGS) F_mpz_mul-timing.c profiler.o -o Zmul $(FLINTOBJ) $(LIBS)
    250  
  • patches/ulong.patch

    diff --git a/patches/ulong.patch b/patches/ulong.patch
    a b  
    1 diff -ru src/flint.h b/flint.h
    2 --- src/flint.h 2012-08-03 11:42:57.000000000 +0200
    3 +++ b/flint.h   2013-03-14 14:55:02.997513830 +0100
    4 @@ -134,7 +134,7 @@
     1diff -dNru src.orig/fft.h src/fft.h
     2--- src.orig/fft.h      2012-11-09 21:42:47.000000000 +0100
     3+++ src/fft.h   2013-03-27 14:12:37.157108221 +0100
     4@@ -37,10 +37,8 @@
     5 #ifndef FFT_H
     6 #define FFT_H
     7 
     8-#undef ulong /* interferes with system includes */
     9 #include <stdlib.h>
     10 #include <stdio.h>
     11-#define ulong unsigned long
     12 
     13 #include "mpir.h"
     14 #include "flint.h"
     15diff -dNru src.orig/flint.h src/flint.h
     16--- src.orig/flint.h    2012-11-09 21:42:47.000000000 +0100
     17+++ src/flint.h 2013-03-27 14:12:50.629106553 +0100
     18@@ -1,4 +1,4 @@
     19-/*=============================================================================
     20+ /*=============================================================================
     21 
     22     This file is part of FLINT.
     23 
     24@@ -46,7 +46,7 @@
     25 
     26 extern char version[];
     27 
     28-#define ulong unsigned long
     29+typedef unsigned long ulong;
     30 
     31 void * flint_malloc(size_t size);
     32 void * flint_realloc(void * ptr, size_t size);
     33diff -dNru src.orig/fmpq.h src/fmpq.h
     34--- src.orig/fmpq.h     2012-11-09 21:42:47.000000000 +0100
     35+++ src/fmpq.h  2013-03-27 14:12:26.693108610 +0100
     36@@ -27,9 +27,7 @@
     37 #ifndef FMPQ_H
     38 #define FMPQ_H
     39 
     40-#undef ulong /* interferes with system includes */
     41 #include <stdio.h>
     42-#define ulong unsigned long
     43 
     44 #include <mpir.h>
     45 #include <mpfr.h>
     46diff -dNru src.orig/fmpz/inlines.c src/fmpz/inlines.c
     47--- src.orig/fmpz/inlines.c     2012-11-09 21:42:47.000000000 +0100
     48+++ src/fmpz/inlines.c  2013-03-27 14:12:27.173108592 +0100
     49@@ -23,9 +23,7 @@
     50 
     51 ******************************************************************************/
     52 
     53-#undef ulong /* prevent clash with stdlib */
     54 #include <stdlib.h>
     55-#define ulong unsigned long
     56 #include <mpir.h>
     57 #include "flint.h"
     58 #include "ulong_extras.h"
     59diff -dNru src.orig/fmpz/root.c src/fmpz/root.c
     60--- src.orig/fmpz/root.c        2012-11-09 21:42:47.000000000 +0100
     61+++ src/fmpz/root.c     2013-03-27 14:12:28.489108543 +0100
     62@@ -23,9 +23,7 @@
     63 
     64 ******************************************************************************/
     65 
     66-#undef ulong /* avoid conflict with standard library */
     67 #include <stdlib.h>
     68-#define ulong unsigned long
     69 
     70 #include <mpir.h>
     71 #include "flint.h"
     72diff -dNru src.orig/fmpz.h src/fmpz.h
     73--- src.orig/fmpz.h     2012-11-09 21:42:47.000000000 +0100
     74+++ src/fmpz.h  2013-03-27 14:12:26.477108617 +0100
     75@@ -26,10 +26,8 @@
     76 #ifndef FMPZ_H
     77 #define FMPZ_H
     78 
     79-#undef ulong /* interferes with system includes */
     80 #include <stdlib.h>
     81 #include <stdio.h>
     82-#define ulong unsigned long
     83 
     84 #include <mpir.h>
     85 
     86diff -dNru src.orig/fmpz_mat.h src/fmpz_mat.h
     87--- src.orig/fmpz_mat.h 2012-11-09 21:42:47.000000000 +0100
     88+++ src/fmpz_mat.h      2013-03-27 14:12:34.181108329 +0100
     89@@ -27,9 +27,7 @@
     90 #ifndef FMPZ_MAT_H
     91 #define FMPZ_MAT_H
     92 
     93-#undef ulong /* interferes with system includes */
     94 #include <stdio.h>
     95-#define ulong unsigned long
     96 
     97 #include <mpir.h>
     98 #include "flint.h"
     99diff -dNru src.orig/fmpz_mod_poly.h src/fmpz_mod_poly.h
     100--- src.orig/fmpz_mod_poly.h    2012-11-09 21:42:47.000000000 +0100
     101+++ src/fmpz_mod_poly.h 2013-03-27 14:12:29.981108488 +0100
     102@@ -26,9 +26,7 @@
     103 #ifndef FMPZ_MOD_POLY_H
     104 #define FMPZ_MOD_POLY_H
     105 
     106-#undef ulong /* interferes with system includes */
     107 #include <stdio.h>
     108-#define ulong unsigned long
     109 
     110 #include <mpir.h>
     111 
     112diff -dNru src.orig/fmpz_poly_factor.h src/fmpz_poly_factor.h
     113--- src.orig/fmpz_poly_factor.h 2012-11-09 21:42:47.000000000 +0100
     114+++ src/fmpz_poly_factor.h      2013-03-27 14:12:26.505108616 +0100
     115@@ -28,9 +28,7 @@
     116 #ifndef FMPZ_POLY_FACTOR_H
     117 #define FMPZ_POLY_FACTOR_H
     118 
     119-#undef ulong /* interferes with system includes */
     120 #include <stdio.h>
     121-#define ulong unsigned long
     122 
     123 #include <mpir.h>
     124 #include "flint.h"
     125diff -dNru src.orig/fmpz_poly.h src/fmpz_poly.h
     126--- src.orig/fmpz_poly.h        2012-11-09 21:42:47.000000000 +0100
     127+++ src/fmpz_poly.h     2013-03-27 14:12:29.993108484 +0100
     128@@ -29,9 +29,7 @@
     129 #ifndef FMPZ_POLY_H
     130 #define FMPZ_POLY_H
     131 
     132-#undef ulong /* interferes with system includes */
     133 #include <stdio.h>
     134-#define ulong unsigned long
     135 
     136 #include <mpir.h>
     137 #include "flint.h"
     138diff -dNru src.orig/fmpz_poly_q.h src/fmpz_poly_q.h
     139--- src.orig/fmpz_poly_q.h      2012-11-09 21:42:47.000000000 +0100
     140+++ src/fmpz_poly_q.h   2013-03-27 14:12:36.613108240 +0100
     141@@ -26,9 +26,7 @@
     142 #ifndef FMPZ_POLY_Q_H
     143 #define FMPZ_POLY_Q_H
     144 
     145-#undef ulong /* interferes with system includes */
     146 #include <stdlib.h>
     147-#define ulong unsigned long
     148 
     149 #include "flint.h"
     150 #include "fmpz.h"
     151diff -dNru src.orig/NEWS src/NEWS
     152--- src.orig/NEWS       2012-11-09 21:42:47.000000000 +0100
     153+++ src/NEWS    2013-03-27 14:12:26.553108615 +0100
     154@@ -226,7 +226,6 @@
     155 v 1.2.4 -- 4-Apr-09
    5156 
    6  #define FLINT_POL_DIV_1_LENGTH 10
     157    * Defined THREAD to be blank on Apple CC and __thread for thread local storage on other gcc's (where it's defined)
     158-   * #undef ulong in profiler.h where time.h and other system time headers are included (both reported by M. Abshoff)
    7159 
    8 -#define ulong unsigned long
    9 +typedef unsigned long ulong;
     160 v 1.2.5 -- 18-Apr-09
    10161 
    11  #if FLINT_BITS == 32
    12  #define half_ulong uint16_t
     162diff -dNru src.orig/nmod_mat.h src/nmod_mat.h
     163--- src.orig/nmod_mat.h 2012-11-09 21:42:47.000000000 +0100
     164+++ src/nmod_mat.h      2013-03-27 14:12:26.457108616 +0100
     165@@ -27,9 +27,7 @@
     166 #ifndef NMOD_MAT_H
     167 #define NMOD_MAT_H
     168 
     169-#undef ulong /* interferes with system includes */
     170 #include <stdlib.h>
     171-#define ulong unsigned long
     172 
     173 #include <mpir.h>
     174 #include "flint.h"
     175diff -dNru src.orig/nmod_poly.h src/nmod_poly.h
     176--- src.orig/nmod_poly.h        2012-11-09 21:42:47.000000000 +0100
     177+++ src/nmod_poly.h     2013-03-27 14:12:29.269108513 +0100
     178@@ -29,9 +29,7 @@
     179 #ifndef NMOD_POLY_H
     180 #define NMOD_POLY_H
     181 
     182-#undef ulong /* interferes with system includes */
     183 #include <stdio.h>
     184-#define ulong unsigned long
     185 
     186 #include "flint.h"
     187 #include "nmod_vec.h"
     188diff -dNru src.orig/nmod_vec.h src/nmod_vec.h
     189--- src.orig/nmod_vec.h 2012-11-09 21:42:47.000000000 +0100
     190+++ src/nmod_vec.h      2013-03-27 14:12:26.537108613 +0100
     191@@ -26,9 +26,7 @@
     192 #ifndef NMOD_VEC_H
     193 #define NMOD_VEC_H
     194 
     195-#undef ulong /* interferes with system includes */
     196 #include <stdlib.h>
     197-#define ulong unsigned long
     198 
     199 #include <mpir.h>
     200 #include "longlong.h"
     201diff -dNru src.orig/padic.h src/padic.h
     202--- src.orig/padic.h    2012-11-09 21:42:47.000000000 +0100
     203+++ src/padic.h 2013-03-27 14:12:20.957108822 +0100
     204@@ -26,10 +26,8 @@
     205 #ifndef PADIC_H
     206 #define PADIC_H
     207 
     208-#undef ulong /* interferes with system includes */
     209 #include <stdlib.h>
     210 #include <stdio.h>
     211-#define ulong unsigned long
     212 
     213 #include <mpir.h>
     214 
     215diff -dNru src.orig/perm.h src/perm.h
     216--- src.orig/perm.h     2012-11-09 21:42:47.000000000 +0100
     217+++ src/perm.h  2013-03-27 14:12:30.177108477 +0100
     218@@ -26,10 +26,8 @@
     219 #ifndef PERM_H
     220 #define PERM_H
     221 
     222-#undef ulong /* interferes with system includes */
     223 #include <stdlib.h>
     224 #include <stdio.h>
     225-#define ulong unsigned long
     226 
     227 #include "flint.h"
     228 
     229diff -dNru src.orig/profiler.h src/profiler.h
     230--- src.orig/profiler.h 2012-11-09 21:42:47.000000000 +0100
     231+++ src/profiler.h      2013-03-27 14:12:26.493108616 +0100
     232@@ -23,7 +23,6 @@
     233 
     234 ******************************************************************************/
     235 
     236-#undef ulong /* interferes with system includes, redefined by flint.h below */
     237 #include <time.h>
     238 #include <sys/time.h>
     239 #if defined (__WIN32) && !defined(__CYGWIN__)
     240@@ -49,7 +48,6 @@
     241 #else
     242 #include <sys/resource.h>
     243 #endif
     244-#define ulong unsigned long
     245 
     246 #ifndef FLINT_PROFILER_H
     247 #define FLINT_PROFILER_H
     248diff -dNru src.orig/qsieve/block_lanczos.c src/qsieve/block_lanczos.c
     249--- src.orig/qsieve/block_lanczos.c     2012-11-09 21:42:47.000000000 +0100
     250+++ src/qsieve/block_lanczos.c  2013-03-27 14:12:30.113108480 +0100
     251@@ -33,11 +33,9 @@
     252 --------------------------------------------------------------------*/
     253 
     254 
     255-#undef ulong /* avoid clash with stdlib */
     256 #include <string.h>
     257 #include <stdlib.h>
     258 #include <stdio.h>
     259-#define ulong unsigned long
     260 
     261 #include <mpir.h>
     262 #include "flint.h"
     263diff -dNru src.orig/qsieve/ll_collect_relations.c src/qsieve/ll_collect_relations.c
     264--- src.orig/qsieve/ll_collect_relations.c      2012-11-09 21:42:47.000000000 +0100
     265+++ src/qsieve/ll_collect_relations.c   2013-03-27 14:12:30.145108478 +0100
     266@@ -23,11 +23,9 @@
     267 
     268 ******************************************************************************/
     269 
     270-#undef ulong /* avoid clash with stdlib */
     271 #include <string.h>
     272 #include <stdlib.h>
     273 #include <stdio.h>
     274-#define ulong unsigned long
     275 
     276 #include <mpir.h>
     277 #include "flint.h"
     278diff -dNru src.orig/qsieve/ll_compute_poly_data.c src/qsieve/ll_compute_poly_data.c
     279--- src.orig/qsieve/ll_compute_poly_data.c      2012-11-09 21:42:47.000000000 +0100
     280+++ src/qsieve/ll_compute_poly_data.c   2013-03-27 14:12:30.101108483 +0100
     281@@ -23,10 +23,8 @@
     282 
     283 ******************************************************************************/
     284 
     285-#undef ulong /* avoid clash with stdlib */
     286 #include <stdlib.h>
     287 #include <stdio.h>
     288-#define ulong unsigned long
     289 
     290 #include <mpir.h>
     291 #include "flint.h"
     292diff -dNru src.orig/qsieve/ll_factor.c src/qsieve/ll_factor.c
     293--- src.orig/qsieve/ll_factor.c 2012-11-09 21:42:47.000000000 +0100
     294+++ src/qsieve/ll_factor.c      2013-03-27 14:12:30.169108478 +0100
     295@@ -23,9 +23,7 @@
     296 
     297 ******************************************************************************/
     298 
     299-#undef ulong /* avoid clash with stdlib */
     300 #include <stdio.h>
     301-#define ulong unsigned long
     302 
     303 #include <mpir.h>
     304 #include "flint.h"
     305diff -dNru src.orig/qsieve/ll_insert_relations.c src/qsieve/ll_insert_relations.c
     306--- src.orig/qsieve/ll_insert_relations.c       2012-11-09 21:42:47.000000000 +0100
     307+++ src/qsieve/ll_insert_relations.c    2013-03-27 14:12:30.061108481 +0100
     308@@ -27,10 +27,8 @@
     309 
     310 ******************************************************************************/
     311 
     312-#undef ulong /* avoid clash with stdlib */
     313 #include <stdlib.h>
     314 #include <stdio.h>
     315-#define ulong unsigned long
     316 
     317 #include <mpir.h>
     318 #include "flint.h"
     319diff -dNru src.orig/qsieve/ll_square_root.c src/qsieve/ll_square_root.c
     320--- src.orig/qsieve/ll_square_root.c    2012-11-09 21:42:47.000000000 +0100
     321+++ src/qsieve/ll_square_root.c 2013-03-27 14:12:30.121108479 +0100
     322@@ -23,11 +23,9 @@
     323 
     324 ******************************************************************************/
     325 
     326-#undef ulong /* avoid clash with stdlib */
     327 #include <string.h>
     328 #include <stdlib.h>
     329 #include <stdio.h>
     330-#define ulong unsigned long
     331 
     332 #include <mpir.h>
     333 #include "flint.h"
     334diff -dNru src.orig/ulong_extras/compute_primes.c src/ulong_extras/compute_primes.c
     335--- src.orig/ulong_extras/compute_primes.c      2012-11-09 21:42:47.000000000 +0100
     336+++ src/ulong_extras/compute_primes.c   2013-03-27 14:12:25.673108648 +0100
     337@@ -25,12 +25,10 @@
     338 
     339 ******************************************************************************/
     340 
     341-#undef ulong /* prevent clash with standard library */
     342 #include <stdlib.h>
     343 #include <string.h>
     344 #include <stdio.h>
     345 #include <pthread.h>
     346-#define ulong unsigned long
     347 #include <mpir.h>
     348 #include "flint.h"
     349 #include "ulong_extras.h"
     350diff -dNru src.orig/ulong_extras/factor.c src/ulong_extras/factor.c
     351--- src.orig/ulong_extras/factor.c      2012-11-09 21:42:47.000000000 +0100
     352+++ src/ulong_extras/factor.c   2013-03-27 14:12:25.497108652 +0100
     353@@ -23,10 +23,8 @@
     354 
     355 ******************************************************************************/
     356 
     357-#undef ulong /* prevent clash with standard library */
     358 #include <stdlib.h>
     359 #include <stdio.h>
     360-#define ulong unsigned long
     361 #include <mpir.h>
     362 #include "flint.h"
     363 #include "ulong_extras.h"
     364diff -dNru src.orig/ulong_extras/factor_lehman.c src/ulong_extras/factor_lehman.c
     365--- src.orig/ulong_extras/factor_lehman.c       2012-11-09 21:42:47.000000000 +0100
     366+++ src/ulong_extras/factor_lehman.c    2013-03-27 14:12:25.697108646 +0100
     367@@ -23,9 +23,7 @@
     368     
     369 ******************************************************************************/
     370 
     371-#undef ulong /* prevent clash with standard library */
     372 #include <math.h>
     373-#define ulong unsigned long
     374 #include <mpir.h>
     375 #include "flint.h"
     376 #include "ulong_extras.h"
     377diff -dNru src.orig/ulong_extras/factor_partial.c src/ulong_extras/factor_partial.c
     378--- src.orig/ulong_extras/factor_partial.c      2012-11-09 21:42:47.000000000 +0100
     379+++ src/ulong_extras/factor_partial.c   2013-03-27 14:12:25.665108645 +0100
     380@@ -23,10 +23,8 @@
     381 
     382 ******************************************************************************/
     383 
     384-#undef ulong /* prevent clash with standard library */
     385 #include <stdlib.h>
     386 #include <stdio.h>
     387-#define ulong unsigned long
     388 #include <mpir.h>
     389 #include "flint.h"
     390 #include "ulong_extras.h"
     391diff -dNru src.orig/ulong_extras/factor_power235.c src/ulong_extras/factor_power235.c
     392--- src.orig/ulong_extras/factor_power235.c     2012-11-09 21:42:47.000000000 +0100
     393+++ src/ulong_extras/factor_power235.c  2013-03-27 14:12:25.741108643 +0100
     394@@ -24,9 +24,7 @@
     395 
     396 ******************************************************************************/
     397 
     398-#undef ulong /* prevent clash with standard library */
     399 #include <math.h>
     400-#define ulong unsigned long
     401 #include <mpir.h>
     402 #include "flint.h"
     403 #include "ulong_extras.h"
     404diff -dNru src.orig/ulong_extras/is_perfect_power235.c src/ulong_extras/is_perfect_power235.c
     405--- src.orig/ulong_extras/is_perfect_power235.c 2012-11-09 21:42:47.000000000 +0100
     406+++ src/ulong_extras/is_perfect_power235.c      2013-03-27 14:12:25.765108645 +0100
     407@@ -25,9 +25,7 @@
     408 ******************************************************************************/
     409 
     410 #include <mpir.h>
     411-#undef ulong /* prevent clash with standard library */
     412 #include <math.h>
     413-#define ulong unsigned long
     414 #include "flint.h"
     415 #include "ulong_extras.h"
     416 
     417diff -dNru src.orig/ulong_extras/is_prime_pocklington.c src/ulong_extras/is_prime_pocklington.c
     418--- src.orig/ulong_extras/is_prime_pocklington.c        2012-11-09 21:42:47.000000000 +0100
     419+++ src/ulong_extras/is_prime_pocklington.c     2013-03-27 14:12:25.681108647 +0100
     420@@ -25,9 +25,7 @@
     421 ******************************************************************************/
     422 
     423 #include <mpir.h>
     424-#undef ulong /* prevent clash with standard library */
     425 #include <stdlib.h>
     426-#define ulong unsigned long
     427 #include "flint.h"
     428 #include "ulong_extras.h"
     429 
     430diff -dNru src.orig/ulong_extras/is_prime_pseudosquare.c src/ulong_extras/is_prime_pseudosquare.c
     431--- src.orig/ulong_extras/is_prime_pseudosquare.c       2012-11-09 21:42:47.000000000 +0100
     432+++ src/ulong_extras/is_prime_pseudosquare.c    2013-03-27 14:12:26.417108617 +0100
     433@@ -23,10 +23,8 @@
     434   
     435 ******************************************************************************/
     436 
     437-#undef ulong /* prevent clash with standard library */
     438 #include <stdlib.h>
     439 #include <stdio.h>
     440-#define ulong unsigned long
     441 #include <mpir.h>
     442 #include "flint.h"
     443 #include "ulong_extras.h"
     444diff -dNru src.orig/ulong_extras/is_square.c src/ulong_extras/is_square.c
     445--- src.orig/ulong_extras/is_square.c   2012-11-09 21:42:47.000000000 +0100
     446+++ src/ulong_extras/is_square.c        2013-03-27 14:12:25.789108643 +0100
     447@@ -23,9 +23,7 @@
     448 
     449 ******************************************************************************/
     450 
     451-#undef ulong /* prevent clash with standard library */
     452 #include <math.h>
     453-#define ulong unsigned long
     454 #include <mpir.h>
     455 #include "flint.h"
     456 #include "ulong_extras.h"
     457diff -dNru src.orig/ulong_extras/nextprime.c src/ulong_extras/nextprime.c
     458--- src.orig/ulong_extras/nextprime.c   2012-11-09 21:42:47.000000000 +0100
     459+++ src/ulong_extras/nextprime.c        2013-03-27 14:12:25.717108643 +0100
     460@@ -25,10 +25,8 @@
     461 
     462 ******************************************************************************/
     463 
     464-#undef ulong /* prevent clash with standard library */
     465 #include <stdio.h>
     466 #include <stdlib.h>
     467-#define ulong unsigned long
     468 #include <mpir.h>
     469 #include "flint.h"
     470 #include "ulong_extras.h"
     471diff -dNru src.orig/ulong_extras/nth_prime.c src/ulong_extras/nth_prime.c
     472--- src.orig/ulong_extras/nth_prime.c   2012-11-09 21:42:47.000000000 +0100
     473+++ src/ulong_extras/nth_prime.c        2013-03-27 14:12:25.465108656 +0100
     474@@ -23,10 +23,8 @@
     475 
     476 ******************************************************************************/
     477 
     478-#undef ulong /* prevent clash with standard library */
     479 #include <stdlib.h>
     480 #include <stdio.h>
     481-#define ulong unsigned long
     482 #include "flint.h"
     483 #include "ulong_extras.h"
     484 
     485diff -dNru src.orig/ulong_extras/randprime.c src/ulong_extras/randprime.c
     486--- src.orig/ulong_extras/randprime.c   2012-11-09 21:42:47.000000000 +0100
     487+++ src/ulong_extras/randprime.c        2013-03-27 14:12:25.513108653 +0100
     488@@ -25,10 +25,8 @@
     489 
     490 ******************************************************************************/
     491 
     492-#undef ulong /* prevent clash with standard library */
     493 #include <stdlib.h>
     494 #include <stdio.h>
     495-#define ulong unsigned long
     496 #include "flint.h"
     497 #include "ulong_extras.h"
     498 
     499diff -dNru src.orig/ulong_extras/sizeinbase.c src/ulong_extras/sizeinbase.c
     500--- src.orig/ulong_extras/sizeinbase.c  2012-11-09 21:42:47.000000000 +0100
     501+++ src/ulong_extras/sizeinbase.c       2013-03-27 14:12:25.601108648 +0100
     502@@ -24,9 +24,7 @@
     503 ******************************************************************************/
     504 
     505 #include <mpir.h>
     506-#undef ulong /* prevent clash with standard library */
     507 #include <math.h>
     508-#define ulong unsigned long
     509 #include "flint.h"
     510 #include "ulong_extras.h"
     511 
     512diff -dNru src.orig/ulong_extras/sqrt.c src/ulong_extras/sqrt.c
     513--- src.orig/ulong_extras/sqrt.c        2012-11-09 21:42:47.000000000 +0100
     514+++ src/ulong_extras/sqrt.c     2013-03-27 14:12:25.457108655 +0100
     515@@ -24,9 +24,7 @@
     516 ******************************************************************************/
     517 
     518 #include <mpir.h>
     519-#undef ulong /* prevent clash with standard library */
     520 #include <math.h>
     521-#define ulong unsigned long
     522 #include "flint.h"
     523 #include "ulong_extras.h"
     524 
     525diff -dNru src.orig/ulong_extras/sqrtmodn.c src/ulong_extras/sqrtmodn.c
     526--- src.orig/ulong_extras/sqrtmodn.c    2012-11-09 21:42:47.000000000 +0100
     527+++ src/ulong_extras/sqrtmodn.c 2013-03-27 14:12:25.749108642 +0100
     528@@ -23,10 +23,8 @@
     529 
     530 ******************************************************************************/
     531 
     532-#undef ulong /* prevent clash with standard library */
     533 #include <stdio.h>
     534 #include <stdlib.h>
     535-#define ulong unsigned long
     536 #include <mpir.h>
     537 #include "flint.h"
     538 #include "ulong_extras.h"
     539diff -dNru src.orig/ulong_extras/sqrtmod_primepow.c src/ulong_extras/sqrtmod_primepow.c
     540--- src.orig/ulong_extras/sqrtmod_primepow.c    2012-11-09 21:42:47.000000000 +0100
     541+++ src/ulong_extras/sqrtmod_primepow.c 2013-03-27 14:12:25.345108659 +0100
     542@@ -23,10 +23,8 @@
     543 
     544 ******************************************************************************/
     545 
     546-#undef ulong /* prevent clash with standard library */
     547 #include <stdio.h>
     548 #include <stdlib.h>
     549-#define ulong unsigned long
     550 #include <mpir.h>
     551 #include "flint.h"
     552 #include "ulong_extras.h"
  • spkg-check

    diff --git a/spkg-check b/spkg-check
    a b  
    11#!/usr/bin/env bash
    22
    3 echo "*************************************************"
    4 echo "Running test suite. This should take 6-20 minutes"
    5 echo "   Please report all failures to sage-devel      "
    6 echo "*************************************************"
     3###############################################################################
     4#
     5# FLINT Sage check script
     6#
     7###############################################################################
    78
    8 if [ "`uname`" = "Linux" -a "`uname -m`" = "x86_64" ]; then
    9    FLINT_TUNE="-mtune=opteron -march=opteron -fPIC -funroll-loops "
    10 elif [ "`uname`" = "Darwin" -a "`uname -m`" = "Power Macintosh" ]; then
    11    FLINT_TUNE=" -fPIC -funroll-loops "
    12 elif [ "`uname -m`" = "ia64" ]; then
    13    # -funroll-loops crashes the build on itanium under GCC-4.2.1, as reported by
    14    # Kate Minola.
    15    FLINT_TUNE=" -fPIC "
    16 else
    17    FLINT_TUNE=" -fPIC -funroll-loops  "
     9if [ "$SAGE_LOCAL" = "" ]; then
     10   echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
     11   echo >&2 "Maybe run 'sage -sh'?"
     12   exit 1
    1813fi
    1914
    20 export FLINT_TUNE
     15cd src
     16$MAKE check
    2117
    22 if [ "x$SAGE64" = xyes ]; then
    23    echo "Building a 64-bit version of the Flint test suite"
    24    FLINT_TUNE=" -fPIC -m64 -funroll-loops"
    25 fi
    26 
    27 FLINT_GMP_INCLUDE_DIR="$SAGE_LOCAL"/include/
    28 FLINT_GMP_LIB_DIR="$SAGE_LOCAL"/lib/
    29 
    30 FLINT_NTL_INCLUDE_DIR="$SAGE_LOCAL"/include
    31 FLINT_NTL_LIB_DIR="$SAGE_LOCAL"/lib/
    32 
    33 # What is QD??
    34 FLINT_QD_LIB_DIR="$SAGE_LOCAL"/include
    35 FLINT_QD_INCLUDE_DIR="$SAGE_LOCAL"/include
    36 
    37 export FLINT_GMP_INCLUDE_DIR
    38 export FLINT_GMP_LIB_DIR
    39 export FLINT_QD_INCLUDE_DIR
    40 export FLINT_QD_LIB_DIR
    41 export FLINT_NTL_INCLUDE_DIR
    42 export FLINT_NTL_LIB_DIR
    43 
    44 ###
    45 FLINT_LINK_OPTIONS=""
    46 export FLINT_LINK_OPTIONS
    47 
    48 cd src
    49 
    50 make test
    5118if [ $? -ne 0 ]; then
    52     echo "Error building the test suite for FLINT"
     19    echo >&2 "Error: FLINT failed to pass its test suite."
    5320    exit 1
    5421fi
    55 
    56 for i in {mpn_extras-test,ZmodF-test,ZmodF_mul-test,ZmodF_poly-test,fmpz-test,fmpz_poly-test,mpz_poly-test,long_extras-test,zmod_poly-test,zmod_mat-test,NTL-interface-test}; do
    57         ./$i
    58         if [ $? -ne 0 ]; then
    59             echo "FLINT test failed: $i"
    60             exit 1
    61         fi
    62 done
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
     3###############################################################################
     4#
     5# FLINT Sage install script
     6#
     7###############################################################################
     8
    39if [ "$SAGE_LOCAL" = "" ]; then
    4    echo "SAGE_LOCAL undefined ... exiting";
    5    echo "Maybe run 'sage -sh'?"
     10   echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
     11   echo >&2 "Maybe run 'sage -sh'?"
    612   exit 1
    713fi
    814
    9 if [ $UNAME = "CYGWIN" ]; then
    10    # we'll move the libntl.a temporarily out of the way and move it back at the
    11    # end of this spkg-install script
    12    mv $SAGE_LOCAL/lib/libntl.a $SAGE_LOCAL/lib/xxx_libntl.a
    13 fi
    14 
    15 FLINT_TUNE=" -fPIC -funroll-loops "
    16 
    17 if [ -z "$CFLAG64" ] ; then
    18     CFLAG64=-m64
    19 fi
    20 
    21 if [ -z "$CXXFLAG64" ] ; then
    22     CXXFLAG64=-m64
     15if [ "$SAGE64" = "yes" ]; then
     16    echo "Building a 64-bit version of FLINT."
     17    ABI="64"; export ABI
    2318fi
    2419
    25 
    26 if [ "x$SAGE64" = xyes ]; then
    27    FLINT_TUNE="$FLINT_TUNE $CFLAG64"
    28    export CXXFLAG64
     20if [ "$SAGE_DEBUG" = "yes" ]; then
     21    echo "Building a debug version of FLINT."
     22    CFLAGS="-O0 -g $CFLAGS"; export CFLAGS
     23    FLINT_TUNE=" $FLINT_TUNE"; export FLINT_TUNE
    2924fi
    3025
    31 export FLINT_TUNE
     26if [ "$UNAME" = "CYGWIN" ]; then
     27    echo "Only building a shared version of FLINT on Cygwin."
     28    FLINT_CONFIGURE="--disable-static $FLINT_CONFIGURE"
     29fi
    3230
    33 export FLINT_GMP_INCLUDE_DIR="$SAGE_LOCAL"/include/
    34 export FLINT_GMP_LIB_DIR="$SAGE_LOCAL"/lib/
    35 export FLINT_NTL_INCLUDE_DIR="$SAGE_LOCAL"/include
    36 export FLINT_NTL_LIB_DIR="$SAGE_LOCAL"/lib/
     31cd src
    3732
    38 export FLINT_LINK_OPTIONS=""
    39 
    40 
    41 # Apply all patches
    42 if [ $UNAME = "CYGWIN" ]; then
    43     PATCH_FLAG=--binary
    44 fi
    45 cd src
    46 echo "Patching Flint"
    47 for p in ../patches/*.patch; do 
    48     patch $PATCH_FLAG -p1 <"$p"
     33echo "Patching FLINT."
     34for patch in ../patches/*.patch; do
     35    [ -f "$patch" ] || continue
     36    patch -p1 <"$patch"
    4937    if [ $? -ne 0 ]; then
    50         echo "Applying patch $p failed"
     38        echo >&2 "Error applying '$patch'"
    5139        exit 1
    5240    fi
    53 done 
     41done
    5442
    55 # UNIX
    56 if [ $UNAME != "Darwin" ]; then
    57     $MAKE libflint.so
    58     if [ $? -ne 0 ]; then
    59         if [ $UNAME = "CYGWIN" ]; then
    60            # let's move libntl.a back
    61            mv $SAGE_LOCAL/lib/xxx_libntl.a $SAGE_LOCAL/lib/libntl.a
    62         fi
    63         echo "Error building flint shared library."
    64         exit 1
    65     fi
    66     if [ $UNAME = "CYGWIN" ]; then
    67        # let's move libntl.a back
    68        mv $SAGE_LOCAL/lib/xxx_libntl.a $SAGE_LOCAL/lib/libntl.a
    69        # make both kinds of dynamic libraries available for Windows
    70        cp -p libflint.so libflint.dll
    71     fi
    72     echo "Deleting old FLINT"
    73     rm -f $SAGE_LOCAL/lib/libflint*
    74     echo "Installing new library file"
    75     $CP -p libflint* "$SAGE_LOCAL/lib/"
    76 fi
     43echo "Configuring FLINT."
     44./configure --prefix="$SAGE_LOCAL" --with-mpir="$SAGE_LOCAL" \
     45    --with-mpfr="$SAGE_LOCAL" --with-ntl="$SAGE_LOCAL" $FLINT_CONFIGURE
     46if [ $? -ne 0 ]; then
     47    echo >&2 "Error: Failed to configure FLINT."
     48    exit 1
     49fi
    7750
    78 # OS X
    79 if [ $UNAME = "Darwin" ]; then
    80     if [ "$SAGE64" = "yes" ]; then
    81        $MAKE libflint.dylib64
    82     else
    83        $MAKE libflint.dylib
    84     fi
    85     if [ ! -f libflint.dylib ]; then
    86         echo "Failed to build FLINT dylib."
    87         exit 1
    88     fi
    89     echo "Deleting old FLINT"
    90     rm -f $SAGE_LOCAL/lib/libflint*
    91     echo "Installing new library file"
    92     $CP libflint.dylib "$SAGE_LOCAL/lib/"
    93 fi
     51echo "Building FLINT shared library."
     52$MAKE
     53if [ $? -ne 0 ]; then
     54    echo >&2 "Error: Failed to build FLINT shared library."
     55    exit 1
     56fi
    9457
     58echo "Deleting old FLINT files."
     59rm -f $SAGE_LOCAL/lib/libflint*
     60rm -rf $SAGE_LOCAL/include/flint
    9561
    96 # Copy the header files
    97 
    98 rm -rf "$SAGE_LOCAL"/include/FLINT
    99 
    100 for i in {FLINT/,FLINT/zn_poly/src/}; do
    101         mkdir -p "$SAGE_LOCAL"/include/$i
    102         if [ $? -ne 0 ]; then
    103             echo "Error building FLINT"
    104             exit 1
    105         fi
    106 
    107         $CP ${i/FLINT\//}*.h "$SAGE_LOCAL"/include/$i
    108         if [ $? -ne 0 ]; then
    109             echo "Error building FLINT"
    110             exit 1
    111         fi
    112 done
     62echo "Installing new FLINT files."
     63$MAKE install
     64if [ $? -ne 0 ]; then
     65    echo >&2 "Error: Failed to install FLINT."
     66    exit 1
     67fi