GNU bug report logs - #64114
[PATCH] gnu: fftw: Update to 3.3.10 and build entirely from source.

Previous Next

Package: guix-patches;

Reported by: David Elsing <david.elsing <at> posteo.net>

Date: Fri, 16 Jun 2023 17:18:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 64114 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Fri, 16 Jun 2023 17:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Elsing <david.elsing <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 16 Jun 2023 17:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: David Elsing <david.elsing <at> posteo.net>
Subject: [PATCH] gnu: fftw: Update to 3.3.10 and build entirely from source.
Date: Fri, 16 Jun 2023 17:16:44 +0000
* gnu/packages/algebra.scm (fftw): Update to 3.3.10.
[source]: Use git checkout without autogenerated files.
[arguments]<#:configure-flags>: Use Gexps and set --enable-maintainer-mode.
<#:modules>: Add (ice-9 ftw) and (srfi srfi-26).
<#:phases>: Add phases to run the code generation and build documentation.
[native-inputs]: Add autoconf, automake, ghostscript, indent, libtool, ocaml,
ocamlbuild, ocaml-num, ocaml-findlib, texinfo and transfig.
(fftwf,fftw-openmpi)[arguments]: Use Gexps.
---
Hello,
I noticed that the FFTW release tarballs already contain the
autogenerated codelets and the built documentation. Building them of
course adds a lot more dependencies.
 gnu/packages/algebra.scm | 140 +++++++++++++++++++++++++++------------
 1 file changed, 98 insertions(+), 42 deletions(-)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 3babf90b3c..ca5831066a 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2020, 2021, 2023 Vinicius Monego <monego <at> posteo.net>
 ;;; Copyright © 2021 Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2023 David Elsing <david.elsing <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages documentation)
