[PATCH] gnu: Add form.

  • Open
  • quality assurance status badge
Details
2 participants
  • Antero Mejr
  • Eric Bavier
Owner
unassigned
Submitted by
Antero Mejr
Severity
normal
A
A
Antero Mejr wrote on 23 Dec 2022 02:15
(address . guix-patches@gnu.org)(name . Antero Mejr)(address . antero@mailbox.org)
20221223011551.32708-1-antero@mailbox.org
* gnu/packages/maths.scm (form): New variable.
---
x86_64 only due to test failures on other platforms. Developers
say other platforms are not "tier 1" supported:

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

Toggle diff (65 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 050450e12c..08ddd2ecb4 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8161,3 +8161,58 @@ (define-public optizelle
provided for applications written in C++ and Python. Parallel
computation is supported via MPI.")
(license license:bsd-2))))
+
+(define-public form
+ (let ((commit "28e15eaf0856a0a012795298d6a4b570e764a8b1")
+ (revision "0"))
+ (package
+ (name "form")
+ (version (git-version "4.3.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/vermaseren/form")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04i932lqwng2hmknvai1gmmb5j17rwrhlj11nr96w9bmj4sq736x"))
+ (modules '((guix build utils)))
+ (snippet #~(substitute* "check/examples.frm"
+ (("#pend_if valgrind\\?")
+ "#pend_if 0")))))
+ (build-system gnu-build-system)
+ (native-inputs (list autoconf automake doxygen ruby))
+ (inputs (list bash openmpi))
+ (arguments
+ (list #:configure-flags #~(list "--enable-parform")
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-hardcoded-path
+ (lambda _
+ (substitute* "sources/extcmd.c"
+ (("/bin/sh")
+ (string-append #$(this-package-input "bash")
+ "/bin/sh")))))
+ (add-after 'build 'build-doxygen
+ (lambda _
+ (with-directory-excursion "doc/doxygen"
+ (invoke "make" "html"))))
+ (add-before 'check 'mpi-setup
+ #$%openmpi-setup)
+ (add-after 'install 'install-docs
+ (lambda _
+ (let ((doc (string-append #$output "/share/doc/"
+ #$name "-" #$version
+ "/html")))
+ (mkdir-p doc)
+ (copy-recursively "doc/doxygen/html" doc)))))))
+ (home-page "https://www.nikhef.nl/~form/maindir/maindir.html")
+ (synopsis "Symbolic manipulation system for very big expressions")
+ (description
+ "FORM is a symbolic manipulation system. It reads symbolic expressions
+from files and executes symbolic/algebraic transformations upon them. The
+answers are returned in a textual mathematical representation. The size of the
+considered expressions in FORM is only limited by the available disk space and
+not by the available RAM.")
+ (supported-systems '("x86_64-linux"))
+ (license license:gpl3+))))
--
2.38.1
E
E
Eric Bavier wrote on 9 Jan 19:01 +0100
92910915624cad61de6c1fc75cbe6ac2b8c6fe27.camel@posteo.net
Hello Antero,

Thank you for the patch. Sorry for the delayed reply, holidays and
such. I was able to apply your patch and build a form package.

A few comments:

On Fri, 2022-12-23 at 01:15 +0000, Antero Mejr wrote:
Toggle quote (6 lines)
> * gnu/packages/maths.scm (form): New variable.
> ---
> x86_64 only due to test failures on other platforms. Developers
> say other platforms are not "tier 1" supported:
> https://github.com/vermaseren/form/issues/426

This may be better as a comment near the `supported-systems` field,
along with a short summary of which tests fail on other systems.

Toggle quote (16 lines)
>
> gnu/packages/maths.scm | 55 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 55 insertions(+)
>
> diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
> index 050450e12c..08ddd2ecb4 100644
> --- a/gnu/packages/maths.scm
> +++ b/gnu/packages/maths.scm
> @@ -8161,3 +8161,58 @@ (define-public optizelle
> provided for applications written in C++ and Python. Parallel
> computation is supported via MPI.")
> (license license:bsd-2))))
> +
> +(define-public form
> + (let ((commit "28e15eaf0856a0a012795298d6a4b570e764a8b1")

This commit is downstream from the 4.3.0 release, so we should include
in a comment the rationale for not using just the 4.3.0 release
tarball.

Toggle quote (18 lines)
> + (revision "0"))
> + (package
> + (name "form")
> + (version (git-version "4.3.0" revision commit))
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/vermaseren/form")
> + (commit commit)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "04i932lqwng2hmknvai1gmmb5j17rwrhlj11nr96w9bmj4sq736x"))
> + (modules '((guix build utils)))
> + (snippet #~(substitute* "check/examples.frm"
> + (("#pend_if valgrind\\?")
> + "#pend_if 0")))))

