[WIP PATCH] gnu: flint: Build with ntl.

  • Done
  • quality assurance status badge
Details
2 participants
  • Jakub K?dzio?ka
  • Marius Bakke
Owner
unassigned
Submitted by
Jakub K?dzio?ka
Severity
normal
J
J
Jakub K?dzio?ka wrote on 29 Mar 2020 22:32
(address . guix-patches@gnu.org)
20200329203224.27052-1-kuba@kadziolka.net
* gnu/packages/algebra.scm (flint)[inputs]: Add ntl.
[arguments]: Pass --with-ntl to configure.
---
This is required by sagemath, but the patch as written makes the build
error:

/gnu/store/9yzqiiyfhxi4yhndp46nndi77ica9g4i-ntl-11.4.3/include/NTL/vector.h:201:31: error: invalid conversion from ‘const NTL::Vec<NTL::ZZ>*’ to ‘int’ [-fpermissive]
201 | { VecStrategy<NTL_RELOC_TAG>::do_BlockConstructFromVec(p, n, q); }
| ^~~~~~~~~~~~~~~~~~~~~~~~
| |
| const NTL::Vec<NTL::ZZ>*

Arch Linux seems to be using the same version of ntl and flint, and I
don't see any special workarounds in their PKGBUILDs. I guessed that the
gcc version might be influencing things, but adding gcc-9 to
native-inputs didn't help. Does Guix set up GCC with some non-standard
default flags, maybe?

gnu/packages/algebra.scm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

Toggle diff (33 lines)
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index af50c2d775..99b69eba96 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -445,6 +445,8 @@ or text interfaces) or as a C++ library.")
"11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
(patches (search-patches "flint-ldconfig.patch"))))
(build-system gnu-build-system)
+ (inputs
+ `(("ntl" ,ntl)))
(propagated-inputs
`(("gmp" ,gmp)
("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
@@ -456,13 +458,15 @@ or text interfaces) or as a C++ library.")
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(gmp (assoc-ref inputs "gmp"))
- (mpfr (assoc-ref inputs "mpfr")))
+ (mpfr (assoc-ref inputs "mpfr"))
+ (ntl (assoc-ref inputs "ntl")))
;; do not pass "--enable-fast-install", which makes the
;; homebrew configure process fail
(invoke "./configure"
(string-append "--prefix=" out)
(string-append "--with-gmp=" gmp)
- (string-append "--with-mpfr=" mpfr))
+ (string-append "--with-mpfr=" mpfr)
+ (string-append "--with-ntl=" ntl))
#t))))))
(synopsis "Fast library for number theory")
(description
--
2.26.0
M
M
Marius Bakke wrote on 31 Mar 2020 17:12
87pncstv6v.fsf@devup.no
Jakub K?dzio?ka <kuba@kadziolka.net> writes:

Toggle quote (18 lines)
> * gnu/packages/algebra.scm (flint)[inputs]: Add ntl.
> [arguments]: Pass --with-ntl to configure.
> ---
> This is required by sagemath, but the patch as written makes the build
> error:
>
> /gnu/store/9yzqiiyfhxi4yhndp46nndi77ica9g4i-ntl-11.4.3/include/NTL/vector.h:201:31: error: invalid conversion from ‘const NTL::Vec<NTL::ZZ>*’ to ‘int’ [-fpermissive]
> 201 | { VecStrategy<NTL_RELOC_TAG>::do_BlockConstructFromVec(p, n, q); }
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> | |
> | const NTL::Vec<NTL::ZZ>*
>
> Arch Linux seems to be using the same version of ntl and flint, and I
> don't see any special workarounds in their PKGBUILDs. I guessed that the
> gcc version might be influencing things, but adding gcc-9 to
> native-inputs didn't help. Does Guix set up GCC with some non-standard
> default flags, maybe?

This is because of -Werror, which is not supposed to trigger on external
dependencies. The issue has been fixed on 'core-updates' where
dependencies are added on C_INCLUDE_PATH (which behave like -isystem)
instead of CPATH (which behave like -I).
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl6DXdgACgkQoqBt8qM6
VPpfjgf7BHGcuFYcUyL9Gq7xC6nZRjSbnUp1IyeVt+bUNrsG2jZQjxjY9HzZk9sJ
FaNJbJ9JoeaTyHF0ycZKUeLL+0Ik2SggcsSVE3Plfn6zsnYQVxGdPyW2vmgxj7Hy
7CuRZNovPkag9KiYc15yesuNisc7NZws+ipaRHeDIzgxCCvlNhnWyDdTZ6PTLx0t
HIMJquOC4UxvJjRWdKftJ43wOawHJC16Yf3HnNv0+lN7+Ou5lyc530HYfzmJjOmo
rGY752PlPC2yCDpAE3R7hmfC4JaJkarWdzIJnYFYBXJnfLTvV/VYCmdqQaHAQKf8
8k6fE4KuD9KdMW+BiCOXA7z5r++WXA==
=rcAG
-----END PGP SIGNATURE-----

J
J
Jakub K?dzio?ka wrote on 1 Apr 2020 15:15
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 40283@debbugs.gnu.org)
20200401131552.in7fm3gi3vmw3igw@gravity
On Tue, Mar 31, 2020 at 05:12:24PM +0200, Marius Bakke wrote:
Toggle quote (25 lines)
> Jakub K?dzio?ka <kuba@kadziolka.net> writes:
>
> > * gnu/packages/algebra.scm (flint)[inputs]: Add ntl.
> > [arguments]: Pass --with-ntl to configure.
> > ---
> > This is required by sagemath, but the patch as written makes the build
> > error:
> >
> > /gnu/store/9yzqiiyfhxi4yhndp46nndi77ica9g4i-ntl-11.4.3/include/NTL/vector.h:201:31: error: invalid conversion from ‘const NTL::Vec<NTL::ZZ>*’ to ‘int’ [-fpermissive]
> > 201 | { VecStrategy<NTL_RELOC_TAG>::do_BlockConstructFromVec(p, n, q); }
> > | ^~~~~~~~~~~~~~~~~~~~~~~~
> > | |
> > | const NTL::Vec<NTL::ZZ>*
> >
> > Arch Linux seems to be using the same version of ntl and flint, and I
> > don't see any special workarounds in their PKGBUILDs. I guessed that the
> > gcc version might be influencing things, but adding gcc-9 to
> > native-inputs didn't help. Does Guix set up GCC with some non-standard
> > default flags, maybe?
>
> This is because of -Werror, which is not supposed to trigger on external
> dependencies. The issue has been fixed on 'core-updates' where
> dependencies are added on C_INCLUDE_PATH (which behave like -isystem)
> instead of CPATH (which behave like -I).