@@ -45,6 +47,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fltk)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages image)
@@ -63,6 +66,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages xfig)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -737,39 +741,91 @@ (define-public kiss-fft-for-extempore
 (define-public fftw
   (package
     (name "fftw")
-    (version "3.3.8")
+    (version "3.3.10")
     (source (origin
-             (method url-fetch)
-             (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
-                                 version".tar.gz"))
-             (sha256
-              (base32
-               "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
+              ;; Release tarball contains many generated files
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/FFTW/fftw3")
+                    (commit (string-append "fftw-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "11r4kd1478mi35vv6fgmg6qibqkqjhb77pqxaa8374rxdlqazgyy"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags
-       '("--enable-shared" "--enable-openmp" "--enable-threads"
-         ,@(let ((system (or (%current-target-system) (%current-system))))
-             ;; Enable SIMD extensions for codelets.  See details at:
-             ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
-             (cond
-              ((string-prefix? "x86_64" system)
-               '("--enable-sse2" "--enable-avx" "--enable-avx2"
-                 "--enable-avx512" "--enable-avx-128-fma"))
-              ((string-prefix? "i686" system)
-               '("--enable-sse2"))
-              ((string-prefix? "aarch64" system)
-               ;; Note that fftw supports NEON on 32-bit ARM only when
-               ;; compiled for single-precision.
-               '("--enable-neon"))
-              (else
-               '())))
-         ;; By default '-mtune=native' is used.  However, that may cause the
-         ;; use of ISA extensions (e.g. AVX) that are not necessarily
-         ;; available on the user's machine when that package is built on a
-         ;; different machine.
-         "ax_cv_c_flags__mtune_native=no")))
-    (native-inputs (list perl))
+     (list
+      #:configure-flags
+      #~(list "--enable-shared"
+              "--enable-openmp"
+              "--enable-threads"
+              "--enable-maintainer-mode"
+              #$@(let ((system (or (%current-target-system) (%current-system))))
+                   ;; Enable SIMD extensions for codelets.  See details at:
+                   ;; <https://fftw.org/fftw3_doc/Installation-on-Unix.html>.
+                   (cond
+                    ((string-prefix? "x86_64" system)
+                     '("--enable-sse2" "--enable-avx" "--enable-avx2"
+                       "--enable-avx512" "--enable-avx-128-fma"))
+                    ((string-prefix? "i686" system)
+                     '("--enable-sse2"))
+                    ((string-prefix? "aarch64" system)
+                     ;; Note that fftw supports NEON on 32-bit ARM only when
+                     ;; compiled for single-precision.
+                     '("--enable-neon"))
+                    (else '())))
+              ;; By default '-mtune=native' is used.  However, that may cause the
+              ;; use of ISA extensions (e.g. AVX) that are not necessarily
+              ;; available on the user's machine when that package is built on a
+              ;; different machine.
+              "ax_cv_c_flags__mtune_native=no")
+      #:modules '((ice-9 ftw)
+                  (srfi srfi-26)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'remove-bootstrap
+            (lambda _
+              ;; This script calls configure
+              (delete-file "bootstrap.sh")
+              (invoke "touch" "ChangeLog")
+              ;; OCaml Num library
+              (substitute* "genfft/Makefile.am"
+                ((",nums")
+                 " -package num"))))
+          (add-after 'build 'build-doc
+            (lambda _
+              ;; Reproducibility
+              (substitute* "doc/FAQ/m-html.pl"
+                (("- \\$html_date\\\\n") "")
+                (("\\$html_year \\$user_copyholder")
+                 "2022 $user_copyholder"))
+              (substitute* "doc/FAQ/fftw-faq.bfnn"
+                ((".*`date.*") ""))
+              (invoke "make" "-C" "doc")
+              (invoke "make" "-C" "doc" "html")
+              (invoke "make" "-C" "doc/FAQ" "faq")))
+          (add-after 'install 'install-doc
+            (let ((doc (string-append #$output "/share/doc/"
+                                      #$name "-" #$version)))
+              (lambda _
+                (copy-recursively "doc/html" (string-append doc "/html"))
+                (copy-recursively "doc/FAQ/fftw-faq.html"
+                                  (string-append doc "/fftw-faq.html"))
+                (install-file "doc/FAQ/fftw-faq.ascii" doc)))))))
+    (native-inputs (list autoconf
+                         automake
+                         ghostscript
+                         indent
+                         libtool
+                         ocaml
+                         ocamlbuild
+                         ocaml-num
+                         ocaml-findlib
+                         perl
+                         texinfo
+                         transfig))
     (home-page "https://fftw.org")
     (synopsis "Computing the discrete Fourier transform")
     (description
@@ -785,14 +841,14 @@ (define-public fftwf
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags fftw-configure-flags)
-        `(cons* "--enable-single"
-                ,@(if (string-prefix? "arm" (or (%current-target-system)
-                                                (%current-system)))
-                      ;; fftw supports NEON on 32-bit ARM only when compiled
-                      ;; for single-precision, so add it here.
-                      '("--enable-neon")
-                      '())
-                ,fftw-configure-flags))))
+        #~(cons* "--enable-single"
+                 #$@(if (string-prefix? "arm" (or (%current-target-system)
+                                                  (%current-system)))
+                        ;; fftw supports NEON on 32-bit ARM only when compiled
+                        ;; for single-precision, so add it here.
+                        '("--enable-neon")
+                        '())
+                 #$fftw-configure-flags))))
     (description
      (string-append (package-description fftw)
                     "  Single-precision version."))))
@@ -806,11 +862,11 @@ (define-public fftw-openmpi
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags cf)
-        `(cons "--enable-mpi" ,cf))
+        #~(cons "--enable-mpi" #$cf))
        ((#:phases phases '%standard-phases)
-        `(modify-phases ,phases
-           (add-before 'check 'mpi-setup
-             ,%openmpi-setup)))))
+        #~(modify-phases #$phases
+            (add-before 'check 'mpi-setup
+              #$%openmpi-setup)))))
     (description
      (string-append (package-description fftw)
                     "  With OpenMPI parallelism support."))))
-- 
2.40.1





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Sun, 14 Jan 2024 15:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: 64114 <at> debbugs.gnu.org
Cc: David Elsing <david.elsing <at> posteo.net>
Subject: [PATCH v2 0/2] Build fftw entirely from source
Date: Sun, 14 Jan 2024 15:55:12 +0000
The fftw package has been updated to 3.3.10 in the meantime, but now the
transfig package was replaced by fig2dev, which depends on fftw itself.
Therefore, I put the documentation for fftw into a separate package. It also
depends on the inputs of the fftw package, as the configure phase has to be
run again to generate the Makefiles for the documentation.

David Elsing (2):
  gnu: fftw: Build entirely from source.
  gnu: Add fftw-documentation.

 gnu/packages/algebra.scm | 153 ++++++++++++++++++++++++++++-----------
 1 file changed, 112 insertions(+), 41 deletions(-)

-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Sun, 14 Jan 2024 15:58:02 GMT) Full text and rfc822 format available.

Message #11 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: 64114 <at> debbugs.gnu.org
Cc: David Elsing <david.elsing <at> posteo.net>
Subject: [PATCH v2 1/2] gnu: fftw: Build entirely from source.
Date: Sun, 14 Jan 2024 15:55:13 +0000
* gnu/packages/algebra.scm (fftw)[source]: Use git checkout without
autogenerated files.
[arguments]<#:configure-flags>: Use Gexps and set --enable-maintainer-mode and
--disable-doc.
<#:phases>: Add 'fix-maintainer-build' phase.
[native-inputs]: Add autoconf, automake, libtool, ocaml, ocamlbuild, ocaml-num
and ocaml-findlib.
(fftwf,fftw-openmpi)[arguments]: Use Gexps.
---
 gnu/packages/algebra.scm | 111 ++++++++++++++++++++++++---------------
 1 file changed, 70 insertions(+), 41 deletions(-)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index f319e260e9..dbed683bef 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2020, 2021, 2023 Vinicius Monego <monego <at> posteo.net>
 ;;; Copyright © 2021 Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2024 David Elsing <david.elsing <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,12 +39,14 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fltk)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages image)
@@ -63,6 +66,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages text-editors)
+  #:use-module (gnu packages xfig)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -738,37 +742,62 @@ (define-public fftw
     (name "fftw")
     (version "3.3.10")
     (source (origin
-             (method url-fetch)
-             (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
-                                 version".tar.gz"))
-             (sha256
-              (base32
-               "0rv4w90b65b2kvjpj8g9bdkl4xqc42q20f5bzpxdrkajk1a35jan"))))
+              ;; Release tarball contains many generated files
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/FFTW/fftw3")
+                    (commit (string-append "fftw-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "11r4kd1478mi35vv6fgmg6qibqkqjhb77pqxaa8374rxdlqazgyy"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags
-       '("--enable-shared" "--enable-openmp" "--enable-threads"
-         ,@(let ((system (or (%current-target-system) (%current-system))))
-             ;; Enable SIMD extensions for codelets.  See details at:
-             ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
-             (cond
-              ((string-prefix? "x86_64" system)
-               '("--enable-sse2" "--enable-avx" "--enable-avx2"
-                 "--enable-avx512" "--enable-avx-128-fma"))
-              ((string-prefix? "i686" system)
-               '("--enable-sse2"))
-              ((string-prefix? "aarch64" system)
-               ;; Note that fftw supports NEON on 32-bit ARM only when
-               ;; compiled for single-precision.
-               '("--enable-neon"))
-              (else
-               '())))
-         ;; By default '-mtune=native' is used.  However, that may cause the
-         ;; use of ISA extensions (e.g. AVX) that are not necessarily
-         ;; available on the user's machine when that package is built on a
-         ;; different machine.
-         "ax_cv_c_flags__mtune_native=no")))
-    (native-inputs (list perl))
+     (list
+      #:configure-flags
+      #~(list "--enable-shared"
+              "--enable-openmp"
+              "--enable-threads"
+              "--enable-maintainer-mode"
+              "--disable-doc"
+              #$@(let ((system (or (%current-target-system) (%current-system))))
+                   ;; Enable SIMD extensions for codelets.  See details at:
+                   ;; <https://fftw.org/fftw3_doc/Installation-on-Unix.html>.
+                   (cond
+                    ((string-prefix? "x86_64" system)
+                     '("--enable-sse2" "--enable-avx" "--enable-avx2"
+                       "--enable-avx512" "--enable-avx-128-fma"))
+                    ((string-prefix? "i686" system)
+                     '("--enable-sse2"))
+                    ((string-prefix? "aarch64" system)
+                     ;; Note that fftw supports NEON on 32-bit ARM only when
+                     ;; compiled for single-precision.
+                     '("--enable-neon"))
+                    (else '())))
+              ;; By default '-mtune=native' is used.  However, that may cause the
+              ;; use of ISA extensions (e.g. AVX) that are not necessarily
+              ;; available on the user's machine when that package is built on a
+              ;; different machine.
+              "ax_cv_c_flags__mtune_native=no")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-maintainer-build
+            (lambda _
+              ;; This script calls configure
+              (delete-file "bootstrap.sh")
+              (invoke "touch" "ChangeLog")
+              ;; OCaml Num library
+              (substitute* "genfft/Makefile.am"
+                ((",nums")
+                 " -package num")))))))
+    (native-inputs (list autoconf
+                         automake
+                         libtool
+                         ocaml
+                         ocamlbuild
+                         ocaml-num
+                         ocaml-findlib
+                         perl))
     (home-page "https://fftw.org")
     (synopsis "Computing the discrete Fourier transform")
     (description
@@ -784,14 +813,14 @@ (define-public fftwf
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags fftw-configure-flags)
-        `(cons* "--enable-single"
-                ,@(if (string-prefix? "arm" (or (%current-target-system)
-                                                (%current-system)))
-                      ;; fftw supports NEON on 32-bit ARM only when compiled
-                      ;; for single-precision, so add it here.
-                      '("--enable-neon")
-                      '())
-                ,fftw-configure-flags))))
+        #~(cons* "--enable-single"
+                 #$@(if (string-prefix? "arm" (or (%current-target-system)
+                                                  (%current-system)))
+                        ;; fftw supports NEON on 32-bit ARM only when compiled
+                        ;; for single-precision, so add it here.
+                        '("--enable-neon")
+                        '())
+                 #$fftw-configure-flags))))
     (description
      (string-append (package-description fftw)
                     "  Single-precision version."))))
@@ -805,11 +834,11 @@ (define-public fftw-openmpi
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags cf)
-        `(cons "--enable-mpi" ,cf))
+        #~(cons "--enable-mpi" #$cf))
        ((#:phases phases '%standard-phases)
-        `(modify-phases ,phases
-           (add-before 'check 'mpi-setup
-             ,%openmpi-setup)))))
+        #~(modify-phases #$phases
+            (add-before 'check 'mpi-setup
+              #$%openmpi-setup)))))
     (description
      (string-append (package-description fftw)
                     "  With OpenMPI parallelism support."))))
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Sun, 14 Jan 2024 15:58:03 GMT) Full text and rfc822 format available.

Message #14 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: 64114 <at> debbugs.gnu.org
Cc: David Elsing <david.elsing <at> posteo.net>
Subject: [PATCH v2 2/2] gnu: Add fftw-documentation.
Date: Sun, 14 Jan 2024 15:55:14 +0000
* gnu/packages/algebra.scm (fftw-documentation): New variable.
---
 gnu/packages/algebra.scm | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index dbed683bef..1b2694400d 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -807,6 +807,48 @@ (define-public fftw
 cosine/ sine transforms or DCT/DST).")
     (license license:gpl2+)))
 
