From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 2BXhDY7LamLJJQAAbAwnHQ (envelope-from ) for ; Thu, 28 Apr 2022 19:14:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wCIkDY7LamLKPAEAG6o9tA (envelope-from ) for ; Thu, 28 Apr 2022 19:14:54 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B813E372E4 for ; Thu, 28 Apr 2022 19:14:53 +0200 (CEST) Received: from localhost ([::1]:39576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nk7jB-000265-0A for larch@yhetil.org; Thu, 28 Apr 2022 13:14:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk7gR-0000Jr-KS for guix-patches@gnu.org; Thu, 28 Apr 2022 13:12:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nk7gR-0001jN-Bo for guix-patches@gnu.org; Thu, 28 Apr 2022 13:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nk7gR-0001MY-7Q for guix-patches@gnu.org; Thu, 28 Apr 2022 13:12:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50080] [PATCH v2 2/4] gnu: sundials: Fix various issues. Resent-From: "Paul A. Patience" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Apr 2022 17:12:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50080@debbugs.gnu.org Cc: "Paul A. Patience" Received: via spool by 50080-submit@debbugs.gnu.org id=B50080.16511659055182 (code B ref 50080); Thu, 28 Apr 2022 17:12:03 +0000 Received: (at 50080) by debbugs.gnu.org; 28 Apr 2022 17:11:45 +0000 Received: from localhost ([127.0.0.1]:49841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk7g8-0001LV-Oy for submit@debbugs.gnu.org; Thu, 28 Apr 2022 13:11:45 -0400 Received: from mail-4018.proton.ch ([185.70.40.18]:55498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk7g2-0001Kh-77 for 50080@debbugs.gnu.org; Thu, 28 Apr 2022 13:11:39 -0400 Date: Thu, 28 Apr 2022 17:11:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com; s=protonmail2; t=1651165891; bh=hCLGS/FBf6Ggd8jySqGS3kWBqaqnahYLK//7xpTmVRQ=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=WTVJ+UmTCxAiEABvcC2rgDoiD2kBhuA4lPZ59tL8dOC9NGnp2JoixRRZshuONOZ1q LJ4vqsHa7PJU4Qh5jxHjks+ward+zVm0TvgGYy6QeQXYMWyOvlj0u3yo12Iz5I6Cr+ sxh0i5k7DQjScf8MWozFD9F2PWiSdtFPEfyHR3Zq/iSq9aENIXkwR2jDyrwOoKjZVT 6dxiiQRo6FFs+qI+0x5Nm3i77k/LPu3c5Cz+o7dQPi2ZvBANMay1FZ/BgZK1ltUrAX oMz1nngWUWmqB0+qPcApLIO+xr1dRahZUPnvBCwwSP/UmW83M8Z8PXqQXT7om3SdUM Si/ynW77m6EwQ== From: "Paul A. Patience" Message-ID: <20220428171109.217461-3-paul@apatience.com> In-Reply-To: <20220428171109.217461-1-paul@apatience.com> References: <20220428171109.217461-1-paul@apatience.com> Feedback-ID: 19227857:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Reply-To: "Paul A. Patience" Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651166093; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hCLGS/FBf6Ggd8jySqGS3kWBqaqnahYLK//7xpTmVRQ=; b=tv4i6fEyjsKj0yQldtNgXVRko9TYz4g9SM3GMj1zPKI+sszrKIdKffNBMvwxcCDIv2jDjO 6ZeAeseXKh6kYGZre6wtS+XopHwPEDGnRjNo2XhDAsnnByv0boDIauLduVqiCOMrNRlEkq kpa9gq7USYG2zO9ZAsCbNYnXFnMfV2n1iNCuuLboUu6AwAWbMNSaqUmUPk9SxIaJKns/kR jzP5D4DkEamatGl1GlIhEWPJhVJTZOxGxb6EdOQA1MWdrZ6JExPLKPPVwskWwXGThoGG1w z3sXf1dYfgdf3r5ZJSSv2DbX+wCwfq9sk/I04Ca80p22QABIqnOQnFwqXwR4sQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651166093; a=rsa-sha256; cv=none; b=syQrH/0iO7zOUTf4w+jd1hnRnFr6LzsfwG5DEJfRKGcdSgyExJNuyU/mgjFGPqbcOGkvd8 kmJkU/MgEF7sXYgg2J15zJkj7/pVLvTF9fhqUn8UGaNwBKLlHnqdsrBvY4kDn8UmIIPm0+ KP1JbCw7S940DrBDi87RHeG5KFli1ruHuPuejI+rEuC3oUoxOajePA42BhqrFJOTYxJTw8 0TEG/2cFl8vH+rJz/BsnvQCS3EjKEzNGShOv8ceHOqEGCExZ9uODL6I2eIRFto96qaIoyh 80aGRZmFp+dpMPXlKzuPZDNMvZDlLOpoX+hptsFe1KemF8/+qjxPRZVH8UUvcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=apatience.com header.s=protonmail2 header.b=WTVJ+UmT; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.00 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=apatience.com header.s=protonmail2 header.b=WTVJ+UmT; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B813E372E4 X-Spam-Score: 2.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: CHkCmmJaVHMC This commit fixes various issues. First, some of SUNDIALS's CMake variables were renamed at some point between 5.2.0 and 5.7.0, in particular KLU_ENABLE, which was changed to ENABLE_KLU. Since sundials-julia is essentially SUNDIALS 5.2.0, its configure flags need to be different from those of the sundials package. Second, commit 61bcd648ca215e3d8e75b3a3f49bfb94d66f7c79, which updated SUNDIALS to 6.1.1, accidentally completely disabled PETSc support for sundials-openmpi (PETSc is supported only with MPI) by removing the relevant configure flags. Third, SUNDIALS's default index size is 64 bits, but PETSc's is 32 bits, and they need to be the same; this issue is discussed in the next three paragraphs. The default index size in SUNDIALS 3.1.1 (which was the sundials package's version previous to the aforementioned commit) was also 64 bits (though it was configured through the SUNDIALS_INDEX_TYPE CMake variable, which could take the values INT64_T or INT32_T), but SUNDIALS's configure script didn't warn of any incompatibility with PETSc's 32-bit indices. I don't know if this was an accidental omission from the configure script or if SUNDIALS's index size didn't have to correspond to PETSc's at the time. Keeping 64-bit indices in SUNDIALS would require adding a package for PETSc with 64-bit indices (using the --with-64-bit-indices configure flag), possibly named petsc64-openmpi (to follow the style of the SCOTCH packages, i.e., scotch, scotch32, etc., though there the unadorned package name represents the 64-bit version, unlike the unadorned petsc), which would in turn require a package for METIS with 64-bit indices (using IDXTYPEWIDTH=3D64). However, SUNDIALS is an optional dependency of deal.II, both of which have PETSc as an optional dependency, and deal.II's index size (which defaults to 32 bits) must match PETSc's. In other words, the current deal.II package can build with SUNDIALS only if SUNDIALS has 32-bit indices. Furthermore, users needing 64-bit indices in SUNDIALS probably also need them in PETSc and other libraries. If and when 64-bit indices are deemed necessary, we can add all the package variations at once (for SUNDIALS, PETSc, METIS, deal.II and any others). * gnu/packages/maths.scm (sundials)[source]: Reuse version in URL. [native-inputs]: Capitalize and punctuate comment. [inputs]: Remove petsc, now unnecessary gfortran, and obsolete comment. Move TODO item to sundials-openmpi. [arguments]<#:configure-flags>: Add -DSUNDIALS_INDEX_SIZE=3D32 to match PETSc's 32-bit indices. Remove obsolete -DEXAMPLES_ENABLE_F77, -DEXAMPLES_ENABLE_F90 and -DFCMIX_ENABLE. Mention new but currently unusable -DBUILD_FORTRAN_MODULE_INTERFACE and -DEXAMPLES_ENABLE_F2003. Rename KLU_ENABLE to ENABLE_KLU. (sundials-openmpi): Use package/inherit. [inputs]: Move openmpi and petsc-openmpi from here... [propagated-inputs]: ...to here. Clarify comment. [arguments]<#:configure-flags>: Add -DENABLE_PETSC and -DPETSC_DIR, the equivalents of which were accidentally removed in commit 61bcd648ca215e3d8e75b3a3f49bfb94d66f7c79. <#:phases>: Replace a tab with spaces. [synopsis]: Replace OpenMPI with MPI to conform to other package synopses. (sundials-julia)[inputs]: Add gfortran. [arguments]<#:configure-flags>: Set only, and manually, -DCMAKE_C_FLAGS, -DSUNDIALS_INDEX_SIZE, -DKLU_ENABLE, -DKLU_INCLUDE_DIR, -DKLU_LIBRARY_DIR and -DLAPACK_ENABLE instead of inheriting from the sundials package, because some of SUNDIALS's CMake variables have changed name. [synopsis]: Capitalize =E2=80=9CLAPACK=E2=80=9D. --- gnu/packages/maths.scm | 64 +++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 593bb4651c..f44cd49354 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -6121,28 +6121,30 @@ (define-public sundials (source (origin (method url-fetch) - (uri (string-append "https://github.com/LLNL/sundials/releases/down= load/v6.1.1/" - "sundials-" version ".tar.gz")) + (uri (string-append "https://github.com/LLNL/sundials/releases/down= load/v" + version "/sundials-" version ".tar.gz")) (sha256 (base32 "0327a1fy8rilwc4brsqqb71jd1ymb7mqgxsylab06crcg5xn7byg")))) (build-system cmake-build-system) (native-inputs - (list python-2)) ;for tests; syntax incompatible with python 3 + (list python-2)) ; For tests; syntax incompatible with Pytho= n 3. (inputs - (list gfortran ;for fcmix - openblas petsc suitesparse)) ;TODO: Add hypre + (list openblas suitesparse)) (arguments - `(#:configure-flags `("-DCMAKE_C_FLAGS=3D-O2 -g -fcommon" + '(#:configure-flags `("-DCMAKE_C_FLAGS=3D-O2 -g -fcommon" + + "-DSUNDIALS_INDEX_SIZE=3D32" + ;; Incompatible with 32-bit indices. + ;;"-DBUILD_FORTRAN_MODULE_INTERFACE:BOOL=3DON" + "-DEXAMPLES_ENABLE_C:BOOL=3DON" "-DEXAMPLES_ENABLE_CXX:BOOL=3DON" - "-DEXAMPLES_ENABLE_F77:BOOL=3DON" - "-DEXAMPLES_ENABLE_F90:BOOL=3DON" + ;; Requires -DBUILD_FORTRAN_MODULE_INTERFACE:BO= OL=3DON. + ;;"-DEXAMPLES_ENABLE_F2003:BOOL=3DON" "-DEXAMPLES_INSTALL:BOOL=3DOFF" - "-DFCMIX_ENABLE:BOOL=3DON" - - "-DKLU_ENABLE:BOOL=3DON" + "-DENABLE_KLU:BOOL=3DON" ,(string-append "-DKLU_INCLUDE_DIR=3D" (assoc-ref %build-inputs "suite= sparse") "/include") @@ -6160,22 +6162,26 @@ (define-public sundials (license license:bsd-3))) (define-public sundials-openmpi - (package - (inherit sundials) + (package/inherit sundials (name "sundials-openmpi") - (inputs - (modify-inputs (package-inputs sundials) - (delete "petsc") - (prepend openmpi petsc-openmpi))) ;support in SUNDIALS requires= MPI + (propagated-inputs + (list openmpi + ;; Support for the below requires MPI. + ;; TODO: Add HYPRE. + petsc-openmpi)) (arguments (substitute-keyword-arguments (package-arguments sundials) ((#:configure-flags flags '()) - `(cons* "-DENABLE_MPI:BOOL=3DON" ,flags)) + `(cons* "-DENABLE_MPI:BOOL=3DON" + "-DENABLE_PETSC:BOOL=3DON" + (string-append "-DPETSC_DIR=3D" + (assoc-ref %build-inputs "petsc-openmpi")) + ,flags)) ((#:phases phases '%standard-phases) `(modify-phases ,phases (add-before 'check 'mpi-setup -=09 ,%openmpi-setup))))) - (synopsis "SUNDIALS with OpenMPI support"))) + ,%openmpi-setup))))) + (synopsis "SUNDIALS with MPI support"))) (define-public sundials-julia (package @@ -6194,13 +6200,19 @@ (define-public sundials-julia "0nx4sqhmi126m14myzm7syv2053harav9snl0a247wnkcgs5rxrv")))) (inputs (modify-inputs (package-inputs sundials) - (prepend lapack))) + (prepend gfortran lapack))) (arguments - (substitute-keyword-arguments (package-arguments sundials) - ((#:configure-flags flags '()) - `(cons* "-DLAPACK_ENABLE:BOOL=3DON" - ,flags)))) - (synopsis "SUNDIALS with lapack support as required by julia-sundials-= jll"))) + '(#:configure-flags `("-DCMAKE_C_FLAGS=3D-O2 -g -fcommon" + "-DSUNDIALS_INDEX_SIZE=3D32" + "-DKLU_ENABLE:BOOL=3DON" + ,(string-append "-DKLU_INCLUDE_DIR=3D" + (assoc-ref %build-inputs "suite= sparse") + "/include") + ,(string-append "-DKLU_LIBRARY_DIR=3D" + (assoc-ref %build-inputs "suite= sparse") + "/lib") + "-DLAPACK_ENABLE:BOOL=3DON"))) + (synopsis "SUNDIALS with LAPACK support as required by julia-sundials-= jll"))) (define-public combinatorial-blas (package -- 2.36.0