From 296f569064cfd5efa639b11ea95a4932a07d3203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 16 Dec 2021 20:20:09 -0300 Subject: [PATCH 1/4] givaro: update to 4.2.0. --- srcpkgs/givaro/patches/197.patch | 28 ++++++++++++++++++++++++++++ srcpkgs/givaro/template | 9 ++++----- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/givaro/patches/197.patch diff --git a/srcpkgs/givaro/patches/197.patch b/srcpkgs/givaro/patches/197.patch new file mode 100644 index 000000000000..bafaff3efbd9 --- /dev/null +++ b/srcpkgs/givaro/patches/197.patch @@ -0,0 +1,28 @@ +From ab3d332508c21daff41fb64a8658cdc7cc74fc47 Mon Sep 17 00:00:00 2001 +From: Cyril Bouvier +Date: Thu, 16 Dec 2021 17:12:25 +0100 +Subject: [PATCH] dom_power argument is now an uint64_t to avoid problem with + 32bit machine + +--- + src/kernel/system/givpower.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/kernel/system/givpower.h b/src/kernel/system/givpower.h +index eb784872..5644264d 100644 +--- a/src/kernel/system/givpower.h ++++ b/src/kernel/system/givpower.h +@@ -71,11 +71,11 @@ namespace Givaro { + + //! dom_power + template +- TT& dom_power(TT& res, const TT& n, long l, const D& F) ++ TT& dom_power(TT& res, const TT& n, uint64_t l, const D& F) + { + if (l == 0) return F.assign(res,F.one) ; + +- unsigned long p = (unsigned long) l ; ++ uint64_t p = l; + bool is_assg = false ; + + TT puiss; F.init(puiss); F.assign(puiss,n) ; diff --git a/srcpkgs/givaro/template b/srcpkgs/givaro/template index 9c16de5b1974..52457c02a1ed 100644 --- a/srcpkgs/givaro/template +++ b/srcpkgs/givaro/template @@ -1,6 +1,6 @@ # Template file for 'givaro' pkgname=givaro -version=4.1.1 +version=4.2.0 revision=1 build_style=gnu-configure makedepends="gmpxx-devel" @@ -8,16 +8,15 @@ short_desc="C++ library for arithmetic and algebraic computations" maintainer="Gonzalo Tornaría " license="CECILL-B" homepage="https://github.com/linbox-team/givaro" +changelog="https://github.com/linbox-team/givaro/raw/master/ChangeLog" distfiles="https://github.com/linbox-team/givaro/releases/download/v${version}/givaro-${version}.tar.gz" -checksum=628049899386e91da245aee6cd446350fbca87e94863bc0d815066c08150487f +checksum=865e228812feca971dfb6e776a7bc7ac959cf63ebd52b4f05492730a46e1f189 nocross=yes build_options="native_build" if [ -z "$build_option_native_build" ]; then - configure_args="--enable-sse --enable-sse2 - --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42 - --disable-avx --disable-avx2 --disable-fma --disable-fma4" + configure_args="--without-archnative" fi post_install() { From 6667f066733f6d9d70087a4d285f0cdcb68581df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 16 Dec 2021 20:20:17 -0300 Subject: [PATCH 2/4] fflas-ffpack: update to 2.5.0. --- srcpkgs/fflas-ffpack/patches/357.patch | 35 ++++++++++++++++++++++++++ srcpkgs/fflas-ffpack/template | 12 ++++----- 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/fflas-ffpack/patches/357.patch diff --git a/srcpkgs/fflas-ffpack/patches/357.patch b/srcpkgs/fflas-ffpack/patches/357.patch new file mode 100644 index 000000000000..99fd34efd93b --- /dev/null +++ b/srcpkgs/fflas-ffpack/patches/357.patch @@ -0,0 +1,35 @@ +From 9b6083c663096e9ca85775b79f1f27c848dbeb98 Mon Sep 17 00:00:00 2001 +From: Cyril Bouvier +Date: Fri, 17 Dec 2021 10:27:02 +0100 +Subject: [PATCH] Fix SimdChooser: on not x86_64 machines its value could be an + nonexistant struct + +--- + fflas-ffpack/fflas/fflas_simd.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/fflas-ffpack/fflas/fflas_simd.h b/fflas-ffpack/fflas/fflas_simd.h +index bf5d30211..84ced0fd8 100644 +--- a/fflas-ffpack/fflas/fflas_simd.h ++++ b/fflas-ffpack/fflas/fflas_simd.h +@@ -384,6 +384,20 @@ struct SimdChooser // integral number + #endif + }; + ++#ifndef __x86_64__ ++template <> ++struct SimdChooser ++{ ++ using value = NoSimd; ++}; ++ ++template <> ++struct SimdChooser ++{ ++ using value = NoSimd; ++}; ++#endif ++ + template using Simd = typename SimdChooser::value; + + // template struct SimdChooser { diff --git a/srcpkgs/fflas-ffpack/template b/srcpkgs/fflas-ffpack/template index 557c644c00a4..2aa599703585 100644 --- a/srcpkgs/fflas-ffpack/template +++ b/srcpkgs/fflas-ffpack/template @@ -1,6 +1,6 @@ # Template file for 'fflas-ffpack' pkgname=fflas-ffpack -version=2.4.3 +version=2.5.0 revision=1 build_style=gnu-configure hostmakedepends="pkg-config" @@ -10,15 +10,13 @@ short_desc="Finite Field Linear Algebra Subroutines / Package" maintainer="Gonzalo Tornaría " license="LGPL-2.1-or-later" homepage="http://linbox-team.github.io/fflas-ffpack/" -distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/${version}/fflas-ffpack-${version}.tar.gz" -checksum=f372783a17a9899ee9f88d4c9421d80facccb95556146dad7020d07a03791cc9 +changelog="https://github.com/linbox-team/fflas-ffpack/raw/master/ChangeLog" +distfiles="https://github.com/linbox-team/fflas-ffpack/releases/download/v${version}/fflas-ffpack-${version}.tar.gz" +checksum=dafb4c0835824d28e4f823748579be6e4c8889c9570c6ce9cce1e186c3ebbb23 nocross=yes build_options="native_build" if [ -z "$build_option_native_build" ]; then - configure_args="--enable-sse --enable-sse2 - --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42 - --disable-avx --disable-avx2 --disable-fma --disable-fma4 - --disable-avx512f --disable-avx512dq --disable-avx512vl" + configure_args="--without-archnative" fi From 277dff14025d4b017bb13f13ef86dfcac4cef86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 16 Dec 2021 20:20:20 -0300 Subject: [PATCH 3/4] linbox: update to 1.7.0. --- srcpkgs/linbox/patches/292.patch | 24 ++++++++++++ srcpkgs/linbox/patches/294.patch | 38 +++++++++++++++++++ ...8adade10641f1f04f04b589753d928fb5443.patch | 35 ----------------- .../remove-linboxsage-libs-from-pc.patch | 23 ----------- srcpkgs/linbox/template | 11 +++--- 5 files changed, 67 insertions(+), 64 deletions(-) create mode 100644 srcpkgs/linbox/patches/292.patch create mode 100644 srcpkgs/linbox/patches/294.patch delete mode 100644 srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch delete mode 100644 srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch diff --git a/srcpkgs/linbox/patches/292.patch b/srcpkgs/linbox/patches/292.patch new file mode 100644 index 000000000000..d3333cc23d0b --- /dev/null +++ b/srcpkgs/linbox/patches/292.patch @@ -0,0 +1,24 @@ +From 49b9cccd0286980c1c1811c3b03df883ef0164df Mon Sep 17 00:00:00 2001 +From: Doug Torrance +Date: Tue, 14 Dec 2021 16:22:33 -0500 +Subject: [PATCH] Only register uint128_t as a TypeName when it's available. + +Otherwise, test-fft will fail when it isn't. +--- + tests/test-fft.C | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tests/test-fft.C b/tests/test-fft.C +index d19184c2d..5811ebc5d 100644 +--- a/tests/test-fft.C ++++ b/tests/test-fft.C +@@ -55,7 +55,9 @@ REGISTER_TYPE_NAME(double); + REGISTER_TYPE_NAME(uint16_t); + REGISTER_TYPE_NAME(uint32_t); + REGISTER_TYPE_NAME(uint64_t); ++#ifdef __FFLASFFPACK_HAVE_INT128 + REGISTER_TYPE_NAME(uint128_t); ++#endif + REGISTER_TYPE_NAME(Modular); + REGISTER_TYPE_NAME(ModularExtended); + diff --git a/srcpkgs/linbox/patches/294.patch b/srcpkgs/linbox/patches/294.patch new file mode 100644 index 000000000000..7c645f165d39 --- /dev/null +++ b/srcpkgs/linbox/patches/294.patch @@ -0,0 +1,38 @@ +From f81a1f4a5e0835b7a0f3bb88a0fcbbaa32174cfa Mon Sep 17 00:00:00 2001 +From: Cyril Bouvier +Date: Wed, 15 Dec 2021 16:00:39 +0100 +Subject: [PATCH] Only register uint128_t as a TypeName when it's available + +--- + benchmarks/benchmark-fft.C | 2 ++ + benchmarks/benchmark-polynomial-matrix-mul-fft.C | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/benchmarks/benchmark-fft.C b/benchmarks/benchmark-fft.C +index 39b86c9d9..59a8be57c 100644 +--- a/benchmarks/benchmark-fft.C ++++ b/benchmarks/benchmark-fft.C +@@ -54,7 +54,9 @@ REGISTER_TYPE_NAME(double); + REGISTER_TYPE_NAME(uint16_t); + REGISTER_TYPE_NAME(uint32_t); + REGISTER_TYPE_NAME(uint64_t); ++#ifdef __FFLASFFPACK_HAVE_INT128 + REGISTER_TYPE_NAME(uint128_t); ++#endif + REGISTER_TYPE_NAME(Modular); + REGISTER_TYPE_NAME(ModularExtended); + +diff --git a/benchmarks/benchmark-polynomial-matrix-mul-fft.C b/benchmarks/benchmark-polynomial-matrix-mul-fft.C +index e9b184bcf..7bf17f33e 100644 +--- a/benchmarks/benchmark-polynomial-matrix-mul-fft.C ++++ b/benchmarks/benchmark-polynomial-matrix-mul-fft.C +@@ -65,7 +65,9 @@ REGISTER_TYPE_NAME(double); + REGISTER_TYPE_NAME(uint16_t); + REGISTER_TYPE_NAME(uint32_t); + REGISTER_TYPE_NAME(uint64_t); ++#ifdef __FFLASFFPACK_HAVE_INT128 + REGISTER_TYPE_NAME(uint128_t); ++#endif + REGISTER_TYPE_NAME(Modular); + REGISTER_TYPE_NAME(ModularExtended); + diff --git a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch b/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch deleted file mode 100644 index 5afa078ec7b8..000000000000 --- a/srcpkgs/linbox/patches/892f8adade10641f1f04f04b589753d928fb5443.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 892f8adade10641f1f04f04b589753d928fb5443 Mon Sep 17 00:00:00 2001 -From: Doug Torrance -Date: Sun, 9 May 2021 12:14:19 -0400 -Subject: [PATCH] Use std::ptrdiff_t for vector iterator difference type - -It was previously long (64-bit integers), but this will not be the -case on 32-bit systems. - -Closes: #273 ---- - linbox/vector/bit-vector.inl | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/linbox/vector/bit-vector.inl b/linbox/vector/bit-vector.inl -index 5fa84b421..23a22ba47 100644 ---- a/linbox/vector/bit-vector.inl -+++ b/linbox/vector/bit-vector.inl -@@ -46,7 +46,7 @@ namespace std - typedef LinBox::BitVector::reference reference; - typedef bool *pointer; - typedef bool value_type; -- typedef long difference_type; -+ typedef std::ptrdiff_t difference_type; - }; - - template <> -@@ -56,7 +56,7 @@ namespace std - typedef LinBox::BitVector::const_reference reference; - typedef const bool *pointer; - typedef bool value_type; -- typedef long difference_type; -+ typedef std::ptrdiff_t difference_type; - }; - } - diff --git a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch b/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch deleted file mode 100644 index c93915fb1b06..000000000000 --- a/srcpkgs/linbox/patches/remove-linboxsage-libs-from-pc.patch +++ /dev/null @@ -1,23 +0,0 @@ -Backported from: - -From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001 -From: Cyril Bouvier -Date: Thu, 17 Jan 2019 16:32:19 +0100 -Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in - ---- - linbox.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/linbox.pc.in b/linbox.pc.in -index 278f127e4..c6b8091eb 100644 ---- a/linbox.pc.in -+++ b/linbox.pc.in -@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library - URL: http://github.com/linbox-team/linbox - Version: @VERSION@ - Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0 --Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@ -+Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@ - Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@ @IML_CFLAGS@ @FLINT_CFLAGS@ - \------------------------------------------------------- diff --git a/srcpkgs/linbox/template b/srcpkgs/linbox/template index 096a15b3390b..e6edacdd0a74 100644 --- a/srcpkgs/linbox/template +++ b/srcpkgs/linbox/template @@ -1,7 +1,7 @@ # Template file for 'linbox' pkgname=linbox -version=1.6.3 -revision=2 +version=1.7.0 +revision=1 build_style=gnu-configure hostmakedepends="pkg-config" makedepends="fflas-ffpack" @@ -9,16 +9,15 @@ short_desc="C++ library for exact, high-performance linear algebra" maintainer="Gonzalo Tornaría " license="LGPL-2.1-or-later" homepage="https://linalg.org" +changelog="https://github.com/linbox-team/linbox/raw/master/ChangeLog" distfiles="https://github.com/linbox-team/linbox/releases/download/v${version}/linbox-${version}.tar.gz" -checksum=a58a188307b07c57964e844bceb99321d3043a8a4a1fccc082a54928bb9a0057 +checksum=6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc nocross=yes build_options="native_build" if [ -z "$build_option_native_build" ]; then - configure_args="--enable-sse --enable-sse2 - --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42 - --disable-avx --disable-avx2 --disable-fma --disable-fma4" + configure_args="--without-archnative" fi linbox-devel_package() { From 7cd0f09d1949944cd8d143678962c2f50e5906cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 16 Feb 2023 22:53:33 -0300 Subject: [PATCH 4/4] sagemath: rebuild for linbox 1.7.0 --- .../sagemath/patches/35612-linbox_1.7.patch | 64 +++++++++++++++++++ srcpkgs/sagemath/patches/get_patches | 1 + srcpkgs/sagemath/template | 2 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/sagemath/patches/35612-linbox_1.7.patch diff --git a/srcpkgs/sagemath/patches/35612-linbox_1.7.patch b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch new file mode 100644 index 000000000000..58dddf34a69d --- /dev/null +++ b/srcpkgs/sagemath/patches/35612-linbox_1.7.patch @@ -0,0 +1,64 @@ +diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd +index 7794c9edc39..1753277b1f1 100644 +--- a/src/sage/libs/linbox/conversion.pxd ++++ b/src/sage/libs/linbox/conversion.pxd +@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in + - v -- linbox vector + """ + cdef Vector_integer_dense res = P() +- cdef cppvector[Integer] * vec = &v.refRep() + cdef size_t i + for i in range( res._degree): +- mpz_set(res._entries[i], vec[0][i].get_mpz_const()) ++ mpz_set(res._entries[i], v.getEntry(i).get_mpz_const()) + + return res +diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd +index 9112d151f8b..bfeda4b6042 100644 +--- a/src/sage/libs/linbox/linbox.pxd ++++ b/src/sage/libs/linbox/linbox.pxd +@@ -32,7 +32,6 @@ cdef extern from "linbox/matrix/dense-matrix.h": + ctypedef Modular_double Field + ctypedef double Element + DenseMatrix_Modular_double(Field F, size_t m, size_t n) +- DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n) + void setEntry(size_t i, size_t j, Element& a) + Element &getEntry(size_t i, size_t j) + +@@ -42,7 +41,6 @@ cdef extern from "linbox/matrix/dense-matrix.h": + ctypedef Modular_float Field + ctypedef float Element + DenseMatrix_Modular_float(Field F, size_t m, size_t n) +- DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n) + void setEntry(size_t i, size_t j, Element& a) + Element &getEntry(size_t i, size_t j) + +@@ -101,7 +99,6 @@ cdef extern from "linbox/vector/vector.h": + DenseVector_integer (Field &F) + DenseVector_integer (Field &F, long& m) + DenseVector_integer (Field &F, cppvector[Integer]&) +- cppvector[Element]& refRep() + size_t size() + void resize(size_t) + void resize(size_t n, const Element&) +diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi +index abf29badce6..68b869ce314 100644 +--- a/src/sage/matrix/matrix_modn_dense_template.pxi ++++ b/src/sage/matrix/matrix_modn_dense_template.pxi +@@ -221,9 +221,14 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_ + return 0,[] + + cdef ModField *F = new ModField(modulus) +- cdef DenseMatrix *A = new DenseMatrix(F[0], entries,nrows, ncols) +- cdef Py_ssize_t r = reducedRowEchelonize(A[0]) ++ cdef DenseMatrix *A = new DenseMatrix(F[0], nrows, ncols) ++ + cdef Py_ssize_t i,j ++ for i in range(nrows): ++ for j in range(ncols): ++ A.setEntry(i, j, entries[i*ncols+j]) ++ ++ cdef Py_ssize_t r = reducedRowEchelonize(A[0]) + for i in range(nrows): + for j in range(ncols): + entries[i*ncols+j] = A.getEntry(i,j) diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches index 871ae38577fd..db36086fc9f9 100755 --- a/srcpkgs/sagemath/patches/get_patches +++ b/srcpkgs/sagemath/patches/get_patches @@ -61,3 +61,4 @@ get_pr 35438 "pythran 0.12.1" # needs review get_pr 35584 "networkx 3.1" +get_pr 35612 "linbox 1.7" diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 66a543efd21d..6e794c931df4 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,7 +1,7 @@ # Template file for 'sagemath' pkgname=sagemath version=9.8 -revision=2 +revision=3 build_wrksrc=pkgs/sagemath-standard build_style=python3-module _bindir=/usr/lib/sagemath/$version/bin