+;; Separate package to prevent dependency cycle
+(define-public fftw-documentation
+  (package/inherit fftw
+    (name "fftw-documentation")
+    (arguments
+     (substitute-keyword-arguments (package-arguments fftw)
+       ((#:tests? _ #f) #f)
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            (replace 'build
+              (lambda _
+                ;; Reproducibility
+                (substitute* "doc/FAQ/m-html.pl"
+                  (("- \\$html_date\\\\n") "")
+                  (("\\$html_year \\$user_copyholder")
+                   "2021 $user_copyholder"))
+                (substitute* "doc/FAQ/fftw-faq.bfnn"
+                  ((".*`date.*") ""))
+                (invoke "make" "-C" "doc")
+                (invoke "make" "-C" "doc" "html")
+                (invoke "make" "-C" "doc/FAQ" "faq")))
+            (replace 'install
+              (let ((doc (string-append #$output "/share/doc/"
+                                        #$(package-name this-package) "-"
+                                        #$(package-version this-package))))
+                (lambda _
+                  (copy-recursively "doc/html" (string-append doc "/html"))
+                  (copy-recursively "doc/FAQ/fftw-faq.html"
+                                    (string-append doc "/fftw-faq.html"))
+                  (install-file "doc/FAQ/fftw-faq.ascii" doc))))))))
+    (native-inputs
+     (modify-inputs (package-native-inputs fftw)
+       (prepend ghostscript texinfo fig2dev)))
+    (home-page "https://fftw.org")
+    (synopsis "Computing the discrete Fourier transform")
+    (description
+     "FFTW is a C subroutine library for computing the discrete Fourier
+transform (DFT) in one or more dimensions, of arbitrary input size, and of
+both real and complex data (as well as of even/odd data---i.e. the discrete
+cosine/ sine transforms or DCT/DST).")
+    (license license:gpl2+)))
+
 (define-public fftwf
   (package/inherit fftw
     (name "fftwf")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Fri, 22 Nov 2024 17:26:02 GMT) Full text and rfc822 format available.

Message #17 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: 64114 <at> debbugs.gnu.org
Subject: Action?
Date: Fri, 22 Nov 2024 18:25:12 +0100
Hello David,

I happened to come along your patch and examined the situation. It turns out
that the fftw version has already been updated to 3.3.10.

Unfortunately, lots of packages depend on it, so changing the package will
be quite costly. Maybe it would make sense to close the bug for now (or let
it wait) and come back to it when a new version of fftw comes out?

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Tue, 07 Jan 2025 20:37:01 GMT) Full text and rfc822 format available.

Message #20 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: Andreas Enge <andreas <at> enge.fr>, 64114 <at> debbugs.gnu.org
Subject: Re: Action?
Date: Tue, 07 Jan 2025 20:36:27 +0000
Hello Andreas,

sorry, I didn't see your reply before.

Andreas Enge <andreas <at> enge.fr> writes:

> I happened to come along your patch and examined the situation. It turns out
> that the fftw version has already been updated to 3.3.10.
>
> Unfortunately, lots of packages depend on it, so changing the package will
> be quite costly. Maybe it would make sense to close the bug for now (or let
> it wait) and come back to it when a new version of fftw comes out?

FFTW isn't very actively developed, so it might take a while until there
is a new release. I think it makes sense to leave the bug open until
someone applies it when a dependency for fftw is updated (e.g. in
core-updates).

Do you think I should send updated patches rebased to master or would
this just unnecessarily occupy QA?

Best,
David




Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Wed, 22 Jan 2025 10:35:02 GMT) Full text and rfc822 format available.

Message #23 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: David Elsing <david.elsing <at> posteo.net>
Cc: 64114 <at> debbugs.gnu.org
Subject: Re: Action?
Date: Wed, 22 Jan 2025 11:34:01 +0100
Hello David,

Am Tue, Jan 07, 2025 at 08:36:27PM +0000 schrieb David Elsing:
> sorry, I didn't see your reply before.

I only learnt recently that debbugs does not forward comments on issues
to those who have opened them, so I did not cc you.

> FFTW isn't very actively developed, so it might take a while until there
> is a new release. I think it makes sense to leave the bug open until
> someone applies it when a dependency for fftw is updated (e.g. in
> core-updates).

Okay, there is just a risk of forgetting it...
How big is the documentation? Would it make sense to just keep it in the
package? Or have it as a separate doc output, which would be more in
line with what we usually do?

> Do you think I should send updated patches rebased to master or would
> this just unnecessarily occupy QA?

Yes, that would be nice. QA will not be triggered as the package
results in too many rebuilds.

Thanks,

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Sun, 26 Jan 2025 16:50:02 GMT) Full text and rfc822 format available.

Message #26 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: andreas <at> enge.fr
Cc: David Elsing <david.elsing <at> posteo.net>, 64114 <at> debbugs.gnu.org
Subject: [PATCH v2 0/2] Build fftw entirely from source
Date: Sun, 26 Jan 2025 16:47:11 +0000
Hi Andreas,

here is the rebased version.

Andreas Enge <andreas <at> enge.fr> writes:

> I only learnt recently that debbugs does not forward comments on issues
> to those who have opened them, so I did not cc you.

Ah, so that's why I didn't receive your email.

> Okay, there is just a risk of forgetting it...
> How big is the documentation? Would it make sense to just keep it in the
> package? Or have it as a separate doc output, which would be more in
> line with what we usually do?

The problem isn't the size, but the documentation depends through
fig2dev on imagemagick, which depends on fftw itself.

> Yes, that would be nice. QA will not be triggered as the package
> results in too many rebuilds.

Ok thanks, good to know.

Cheers,
David

David Elsing (2):
  gnu: fftw: Build entirely from source.
  gnu: Add fftw-documentation.

 gnu/packages/algebra.scm | 153 ++++++++++++++++++++++++++++-----------
 1 file changed, 112 insertions(+), 41 deletions(-)

-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Sun, 26 Jan 2025 16:55:01 GMT) Full text and rfc822 format available.

Message #29 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: 64114 <at> debbugs.gnu.org
Cc: David Elsing <david.elsing <at> posteo.net>
Subject: [PATCH v2 1/2] gnu: fftw: Build entirely from source.
Date: Sun, 26 Jan 2025 16:54:32 +0000
* gnu/packages/algebra.scm (fftw)[source]: Use git checkout without
autogenerated files.
[arguments]<#:configure-flags>: Use Gexps and set --enable-maintainer-mode and
--disable-doc.
<#:phases>: Add 'fix-maintainer-build' phase.
[native-inputs]: Add autoconf, automake, libtool, ocaml, ocamlbuild, ocaml-num
and ocaml-findlib.
(fftwf,fftw-openmpi)[arguments]: Use Gexps.
---
 gnu/packages/algebra.scm | 111 ++++++++++++++++++++++++---------------
 1 file changed, 70 insertions(+), 41 deletions(-)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 7c22e811d5..96f9b36a0e 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2023 Mehmet Tekman <mtekman89 <at> gmail.com>
 ;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus <at> gmail.com>
+;;; Copyright © 2025 David Elsing <david.elsing <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,6 +41,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages curl)
@@ -47,6 +49,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fltk)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages image)
@@ -68,6 +71,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages text-editors)
+  #:use-module (gnu packages xfig)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -730,37 +734,62 @@ (define-public fftw
     (name "fftw")
     (version "3.3.10")
     (source (origin
-             (method url-fetch)
-             (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
-                                 version".tar.gz"))
-             (sha256
-              (base32
-               "0rv4w90b65b2kvjpj8g9bdkl4xqc42q20f5bzpxdrkajk1a35jan"))))
+              ;; Release tarball contains many generated files
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/FFTW/fftw3")
+                    (commit (string-append "fftw-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "11r4kd1478mi35vv6fgmg6qibqkqjhb77pqxaa8374rxdlqazgyy"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags
-       '("--enable-shared" "--enable-openmp" "--enable-threads"
-         ,@(let ((system (or (%current-target-system) (%current-system))))
-             ;; Enable SIMD extensions for codelets.  See details at:
-             ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
-             (cond
-              ((string-prefix? "x86_64" system)
-               '("--enable-sse2" "--enable-avx" "--enable-avx2"
-                 "--enable-avx512" "--enable-avx-128-fma"))
-              ((string-prefix? "i686" system)
-               '("--enable-sse2"))
-              ((string-prefix? "aarch64" system)
-               ;; Note that fftw supports NEON on 32-bit ARM only when
-               ;; compiled for single-precision.
-               '("--enable-neon"))
-              (else
-               '())))
-         ;; By default '-mtune=native' is used.  However, that may cause the
-         ;; use of ISA extensions (e.g. AVX) that are not necessarily
-         ;; available on the user's machine when that package is built on a
-         ;; different machine.
-         "ax_cv_c_flags__mtune_native=no")))
-    (native-inputs (list perl))
+     (list
+      #:configure-flags
+      #~(list "--enable-shared"
+              "--enable-openmp"
+              "--enable-threads"
+              "--enable-maintainer-mode"
+              "--disable-doc"
+              #$@(let ((system (or (%current-target-system) (%current-system))))
+                   ;; Enable SIMD extensions for codelets.  See details at:
+                   ;; <https://fftw.org/fftw3_doc/Installation-on-Unix.html>.
+                   (cond
+                    ((string-prefix? "x86_64" system)
+                     '("--enable-sse2" "--enable-avx" "--enable-avx2"
+                       "--enable-avx512" "--enable-avx-128-fma"))
+                    ((string-prefix? "i686" system)
+                     '("--enable-sse2"))
+                    ((string-prefix? "aarch64" system)
+                     ;; Note that fftw supports NEON on 32-bit ARM only when
+                     ;; compiled for single-precision.
+                     '("--enable-neon"))
+                    (else '())))
+              ;; By default '-mtune=native' is used.  However, that may cause the
+              ;; use of ISA extensions (e.g. AVX) that are not necessarily
+              ;; available on the user's machine when that package is built on a
+              ;; different machine.
+              "ax_cv_c_flags__mtune_native=no")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-maintainer-build
+            (lambda _
+              ;; This script calls configure
+              (delete-file "bootstrap.sh")
+              (invoke "touch" "ChangeLog")
+              ;; OCaml Num library
+              (substitute* "genfft/Makefile.am"
+                ((",nums")
+                 " -package num")))))))
+    (native-inputs (list autoconf
+                         automake
+                         libtool
+                         ocaml
+                         ocamlbuild
+                         ocaml-num
+                         ocaml-findlib
+                         perl))
     (home-page "https://fftw.org")
     (synopsis "Computing the discrete Fourier transform")
     (description
@@ -790,14 +819,14 @@ (define-public fftwf
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags fftw-configure-flags)
-        `(cons* "--enable-single"
-                ,@(if (string-prefix? "arm" (or (%current-target-system)
-                                                (%current-system)))
-                      ;; fftw supports NEON on 32-bit ARM only when compiled
-                      ;; for single-precision, so add it here.
-                      '("--enable-neon")
-                      '())
-                ,fftw-configure-flags))))
+        #~(cons* "--enable-single"
+                 #$@(if (string-prefix? "arm" (or (%current-target-system)
+                                                  (%current-system)))
+                        ;; fftw supports NEON on 32-bit ARM only when compiled
+                        ;; for single-precision, so add it here.
+                        '("--enable-neon")
+                        '())
+                 #$fftw-configure-flags))))
     (description
      (string-append (package-description fftw)
                     "  Single-precision version."))))
@@ -811,11 +840,11 @@ (define-public fftw-openmpi
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
        ((#:configure-flags cf)
-        `(cons "--enable-mpi" ,cf))
+        #~(cons "--enable-mpi" #$cf))
        ((#:phases phases '%standard-phases)
-        `(modify-phases ,phases
-           (add-before 'check 'mpi-setup
-             ,%openmpi-setup)))))
+        #~(modify-phases #$phases
+            (add-before 'check 'mpi-setup
+              #$%openmpi-setup)))))
     (description
      (string-append (package-description fftw)
                     "  With OpenMPI parallelism support."))))
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#64114; Package guix-patches. (Sun, 26 Jan 2025 16:55:02 GMT) Full text and rfc822 format available.

Message #32 received at 64114 <at> debbugs.gnu.org (full text, mbox):

From: David Elsing <david.elsing <at> posteo.net>
To: 64114 <at> debbugs.gnu.org
Cc: David Elsing <david.elsing <at> posteo.net>
Subject: [PATCH v2 2/2] gnu: Add fftw-documentation.
Date: Sun, 26 Jan 2025 16:54:33 +0000
* gnu/packages/algebra.scm (fftw-documentation): New variable.
---
 gnu/packages/algebra.scm | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 96f9b36a0e..56fc90b518 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -799,6 +799,48 @@ (define-public fftw
 cosine/ sine transforms or DCT/DST).")
     (license license:gpl2+)))
 
+;; Separate package to prevent dependency cycle
+(define-public fftw-documentation
+  (package/inherit fftw
+    (name "fftw-documentation")
+    (arguments
+     (substitute-keyword-arguments (package-arguments fftw)
+       ((#:tests? _ #f) #f)
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            (replace 'build
+              (lambda _
+                ;; Reproducibility
+                (substitute* "doc/FAQ/m-html.pl"
+                  (("- \\$html_date\\\\n") "")
+                  (("\\$html_year \\$user_copyholder")
+                   "2021 $user_copyholder"))
+                (substitute* "doc/FAQ/fftw-faq.bfnn"
+                  ((".*`date.*") ""))
+                (invoke "make" "-C" "doc")
+                (invoke "make" "-C" "doc" "html")
+                (invoke "make" "-C" "doc/FAQ" "faq")))
+            (replace 'install
+              (let ((doc (string-append #$output "/share/doc/"
+                                        #$(package-name this-package) "-"
+                                        #$(package-version this-package))))
+                (lambda _
+                  (copy-recursively "doc/html" (string-append doc "/html"))
+                  (copy-recursively "doc/FAQ/fftw-faq.html"
+                                    (string-append doc "/fftw-faq.html"))
+                  (install-file "doc/FAQ/fftw-faq.ascii" doc))))))))
+    (native-inputs
+     (modify-inputs (package-native-inputs fftw)
+       (prepend ghostscript texinfo fig2dev)))
+    (home-page "https://fftw.org")
+    (synopsis "Computing the discrete Fourier transform")
+    (description
+     "FFTW is a C subroutine library for computing the discrete Fourier
+transform (DFT) in one or more dimensions, of arbitrary input size, and of
+both real and complex data (as well as of even/odd data---i.e. the discrete
+cosine/ sine transforms or DCT/DST).")
+    (license license:gpl2+)))
+
 (define-public fftw-cmake
   (package/inherit fftw
     ;; Cmake compiling is experimental since 2017, and it is not clear if this
-- 
2.46.0





This bug report was last modified 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.