This snippet appears to be related to the specifics of this package
build? E.g. if someone were to grab the source with `guix build -S
form`, they would not be able to have valgrind support, correct? If
that's the case, perhaps it would be better to apply this substitution
in a build phase.

Toggle quote (6 lines)
> + (build-system gnu-build-system)
> + (native-inputs (list autoconf automake doxygen ruby))
> + (inputs (list bash openmpi))
> + (arguments
> + (list #:configure-flags #~(list "--enable-parform")

For some other maths packages that have both a serial and MPI versions,
we've usually provided two packages. See e.g. `petsc` and `petsc-
openmpi`. This can be useful if someone does not need a full MPI-
capable version of form, and the separation is easily achieved.

Also, I see the default compilation flags include `-march=native`,
which will most likely cause a problem with build farm substitutes or
`guix challenge`. Could you figure out have to override these flags?
Guix usually assumes `SSE2` capabilities for x86_64 targets, iirc.
Bonus points for enabling a "tunable" package (c.f. "Package
Transformation Options").

Toggle quote (22 lines)
> + #:phases #~(modify-phases %standard-phases
> + (add-after 'unpack 'fix-hardcoded-path
> + (lambda _
> + (substitute* "sources/extcmd.c"
> + (("/bin/sh")
> + (string-append #$(this-package-input "bash")
> + "/bin/sh")))))
> + (add-after 'build 'build-doxygen
> + (lambda _
> + (with-directory-excursion "doc/doxygen"
> + (invoke "make" "html"))))
> + (add-before 'check 'mpi-setup
> + #$%openmpi-setup)
> + (add-after 'install 'install-docs
> + (lambda _
> + (let ((doc (string-append #$output "/share/doc/"
> + #$name "-" #$version
> + "/html")))
> + (mkdir-p doc)
> + (copy-recursively "doc/doxygen/html" doc)))))))
> + (home-page "https://www.nikhef.nl/~form/maindir/maindir.html")

Maybe we should use https://www.nikhef.nl/~form/instead? This is the
URL specified in the included manpage.

Toggle quote (10 lines)
> + (synopsis "Symbolic manipulation system for very big expressions")
> + (description
> + "FORM is a symbolic manipulation system. It reads symbolic expressions
> +from files and executes symbolic/algebraic transformations upon them. The
> +answers are returned in a textual mathematical representation. The size of the
> +considered expressions in FORM is only limited by the available disk space and
> +not by the available RAM.")
> + (supported-systems '("x86_64-linux"))
> + (license license:gpl3+))))

Thanks,
`~Eric
-----BEGIN PGP SIGNATURE-----

iQJGBAABCgAwFiEEo6S0GQB0CHyn3laYvEXKZ+L40AcFAmO8Vn0SHGJhdmllckBw
b3N0ZW8ubmV0AAoJELxFymfi+NAHUpwQAJwkC27XBHydtH34AqDU7FgE6q5p75sY
JaHfs+JrCEzU8nQqfMx0HErVokmQ1BL4pYaWoXxZwcKLspTsoFmVtIFb00ZUZar0
/jK5nbzjdpCruq+3VwX4yGHooe4KL+whsc1XpbDPrdemKa0NinJZNDRqFE1KptHy
mBm9fVDjUojPdrbWe/Fk/e8Hn65+zz9Ue/n4prPK2DPv73Kryh2WoC+8fYeAjPU/
W95ozHDLneQzsbmE2W9ofgwtJpxZu0N3tQti++9QblYjoCwH7YCCM8l04FkMjNKl
9PoiCOlrv3Ak33MmiRm2qZ9CEq2vu+JFdXMcdwTU8wXwyWzCVH285IOft6HH8FE0
Y7eIKO+7YaojUpRE692ziRLMvTiMTtWbW5lo5o5Ge3yyXz7a22yAcO0VOWG66EeG
vvuKsdwXMf+r2YAhaUkZo2Z5sYt1JEFl+ESMmJMSGQowW/QagVTJTaZTFEeO6Ag4
EM3z/e0lQTNKCwlTK+u1IfQBx0vFxiKsAUs2ySx6EPxdCJPeEZRe9iJJu7vfuP1i
QrYNhZ/JeQSZ09wJX5OugnqwpJUNxUoRctwxO2S0t6576nvYAUB1uErdXSjcsVSJ
EFhg0Sv5MsSsOCjcKNzPOOevT+fX14Llz1OtREUOfP4X3Cvnx+FWaZhZ5L1FNRsD
8seOIr9ABapd
=0vQ5
-----END PGP SIGNATURE-----


?