Thanks! I had a guess it was about -Werror, but I don't think I would've
figured out the CPATH vs C_INCLUDE_PATH bit. As far as I understand,
we're relatively close to merging c-u into master, and the patch is far
from urgent, so I won't bother with trying to come up with a workaround.

Cheers,
Jakub K?dzio?ka
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl6ElAgACgkQ4xWnWEYT
FWSccw/9Ftu00GHsmFOr4BzqmFn5c24J/anlBkr0mUuc5jN7PQ6U3s9A+iBrFgmJ
HcxTX6AaojoT3x9J7C/ucd5XOxP/sfr+EGz3Qk0zyhjWut1ZPXPXnTyD6bzymexc
98E2v3bAl76C8Py/E70Vut5/mCBtmCTCs1El1QBFF0rvf7CXC2bUer4EIqUrqUBd
tymdUIe6jAQ6zgBNWROFUHoaWedZyiL6Bx2ITjoX07Ilb/77tUq0ZtNQfjS5EiYH
kyWq/96iZ4AbVTGhOOYpJYlD3Vwpc3O+pNAxLR7/Sn9TRtpHDbYLLV0Ngd9itZS5
WAr5JhhTioOUaZeb+hFGumdBeLkICWKflUKjSWmnhCPwbiyLX+T/031OhNSwOVzX
MnUQ6I/hHpwirEBFR4NXDZQl6f0fX2PStbV/q99o0xuPW5Br9L09H4jrzNbRcBB1
ZpkFVenDk5L70RjFeAIHde0YwAfmXYibX03oUtCaOYE8X8MiNNuTTpn7Ba3g4voY
nqRmozmLTC/6UHv9qmJCewhr3ZkxvW897roOUZhkrMulxrqYgHUPlvLhkyypodQY
gY3cUhPt37H7kuei/9sREVQThQIoXhThFiGUH29LhA/smLZVdpDtpxJuclsCTxBY
I8LR4ozsWc4ZtSJmhNSGeDYAlyxUpOF3YLIYYYxurPgk41tYpus=
=qaS2
-----END PGP SIGNATURE-----


