diff mbox series

[bug#40283,WIP] gnu: flint: Build with ntl.

Message ID 20200329203224.27052-1-kuba@kadziolka.net
State Accepted
Headers show
Series [bug#40283,WIP] gnu: flint: Build with ntl. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Maja Kądziołka March 29, 2020, 8:32 p.m. UTC
* 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(-)

Comments

Marius Bakke March 31, 2020, 3:12 p.m. UTC | #1
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).
Maja Kądziołka April 1, 2020, 1:15 p.m. UTC | #2
On Tue, Mar 31, 2020 at 05:12:24PM +0200, Marius Bakke wrote:
> 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
diff mbox series

Patch

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