Ticket #12173: flint-2.3.diff
File flint-2.3.diff, 29.6 KB (added by , 9 years ago) |
---|
-
SPKG.txt
# HG changeset patch # User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr> # Date 1364403626 -3600 # Node ID 63675866eb180215e180bb6d5732ecdb5edf2c4f # Parent 219b9de5052506548e4ec0a6658af61219a4143c #12173: Update FLINT to version 2.3 diff --git a/SPKG.txt b/SPKG.txt
a b 2 2 3 3 == Description == 4 4 5 FLINT is a C library for doing number theory, written by William Hart and David Harvey.5 FLINT is a C library for doing number theory, maintained by William Hart. 6 6 7 7 Website: www.flintlib.org 8 8 9 9 == License == 10 10 11 GPL V2+ 11 FLINT is licensed GPL v2+. 12 12 13 13 == SPKG Maintainers == 14 14 15 * Burcin Erocal 16 * Mike Hansen 17 * William Stein 15 * Fredrik Johansson 16 * Jean-Pierre Flori 18 17 19 18 == Upstream Contact == 20 19 21 * Bill Hart22 * 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 23 22 24 23 == Dependencies == 25 24 26 * gmp 25 * MPIR 26 * MPFR 27 27 * NTL 28 28 29 == Special Update/Build Instructions ==29 == Patches == 30 30 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. 37 33 38 34 == Changelog == 39 35 36 === flint-2.3.p0 (Jean-Pierre Flori, 26 March 2013) === 37 * Trac #12173: add dylib.patch to make sure the shared library is called 38 libflint.dylib on Darwin 39 40 === flint-2.3 (Mike Hansen, Fredrik Johansson, Jean-Pierre Flori, May 2012-March 2013) === 41 * Trac #12173: Update FLINT to version 2.3. 42 * Removed obsolete patches. 43 * Cleanup spkg-install and spkg-check scripts. 44 * Removed Cygwin hack for libntl.a made useless by #9050. 45 * Removed now useless patch --binary flag on Cygwin. 46 * Only build shared library on Cygwin. 47 40 48 === flint-1.5.2.p3 (Timo Kluck, 7 March 2013) === 41 49 * #14241: Fix double // path separators in longlong.patch 42 50 … … 86 94 * #9277 Add -m64 flag when building the Flint test suite 87 95 if SAGE64 is set to "yes". Otherwise it builds 32-bit 88 96 objects and so the test files are not built, but instead 89 generating the usual "WRONG ELF CLASS" error. 90 * Remove a couple of lines which call spkg-check from 91 spkg-install if SAGE_CHECK is set to "yes". Otherwise, 92 spkg-check gets called twice, which is a waste of time. 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. 93 101 I'm afraid to say it was probably me that put those couple 94 of lines in a year or two ago, before I realised how 95 spkg-check was supposed to be called. 102 of lines in a year or two ago, before I realised how 103 spkg-check was supposed to be called. 96 104 97 105 === flint-1.5.0.p4 (Jaap Spies, Feb 23th, 2010) === 98 106 * #8112 Pass CFLAG64 to FLINT_TUNE if set for a 64 bit build. 99 107 100 108 === flint-1.5.0.p3 (David Kirkby, January 2nd, 2010) === 101 * #7815 Changed makes and spkg-install so that the flag -m64 got 102 added with a 64-bit build. 109 * #7815 Changed makes and spkg-install so that the flag -m64 got 110 added with a 64-bit build. 103 111 104 112 === flint-1.5.0.p1 (William Stein, September 25th, 2009) === 105 113 * Included a cygwin fix that involves naming the library .dll instead of .so. … … 109 117 110 118 === flint-1.3.0p3 (Ondrej Certik, September 20th, 2009) === 111 119 * Move libntl.a out of the way temporarily on CYGWIN (this makes the package 112 built, because it will link to the .so lib instead) 120 built, because it will link to the .so lib instead) 113 121 114 122 === flint-1.3.0p2 (David Kirkby, June 30th, 2009) === 115 123 * Change '-a' to '-p' option spkg-install so flint installs 116 124 on Solaris too. The usual GNUism. Only one byte is changed! 117 125 118 126 === flint-1.3.0 (Nick Alexander, June 9th, 2009) === 119 127 * Update to latest upstream FLINT, 1.3.0. 120 128 … … 165 173 166 174 === flint-1.0.20 (Michael Abshoff, December 23rd, 2008) === 167 175 * Upgrade to latest upstream (#4861) 168 * clean up SPKG.txt 176 * clean up SPKG.txt 169 177 170 178 === flint-1.0.13.p0 (Michael Abshoff, August 18th, 2008) === 171 179 * Add 64 bit OSX support … … 185 193 * Only check major and minor gcc release number, not tiny (fixes #3528) 186 194 187 195 === flint-1.010 (William Stein and Craig Citro, June 30, 2008) === 188 * upgrade to version 1.0.10 196 * upgrade to version 1.0.10 189 197 190 198 === flint-1.06.p3 (Michael Abshoff, April 1st, 2008) === 191 199 * import shared library versioning for flint (Tim Abbott, #3259) -
deleted file patches/ZmodF_mul.c.patch
diff --git a/patches/ZmodF_mul.c.patch b/patches/ZmodF_mul.c.patch deleted file mode 100644
+ - 1 --- src/ZmodF_mul.c 2009-09-23 18:03:27.000000000 +08002 +++ patches/ZmodF_mul.c 2011-04-25 22:32:40.000000000 +08003 @@ -30,7 +30,6 @@4 ******************************************************************************/5 6 #include <math.h>7 -#include "ZmodF.h"8 #include "ZmodF_poly.h"9 #include "ZmodF_mul.h"10 #include "mpn_extras.h" -
deleted file patches/ZmodF_poly.c.patch
diff --git a/patches/ZmodF_poly.c.patch b/patches/ZmodF_poly.c.patch deleted file mode 100644
+ - 1 --- src/ZmodF_poly.c 2009-09-23 18:03:27.000000000 +08002 +++ patches/ZmodF_poly.c 2011-04-25 22:37:17.000000000 +08003 @@ -29,8 +29,6 @@4 5 *****************************************************************************/6 7 -#include "flint.h"8 -#include "memory-manager.h"9 #include "ZmodF_poly.h"10 #include "ZmodF_mul.h"11 #include "fmpz_poly.h" -
new file patches/dylib.patch
diff --git a/patches/dylib.patch b/patches/dylib.patch new file mode 100644
- + 1 diff -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.h2 --- flint-1.5.2.orig/longlong.h 2009-09-23 12:03:27.000000000 +02003 +++ flint-1.5.2/longlong.h 2010-11-25 07:00:41.000000000 +01004 @@ -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 +02002 +++ patches/makefile 2010-01-02 07:00:32.000000000 +01003 @@ -1,3 +1,5 @@4 +# sage depends on the NTL interface, so we include it in the flint library5 +6 LIBDIR=$(PREFIX)/lib7 INCLUDEDIR=$(PREFIX)/include8 DOCDIR=$(PREFIX)/doc9 @@ -22,7 +24,8 @@10 11 CPP = $(FLINT_CPP)12 13 -LIBS = -L$(FLINT_GMP_LIB_DIR) $(FLINT_LINK_OPTIONS) -lgmp -lpthread -lm14 +# add NTL options so that NTL interface links properly15 +LIBS = -L$(FLINT_GMP_LIB_DIR) -L$(FLINT_NTL_LIB_DIR) $(FLINT_LINK_OPTIONS) -lgmp -lpthread -lntl -lm16 17 LIBS2 = -L$(FLINT_GMP_LIB_DIR) -L$(FLINT_NTL_LIB_DIR) $(FLINT_LINK_OPTIONS) -lgmp -lpthread -lntl -lm18 19 @@ -66,7 +69,8 @@20 theta.h \21 zmod_mat.h \22 F_mpz.h \23 - QS/tinyQS.h24 + QS/tinyQS.h \25 + NTL-interface.h26 27 ####### library object files28 29 @@ -109,13 +113,14 @@30 poly.o \31 sieve.o \32 linear_algebra.o \33 - block_lanczos.o34 + block_lanczos.o \35 + NTL-interface.o36 37 QS: mpQS38 39 tune: ZmodF_mul-tune mpz_poly-tune40 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-test42 +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-test43 44 check: test45 ./F_mpz-test46 @@ -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 produce62 +# a library, the -m64 (or equivalent) option must be provided, as it63 +# it is in the line above where the target is libflint.dylib6464 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 files70 71 @@ -345,55 +354,56 @@72 ####### test program targets73 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 library139 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 files144 145 @@ -489,70 +499,70 @@146 PROFOBJ = $(FLINTOBJ) profiler.o profiler-main.o147 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) -lntl175 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 programs185 186 delta_qexp.o: delta_qexp.c $(HEADERS)187 - $(CC) $(CFLAGS) -c delta_qexp.c -o delta_qexp.o188 + $(CPP) $(CFLAGS) -c delta_qexp.c -o delta_qexp.o189 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.o204 + $(CPP) $(CFLAGS) -c bernoulli.c -o bernoulli.o205 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.o212 + $(CPP) $(CFLAGS) -c bernoulli_fmpz.c -o bernoulli_fmpz.o213 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.o220 + $(CPP) $(CFLAGS) -c bernoulli_zmod.c -o bernoulli_zmod.o221 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.o228 + $(CPP) $(CFLAGS2) $(WITH_ZNPOLY) -c thetaproduct.c -o thetaproduct.o229 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 sieve235 236 @@ -590,12 +600,12 @@237 $(CC) $(CFLAGS) -c QS/mp_factor_base.c -o mp_factor_base.o238 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 timing244 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.o246 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 -
deleted file patches/mpn_extras.h.patch
diff --git a/patches/mpn_extras.h.patch b/patches/mpn_extras.h.patch deleted file mode 100644
+ - 1 --- src/mpn_extras.h 2009-09-23 03:03:27.000000000 -07002 +++ patches/mpn_extras.h 2011-12-20 15:47:18.495311148 -08003 @@ -22,7 +22,6 @@4 #ifndef MPN_EXTRAS_H5 #define MPN_EXTRAS_H6 7 -#include "flint.h"8 #include "ZmodF_poly.h"9 10 #include "longlong_wrapper.h" -
spkg-check
diff --git a/spkg-check b/spkg-check
a b 1 1 #!/usr/bin/env bash 2 2 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 ############################################################################### 7 8 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 " 9 if [ "$SAGE_LOCAL" = "" ]; then 10 echo >&2 "Error: SAGE_LOCAL undefined - exiting..." 11 echo >&2 "Maybe run 'sage -sh'?" 12 exit 1 18 13 fi 19 14 20 export FLINT_TUNE 15 cd src 16 $MAKE check 21 17 22 if [ "x$SAGE64" = xyes ]; then23 echo "Building a 64-bit version of the Flint test suite"24 FLINT_TUNE=" -fPIC -m64 -funroll-loops"25 fi26 27 FLINT_GMP_INCLUDE_DIR="$SAGE_LOCAL"/include/28 FLINT_GMP_LIB_DIR="$SAGE_LOCAL"/lib/29 30 FLINT_NTL_INCLUDE_DIR="$SAGE_LOCAL"/include31 FLINT_NTL_LIB_DIR="$SAGE_LOCAL"/lib/32 33 # What is QD??34 FLINT_QD_LIB_DIR="$SAGE_LOCAL"/include35 FLINT_QD_INCLUDE_DIR="$SAGE_LOCAL"/include36 37 export FLINT_GMP_INCLUDE_DIR38 export FLINT_GMP_LIB_DIR39 export FLINT_QD_INCLUDE_DIR40 export FLINT_QD_LIB_DIR41 export FLINT_NTL_INCLUDE_DIR42 export FLINT_NTL_LIB_DIR43 44 ###45 FLINT_LINK_OPTIONS=""46 export FLINT_LINK_OPTIONS47 48 cd src49 50 make test51 18 if [ $? -ne 0 ]; then 52 echo "Error building the test suite for FLINT"19 echo >&2 "Error: FLINT failed to pass its test suite." 53 20 exit 1 54 21 fi 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}; do57 ./$i58 if [ $? -ne 0 ]; then59 echo "FLINT test failed: $i"60 exit 161 fi62 done -
spkg-install
diff --git a/spkg-install b/spkg-install
a b 1 1 #!/usr/bin/env bash 2 2 3 ############################################################################### 4 # 5 # FLINT Sage install script 6 # 7 ############################################################################### 8 3 9 if [ "$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'?" 6 12 exit 1 7 13 fi 8 14 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 if [ "`uname`" = "Linux" -a "`uname -m`" = "x86_64" ]; then 16 # This line causes *MAJOR* Illegal Instruction problems on 17 # 64-bit Pentium 4's. Do *not* do that!! Only enable the 18 # opteron stuff with a surefire way of detecting that a 19 # machine is really an opteron. 20 #FLINT_TUNE="-mtune=opteron -march=opteron -fPIC -funroll-loops " 21 22 FLINT_TUNE="-fPIC -funroll-loops " 23 elif [ "`uname`" = "Darwin" -a "`uname -m`" = "Power Macintosh" ]; then 24 FLINT_TUNE=" -fPIC -funroll-loops " 25 elif [ "`uname -m`" = "ia64" ]; then 26 # -funroll-loops crashes the build on itanium under GCC-4.2.1, as reported by 27 # Kate Minola. 28 echo "Turning off loop unrolling on Linux/Itanium" 29 FLINT_TUNE=" -fPIC " 30 elif [ "`uname`" = "SunOS" -a "`uname -p`" = "sparc" ]; then 31 # -funroll-loops crashes the build on an US IIIi under GCC-4.3.2, as reported by 32 # Michael Abshoff 33 echo "Turning off loop unrolling on Solaris/Sparc" 34 FLINT_TUNE=" -fPIC " 35 else 36 FLINT_TUNE=" -fPIC -funroll-loops " 15 if [ "$SAGE64" = "yes" ]; then 16 echo "Building a 64-bit version of FLINT." 17 ABI="64"; export ABI 37 18 fi 38 19 39 if [ -z "$CFLAG64" ] ; then 40 CFLAG64=-m64 41 fi 42 43 if [ -z "$CXXFLAG64" ] ; then 44 CXXFLAG64=-m64 20 if [ "$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 45 24 fi 46 25 47 48 if [ "x$SAGE64" = xyes ]; then 49 FLINT_TUNE="$FLINT_TUNE $CFLAG64" 50 export CXXFLAG64 26 if [ "$UNAME" = "CYGWIN" ]; then 27 echo "Only building a shared version of FLINT on Cygwin." 28 FLINT_CONFIGURE="--disable-static $FLINT_CONFIGURE" 51 29 fi 52 30 53 export FLINT_TUNE 31 cd src 54 32 55 FLINT_GMP_INCLUDE_DIR="$SAGE_LOCAL"/include/ 56 FLINT_GMP_LIB_DIR="$SAGE_LOCAL"/lib/ 57 58 FLINT_NTL_INCLUDE_DIR="$SAGE_LOCAL"/include 59 FLINT_NTL_LIB_DIR="$SAGE_LOCAL"/lib/ 60 61 # What is QD?? possibly quad double? 62 FLINT_QD_LIB_DIR="$SAGE_LOCAL"/include 63 FLINT_QD_INCLUDE_DIR="$SAGE_LOCAL"/include 64 65 export FLINT_GMP_INCLUDE_DIR 66 export FLINT_GMP_LIB_DIR 67 export FLINT_QD_INCLUDE_DIR 68 export FLINT_QD_LIB_DIR 69 export FLINT_NTL_INCLUDE_DIR 70 export FLINT_NTL_LIB_DIR 71 72 ### 73 FLINT_LINK_OPTIONS="" 74 export FLINT_LINK_OPTIONS 75 76 # Apply all patches 77 if [ $UNAME = "CYGWIN" ]; then 78 PATCH_FLAG=--binary 79 fi 80 cd src 81 echo "Patching Flint" 82 for p in ../patches/*.patch; do 83 patch $PATCH_FLAG -p1 <"$p" 33 echo "Patching FLINT." 34 for patch in ../patches/*.patch; do 35 [ -f "$patch" ] || continue 36 patch -p1 <"$patch" 84 37 if [ $? -ne 0 ]; then 85 echo "Applying patch $p failed"38 echo >&2 "Error applying '$patch'" 86 39 exit 1 87 40 fi 88 done 41 done 89 42 90 # UNIX 91 if [ $UNAME != "Darwin" ]; then 92 $MAKE libflint.so 93 if [ $? -ne 0 ]; then 94 if [ $UNAME = "CYGWIN" ]; then 95 # let's move libntl.a back 96 mv $SAGE_LOCAL/lib/xxx_libntl.a $SAGE_LOCAL/lib/libntl.a 97 fi 98 echo "Error building flint shared library." 99 exit 1 100 fi 101 if [ $UNAME = "CYGWIN" ]; then 102 # let's move libntl.a back 103 mv $SAGE_LOCAL/lib/xxx_libntl.a $SAGE_LOCAL/lib/libntl.a 104 # make both kinds of dynamic libraries available for Windows 105 cp -p libflint.so libflint.dll 106 fi 107 echo "Deleting old FLINT" 108 rm -f $SAGE_LOCAL/lib/libflint* 109 echo "Installing new library file" 110 $CP -p libflint* "$SAGE_LOCAL/lib/" 111 fi 43 echo "Configuring FLINT." 44 ./configure --prefix="$SAGE_LOCAL" --with-mpir="$SAGE_LOCAL" \ 45 --with-mpfr="$SAGE_LOCAL" --with-ntl="$SAGE_LOCAL" $FLINT_CONFIGURE 46 if [ $? -ne 0 ]; then 47 echo >&2 "Error: Failed to configure FLINT." 48 exit 1 49 fi 112 50 113 # OS X 114 if [ $UNAME = "Darwin" ]; then 115 if [ "$SAGE64" = "yes" ]; then 116 $MAKE libflint.dylib64 117 else 118 $MAKE libflint.dylib 119 fi 120 if [ ! -f libflint.dylib ]; then 121 echo "Failed to build FLINT dylib." 122 exit 1 123 fi 124 echo "Deleting old FLINT" 125 rm -f $SAGE_LOCAL/lib/libflint* 126 echo "Installing new library file" 127 $CP libflint.dylib "$SAGE_LOCAL/lib/" 128 fi 51 echo "Building FLINT shared library." 52 $MAKE 53 if [ $? -ne 0 ]; then 54 echo >&2 "Error: Failed to build FLINT shared library." 55 exit 1 56 fi 129 57 58 echo "Deleting old FLINT files." 59 rm -f $SAGE_LOCAL/lib/libflint* 60 rm -rf $SAGE_LOCAL/include/flint 130 61 131 # Copy the header files 132 133 rm -rf "$SAGE_LOCAL"/include/FLINT 134 135 for i in {FLINT/,FLINT/zn_poly/src/}; do 136 mkdir -p "$SAGE_LOCAL"/include/$i 137 if [ $? -ne 0 ]; then 138 echo "Error building FLINT" 139 exit 1 140 fi 141 142 $CP ${i/FLINT\//}*.h "$SAGE_LOCAL"/include/$i 143 if [ $? -ne 0 ]; then 144 echo "Error building FLINT" 145 exit 1 146 fi 147 done 62 echo "Installing new FLINT files." 63 $MAKE install 64 if [ $? -ne 0 ]; then 65 echo >&2 "Error: Failed to install FLINT." 66 exit 1 67 fi