From patchwork Fri Jun 16 17:16:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 50982 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2DA2927BBEA; Fri, 16 Jun 2023 18:18:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A2DFE27BBE9 for ; Fri, 16 Jun 2023 18:18:22 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAD5J-0000EG-DW; Fri, 16 Jun 2023 13:18:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAD5H-0000Dk-Ep for guix-patches@gnu.org; Fri, 16 Jun 2023 13:18:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAD5G-0000Mi-HW for guix-patches@gnu.org; Fri, 16 Jun 2023 13:18:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAD5F-0007HX-Vo for guix-patches@gnu.org; Fri, 16 Jun 2023 13:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64114] [PATCH] gnu: fftw: Update to 3.3.10 and build entirely from source. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 16 Jun 2023 17:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64114 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64114@debbugs.gnu.org Cc: David Elsing X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168693584227929 (code B ref -1); Fri, 16 Jun 2023 17:18:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jun 2023 17:17:22 +0000 Received: from localhost ([127.0.0.1]:50297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAD4b-0007GO-4C for submit@debbugs.gnu.org; Fri, 16 Jun 2023 13:17:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:44890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAD4Y-0007GF-RR for submit@debbugs.gnu.org; Fri, 16 Jun 2023 13:17:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAD4X-00009U-Ac for guix-patches@gnu.org; Fri, 16 Jun 2023 13:17:17 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAD4U-00006Q-Qa for guix-patches@gnu.org; Fri, 16 Jun 2023 13:17:17 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 66994240103 for ; Fri, 16 Jun 2023 19:17:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686935831; bh=478c/nhtf89LgUB/iJBqc8w8lZr0UrHed79gGXPXGvQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=LhKlX5uI5dKyw3F7UHen46f/rOH/mpM8LRywSSmwvQNfS6+us7WNXJfob2gkvRQHU 65gWtWYwfhINGTd25mhAfSPh3pb+0g8UNdIP6XEh17xDIUz/G807Jr42oTnvpDjTzu Ty1dBPk6jhqk7fI7kQOCPYIhrLIrbS0/JrdBS3IE40V3rmKmnt1nohK6iZlW+n6p2L jM5oxEGFaU3tyyE9QwFOvPtuJl0iDwq44GyNolf5CnJBTkSLALsQ8zUP7ZfSgEgwKG YfZgZ2zQonEPFbDDmOBnKhsSBc2VOZUyJO9x5gze3JdrIPl9wHTKS7ZQ+T+J/jAehT SjIa0SQ77jZiA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QjQnf6pNjz9rxM; Fri, 16 Jun 2023 19:17:10 +0200 (CEST) From: David Elsing Date: Fri, 16 Jun 2023 17:16:44 +0000 Message-Id: <9ae0d0f6a21a74fc0b36c52f23bbbd44b251d039.1686934712.git.david.elsing@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.66; envelope-from=david.elsing@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 ;;; Copyright © 2021 Lars-Dominik Braun ;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2023 David Elsing ;;; ;;; 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: - ;; . - (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: + ;; . + (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.")))) From patchwork Sun Jan 14 15:55:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 58865 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8471427BBEA; Sun, 14 Jan 2024 15:58:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2EC5927BBE9 for ; Sun, 14 Jan 2024 15:58:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rP2sD-0004xM-Tr; Sun, 14 Jan 2024 10:58:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rP2s9-0004wP-8j for guix-patches@gnu.org; Sun, 14 Jan 2024 10:58:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rP2s8-0003Fi-9k for guix-patches@gnu.org; Sun, 14 Jan 2024 10:58:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rP2s7-0004Lq-CF for guix-patches@gnu.org; Sun, 14 Jan 2024 10:58:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#64114] [PATCH v2 2/2] gnu: Add fftw-documentation. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jan 2024 15:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64114 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64114@debbugs.gnu.org Cc: David Elsing Received: via spool by 64114-submit@debbugs.gnu.org id=B64114.170524783416642 (code B ref 64114); Sun, 14 Jan 2024 15:58:03 +0000 Received: (at 64114) by debbugs.gnu.org; 14 Jan 2024 15:57:14 +0000 Received: from localhost ([127.0.0.1]:43988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rP2rH-0004K8-Aq for submit@debbugs.gnu.org; Sun, 14 Jan 2024 10:57:14 -0500 Received: from mout02.posteo.de ([185.67.36.66]:40581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rP2rE-0004JQ-HH for 64114@debbugs.gnu.org; Sun, 14 Jan 2024 10:57:09 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A0E30240104 for <64114@debbugs.gnu.org>; Sun, 14 Jan 2024 16:57:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705247823; bh=2zIeVBOtxO90H8g2zA5P5h10gQJTd41D7ndi4wxxkL4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=DVuILMrpWZ2KBIH8U1gkltffSnvkXsRPbeCk0AvHUdGwbFMHxdR3WDsW4XQ03C+x8 gHQfEuP4uLLJUuJs3Y5vOnd6k7HFGFz46HRORpqkk+6cbcLUqSjVxdg5ijKJx1f5ty 7Ver1zARpScMPaA9aTQWJRI4FVIXD9F7g3tW5j3gwk/FKtuTc485GkRrZTJxGjMG+5 uBCJawd2vGCZVdN57uZeFpIzzoEGK3jIFLp1R2dxpGsI9gZyL1RHo+ybGPgjuJnt62 Lt+20FNnywfZnpaJktKqqWDX5fTkdabhHgBYHoV3DZ/wRPAwlSKJx9mz5JtpKWF5KU dBAjc/6OHeHPg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TCfzM2HWpz9rxB; Sun, 14 Jan 2024 16:57:03 +0100 (CET) From: David Elsing Date: Sun, 14 Jan 2024 15:55:14 +0000 Message-ID: <20240114155516.12457-3-david.elsing@posteo.net> In-Reply-To: <9ae0d0f6a21a74fc0b36c52f23bbbd44b251d039.1686934712.git.david.elsing@posteo.net> References: <9ae0d0f6a21a74fc0b36c52f23bbbd44b251d039.1686934712.git.david.elsing@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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")