From patchwork Thu Mar 18 15:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 27962 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 5519827BC58; Thu, 18 Mar 2021 15:05:05 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7F18727BC55 for ; Thu, 18 Mar 2021 15:05:04 +0000 (GMT) Received: from localhost ([::1]:57658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMuCt-0007nh-L6 for patchwork@mira.cbaines.net; Thu, 18 Mar 2021 11:05:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMuBu-0007m6-FI for guix-patches@gnu.org; Thu, 18 Mar 2021 11:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36147) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMuBu-0007Pk-70 for guix-patches@gnu.org; Thu, 18 Mar 2021 11:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMuBu-0000LE-1T for guix-patches@gnu.org; Thu, 18 Mar 2021 11:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47237] [PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit architectures. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 Mar 2021 15:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47237 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47237@debbugs.gnu.org Cc: Emmanuel Agullo , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Eric Bavier , Paul Garlick X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16160797961238 (code B ref -1); Thu, 18 Mar 2021 15:04:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2021 15:03:16 +0000 Received: from localhost ([127.0.0.1]:47690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMuB3-0000Jo-V6 for submit@debbugs.gnu.org; Thu, 18 Mar 2021 11:03:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:56674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMuB2-0000Jg-1F for submit@debbugs.gnu.org; Thu, 18 Mar 2021 11:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMuB0-0006Zv-Co for guix-patches@gnu.org; Thu, 18 Mar 2021 11:03:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56760) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMuAu-0006lT-9N; Thu, 18 Mar 2021 11:03:02 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=53470 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lMuAt-0006u1-QE; Thu, 18 Mar 2021 11:03:00 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 18 Mar 2021 16:02:46 +0100 Message-Id: <20210318150246.7220-1-ludo@gnu.org> X-Mailer: git-send-email 2.30.2 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" X-getmail-retrieved-from-mailbox: Patches From: Ludovic Courtès * gnu/packages/maths.scm (metis)[arguments]: Add #:modules and #:phases. --- gnu/packages/maths.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) Hi! Metis defaults to 32-bit floating point numbers. However, on 64-bit platforms, users probably expect 64-bit floating point numbers, hence this patch. We could make it configurable through different variants or via package parameters when they’re available, but I wonder about the usefulness of a variant that uses 32-bit floats on 64-bit architectures. Can we keep just this one variant? Thanks, Ludo’. diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 565f109f47..4cd9112be9 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -12,7 +12,7 @@ ;;; Copyright © 2015 Fabian Harfert ;;; Copyright © 2016 Roel Janssen ;;; Copyright © 2016, 2018, 2020 Kei Kebreau -;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2016 Leo Famulari ;;; Copyright © 2016, 2017 Thomas Danckaert ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick @@ -3312,7 +3312,26 @@ YACC = bison -pscotchyy -y -b y `(#:tests? #f ;no tests #:configure-flags `("-DSHARED=ON" ,(string-append "-DGKLIB_PATH=" (getcwd) - "/metis-" ,version "/GKlib")))) + "/metis-" ,version "/GKlib")) + + #:modules ((system base target) + (guix build cmake-build-system) + (guix build utils)) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'set-real-type-width + (lambda* (#:key build target #:allow-other-keys) + ;; Enable 64-bit floating point numbers on 64-bit + ;; architectures. Leave the default 32-bit width on + ;; other architectures. + (let ((word-size + (with-target (or target build %host-type) + (lambda () + (target-word-size))))) + (when (= 8 word-size) + (display "setting REALTYPEWIDTH to 64...\n") + (substitute* "include/metis.h" + (("define REALTYPEWIDTH.*$") + "define REALTYPEWIDTH 64\n"))))))))) (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") (synopsis "Graph partitioning and fill-reducing matrix ordering library") (description