[gap-float] 01/01: Imported Debian patch 0.7.4+ds-2: Mig. Bug fix #835505

Jerome Benoit calculus-guest at moszumanska.debian.org
Sat Oct 15 04:14:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

calculus-guest pushed a commit to branch master
in repository gap-float.

commit 92451469b8bb0260d12c1285195c704b39753bb1
Author: Jerome Benoit <calculus at rezozer.net>
Date:   Sat Oct 15 05:10:27 2016 +0100

    Imported Debian patch 0.7.4+ds-2: Mig. Bug fix #835505
---
 debian/changelog                                   |   6 +
 debian/control                                     |   2 +-
 debian/patches/series                              |   1 +
 .../patches/upstream-migration-fplll-4_to_5.patch  | 141 +++++++++++++++++++++
 4 files changed, 149 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 5108a08..1463c58 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gap-float (0.7.4+ds-2) experimental; urgency=medium
+
+  * Migration Bug fix (Closes: #835505).
+
+ -- Jerome Benoit <calculus at rezozer.net>  Sat, 15 Oct 2016 04:06:46 +0000
+
 gap-float (0.7.4+ds-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 132ac7f..c1e0e5b 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Jerome Benoit <calculus at rezozer.net>
 Build-Depends:
  debhelper (>= 9), quilt, autotools-dev, libtool, dh-autoreconf, autoconf-archive,
  gap (>=4r8p3), gap-dev (>=4r8p3), gap-gapdoc,
- libgmp-dev, libmpfr-dev, libmpc-dev, libmpfi-dev, libfplll-dev,
+ libgmp-dev, libmpfr-dev, libmpc-dev, libmpfi-dev, libfplll-dev (>=5),
 # libcxsc-dev,
  texlive-latex-recommended, texlive-fonts-recommended, texlive-latex-extra
 Standards-Version: 3.9.8
diff --git a/debian/patches/series b/debian/patches/series
index 719eef5..77de806 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+upstream-migration-fplll-4_to_5.patch
 upstream-fix-gapdoc-bib.patch
 upstream-upgrade-tst-testall_g.patch
 upstream-autotoolization-cleanup.patch
diff --git a/debian/patches/upstream-migration-fplll-4_to_5.patch b/debian/patches/upstream-migration-fplll-4_to_5.patch
new file mode 100644
index 0000000..e74b668
--- /dev/null
+++ b/debian/patches/upstream-migration-fplll-4_to_5.patch
@@ -0,0 +1,141 @@
+Description: migration: fplll 4 -> 5
+ Attempt to migrate from fplll 4 to fplll 5;
+ meant to be submitted to the upstream maintainer.
+Origin: vendor, Debian
+Forwarded: https://github.com/gap-packages/float/pull/13
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-10-15
+
+--- a/m4/ac_check_fplll.m4
++++ b/m4/ac_check_fplll.m4
+@@ -76,8 +76,10 @@
+ LDFLAGS="$LDFLAGS $FPLLL_LDFLAGS $MPFR_CFLAGS"
+ LIBS="$LIBS -lfplll -lgmp"
+ AC_MSG_CHECKING([for lllReduction in -lfplll])
+-AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <fplll.h>],
+-    [ZZ_mat<mpz_t> M(3,3); lllReduction(M, 0.99, 0.51, LM_WRAPPER);])],[AC_MSG_RESULT([yes])],[temp_status=false; AC_MSG_RESULT([no])])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <fplll.h>],[
++ZZ_mat<mpz_t> M(3,3);
++lll_reduction(M, 0.99, 0.51, LM_WRAPPER);
++])],[AC_MSG_RESULT([yes])],[temp_status=false; AC_MSG_RESULT([no])])
+ AC_LANG_POP([C++])
+ 
+ if test "$temp_status" = false; then
+--- a/src/fplll.C
++++ b/src/fplll.C
+@@ -4,7 +4,7 @@
+  *
+  *   @(#)$id: fr_dll.c,v 1.18 2010/10/26 05:19:40 gap exp $
+  *
+- * Copyright (c) 2012, Laurent Bartholdi
++ * Copyright (c) 2012-2016, Laurent Bartholdi
+  *
+  ****************************************************************************
+  *
+@@ -30,6 +30,10 @@
+ }
+ #include <fplll.h>
+ 
++#ifndef FPLLL_VERSION
++#error obsolete fplll library
++#endif
++
+ typedef Obj (*ObjFunc)(); // I never could get the () and * right
+ 
+ template <class Z> void SET_INTOBJ(Z_NR<Z> &v, Obj z);
+@@ -38,8 +42,13 @@
+ template<> void SET_INTOBJ(Z_NR<mpz_t> &v, Obj z) {
+   if (IS_INTOBJ(z))
+     v = INT_INTOBJ(z);
+-  else
+-    mpz_set(v.getData(), mpz_MPZ(MPZ_LONGINT(z)));
++  else {
++    mpz_t zz;
++    mpz_init(zz);
++    mpz_set(zz, mpz_MPZ(MPZ_LONGINT(z)));
++    v = zz;
++    mpz_clear(zz);
++  }
+ }
+ 
+ template<> void SET_INTOBJ(Z_NR<long> &v, Obj z) {
+@@ -57,13 +66,18 @@
+ }
+ 
+ template<> Obj GET_INTOBJ(Z_NR<mpz_t> &v) {
+-  return INT_mpz(v.getData());
++  mpz_t z;
++  mpz_init2 (z, 8*sizeof(long)+1);
++	v.get_mpz(z);
++  Obj o = INT_mpz(z);
++	mpz_clear(z);
++  return o;
+ }
+ 
+ template<> Obj GET_INTOBJ(Z_NR<long> &v) {
+   mpz_t z;
+   mpz_init2 (z, 8*sizeof(long)+1);
+-  mpz_set_si(z,v.getData());
++  mpz_set_si(z,v.get_si());
+   Obj o = INT_mpz(z);
+   mpz_clear(z);
+   return o;
+@@ -72,7 +86,7 @@
+ template<> Obj GET_INTOBJ(Z_NR<double> &v) {
+   mpz_t z;
+   mpz_init2 (z, 8*sizeof(double)+1);
+-  mpz_set_d(z,v.getData());
++  mpz_set_d(z,v.get_d());
+   Obj o = INT_mpz(z);
+   mpz_clear(z);
+   return o;
+@@ -86,6 +100,7 @@
+ }
+ 
+ // in principle, the following 2 methods are not needed. However, mac's llvm-g++ requires them.
++#if 0
+ #ifdef __APPLE__
+ void SET_Z(Integer &s, const Z_NR<double> &t)
+ {
+@@ -97,12 +112,13 @@
+   s = t.getData();
+ }
+ #endif
++#endif
+ 
+ template<class Z> Obj dofplll(Obj gapmat, Obj lllargs, Obj svpargs)
+ {
+   if (!IS_PLIST(gapmat)) return INTOBJ_INT(-1);
+   Int numrows = LEN_PLIST(gapmat), numcols = -1;
+-  
++
+   for (int i = 1; i <= numrows; i++) {
+     Obj row = ELM_PLIST(gapmat,i);
+     if (numcols == -1)
+@@ -159,7 +175,7 @@
+       if (IS_INTOBJ(v)) flags = INT_INTOBJ(v);
+       else if (v != Fail) return INTOBJ_INT(-26);
+     }
+-    int result = lllReduction(mat, delta, eta, method, floatType, precision, flags);
++    int result = lll_reduction(mat, delta, eta, method, floatType, precision, flags);
+ 
+     if (result != RED_SUCCESS)
+       return INTOBJ_INT(10*result+1);
+@@ -190,7 +206,7 @@
+       for (int j = 0; j < numcols; j++)
+ 	SET_Z(svpmat[i][j],mat[i][j]);
+ 
+-    int result = shortestVector(svpmat, sol, method, flags);
++    int result = shortest_vector(svpmat, sol, method, flags);
+ 
+     if (result != RED_SUCCESS)
+       return INTOBJ_INT(10*result+2);
+@@ -244,7 +260,7 @@
+   }
+ }
+ 
+-static StructGVarFunc GVarFuncs [] = {  
++static StructGVarFunc GVarFuncs [] = {
+   { "@FPLLL", 4, "mat, intType, lllargs, svpargs", (ObjFunc) FPLLL, "fplll.C:FPLLL" },
+   { 0 }
+ };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gap-float.git



More information about the debian-science-commits mailing list