GNU bug report logs - #70056
[RFC PATCH] draft: gnu: Add mfem.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: "Paul A. Patience" <paul@HIDDEN>; Keywords: patch; dated Thu, 28 Mar 2024 14:21:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 70056 <at> debbugs.gnu.org:


Received: (at 70056) by debbugs.gnu.org; 2 Apr 2024 15:38:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 02 11:38:27 2024
Received: from localhost ([127.0.0.1]:55023 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rrgDS-0000zQ-MG
	for submit <at> debbugs.gnu.org; Tue, 02 Apr 2024 11:38:27 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1rrgDP-0000yd-Ri
 for 70056 <at> debbugs.gnu.org; Tue, 02 Apr 2024 11:38:24 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1rrgDF-0008MJ-2y; Tue, 02 Apr 2024 11:38:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=ZIXsd5GvueDnvU37iPnAj589YeRVcNb0I05p8iMwcHY=; b=WfAABwlI8iyhABHYsbBH
 yoIc1ov/9gLs7+XmQrg10f2iGZ+PemmdzRIpcd6i874pNg2X19AySnXDqGEbcfM55R0C9eYUxSDFw
 PvSeR8c+rEeIprnE2CIZ+AvoYscWhsBTZ9Hnbe7oABsnMejSMJH+JSnp608Bo0ZeBDe2FiPVJpIpb
 gQ1d3tW2jkKloJjx+JlF4sIICzyHigDDuRYhY51hZON1MqrRQs8BkPz4Jk4RfGY6ZQE8hGbGjF5jV
 w7Ajo2KMSbxiSqM/Tn8oU4r1G6rK/iUAIjyOMmS6QDCm5lFkjuzGwBB3Q4wy8MqqAQckX64arQJlP
 uybtq99Sb2jm4g==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: "Paul A. Patience" <paul@HIDDEN>
Subject: Re: bug#70056: [RFC PATCH] draft: gnu: Add mfem.
In-Reply-To: <adcc00db46287e4467c69bb102a7cb80e088724b.1711634614.git.paul@HIDDEN>
 (Paul A. Patience's message of "Thu, 28 Mar 2024 14:17:39 +0000")
References: <adcc00db46287e4467c69bb102a7cb80e088724b.1711634614.git.paul@HIDDEN>
Date: Tue, 02 Apr 2024 17:38:07 +0200
Message-ID: <87v84z3hcw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70056
Cc: 70056 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Paul,

"Paul A. Patience" <paul@HIDDEN> skribis:

> HEAD is now at 69fbae7 Merge pull request #3841 from mfem/mfem-4.6-dev
> suspicious ownership or permission on `/gnu/store/dc5fx7xfg67fsvl5brdxnbg=
kirirqxd0-mfem-4.6-checkout'; rejecting this build output
> build of /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.dr=
v failed

Could you try updating guix-daemon?  (You might need to roll back first
to avoid the bug above.)

While fixing
<https://guix.gnu.org/en/blog/2024/fixed-output-derivation-sandbox-bypass-c=
ve-2024-27297/>,
I first pushed a =E2=80=9Cbroken=E2=80=9D fix that led to the problem above=
.  If you
were unlucky and upgraded guix-daemon right at that time (I fixed it
with a followup commit ~24h later), then you have the problem above.

HTH!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#70056; Package guix-patches. Full text available.

Message received at 70056 <at> debbugs.gnu.org:


Received: (at 70056) by debbugs.gnu.org; 29 Mar 2024 04:41:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 29 00:41:04 2024
Received: from localhost ([127.0.0.1]:41424 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rq435-0003AX-Vd
	for submit <at> debbugs.gnu.org; Fri, 29 Mar 2024 00:41:04 -0400
Received: from mail-4323.proton.ch ([185.70.43.23]:31397)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <paul@HIDDEN>) id 1rq431-00039j-2z
 for 70056 <at> debbugs.gnu.org; Fri, 29 Mar 2024 00:41:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com;
 s=protonmail3; t=1711687249; x=1711946449;
 bh=Fgaf4CMsxAFyPTQYY+knjXLoXfb3kw5NOuhpxVJrD4w=;
 h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=d1KITf553pFblywUxDCMoPrQT6U35kBS2ECHWXbDMss8WKusMaj0pFuMJ1BlsTbSF
 W/Rfx1qAras6h3OHFlmljcaOoj/jSDIGb7w3YU0FKDHMI9yJP0Ol1XdmeFG4TDEb/6
 yDp1BPDJcnYutAmVu0mnPS4ju/cOgWNsfJQhbKWUisHzyBt7LfxfPN2lhq35dP9N2Z
 Vi7C4OCSTfCGK8MRU0hiGUqJLnIToFC3zmYIgj2vxA7NCInfUnZuY7DSmlKvpLQXg4
 SodmWMDIKnjino3z7wy0JyQ0XAJuRvD0beTHf57a1qQ8eOgPWtCx/C52ciP0+AyHf/
 pEnJAxYcUQv0w==
Date: Fri, 29 Mar 2024 04:40:43 +0000
To: 70056 <at> debbugs.gnu.org
From: "Paul A. Patience" <paul@HIDDEN>
Subject: [RFC PATCH v2] gnu: Add mfem.
Message-ID: <5a802d6de248452445b9a7671b2e28eef8259471.1711686959.git.paul@HIDDEN>
Feedback-ID: 19227857:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70056
Cc: "Paul A. Patience" <paul@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* gnu/packages/maths.scm (mfem): New variable.
* gnu/packages/patches/mfem-fix-mk-file-export.patch: New file.
* gnu/packages/patches/mfem-remove-source-dir-refs.patch: Same.
* gnu/local.mk (dist_patch_DATA): Register them.

Change-Id: Ida81f2b081a016e91426b68437909653020976f5
---
The package is basically ready now, except for the suspicious ownership
mentioned in the previous patch.
I've tested it on a local copy of MFEM.
(The OpenMPI version is trickier to compile.)

 gnu/local.mk                                  |   2 +
 gnu/packages/maths.scm                        | 171 ++++++++++++++++++
 .../patches/mfem-fix-mk-file-export.patch     |  29 +++
 .../patches/mfem-remove-source-dir-refs.patch | 101 +++++++++++
 4 files changed, 303 insertions(+)
 create mode 100644 gnu/packages/patches/mfem-fix-mk-file-export.patch
 create mode 100644 gnu/packages/patches/mfem-remove-source-dir-refs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5429dc498c..dcedef5f99 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1682,6 +1682,8 @@ dist_patch_DATA =3D=09=09=09=09=09=09\
   %D%/packages/patches/memtest86+-build-reproducibly.patch=09\
   %D%/packages/patches/mercurial-hg-extension-path.patch=09\
   %D%/packages/patches/mercurial-openssl-compat.patch=09=09\
+  %D%/packages/patches/mfem-fix-mk-file-export.patch=09=09\
+  %D%/packages/patches/mfem-remove-source-dir-refs.patch=09\
   %D%/packages/patches/mhash-keygen-test-segfault.patch=09=09\
   %D%/packages/patches/mia-fix-boost-headers.patch=09=09\
   %D%/packages/patches/mia-vtk9.patch=09=09=09=09\
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1b4d325649..2191b5e2da 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -151,6 +151,7 @@ (define-module (gnu packages maths)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
@@ -6890,6 +6891,176 @@ (define-public dealii-openmpi
             (delete 'unset-cpath)))))
     (synopsis "Finite element library (with MPI support)")))
=20
+(define-public mfem
+  (package
+    (name "mfem")
+    (version "4.6")
+    ;; (source
+    ;;  (origin
+    ;;    ;; (method url-fetch)
+    ;;    ;; (uri (string-append "https://github.com/mfem/mfem/archive/ref=
s/tags/v"
+    ;;    ;;                     version ".tar.gz"))
+    ;;    ;; (file-name (string-append name "-" version ".tar.gz"))
+    ;;    (method git-fetch)
+    ;;    (uri (git-reference
+    ;;          (url "https://github.com/mfem/mfem")
+    ;;          (commit (string-append "v" version))))
+    ;;    (file-name (git-file-name name version))
+    ;;    (sha256
+    ;;     (base32 "0m57j5kd7glc8lfp5bdmmx4az4fs6lkqjwd970w4fx8gylxff3n9")=
)
+    ;;    (patches (search-patches "mfem-remove-source-dir-refs.patch"
+    ;;                             "mfem-fix-mk-file-export.patch"))))
+    (source (local-file "/tmp/mfem" #:recursive? #t))
+    (outputs '("out" "doc"))            ; 338 MiB of documentation
+    (build-system cmake-build-system)
+    (arguments
+     (list #:configure-flags
+           ;; Follow order of config/defaults.mk, which has a more exhaust=
ive
+           ;; list than config/defaults.cmake.
+           #~(list "-DBUILD_SHARED_LIBS=3DON"
+                   "-DMFEM_USE_MPI=3DOFF"
+                   "-DMFEM_USE_METIS=3DOFF" ; MPI only
+                   "-DMFEM_USE_METIS_5=3DOFF"
+                   "-DMFEM_PRECISION=3Ddouble" ; For versions beyond 4.6
+                   "-DMFEM_DEBUG=3DOFF"
+                   "-DMFEM_USE_EXCEPTIONS=3DON"
+                   "-DMFEM_USE_ZLIB=3DON"
+                   "-DMFEM_USE_LIBUNWIND=3DON"
+                   "-DMFEM_USE_LAPACK=3DON"
+                   "-DMFEM_THREAD_SAFE=3DOFF"
+                   "-DMFEM_USE_OPENMP=3DON"
+                   "-DMFEM_USE_LEGACY_OPENMP=3DOFF"
+                   "-DMFEM_USE_MEMALLOC=3DON"
+                   "-DMFEM_TIMER_TYPE=3D2"
+                   "-DMFEM_USE_SUNDIALS=3DON"
+                   "-DMFEM_USE_SUITESPARSE=3DON"
+                   "-DMFEM_USE_SUPERLU=3DOFF" ; MPI only
+                   "-DMFEM_USE_SUPERLU5=3DOFF"
+                   "-DMFEM_USE_MUMPS=3DOFF"     ; MPI only
+                   "-DMFEM_USE_STRUMPACK=3DOFF" ; Missing dep, MPI only
+                   "-DMFEM_USE_GINKGO=3DOFF"    ; Missing dep
+                   "-DMFEM_USE_AMGX=3DOFF"      ; CUDA library
+                   "-DMFEM_USE_GNUTLS=3DON"
+                   "-DMFEM_USE_NETCDF=3DON"
+                   "-DMFEM_USE_PETSC=3DOFF" ; MPI only
+                   "-DMFEM_USE_SLEPC=3DOFF" ; MPI only
+                   "-DMFEM_USE_MPFR=3DON"
+                   "-DMFEM_USE_SIDRE=3DOFF"   ; Missing dep
+                   "-DMFEM_USE_FMS=3DOFF"     ; Missing dep
+                   "-DMFEM_USE_CONDUIT=3DOFF" ; Missing dep
+                   "-DMFEM_USE_PUMI=3DOFF"    ; Missing dep, MPI only
+                   "-DMFEM_USE_HIOP=3DOFF"    ; Missing dep
+                   "-DMFEM_USE_GSLIB=3DOFF"   ; Missing dep
+                   "-DMFEM_USE_CUDA=3DOFF"
+                   "-DMFEM_USE_HIP=3DOFF"     ; GPU library
+                   "-DMFEM_USE_RAJA=3DOFF"    ; Missing dep
+                   "-DMFEM_USE_OCCA=3DOFF"    ; Missing dep
+                   "-DMFEM_USE_CEED=3DOFF"    ; Missing dep
+                   "-DMFEM_USE_CALIPER=3DOFF" ; Missing dep
+                   "-DMFEM_USE_ALGOIM=3DOFF"  ; Missing dep
+                   "-DMFEM_USE_UMPIRE=3DOFF"  ; Missing dep
+                   "-DMFEM_USE_SIMD=3DON"
+                   "-DMFEM_USE_ADIOS2=3DOFF"       ; Missing dep
+                   "-DMFEM_USE_MKL_CPARDISO=3DOFF" ; Intel MKL
+                   "-DMFEM_USE_MKL_PARDISO=3DOFF"
+                   "-DMFEM_USE_MOONOLITH=3DOFF" ; Missing dep
+                   "-DMFEM_USE_ADFORWARD=3DOFF"
+                   "-DMFEM_USE_CODIPACK=3DOFF"  ; Missing dep
+                   "-DMFEM_USE_BENCHMARK=3DOFF" ; Only for benchmarks
+                   "-DMFEM_USE_PARELAG=3DOFF"   ; Missing dep, only for mi=
niapps
+                   "-DMFEM_USE_ENZYME=3DOFF"    ; Missing dep, requires Cl=
ang
+                   "-DMFEM_ENABLE_TESTING=3DON"
+                   "-DMFEM_ENABLE_EXAMPLES=3DON"
+                   "-DMFEM_ENABLE_MINIAPPS=3DON" ; Used in some tests
+                   "-DMFEM_ENABLE_GOOGLE_BENCHMARKS=3DOFF"
+                   (string-append "-DHDF5_DIR=3D" #$(this-package-input "h=
df5")))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'clean-mpi-references
+                 (lambda _
+                   (substitute* (string-append "config/config.mk.in")
+                     (("(MFEM_MPIEXEC +=3D ).*" _ prefix)
+                      ;; Set and non-empty, to avoid running unexpected
+                      ;; commands.
+                      (string-append prefix (which "false") "\n"))
+                     (("(MFEM_MPIEXEC_NP +=3D).*" _ prefix)
+                      (string-append prefix "\n"))
+                     (("(MFEM_MPI_NP +=3D).*" _ prefix)
+                      (string-append prefix "\n")))))
+               (add-after 'unpack 'clean-local-references
+                 (lambda _
+                   (substitute* (string-append "config/config.mk.in")
+                     (("(MFEM_BUILD_TAG +=3D ).*" _ prefix)
+                      (string-append prefix "(none)\n")))))
+               (add-before 'check 'build-tests
+                 (lambda _
+                   (invoke "cmake" "--build" "." "--target" "tests")))
+               (add-after 'check 'build-doc
+                 (lambda _
+                   (setenv "HOME" "/tmp") ; Writable cache for fontconfig
+                   (invoke "cmake" "--build" "." "--target" "doc")))
+               (add-after 'install 'remove-examples
+                 (lambda _
+                   (delete-file-recursively
+                    (string-append #$output "/examples"))))
+               (add-after 'install 'install-doc
+                 (lambda _
+                   (let ((docdir (string-append #$output:doc "/share/doc/"
+                                                #$name "-" #$version)))
+                     (install-file "doc/CodeDocumentation.html" docdir)
+                     (copy-recursively
+                      "doc/CodeDocumentation"
+                      (string-append docdir "/CodeDocumentation")))))
+               (add-after 'install 'fix-library-paths
+                 (let ((mpfr #$(this-package-input "mpfr"))
+                       (libunwind #$(this-package-input "libunwind")))
+                   (lambda _
+                     (substitute* (string-append
+                                   #$output "/lib/cmake/mfem/MFEMTargets.c=
make")
+                       ((";mpfr;")
+                        (string-append ";" mpfr "/lib/libmpfr.so;"))
+                       ((";unwind;")
+                        (string-append ";" libunwind "/lib/libunwind.so;")=
))
+                     (substitute* (string-append #$output "/share/mfem/con=
fig.mk")
+                       ((" mpfr ")
+                        (string-append " -Wl,-rpath," mpfr "/lib"
+                                       " -L" mpfr "/lib"
+                                       " -lmpfr "))
+                       ((" unwind ")
+                        (string-append " -Wl,-rpath," libunwind "/lib"
+                                       " -L" libunwind "/lib"
+                                       " -lunwind ")))))))))
+    (native-inputs
+     (list doxygen graphviz perl))      ; For documentation
+    ;; No propagated inputs necessary because the installed CMake files an=
d
+    ;; share/mfem/config.mk provide the full list of include directories.
+    (inputs
+     (list gnutls
+           hdf5                         ; For NetCDF
+           lapack
+           libunwind
+           metis-suitesparse            ; For SuiteSparse
+           mpfr
+           netcdf
+           suitesparse-amd
+           suitesparse-btf
+           suitesparse-camd
+           suitesparse-ccolamd
+           suitesparse-cholmod
+           suitesparse-colamd
+           suitesparse-config
+           suitesparse-klu
+           suitesparse-umfpack
+           sundials
+           zlib))
+    (home-page "https://mfem.org/")
+    (synopsis "Finite element library")
+    (description "MFEM is a modular parallel C++ library for finite elemen=
t
+methods.  Its goal is to enable high-performance scalable finite element
+discretization research and application development on a wide variety of
+platforms, ranging from laptops to supercomputers.")
+    (license license:bsd-3)))
+
 (define-public flann
   (package
     (name "flann")
diff --git a/gnu/packages/patches/mfem-fix-mk-file-export.patch b/gnu/packa=
ges/patches/mfem-fix-mk-file-export.patch
new file mode 100644
index 0000000000..fbd35a029a
--- /dev/null
+++ b/gnu/packages/patches/mfem-fix-mk-file-export.patch
@@ -0,0 +1,29 @@
+From ccba86c0259c2ae56ad44a53d5d5a2a40822cbe3 Mon Sep 17 00:00:00 2001
+From: "Paul A. Patience" <paul@HIDDEN>
+Date: Thu, 28 Mar 2024 13:28:49 -0400
+Subject: [PATCH 2/2] Add forgotten variable to mfem_export_mk_files
+
+MFEM_USE_MKL_PARDISO was missing.
+---
+ config/cmake/modules/MfemCmakeUtilities.cmake | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/config/cmake/modules/MfemCmakeUtilities.cmake b/config/cmake/=
modules/MfemCmakeUtilities.cmake
+index 204b7d87f..217f4eec7 100644
+--- a/config/cmake/modules/MfemCmakeUtilities.cmake
++++ b/config/cmake/modules/MfemCmakeUtilities.cmake
+@@ -851,8 +851,9 @@ function(mfem_export_mk_files)
+       MFEM_USE_CONDUIT MFEM_USE_PUMI MFEM_USE_HIOP MFEM_USE_GSLIB MFEM_US=
E_CUDA
+       MFEM_USE_HIP MFEM_USE_RAJA MFEM_USE_OCCA MFEM_USE_CEED MFEM_USE_CAL=
IPER
+       MFEM_USE_UMPIRE MFEM_USE_SIMD MFEM_USE_ADIOS2 MFEM_USE_MKL_CPARDISO
+-      MFEM_USE_ADFORWARD MFEM_USE_CODIPACK MFEM_USE_BENCHMARK MFEM_USE_PA=
RELAG
+-      MFEM_USE_MOONOLITH MFEM_USE_ALGOIM MFEM_USE_ENZYME)
++      MFEM_USE_MKL_PARDISO MFEM_USE_ADFORWARD MFEM_USE_CODIPACK
++      MFEM_USE_BENCHMARK MFEM_USE_PARELAG MFEM_USE_MOONOLITH MFEM_USE_ALG=
OIM
++      MFEM_USE_ENZYME)
+   foreach(var ${CONFIG_MK_BOOL_VARS})
+     if (${var})
+       set(${var} YES)
+--=20
+2.41.0
+
diff --git a/gnu/packages/patches/mfem-remove-source-dir-refs.patch b/gnu/p=
ackages/patches/mfem-remove-source-dir-refs.patch
new file mode 100644
index 0000000000..f9898748c7
--- /dev/null
+++ b/gnu/packages/patches/mfem-remove-source-dir-refs.patch
@@ -0,0 +1,101 @@
+From 0ad647e045e9cbe456ad0f5f3bdb6e015566e067 Mon Sep 17 00:00:00 2001
+From: "Paul A. Patience" <paul@HIDDEN>
+Date: Thu, 28 Mar 2024 13:22:48 -0400
+Subject: [PATCH 1/2] Remove references to MFEM_SOURCE_DIR
+
+---
+ config/cmake/config.hpp.in  | 3 ---
+ config/config.hpp.in        | 3 ---
+ config/config.mk.in         | 1 -
+ fem/ceed/interface/util.cpp | 8 +-------
+ general/device.cpp          | 6 +-----
+ 5 files changed, 2 insertions(+), 19 deletions(-)
+
+diff --git a/config/cmake/config.hpp.in b/config/cmake/config.hpp.in
+index 7cb2a958d..13f13c48d 100644
+--- a/config/cmake/config.hpp.in
++++ b/config/cmake/config.hpp.in
+@@ -30,9 +30,6 @@
+ #define MFEM_VERSION_MINOR (((MFEM_VERSION)/100)%100)
+ #define MFEM_VERSION_PATCH ((MFEM_VERSION)%100)
+=20
+-// MFEM source directory.
+-#define MFEM_SOURCE_DIR "@MFEM_SOURCE_DIR@"
+-
+ // MFEM install directory.
+ #define MFEM_INSTALL_DIR "@MFEM_INSTALL_DIR@"
+=20
+diff --git a/config/config.hpp.in b/config/config.hpp.in
+index 39d7737c7..dbee1f32f 100644
+--- a/config/config.hpp.in
++++ b/config/config.hpp.in
+@@ -30,9 +30,6 @@
+ #define MFEM_VERSION_MINOR (((MFEM_VERSION)/100)%100)
+ #define MFEM_VERSION_PATCH ((MFEM_VERSION)%100)
+=20
+-// The absolute path of the MFEM source prefix.
+-// #define MFEM_SOURCE_DIR "@MFEM_SOURCE_DIR@"
+-
+ // The absolute path of the MFEM installation prefix.
+ // #define MFEM_INSTALL_DIR "@MFEM_INSTALL_DIR@"
+=20
+diff --git a/config/config.mk.in b/config/config.mk.in
+index 303750bf5..d2f538666 100644
+--- a/config/config.mk.in
++++ b/config/config.mk.in
+@@ -12,7 +12,6 @@
+ # Variables corresponding to defines in config.hpp (YES, NO, or value)
+ MFEM_VERSION           =3D @MFEM_VERSION@
+ MFEM_VERSION_STRING    =3D @MFEM_VERSION_STRING@
+-MFEM_SOURCE_DIR        =3D @MFEM_SOURCE_DIR@
+ MFEM_INSTALL_DIR       =3D @MFEM_INSTALL_DIR@
+ MFEM_GIT_STRING        =3D @MFEM_GIT_STRING@
+ MFEM_USE_MPI           =3D @MFEM_USE_MPI@
+diff --git a/fem/ceed/interface/util.cpp b/fem/ceed/interface/util.cpp
+index d122c2ab5..f2bc900a5 100644
+--- a/fem/ceed/interface/util.cpp
++++ b/fem/ceed/interface/util.cpp
+@@ -257,20 +257,14 @@ const std::string &GetCeedPath()
+    if (ceed_path.empty())
+    {
+       const char *install_dir =3D MFEM_INSTALL_DIR "/include/mfem/fem/cee=
d";
+-      const char *source_dir =3D MFEM_SOURCE_DIR "/fem/ceed";
+       struct_stat m_stat;
+       if (stat(install_dir, &m_stat) =3D=3D 0 && S_ISDIR(m_stat.st_mode))
+       {
+          ceed_path =3D install_dir;
+       }
+-      else if (stat(source_dir, &m_stat) =3D=3D 0 && S_ISDIR(m_stat.st_mo=
de))
+-      {
+-         ceed_path =3D source_dir;
+-      }
+       else
+       {
+-         MFEM_ABORT("Cannot find libCEED kernels in MFEM_INSTALL_DIR or "
+-                    "MFEM_SOURCE_DIR");
++         MFEM_ABORT("Cannot find libCEED kernels in MFEM_INSTALL_DIR");
+       }
+       // Could be useful for debugging:
+       // out << "Using libCEED dir: " << ceed_path << std::endl;
+diff --git a/general/device.cpp b/general/device.cpp
+index ccee71cd7..a68ba7191 100644
+--- a/general/device.cpp
++++ b/general/device.cpp
+@@ -464,13 +464,9 @@ static void OccaDeviceSetup(const int dev)
+    {
+       mfemDir =3D MFEM_INSTALL_DIR "/include/mfem/";
+    }
+-   else if (occa::io::exists(MFEM_SOURCE_DIR))
+-   {
+-      mfemDir =3D MFEM_SOURCE_DIR;
+-   }
+    else
+    {
+-      MFEM_ABORT("Cannot find OCCA kernels in MFEM_INSTALL_DIR or MFEM_SO=
URCE_DIR");
++      MFEM_ABORT("Cannot find OCCA kernels in MFEM_INSTALL_DIR");
+    }
+=20
+    occa::io::addLibraryPath("mfem", mfemDir);
+--=20
+2.41.0
+

base-commit: fb9549164520ad993c2fbbaedc899844d57baabc
--=20
2.41.0






Information forwarded to guix-patches@HIDDEN:
bug#70056; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Mar 2024 14:20:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 28 10:20:27 2024
Received: from localhost ([127.0.0.1]:40879 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rpqcE-00057u-JB
	for submit <at> debbugs.gnu.org; Thu, 28 Mar 2024 10:20:27 -0400
Received: from lists.gnu.org ([2001:470:142::17]:45922)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <paul@HIDDEN>) id 1rpqcB-000578-P8
 for submit <at> debbugs.gnu.org; Thu, 28 Mar 2024 10:20:25 -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 <paul@HIDDEN>)
 id 1rpqc1-0007Ii-Aa
 for guix-patches@HIDDEN; Thu, 28 Mar 2024 10:20:15 -0400
Received: from mail-4022.proton.ch ([185.70.40.22])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <paul@HIDDEN>)
 id 1rpqbw-0007HK-Aw
 for guix-patches@HIDDEN; Thu, 28 Mar 2024 10:20:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com;
 s=protonmail3; t=1711635597; x=1711894797;
 bh=MZ9Jo0Gl+rmJ72HTCtCfkYe3fxSnX8RlGjNSaddl7TI=;
 h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=nomtVW0l10a4ZF0qPR/GiGqN7NGJk9wsCm5nBu5VjJLjh+FsjR0d4XAcj8XXg+7E3
 lMnEivqKJ1nz+l2uhhgHyDkqPqvQMBi/kPtCX9HSOewRfS2gtS6Lgr71gLYLBJpG9y
 XVWPoNvrST8Ximncc1uhYX3RgqpJ3lYkwfsz6l9LG6oQvQs7gE11nmMjL3P792GIQB
 RdmGcnMBbZlgQZxP/esQqfshgC0kP8RbUHdiGJ7ecVgTsI7s6F1aZvT167YX+88v6k
 uCdLLGqiCa6Z5T2T5vwlXpxiKRWBV20agXkg+uWOxxQxOzBrG3Fu2Iae0Zhii0+U51
 AFeQRXGPnWb/w==
Date: Thu, 28 Mar 2024 14:17:39 +0000
To: guix-patches@HIDDEN
From: "Paul A. Patience" <paul@HIDDEN>
Subject: [RFC PATCH] draft: gnu: Add mfem.
Message-ID: <adcc00db46287e4467c69bb102a7cb80e088724b.1711634614.git.paul@HIDDEN>
Feedback-ID: 19227857:user:proton
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=185.70.40.22; envelope-from=paul@HIDDEN;
 helo=mail-4022.proton.ch
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, WEIRD_PORT=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: "Paul A. Patience" <paul@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* gnu/packages/maths.scm (mfem): New variable.

Change-Id: Ida81f2b081a016e91426b68437909653020976f5
---
Hi,

I'm trying to package MFEM, but I get the following error while building:

--8<---------------cut here---------------start------------->8---
The following derivations will be built:
  /gnu/store/ibv1qjm24b2z4qsfhsw7q4izalcbb7rd-mfem-4.6.drv
  /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv
building /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv.=
..
Initialized empty Git repository in /gnu/store/dc5fx7xfg67fsvl5brdxnbgkirir=
qxd0-mfem-4.6-checkout/.git/
From https://github.com/mfem/mfem
 * tag               v4.6       -> FETCH_HEAD
warning: unable to access '//.config/git/ignore': Permission denied
warning: unable to access '//.config/git/attributes': Permission denied
warning: unable to access '//.config/git/ignore': Permission denied
Note: switching to 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to fals=
e

HEAD is now at 69fbae7 Merge pull request #3841 from mfem/mfem-4.6-dev
suspicious ownership or permission on `/gnu/store/dc5fx7xfg67fsvl5brdxnbgki=
rirqxd0-mfem-4.6-checkout'; rejecting this build output
build of /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv =
failed
View build log at '/var/log/guix/drvs/l0/df6d28w16dhnnpcr1qg26xvpmyrkqa-mfe=
m-4.6-checkout.drv.gz'.
cannot build derivation `/gnu/store/ibv1qjm24b2z4qsfhsw7q4izalcbb7rd-mfem-4=
.6.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/ibv1qjm24b2z4qsfhsw7q4izalcbb7rd-mf=
em-4.6.drv' failed
--8<---------------cut here---------------end--------------->8---

Basically it complains of suspicious ownership or permission.
I looked at the permissions of the contents of the repository when cloning =
it
manually, and nothing seems to be world-writable, as
nix/libstore/build.cc:2373 seems to be trying to protect against.

Regarding the Git warning at the top, I looked in the repository for any
references to Git attributes and ignore files, but did not find any.
I suspect it is looking for the .config directory in $HOME, but the variabl=
e
is unset, of course.

What's more, I tried with url-fetch, and it also results in suspicious
ownership or permission.

I'm at a loss as to what to do.

Can someone give me a hand?

Thanks,
Paul

 gnu/packages/maths.scm | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1b4d325649..5e81225947 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -151,6 +151,7 @@ (define-module (gnu packages maths)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
@@ -6890,6 +6891,53 @@ (define-public dealii-openmpi
             (delete 'unset-cpath)))))
     (synopsis "Finite element library (with MPI support)")))
=20
+(define-public mfem
+  (package
+    (name "mfem")
+    (version "4.6")
+    (source
+     (origin
+       ;; (method url-fetch)
+       ;; (uri (string-append "https://github.com/mfem/mfem/archive/refs/t=
ags/v"
+       ;;                     version ".tar.gz"))
+       ;; (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mfem/mfem")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0m57j5kd7glc8lfp5bdmmx4az4fs6lkqjwd970w4fx8gylxff3n9"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     (list graphviz doxygen perl))      ; documentation
+    (inputs
+     (list gfortran
+           gnutls
+           lapack
+           libunwind
+           metis
+           mpfr
+           netcdf
+           suitesparse-amd
+           suitesparse-btf
+           suitesparse-camd
+           suitesparse-ccolamd
+           suitesparse-cholmod
+           suitesparse-colamd
+           suitesparse-config
+           suitesparse-klu
+           suitesparse-umfpack
+           sundials
+           zlib))
+    (home-page "https://mfem.org/")
+    (synopsis "Finite element library")
+    (description "MFEM is a modular parallel C++ library for finite elemen=
t
+methods.  Its goal is to enable high-performance scalable finite element
+discretization research and application development on a wide variety of
+platforms, ranging from laptops to supercomputers.")
+    (license license:bsd-3)))
+
 (define-public flann
   (package
     (name "flann")

base-commit: fb9549164520ad993c2fbbaedc899844d57baabc
--=20
2.41.0






Acknowledgement sent to "Paul A. Patience" <paul@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#70056; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 2 Apr 2024 15:45:02 UTC

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