J
J
Jakub K?dzio?ka wrote on 8 Jun 2020 13:05
[PATCH v2 2/3] gnu: flint: Build with ntl.
(address . 40283@debbugs.gnu.org)(address . mbakke@fastmail.com)
20200608110550.16488-2-kuba@kadziolka.net
* gnu/packages/algebra.scm (flint)[inputs]: Add ntl.
[arguments]: Pass --with-ntl to configure.
---
gnu/packages/algebra.scm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 4559293a03..6b632d3e95 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -447,6 +447,8 @@ or text interfaces) or as a C++ library.")
(sha256 (base32
"0h08a71kn8347zsqjamqnmrxjpsnnzpmhvxb6d2xmfrcs6nyv2ch"))))
(build-system gnu-build-system)
+ (inputs
+ `(("ntl" ,ntl)))
(propagated-inputs
`(("gmp" ,gmp)
("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
@@ -454,17 +456,24 @@ or text interfaces) or as a C++ library.")
`(#:parallel-tests? #f ; seems to be necessary on arm
#:phases
(modify-phases %standard-phases
+ (add-before 'configure 'newer-c++
+ (lambda _
+ (substitute* "configure"
+ (("-ansi") ""))
+ #t))
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(gmp (assoc-ref inputs "gmp"))
- (mpfr (assoc-ref inputs "mpfr")))
+ (mpfr (assoc-ref inputs "mpfr"))
+ (ntl (assoc-ref inputs "ntl")))
;; do not pass "--enable-fast-install", which makes the
;; homebrew configure process fail
(invoke "./configure"
(string-append "--prefix=" out)
(string-append "--with-gmp=" gmp)
- (string-append "--with-mpfr=" mpfr))
+ (string-append "--with-mpfr=" mpfr)
+ (string-append "--with-ntl=" ntl))
#t))))))
(synopsis "Fast library for number theory")
(description
--
2.26.2
J
J
Jakub K?dzio?ka wrote on 8 Jun 2020 13:05
[PATCH v2 1/3] gnu: flint: Update to 2.6.0.
(address . 40283@debbugs.gnu.org)(address . mbakke@fastmail.com)
20200608110550.16488-1-kuba@kadziolka.net
* gnu/packages/algebra.scm (flint): Update to 2.6.0.
* gnu/packages/patches/flint-ldconfig.patch: Remove the patch as it got
applied upstream.
* gnu/local.mk (dist_patch_DATA): Deregister the removed file.
---
gnu/local.mk | 1 -
gnu/packages/algebra.scm | 5 ++---
gnu/packages/patches/flint-ldconfig.patch | 26 -----------------------
3 files changed, 2 insertions(+), 30 deletions(-)
delete mode 100644 gnu/packages/patches/flint-ldconfig.patch

Toggle diff (68 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ae8a2275f7..27e96ea77b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -921,7 +921,6 @@ dist_patch_DATA = \
%D%/packages/patches/findutils-localstatedir.patch \
%D%/packages/patches/findutils-test-rwlock-threads.patch \
%D%/packages/patches/flann-cmake-3.11.patch \
- %D%/packages/patches/flint-ldconfig.patch \
%D%/packages/patches/foobillard++-pkg-config.patch \
%D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \
%D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 1008d24cd3..4559293a03 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -438,15 +438,14 @@ or text interfaces) or as a C++ library.")
(define-public flint
(package
(name "flint")
- (version "2.5.2")
+ (version "2.6.0")
(source (origin
(method url-fetch)
(uri (string-append
"http://flintlib.org/flint-"
version ".tar.gz"))
(sha256 (base32
- "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
- (patches (search-patches "flint-ldconfig.patch"))))
+ "0h08a71kn8347zsqjamqnmrxjpsnnzpmhvxb6d2xmfrcs6nyv2ch"))))
(build-system gnu-build-system)
(propagated-inputs
`(("gmp" ,gmp)
diff --git a/gnu/packages/patches/flint-ldconfig.patch b/gnu/packages/patches/flint-ldconfig.patch
deleted file mode 100644
index d7c66e17ab..0000000000
--- a/gnu/packages/patches/flint-ldconfig.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Patch by Andreas Enge <andreas@enge.fr>.
-Remedy the absence of ldconfig and explicitly create an additional symbolic
-link to the flint library, as discussed privately with upstream.
-
-diff -r -u flint-2.5.2.orig/configure flint-2.5.2/configure
---- flint-2.5.2.orig/configure 2015-08-13 18:16:22.000000000 +0200
-+++ flint-2.5.2/configure 2015-08-14 17:38:14.316284437 +0200
-@@ -714,6 +714,7 @@
- echo "FLINT_SHARED=$SHARED" >> Makefile
- echo "FLINT_LIB=$FLINT_LIB" >> Makefile
- echo "FLINT_LIBNAME=$FLINT_LIBNAME" >> Makefile
-+echo "FLINT_MAJOR=$FLINT_MAJOR" >> Makefile
- echo "FLINT_SOLIB=$FLINT_SOLIB" >> Makefile
- echo "EXEEXT=$EXEEXT" >> Makefile
- echo "PREFIX=$PREFIX" >> Makefile
-diff -r -u flint-2.5.2.orig/Makefile.in flint-2.5.2/Makefile.in
---- flint-2.5.2.orig/Makefile.in 2015-08-13 18:16:22.000000000 +0200
-+++ flint-2.5.2/Makefile.in 2015-08-14 17:38:50.584774817 +0200
-@@ -118,6 +118,7 @@
- $(LDCONFIG) -n "$(CURDIR)"; \
- fi
- ln -sf "$(FLINT_LIB)" "$(FLINT_LIBNAME)"; \
-+ ln -sf "$(FLINT_LIB)" "$(FLINT_LIBNAME).$(FLINT_MAJOR)"; \
-
- libflint.a: $(OBJS) $(LIB_SOURCES) $(EXT_SOURCES) $(HEADERS) $(EXT_HEADERS) | build build/interfaces
- $(AT)$(foreach ext, $(EXTENSIONS), $(foreach dir, $(filter-out %templates, $(patsubst $(ext)/%.h, %, $(wildcard $(ext)/*.h))), mkdir -p build/$(dir); BUILD_DIR=$(CURDIR)/build/$(dir); export BUILD_DIR; MOD_DIR=$(dir); export MOD_DIR; $(MAKE) -f $(CURDIR)/Makefile.subdirs -C $(ext)/$(dir) static || exit $$?;))
--
2.26.2
J
J
Jakub K?dzio?ka wrote on 8 Jun 2020 13:05
[PATCH v2 3/3] gnu: arb: Build with flint 2.6.
(address . 40283@debbugs.gnu.org)(address . mbakke@fastmail.com)
20200608110550.16488-3-kuba@kadziolka.net
Backport an upstream patch to fix a compatibility issue with flint 2.6.

* gnu/packages/algebra.scm (arb): Add patch.
* gnu/packages/patches/arb-flint-2.6.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register new file.
---
gnu/local.mk | 1 +
gnu/packages/algebra.scm | 3 +-
gnu/packages/patches/arb-flint-2.6.patch | 48 ++++++++++++++++++++++++
3 files changed, 51 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/arb-flint-2.6.patch

Toggle diff (82 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 27e96ea77b..3ed0a98687 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -754,6 +754,7 @@ dist_patch_DATA = \
%D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \
%D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \
%D%/packages/patches/apr-skip-getservbyname-test.patch \
+ %D%/packages/patches/arb-flint-2.6.patch \
%D%/packages/patches/aspell-default-dict-dir.patch \
%D%/packages/patches/ath9k-htc-firmware-binutils.patch \
%D%/packages/patches/ath9k-htc-firmware-gcc.patch \
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 6b632d3e95..aceaee52f9 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -502,7 +502,8 @@ fast arithmetic.")
(file-name (git-file-name name version))
(sha256
(base32
- "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1"))))
+ "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1"))
+ (patches (search-patches "arb-flint-2.6.patch"))))
(build-system gnu-build-system)
(propagated-inputs
`(("flint" ,flint))) ; flint.h is included by arf.h
diff --git a/gnu/packages/patches/arb-flint-2.6.patch b/gnu/packages/patches/arb-flint-2.6.patch
new file mode 100644
index 0000000000..98ff5e95b4
--- /dev/null
+++ b/gnu/packages/patches/arb-flint-2.6.patch
@@ -0,0 +1,48 @@
+From d3d9983231e0f034e86a1e75761627eb8213b704 Mon Sep 17 00:00:00 2001
+From: fredrik <fredrik.johansson@gmail.com>
+Date: Wed, 29 Apr 2020 13:41:36 +0200
+Subject: [PATCH] handle flint incompatibilities
+
+---
+ fmpr.h | 4 ++++
+ fmpz_extras.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/fmpr.h b/fmpr.h
+index 2204d72e..c6a8c342 100644
+--- a/fmpr.h
++++ b/fmpr.h
+@@ -22,7 +22,11 @@
+ #include "flint/flint.h"
+ #include "flint/fmpz.h"
+ #include "flint/fmpq.h"
++#if __FLINT_RELEASE < 20600
+ #include "flint/config.h"
++#else
++#include "flint/flint-config.h"
++#endif
+ #include "fmpz_extras.h"
+
+ #ifndef flint_abort
+diff --git a/fmpz_extras.h b/fmpz_extras.h
+index 4fd0538f..486e28c8 100644
+--- a/fmpz_extras.h
++++ b/fmpz_extras.h
+@@ -43,6 +43,8 @@ fmpz_add_inline(fmpz_t z, const fmpz_t x, const fmpz_t y)
+ fmpz_add(z, x, y);
+ }
+
++#if __FLINT_RELEASE < 20600
++
+ static __inline__ void
+ fmpz_add_si(fmpz_t z, const fmpz_t x, slong y)
+ {
+@@ -61,6 +63,8 @@ fmpz_sub_si(fmpz_t z, const fmpz_t x, slong y)
+ fmpz_add_ui(z, x, -y);
+ }
+
++#endif
++
+ static __inline__ void
+ fmpz_add_si_inline(fmpz_t z, const fmpz_t x, slong y)
+ {
--
2.26.2
J
J
Jakub K?dzio?ka wrote on 10 Jul 2020 23:06
Re: [bug#41971] [WIP PATCH 0/5] Add SageMath
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
20200710210640.izcxlglsmp6tvse7@gravity
On Tue, Jul 07, 2020 at 02:47:28PM +0200, Nicolas Goaziou wrote:
Toggle quote (15 lines)
> Hello,
>
> Jakub K?dzio?ka <kuba@kadziolka.net> writes:
>
> > This patchstack builds upon #40283 and packages (some of) SageMath.
> > Currently, sagelib is built successfully, but the `sage' binary is not
> > being installed. I'm submitting this here as I'm no longer actively
> > working on this for now. Some things remain to be done:
>
> Thanks!
>
> Would it make sense to add the uncontroversial fourth first patches,
> along with #40283, so it is easier to hack on the sagemath package
> itself?

Sure it would! I just did.

Toggle quote (3 lines)
> I'm also Cc'ing Andreas Enge, who showed interest in packaging Sagemath
> a few months ago, and, AFAIK, was close to succeeding.

Thanks!

Regards,
Jakub K?dzio?ka
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl8I2GAACgkQ4xWnWEYT
FWRWbBAAp5s3cOeZMLuvHVhZZdlbKDbi6G1Lm/3w9uXyONIfBhMYV7LfhBZeRIUH
VJ8NRS91rxyBnbhowmTxQkuILCS9jhP+FXwTFi6m6fhWulfOSsxu8sr9q2u8cvcX
JKYM5xpvxXKdgRWtns94K/N6lnWz0E4EP9xbOn+70+Jc/kLopJt6uwSm0jlLWJYD
1KLgAb2bOjtsxNmWRaHe/t94YdaLZg8Nd7jG4lZWzE5+l6O96s8DNI+9mGoorOso
LXyQKbKgZ+XrCgWWCcoXlTrUt1XA7EBCy3FsHAx+0sP7hkYMNKy5sP1g/s7omiGL
RLdvqsykCI+LYhKLyLFn+Ma96+/rvemh7l80d3nWdCmWGTHnpvmE60RavJeDAZqU
li81PX3yc4MgkpFFlR+bk7/0TIsjqll+bwtcITMMIGacCwtnPDUrshCZ6S6fyfeD
Gx5Dm5lJKNxCJWztcsfWL7hwqbz3pwnE2Z54E8vqRVsGvB8ApM/Pq2f5Mm9JR7Xz
2LYtLhhNnimMzXH0y63elL7kpgrXzgCBi3WqRI/uMcZMrtVQ/t1j1yF1n51q5vBk
KMrDARce0DnMxCLgJPbBbKmkEMAt4sS9Rzrp88RNQpxsggeh5CIa6QkQQniR9uNq
D6bVsiOJjHvZ38OtMif45ESXYoaiU6faDSt2rUAMdOjZAsK9hKQ=
=h1CR
-----END PGP SIGNATURE-----


Closed
?