[PATCH 0/1] gnu: Add gromacs.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Vincent Legoll
Owner
unassigned
Submitted by
Vincent Legoll
Severity
normal

Debbugs page

Vincent Legoll wrote 5 years ago
(address . guix-patches@gnu.org)
b248e42f-39a6-1863-f35c-5b7027dd3974@gmail.com
Hello,

following this is a patch to add gromacs.

Description & synopsis taken from nix (hello Tobias)

Linted, indent-code.el passed, and built OK with 2 rounds.

Not sure if we want more cmake flags.

problems reported by cmake:

-- Found Doxygen:
/gnu/store/k6albjaxkybsgshqyw6g44f5hz75l7q6-doxygen-1.8.15/bin/doxygen
(found version "1.8.15") found components: doxygen missing components: dot

-- Could NOT find Sphinx: Found unsuitable version "-real 2.3.1", but
required is at least "1.6.1" (found
/gnu/store/anyhb84x3mvyp11sbhmdnicbsa42m3x0-python-sphinx-2.3.1/bin/sphinx-build)

--
Vincent Legoll
Vincent Legoll wrote 5 years ago
[PATCH] gnu: Add gromacs.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200417222444.11115-1-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (gromacs): New variable.
---
gnu/packages/bioinformatics.scm | 39 +++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index b9be0c1918..f0fca30dd8 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -785,6 +786,44 @@ input/output delimiter. When the new functionality is not used, bioawk is
intended to behave exactly the same as the original BWK awk.")
(license license:x11)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1kwrk3i1dxp8abhqqsl049lh361n4910h0415g052f8shdc6arp1"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on")))
+ (native-inputs
+ `(("doxygen" ,doxygen) ; need dot
+ ("python-sphinx" ,python-sphinx))) ; problem reported by cmake
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("imagemagick" ,imagemagick)
+ ("lapack" ,lapack)
+ ("openblas" ,openblas)
+ ("openmpi" ,openmpi)
+ ("perl" ,perl)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Vincent Legoll wrote 5 years ago
Re: gromacs - WIP, submitted
(address . 40691@debbugs.gnu.org)
062db5ae-0377-8483-28ed-886dd97f33fc@gmail.com
And now I see I've copy/pasted the fftwf input when
I probably should have put one of the other fftws...

WDYT ?
Ludovic Courtès wrote 5 years ago
Re: [bug#40691] [PATCH 0/1] gnu: Add gromacs.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87k12b15ki.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (4 lines)
> following this is a patch to add gromacs.
>
> Description & synopsis taken from nix (hello Tobias)

Heheh. :-)

Toggle quote (2 lines)
> Not sure if we want more cmake flags.

Could you add a comment explaining the reason for this flag?

Toggle quote (7 lines)
> problems reported by cmake:
>
> -- Found Doxygen:
> /gnu/store/k6albjaxkybsgshqyw6g44f5hz75l7q6-doxygen-1.8.15/bin/doxygen
> (found version "1.8.15") found components: doxygen missing
> components: dot

Perhaps add ‘graphviz’ as a native input?

Toggle quote (4 lines)
> -- Could NOT find Sphinx: Found unsuitable version "-real 2.3.1", but
> required is at least "1.6.1" (found
> /gnu/store/anyhb84x3mvyp11sbhmdnicbsa42m3x0-python-sphinx-2.3.1/bin/sphinx-build)

Oh, looks like it’s looking at argv[0] and the script is wrapped. :-/
Can you somehow for CMake to think it’s fine, either with a flag or by
skipping the relevant check in ‘CMakeLists.txt’?

Thanks,
Ludo’.
Vincent Legoll wrote 5 years ago
Re: [bug#40691] [PATCH v2 1/1] gnu: Add gromacs.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40691@debbugs.gnu.org)
36e8a145-1ca8-c380-9864-dbf8b1fd53cb@gmail.com
Hello,

On 20/04/2020 00:19, Ludovic Courtès wrote:
Toggle quote (2 lines)
> Could you add a comment explaining the reason for this flag?

Done, it'to build test executables.

Toggle quote (9 lines)
>> problems reported by cmake:
>>
>> -- Found Doxygen:
>> /gnu/store/k6albjaxkybsgshqyw6g44f5hz75l7q6-doxygen-1.8.15/bin/doxygen
>> (found version "1.8.15") found components: doxygen missing
>> components: dot
>
> Perhaps add ‘graphviz’ as a native input?

Yep, that fixed it

Toggle quote (8 lines)
>> -- Could NOT find Sphinx: Found unsuitable version "-real 2.3.1", but
>> required is at least "1.6.1" (found
>> /gnu/store/anyhb84x3mvyp11sbhmdnicbsa42m3x0-python-sphinx-2.3.1/bin/sphinx-build)
>
> Oh, looks like it’s looking at argv[0] and the script is wrapped. :-/
> Can you somehow for CMake to think it’s fine, either with a flag or by
> skipping the relevant check in ‘CMakeLists.txt’?

Done, passing the version to cmake & adding pygments to inputs made it
pass.

Thanks for the help

How's the attached v2 ?

--
Vincent Legoll
From 650247f97a56f2967d068ee8b1911fae6412ce4d Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Sat, 18 Apr 2020 00:14:56 +0200
Subject: [PATCH] gnu: Add gromacs.

* gnu/packages/bioinformatics.scm (gromacs): New variable.
---
gnu/packages/bioinformatics.scm | 47 +++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)

Toggle diff (74 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index b9be0c1918..1b643e29c8 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -79,6 +80,7 @@
#:use-module (gnu packages golang)
#:use-module (gnu packages glib)
#:use-module (gnu packages graph)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages groff)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
@@ -785,6 +787,51 @@ input/output delimiter. When the new functionality is not used, bioawk is
intended to behave exactly the same as the original BWK awk.")
(license license:x11)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1kwrk3i1dxp8abhqqsl049lh361n4910h0415g052f8shdc6arp1"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
+ ;; Workaround for cmake/FindSphinx.cmake version parsing that does
+ ;; not understand the guix-wrapped `sphinx-build --version' answer
+ (string-append "-DSPHINX_EXECUTABLE_VERSION="
+ ,(package-version python-sphinx)))))
+ (native-inputs
+ `(("doxygen" ,doxygen)
+ ("graphviz" ,graphviz)
+ ("python" ,python)
+ ("python-pygments" ,python-pygments)
+ ("python-sphinx" ,python-sphinx)))
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("imagemagick" ,imagemagick)
+ ("lapack" ,lapack)
+ ("openblas" ,openblas)
+ ("openmpi" ,openmpi)
+ ("perl" ,perl)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Ludovic Courtès wrote 5 years ago
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87y2qnv8da.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (7 lines)
> From 650247f97a56f2967d068ee8b1911fae6412ce4d Mon Sep 17 00:00:00 2001
> From: Vincent Legoll <vincent.legoll@gmail.com>
> Date: Sat, 18 Apr 2020 00:14:56 +0200
> Subject: [PATCH] gnu: Add gromacs.
>
> * gnu/packages/bioinformatics.scm (gromacs): New variable.

This v2 looks alright to me, but I got this test failure on x86_64:

Toggle snippet (42 lines)
Start 13: HardwareUnitTests
13/52 Test #13: HardwareUnitTests ...................***Failed 0.04 sec
[==========] Running 5 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 1 test from CpuInfoTest
[ RUN ] CpuInfoTest.SupportLevel
[ OK ] CpuInfoTest.SupportLevel (0 ms)
[----------] 1 test from CpuInfoTest (0 ms total)

[----------] 4 tests from HardwareTopologyTest
[ RUN ] HardwareTopologyTest.Execute
[ OK ] HardwareTopologyTest.Execute (6 ms)
[ RUN ] HardwareTopologyTest.HwlocExecute
/tmp/guix-build-gromacs-2020.1.drv-0/gromacs-2020.1/src/gromacs/hardware/tests/hardwaretopology.cpp:88: Failure
Expected: (hwTop.supportLevel()) >= (gmx::HardwareTopology::SupportLevel::Basic), actual: 4-byte object <01-00 00-00> vs 4-byte object <02-00 00-00>
Cannot determine basic hardware topology from hwloc. GROMACS will still

work, but it might affect your performance for large nodes.
Please mail gmx-developers@gromacs.org so we can try to fix it.
[ FAILED ] HardwareTopologyTest.HwlocExecute (5 ms)
[ RUN ] HardwareTopologyTest.ProcessorSelfconsistency
[ OK ] HardwareTopologyTest.ProcessorSelfconsistency (6 ms)
[ RUN ] HardwareTopologyTest.NumaCacheSelfconsistency
[ OK ] HardwareTopologyTest.NumaCacheSelfconsistency (5 ms)
[----------] 4 tests from HardwareTopologyTest (22 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 2 test cases ran. (22 ms total)
[ PASSED ] 4 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] HardwareTopologyTest.HwlocExecute

1 FAILED TEST

[…]

The following tests FAILED:
13 - HardwareUnitTests (Failed)
Errors while running CTest
make: *** [Makefile:99: test] Error 8

Could you check what the test is doing?

It may be reasonable to just skip it.

Thanks,
Ludo’.
Vincent Legoll wrote 5 years ago
Re: [bug#40691] [PATCH v3 1/1] gnu: Add gromacs.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40691@debbugs.gnu.org)
d957d49d-2ce0-6e84-e1e1-28deb838b6fc@gmail.com
On 22/04/2020 17:38, Ludovic Courtès wrote:

Toggle quote (47 lines)
> This v2 looks alright to me, but I got this test failure on x86_64:
>
> --8<---------------cut here---------------start------------->8---
> Start 13: HardwareUnitTests
> 13/52 Test #13: HardwareUnitTests ...................***Failed 0.04 sec
> [==========] Running 5 tests from 2 test cases.
> [----------] Global test environment set-up.
> [----------] 1 test from CpuInfoTest
> [ RUN ] CpuInfoTest.SupportLevel
> [ OK ] CpuInfoTest.SupportLevel (0 ms)
> [----------] 1 test from CpuInfoTest (0 ms total)
>
> [----------] 4 tests from HardwareTopologyTest
> [ RUN ] HardwareTopologyTest.Execute
> [ OK ] HardwareTopologyTest.Execute (6 ms)
> [ RUN ] HardwareTopologyTest.HwlocExecute
> /tmp/guix-build-gromacs-2020.1.drv-0/gromacs-2020.1/src/gromacs/hardware/tests/hardwaretopology.cpp:88: Failure
> Expected: (hwTop.supportLevel()) >= (gmx::HardwareTopology::SupportLevel::Basic), actual: 4-byte object <01-00 00-00> vs 4-byte object <02-00 00-00>
> Cannot determine basic hardware topology from hwloc. GROMACS will still
>
> work, but it might affect your performance for large nodes.
> Please mail gmx-developers@gromacs.org so we can try to fix it.
> [ FAILED ] HardwareTopologyTest.HwlocExecute (5 ms)
> [ RUN ] HardwareTopologyTest.ProcessorSelfconsistency
> [ OK ] HardwareTopologyTest.ProcessorSelfconsistency (6 ms)
> [ RUN ] HardwareTopologyTest.NumaCacheSelfconsistency
> [ OK ] HardwareTopologyTest.NumaCacheSelfconsistency (5 ms)
> [----------] 4 tests from HardwareTopologyTest (22 ms total)
>
> [----------] Global test environment tear-down
> [==========] 5 tests from 2 test cases ran. (22 ms total)
> [ PASSED ] 4 tests.
> [ FAILED ] 1 test, listed below:
> [ FAILED ] HardwareTopologyTest.HwlocExecute
>
> 1 FAILED TEST
>
> […]
>
> The following tests FAILED:
> 13 - HardwareUnitTests (Failed)
> Errors while running CTest
> make: *** [Makefile:99: test] Error 8
> --8<---------------cut here---------------end--------------->8---
>
> Could you check what the test is doing?

I think it tries to get CPU topology from the linux kernel,
which is not particularly useful to test on a build server,
the package may run on completely different hardware.

Toggle quote (2 lines)
> It may be reasonable to just skip it.

Hope you don't mind trading a test suite failure for a (harmless)
test suite build warning...

How's the crude disabling in the attached patch v3 look to you ?

And does it fix the failure ?
This test is not failing here (kvm on ryzen).

--
Vincent Legoll
From 660371d5a3e7c7c763fc123357ddd6c31f730553 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Sat, 18 Apr 2020 00:14:56 +0200
Subject: [PATCH] gnu: Add gromacs.

* gnu/packages/bioinformatics.scm (gromacs): New variable.
---
gnu/packages/bioinformatics.scm | 56 +++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index b9be0c1918..62647d6146 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -79,6 +80,7 @@
#:use-module (gnu packages golang)
#:use-module (gnu packages glib)
#:use-module (gnu packages graph)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages groff)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
@@ -785,6 +787,60 @@ input/output delimiter. When the new functionality is not used, bioawk is
intended to behave exactly the same as the original BWK awk.")
(license license:x11)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1kwrk3i1dxp8abhqqsl049lh361n4910h0415g052f8shdc6arp1"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
+ ;; Workaround for cmake/FindSphinx.cmake version parsing that does
+ ;; not understand the guix-wrapped `sphinx-build --version' answer
+ (string-append "-DSPHINX_EXECUTABLE_VERSION="
+ ,(package-version python-sphinx)))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-hwloc-test
+ (lambda _
+ ;; This test warns about the build host hardware
+ (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
+ (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
+ "void __guix_disabled()"))
+ #t)))))
+ (native-inputs
+ `(("doxygen" ,doxygen)
+ ("graphviz" ,graphviz)
+ ("python" ,python)
+ ("python-pygments" ,python-pygments)
+ ("python-sphinx" ,python-sphinx)))
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("imagemagick" ,imagemagick)
+ ("lapack" ,lapack)
+ ("openblas" ,openblas)
+ ("openmpi" ,openmpi)
+ ("perl" ,perl)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Ludovic Courtès wrote 5 years ago
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87lfmmnfn0.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (10 lines)
>> It may be reasonable to just skip it.
>
> Hope you don't mind trading a test suite failure for a (harmless)
> test suite build warning...
>
> How's the crude disabling in the attached patch v3 look to you ?
>
> And does it fix the failure ?
> This test is not failing here (kvm on ryzen).

Oh that’s guix-daemon inside QEMU/KVM? Then what can happen, unlike on
real hardware, is that hwloc doesn’t discrepancies between the actual
number of cores and the info it gathers from /sys or whatever.

Toggle quote (7 lines)
> From 660371d5a3e7c7c763fc123357ddd6c31f730553 Mon Sep 17 00:00:00 2001
> From: Vincent Legoll <vincent.legoll@gmail.com>
> Date: Sat, 18 Apr 2020 00:14:56 +0200
> Subject: [PATCH] gnu: Add gromacs.
>
> * gnu/packages/bioinformatics.scm (gromacs): New variable.

[...]

Toggle quote (7 lines)
> + (add-after 'unpack 'disable-hwloc-test
> + (lambda _
> + ;; This test warns about the build host hardware
> + (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
> + (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
> + "void __guix_disabled()"))

I was thinking it’d be nice to use whatever mechanism gtest has to mark
a test as skipped but I didn’t find anything, so it’s probably OK like
this.

However, there’s another issue I hadn’t noticed (apologies!):
src/external bundles a few things like googletest, tinyxml2, zlib
(indirectly), etc.

Could you check if we can use our own dependencies instead of the
bundled ones?

For gtest it’s good if we can unpack the source of our ‘googletest’
package in place of the bundled copy, but it’s optional (I think there
are cases where we found this wasn’t possible for some reason).

Thank you!

Ludo’.
Vincent Legoll wrote 5 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40691@debbugs.gnu.org)
dae7912d-dab0-517b-0370-f6dc9d402ee8@gmail.com
Hello,

On 23/04/2020 21:52, Ludovic Courtès wrote:
Toggle quote (7 lines)
> However, there’s another issue I hadn’t noticed (apologies!):
> src/external bundles a few things like googletest, tinyxml2, zlib
> (indirectly), etc.
>
> Could you check if we can use our own dependencies instead of the
> bundled ones?

I'm working on it but it is not trivial, some of the bundled versions
are old enough that guix's are not compatible with the code using them.

I'm trying to get some fixes upstream for that.

Toggle quote (4 lines)
> For gtest it’s good if we can unpack the source of our ‘googletest’
> package in place of the bundled copy, but it’s optional (I think there
> are cases where we found this wasn’t possible for some reason).

I'll try to fix this one also.

--
Vincent Legoll
Ludovic Courtès wrote 5 years ago
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87v9le794o.fsf@gnu.org
Hi,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (13 lines)
> On 23/04/2020 21:52, Ludovic Courtès wrote:
>> However, there’s another issue I hadn’t noticed (apologies!):
>> src/external bundles a few things like googletest, tinyxml2, zlib
>> (indirectly), etc.
>>
>> Could you check if we can use our own dependencies instead of the
>> bundled ones?
>
> I'm working on it but it is not trivial, some of the bundled versions
> are old enough that guix's are not compatible with the code using them.
>
> I'm trying to get some fixes upstream for that.

Awesome, let us know how it goes.

Toggle quote (6 lines)
>> For gtest it’s good if we can unpack the source of our ‘googletest’
>> package in place of the bundled copy, but it’s optional (I think there
>> are cases where we found this wasn’t possible for some reason).
>
> I'll try to fix this one also.

Thank you!

Ludo’.
Vincent Legoll wrote 5 years ago
Re: [bug#40691] [PATCH v4 0/3] gnu: Add gromacs, tng & lmfit.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40691@debbugs.gnu.org)
5ff814d6-e0da-f5c9-8ae1-29cf40f87702@gmail.com
Hello,

here is my latest work on adding gromacs to guix.

- rebased on latest guix master
- gromacs had a new version
- unbundling 3rdparties
- packaged some 3rdparties to have our own

I unbundled googletest by extracting our tarball in
place of the bundled copy.

Zlib got unbundled via packaging tng and unbundling
it from there.

Unbundled lmfit by packaging it separately and using that.
I put it with gromacs, but its legitimate place may be
elsewhere, like in maths.scm.

Unbundled tinyxml2 to use our version, which is newer and
broke code compatibility, so I added a patch to fix the
fallout. I am trying to get those fixes upstream, but that
may not be always practical, they may want to keep their
well tested version. I'll follow up updating the patch in
case parts of it get applied / released upstream.

The remaining bundled 3rdparties are vmd_molfile & thread_mpi.

Vmd_molfile source is behind a registration-only web form, I'm
not going there.

Thread_mpi looks like it is made to be bundled like that, and
is part of the parallelizing of gromacs which is above my
level of understanding (I'm only trying to package it, I'm not
a user). More info here:

Latest license change for tng say "revised bsd", I don't know
which one to choose, I put bsd-3.


Lmfit is freebsd license, I choose bsd-2.


Gromacs itself is lgpl2.1+ and its copying file has bundled
3parties license explanations.


Please advise how to proceed further, this is already quite an
adventure for me.

--
Vincent Legoll
Vincent Legoll wrote 5 years ago
[PATCH 1/3] gnu: Add tng.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200502134815.13390-1-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (tng): New variable.
---
gnu/packages/bioinformatics.scm | 36 +++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 65b44568e0..f90401a560 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -785,6 +786,41 @@ input/output delimiter. When the new functionality is not used, bioawk is
intended to behave exactly the same as the original BWK awk.")
(license license:x11)))
+(define-public tng
+ (package
+ (name "tng")
+ (version "1.8.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gromacs/tng.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1apf2n8nb34z09xarj7k4jgriq283l769sakjmj5aalpbilvai4q"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("zlib" ,zlib)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-bundled-zlib
+ (lambda _
+ (delete-file-recursively "external")
+ #t))
+ (replace 'check
+ (lambda _
+ (invoke "../build/bin/tests/tng_testing")
+ #t)))))
+ (home-page "https://github.com/gromacs/tng")
+ (synopsis "Trajectory Next Generation binary format manipulation library")
+ (description "TRAJNG (Trajectory next generation) is a program library for
+handling molecular dynamics (MD) trajectories. It can store coordinates, and
+optionally velocities and the H-matrix. Coordinates and velocities are
+stored with user-specified precision.")
+ (license license:bsd-3)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Vincent Legoll wrote 5 years ago
[PATCH 2/3] gnu: Add lmfit.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200502134815.13390-2-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (lmfit): New variable.
---
gnu/packages/bioinformatics.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index f90401a560..02eae3b589 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -821,6 +821,30 @@ optionally velocities and the H-matrix. Coordinates and velocities are
stored with user-specified precision.")
(license license:bsd-3)))
+(define-public lmfit
+ (package
+ (name "lmfit")
+ (version "8.2.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://jugit.fz-juelich.de/mlz/lmfit.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "00bch77a6qgnw6vzsjn2a42n8n683ih3xm0wpr454jxa15hw78vf"))))
+ (build-system cmake-build-system)
+ (native-inputs
+ `(("perl" ,perl))) ; for pod2man
+ (home-page "https://jugit.fz-juelich.de/mlz/lmfit")
+ (synopsis "C library for Levenberg-Marquardt minimization and least-squares
+fitting.")
+ (description "lmfit is a C library for Levenberg-Marquardt least-squares
+minimization and curve fitting. It is mature code, based on decades-old
+algorithms from the FORTRAN library MINPACK.")
+ (license license:bsd-2)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Vincent Legoll wrote 5 years ago
[PATCH 3/3] gnu: Add gromacs.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200502134815.13390-3-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (gromacs): New variable.
* gnu/packages/patches/gromacs-tinyxml2.patch: New file...
* gnu/local.mk (dist_patch_DATA): ...add it here.
---
gnu/local.mk | 1 +
gnu/packages/bioinformatics.scm | 84 +++++++++++++++++++++
gnu/packages/patches/gromacs-tinyxml2.patch | 50 ++++++++++++
3 files changed, 135 insertions(+)
create mode 100644 gnu/packages/patches/gromacs-tinyxml2.patch

Toggle diff (172 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 812253b192..70e8879284 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1004,6 +1004,7 @@ dist_patch_DATA = \
%D%/packages/patches/gpsbabel-qstring.patch \
%D%/packages/patches/grantlee-merge-theme-dirs.patch \
%D%/packages/patches/grep-timing-sensitive-test.patch \
+ %D%/packages/patches/gromacs-tinyxml2.patch \
%D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \
%D%/packages/patches/grub-efi-fat-serial-number.patch \
%D%/packages/patches/gsl-test-i686.patch \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 02eae3b589..0727d1bac8 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -80,6 +80,7 @@
#:use-module (gnu packages golang)
#:use-module (gnu packages glib)
#:use-module (gnu packages graph)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages groff)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
@@ -845,6 +846,89 @@ minimization and curve fitting. It is mature code, based on decades-old
algorithms from the FORTRAN library MINPACK.")
(license license:bsd-2)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl"))
+ (patches (search-patches "gromacs-tinyxml2.patch"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
+ ; Unbundling
+ "-DGMX_USE_LMFIT=EXTERNAL"
+ "-DGMX_EXTERNAL_TNG=on"
+ "-DGMX_EXTERNAL_ZLIB=on"
+ "-DGMX_EXTERNAL_TINYXML2=on"
+ (string-append "-DTinyXML2_DIR="
+ (assoc-ref %build-inputs "tinyxml2"))
+ ;; Workaround for cmake/FindSphinx.cmake version parsing that does
+ ;; not understand the guix-wrapped `sphinx-build --version' answer
+ (string-append "-DSPHINX_EXECUTABLE_VERSION="
+ ,(package-version python-sphinx)))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fixes
+ (lambda* (#:key inputs #:allow-other-keys)
+ ; The following has been submitted upstream
+ (substitute* "src/testutils/CMakeLists.txt"
+ (("target_link_libraries\\(testutils \\$")
+ "target_link_libraries(testutils PRIVATE $"))
+ ; Unbundling
+; (delete-file-recursively "src/external/vmd_molfile")
+ (delete-file-recursively "src/external/lmfit")
+ (delete-file-recursively "src/external/clFFT")
+ (delete-file-recursively "src/external/fftpack")
+ (delete-file-recursively "src/external/build-fftw")
+; (delete-file-recursively "src/external/thread_mpi")
+ (delete-file-recursively "src/external/tng_io")
+ (delete-file-recursively "src/external/tinyxml2")
+ (delete-file-recursively "src/external/googletest")
+ (copy-recursively (assoc-ref inputs "googletest-source")
+ "src/external/googletest")
+ ;; This test warns about the build host hardware, disable
+ (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
+ (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
+ "void __guix_disabled()"))
+ #t)))))
+ (native-inputs
+ `(("doxygen" ,doxygen)
+ ("googletest-source" ,(package-source googletest))
+ ("graphviz" ,graphviz)
+ ("pkg-config" ,pkg-config)
+ ("python" ,python)
+ ("python-pygments" ,python-pygments)
+ ("python-sphinx" ,python-sphinx)))
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("imagemagick" ,imagemagick)
+ ("lapack" ,lapack)
+ ("lmfit" ,lmfit)
+ ("openblas" ,openblas)
+ ("openmpi" ,openmpi)
+ ("perl" ,perl)
+ ("tinyxml2" ,tinyxml2)
+ ("tng" ,tng)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
diff --git a/gnu/packages/patches/gromacs-tinyxml2.patch b/gnu/packages/patches/gromacs-tinyxml2.patch
new file mode 100644
index 0000000000..3dace595d2
--- /dev/null
+++ b/gnu/packages/patches/gromacs-tinyxml2.patch
@@ -0,0 +1,50 @@
+diff -ruN gromacs-2020.2/src/testutils/CMakeLists.txt gromacs-2020.2-fixed/src/testutils/CMakeLists.txt
+--- gromacs-2020.2/src/testutils/CMakeLists.txt 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/CMakeLists.txt 2020-05-01 22:52:16.356000000 +0200
+@@ -73,7 +73,7 @@
+
+ if(HAVE_TINYXML2)
+ include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
+- target_link_libraries(testutils ${TinyXML2_LIBRARIES})
++ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+ else()
+ include_directories(BEFORE SYSTEM "../external/tinyxml2")
+ endif()
+diff -ruN gromacs-2020.2/src/testutils/refdata_xml.cpp gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp
+--- gromacs-2020.2/src/testutils/refdata_xml.cpp 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp 2020-05-01 23:17:09.556000000 +0200
+@@ -206,21 +206,12 @@
+ document.LoadFile(path.c_str());
+ if (document.Error())
+ {
+- const char* errorStr1 = document.GetErrorStr1();
+- const char* errorStr2 = document.GetErrorStr2();
++ const char* errorStr = document.ErrorStr();
+ std::string errorString("Error was ");
+- if (errorStr1)
+- {
+- errorString += errorStr1;
+- }
+- if (errorStr2)
+- {
+- errorString += errorStr2;
+- }
+- if (!errorStr1 && !errorStr2)
+- {
++ if (errorStr)
++ errorString += errorStr;
++ else
+ errorString += "not specified.";
+- }
+ GMX_THROW(TestException("Reference data not parsed successfully: " + path + "\n."
+ + errorString + "\n"));
+ }
+@@ -371,7 +362,7 @@
+ XMLElementPtr rootElement = createRootElement(&document);
+ createChildElements(rootElement, rootEntry);
+
+- if (document.SaveFile(path.c_str()) != tinyxml2::XML_NO_ERROR)
++ if (document.SaveFile(path.c_str()) != tinyxml2::XML_SUCCESS)
+ {
+ GMX_THROW(TestException("Reference data saving failed in " + path));
+ }
--
2.26.0
Vincent Legoll wrote 5 years ago
Re: [PATCH v4 0/3]: Add gromacs.
(address . 40691@debbugs.gnu.org)
0d82c5ad-a371-bdce-f435-957c7840f786@gmail.com
I'll fix the lint warnings (and check indentation) then resend, but
after getting feedback / fixing what's needed.
Vincent Legoll wrote 5 years ago
[PATCH 1/3] gnu: Add tng.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200502164325.2028-1-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (tng): New variable.
---
gnu/packages/bioinformatics.scm | 36 +++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 65b44568e0..f90401a560 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -785,6 +786,41 @@ input/output delimiter. When the new functionality is not used, bioawk is
intended to behave exactly the same as the original BWK awk.")
(license license:x11)))
+(define-public tng
+ (package
+ (name "tng")
+ (version "1.8.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gromacs/tng.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1apf2n8nb34z09xarj7k4jgriq283l769sakjmj5aalpbilvai4q"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("zlib" ,zlib)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-bundled-zlib
+ (lambda _
+ (delete-file-recursively "external")
+ #t))
+ (replace 'check
+ (lambda _
+ (invoke "../build/bin/tests/tng_testing")
+ #t)))))
+ (home-page "https://github.com/gromacs/tng")
+ (synopsis "Trajectory Next Generation binary format manipulation library")
+ (description "TRAJNG (Trajectory next generation) is a program library for
+handling molecular dynamics (MD) trajectories. It can store coordinates, and
+optionally velocities and the H-matrix. Coordinates and velocities are
+stored with user-specified precision.")
+ (license license:bsd-3)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Vincent Legoll wrote 5 years ago
[PATCH 2/3] gnu: Add lmfit.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200502164325.2028-2-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (lmfit): New variable.
---
gnu/packages/bioinformatics.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index f90401a560..1e3e145500 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -821,6 +821,30 @@ optionally velocities and the H-matrix. Coordinates and velocities are
stored with user-specified precision.")
(license license:bsd-3)))
+(define-public lmfit
+ (package
+ (name "lmfit")
+ (version "8.2.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://jugit.fz-juelich.de/mlz/lmfit.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "00bch77a6qgnw6vzsjn2a42n8n683ih3xm0wpr454jxa15hw78vf"))))
+ (build-system cmake-build-system)
+ (native-inputs
+ `(("perl" ,perl))) ; for pod2man
+ (home-page "https://jugit.fz-juelich.de/mlz/lmfit")
+ (synopsis "C library for Levenberg-Marquardt minimization and least-squares
+fitting")
+ (description "lmfit is a C library for Levenberg-Marquardt least-squares
+minimization and curve fitting. It is mature code, based on decades-old
+algorithms from the FORTRAN library MINPACK.")
+ (license license:bsd-2)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
--
2.26.0
Vincent Legoll wrote 5 years ago
[PATCH 3/3] gnu: Add gromacs.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200502164325.2028-3-vincent.legoll@gmail.com
* gnu/packages/bioinformatics.scm (gromacs): New variable.
* gnu/packages/patches/gromacs-tinyxml2.patch: New file...
* gnu/local.mk (dist_patch_DATA): ...add it here.
---
gnu/local.mk | 1 +
gnu/packages/bioinformatics.scm | 84 +++++++++++++++++++++
gnu/packages/patches/gromacs-tinyxml2.patch | 50 ++++++++++++
3 files changed, 135 insertions(+)
create mode 100644 gnu/packages/patches/gromacs-tinyxml2.patch

Toggle diff (172 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 812253b192..70e8879284 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1004,6 +1004,7 @@ dist_patch_DATA = \
%D%/packages/patches/gpsbabel-qstring.patch \
%D%/packages/patches/grantlee-merge-theme-dirs.patch \
%D%/packages/patches/grep-timing-sensitive-test.patch \
+ %D%/packages/patches/gromacs-tinyxml2.patch \
%D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \
%D%/packages/patches/grub-efi-fat-serial-number.patch \
%D%/packages/patches/gsl-test-i686.patch \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 1e3e145500..13d9c16c10 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -80,6 +80,7 @@
#:use-module (gnu packages golang)
#:use-module (gnu packages glib)
#:use-module (gnu packages graph)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages groff)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
@@ -845,6 +846,89 @@ minimization and curve fitting. It is mature code, based on decades-old
algorithms from the FORTRAN library MINPACK.")
(license license:bsd-2)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl"))
+ (patches (search-patches "gromacs-tinyxml2.patch"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
+ ; Unbundling
+ "-DGMX_USE_LMFIT=EXTERNAL"
+ "-DGMX_BUILD_OWN_FFTW=off"
+ "-DGMX_EXTERNAL_BLAS=on"
+ "-DGMX_EXTERNAL_LAPACK=on"
+ "-DGMX_EXTERNAL_TNG=on"
+ "-DGMX_EXTERNAL_ZLIB=on"
+ "-DGMX_EXTERNAL_TINYXML2=on"
+ (string-append "-DTinyXML2_DIR="
+ (assoc-ref %build-inputs "tinyxml2"))
+ ;; Workaround for cmake/FindSphinx.cmake version parsing that does
+ ;; not understand the guix-wrapped `sphinx-build --version' answer
+ (string-append "-DSPHINX_EXECUTABLE_VERSION="
+ ,(package-version python-sphinx)))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fixes
+ (lambda* (#:key inputs #:allow-other-keys)
+ ; The following has been submitted upstream
+ (substitute* "src/testutils/CMakeLists.txt"
+ (("target_link_libraries\\(testutils \\$")
+ "target_link_libraries(testutils PRIVATE $"))
+ ; Unbundling
+; (delete-file-recursively "src/external/vmd_molfile")
+ (delete-file-recursively "src/external/lmfit")
+ (delete-file-recursively "src/external/clFFT")
+ (delete-file-recursively "src/external/fftpack")
+ (delete-file-recursively "src/external/build-fftw")
+; (delete-file-recursively "src/external/thread_mpi")
+ (delete-file-recursively "src/external/tng_io")
+ (delete-file-recursively "src/external/tinyxml2")
+ (delete-file-recursively "src/external/googletest")
+ (copy-recursively (assoc-ref inputs "googletest-source")
+ "src/external/googletest")
+ ;; This test warns about the build host hardware, disable
+ (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
+ (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
+ "void __guix_disabled()"))
+ #t)))))
+ (native-inputs
+ `(("doxygen" ,doxygen)
+ ("googletest-source" ,(package-source googletest))
+ ("graphviz" ,graphviz)
+ ("pkg-config" ,pkg-config)
+ ("python" ,python)
+ ("python-pygments" ,python-pygments)
+ ("python-sphinx" ,python-sphinx)))
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("lmfit" ,lmfit)
+ ("openblas" ,openblas)
+ ("perl" ,perl)
+ ("tinyxml2" ,tinyxml2)
+ ("tng" ,tng)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public python-pybedtools
(package
(name "python-pybedtools")
diff --git a/gnu/packages/patches/gromacs-tinyxml2.patch b/gnu/packages/patches/gromacs-tinyxml2.patch
new file mode 100644
index 0000000000..3dace595d2
--- /dev/null
+++ b/gnu/packages/patches/gromacs-tinyxml2.patch
@@ -0,0 +1,50 @@
+diff -ruN gromacs-2020.2/src/testutils/CMakeLists.txt gromacs-2020.2-fixed/src/testutils/CMakeLists.txt
+--- gromacs-2020.2/src/testutils/CMakeLists.txt 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/CMakeLists.txt 2020-05-01 22:52:16.356000000 +0200
+@@ -73,7 +73,7 @@
+
+ if(HAVE_TINYXML2)
+ include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
+- target_link_libraries(testutils ${TinyXML2_LIBRARIES})
++ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+ else()
+ include_directories(BEFORE SYSTEM "../external/tinyxml2")
+ endif()
+diff -ruN gromacs-2020.2/src/testutils/refdata_xml.cpp gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp
+--- gromacs-2020.2/src/testutils/refdata_xml.cpp 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp 2020-05-01 23:17:09.556000000 +0200
+@@ -206,21 +206,12 @@
+ document.LoadFile(path.c_str());
+ if (document.Error())
+ {
+- const char* errorStr1 = document.GetErrorStr1();
+- const char* errorStr2 = document.GetErrorStr2();
++ const char* errorStr = document.ErrorStr();
+ std::string errorString("Error was ");
+- if (errorStr1)
+- {
+- errorString += errorStr1;
+- }
+- if (errorStr2)
+- {
+- errorString += errorStr2;
+- }
+- if (!errorStr1 && !errorStr2)
+- {
++ if (errorStr)
++ errorString += errorStr;
++ else
+ errorString += "not specified.";
+- }
+ GMX_THROW(TestException("Reference data not parsed successfully: " + path + "\n."
+ + errorString + "\n"));
+ }
+@@ -371,7 +362,7 @@
+ XMLElementPtr rootElement = createRootElement(&document);
+ createChildElements(rootElement, rootEntry);
+
+- if (document.SaveFile(path.c_str()) != tinyxml2::XML_NO_ERROR)
++ if (document.SaveFile(path.c_str()) != tinyxml2::XML_SUCCESS)
+ {
+ GMX_THROW(TestException("Reference data saving failed in " + path));
+ }
--
2.26.0
Vincent Legoll wrote 5 years ago
Fwd: Re: [PATCH v5 0/3] gnu: Add gromacs.
(address . 40691@debbugs.gnu.org)
cf2494b0-074c-9c3c-75f5-b5a543306c59@gmail.com
should have come before the last batch...

-------- Forwarded Message --------
Subject: Re: [PATCH v5 0/3] gnu: Add gromacs.
Date: Sat, 2 May 2020 18:43:11 +0200
From: Vincent Legoll <vincent.legoll@gmail.com>
To: Vincent Legoll <vincent.legoll@gmail.com>

- Removed unused inputs
- tightened bundled 3rdparty usage by adding more
cmake params
- fixed lint warning
- fixed one of the indent-code.el snippet (ignored
the other ones as they make the comments look wrong)
Ludovic Courtès wrote 5 years ago
Re: [bug#40691] [PATCH v4 0/3] gnu: Add gromacs, tng & lmfit.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87y2q91evv.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (24 lines)
> here is my latest work on adding gromacs to guix.
>
> - rebased on latest guix master
> - gromacs had a new version
> - unbundling 3rdparties
> - packaged some 3rdparties to have our own
>
> I unbundled googletest by extracting our tarball in
> place of the bundled copy.
>
> Zlib got unbundled via packaging tng and unbundling
> it from there.
>
> Unbundled lmfit by packaging it separately and using that.
> I put it with gromacs, but its legitimate place may be
> elsewhere, like in maths.scm.
>
> Unbundled tinyxml2 to use our version, which is newer and
> broke code compatibility, so I added a patch to fix the
> fallout. I am trying to get those fixes upstream, but that
> may not be always practical, they may want to keep their
> well tested version. I'll follow up updating the patch in
> case parts of it get applied / released upstream.

Woow, quite an achievement! Thanks for taking the time to go down this
rabbit hole, I think it’s worth it.

Toggle quote (5 lines)
> The remaining bundled 3rdparties are vmd_molfile & thread_mpi.
>
> Vmd_molfile source is behind a registration-only web form, I'm
> not going there.

Sounds reasonable: the headers say it’s part of Gromacs, and it’s
definitely free software, so it’s OK to keep it here.

Toggle quote (6 lines)
> Thread_mpi looks like it is made to be bundled like that, and
> is part of the parallelizing of gromacs which is above my
> level of understanding (I'm only trying to package it, I'm not
> a user). More info here:
> http://www.gromacs.org/Documentation/Acceleration_and_parallelization#Multithreading_with_thread-MPI

Sounds good. Perhaps a comment in the code to state that would be
welcome, for our future selves.

Toggle quote (17 lines)
> Latest license change for tng say "revised bsd", I don't know
> which one to choose, I put bsd-3.
>
> https://github.com/gromacs/tng/commit/65443992d81a8845ba3597620d84e8652e83a254
>
> Lmfit is freebsd license, I choose bsd-2.
>
> https://jugit.fz-juelich.de/mlz/lmfit/-/blob/master/COPYING
>
> Gromacs itself is lgpl2.1+ and its copying file has bundled
> 3parties license explanations.
>
> https://github.com/gromacs/gromacs/blob/master/COPYING
>
> Please advise how to proceed further, this is already quite an
> adventure for me.

I’ll look at the individual patches but it looks like we’re close to the
end line!

Ludo’.
Ludovic Courtès wrote 5 years ago
Re: [bug#40691] [PATCH 1/3] gnu: Add tng.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87tv0x1etb.fsf@gnu.org
Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/bioinformatics.scm (tng): New variable.

[...]

Toggle quote (3 lines)
> + (description "TRAJNG (Trajectory next generation) is a program library for
> +handling molecular dynamics (MD) trajectories. It can store coordinates, and

I’d rather put it in chemistry.scm, next to ‘nmoldyn’, which seems to do
a similar job. WDYT?

Otherwise LGTM!

Ludo’.
Ludovic Courtès wrote 5 years ago
Re: [bug#40691] [PATCH 2/3] gnu: Add lmfit.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87pnbl1eoz.fsf@gnu.org
Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/bioinformatics.scm (lmfit): New variable.

[...]

Toggle quote (4 lines)
> + (synopsis "C library for Levenberg-Marquardt minimization and least-squares
> +fitting")

Perhaps remove “C Library for” to make it more concise.

What about moving it to algebra.scm, next to Eigen & co.?

Otherwise LGTM!

Ludo’.
Ludovic Courtès wrote 5 years ago
Re: [bug#40691] [PATCH 3/3] gnu: Add gromacs.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691@debbugs.gnu.org)
87lfm91ek3.fsf@gnu.org
Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (4 lines)
> * gnu/packages/bioinformatics.scm (gromacs): New variable.
> * gnu/packages/patches/gromacs-tinyxml2.patch: New file...
> * gnu/local.mk (dist_patch_DATA): ...add it here.

I wonder if chemistry.scm would be more appropriate, WDYT?

Toggle quote (4 lines)
> --- /dev/null
> +++ b/gnu/packages/patches/gromacs-tinyxml2.patch
> @@ -0,0 +1,50 @@

Could you add one or two sentences at the top of the file explaining
what it does and what its upstream status is? It’s not obvious why the
reference data needs to be adjusted as a consequence of unbundling
tinyxml2.

That’s it!

Could you send updated patches? I’ll be happy to commit them. :-)

Thank you for all the work!

Ludo’.
Vincent Legoll wrote 5 years ago
Re: [bug#40691] [PATCH v6 0/3] gnu: Add gromacs, tng & lmfit.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40691@debbugs.gnu.org)
aacb9fad-5901-7907-92f6-e5bcef2b7248@gmail.com
Hello Ludo,

I removed the leftover scm code that was duplicating what is now
in the patch, and added a patch header explaining what's going on.

Toggle quote (6 lines)
>> Vmd_molfile source is behind a registration-only web form, I'm
>> not going there.
>
> Sounds reasonable: the headers say it’s part of Gromacs, and it’s
> definitely free software, so it’s OK to keep it here.

Added comment.

Toggle quote (8 lines)
>> Thread_mpi looks like it is made to be bundled like that, and
>> is part of the parallelizing of gromacs which is above my
>> level of understanding (I'm only trying to package it, I'm not
>> a user). More info here:
>
> Sounds good. Perhaps a comment in the code to state that would be
> welcome, for our future selves.

Added comment.

Put tng & gromacs in chemistry.scm, in fact gromacs sci domain is
chemistry, even if also used in bioinfo. Added more comments for
patch & still bundled 3rdparties.

Moved lmfit to algebra.scm, shortened synopsis.

I think I fixed all review comments.

Thanks, patches follow.

--
Vincent Legoll
Vincent Legoll wrote 5 years ago
[PATCH 1/3] gnu: Add tng.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200503223240.16408-1-vincent.legoll@gmail.com
* gnu/packages/chemistry.scm (tng): New variable.
---
gnu/packages/chemistry.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index 855ae2df22..5b21e3309c 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -300,6 +301,41 @@ is currently not actively maintained and works only with Python 2 and
NumPy < 1.9.")
(license license:cecill)))
+(define-public tng
+ (package
+ (name "tng")
+ (version "1.8.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gromacs/tng.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1apf2n8nb34z09xarj7k4jgriq283l769sakjmj5aalpbilvai4q"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("zlib" ,zlib)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-bundled-zlib
+ (lambda _
+ (delete-file-recursively "external")
+ #t))
+ (replace 'check
+ (lambda _
+ (invoke "../build/bin/tests/tng_testing")
+ #t)))))
+ (home-page "https://github.com/gromacs/tng")
+ (synopsis "Trajectory Next Generation binary format manipulation library")
+ (description "TRAJNG (Trajectory next generation) is a program library for
+handling molecular dynamics (MD) trajectories. It can store coordinates, and
+optionally velocities and the H-matrix. Coordinates and velocities are
+stored with user-specified precision.")
+ (license license:bsd-3)))
+
(define-public openbabel
(package
(name "openbabel")
--
2.26.0
Vincent Legoll wrote 5 years ago
[PATCH 2/3] gnu: Add lmfit.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200503223240.16408-2-vincent.legoll@gmail.com
* gnu/packages/algebra.scm (lmfit): New variable.
---
gnu/packages/algebra.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 34fb9ee4fd..d4f66d2ffd 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -913,6 +914,29 @@ Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
(license license:bsd-2)))
+(define-public lmfit
+ (package
+ (name "lmfit")
+ (version "8.2.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://jugit.fz-juelich.de/mlz/lmfit.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "00bch77a6qgnw6vzsjn2a42n8n683ih3xm0wpr454jxa15hw78vf"))))
+ (build-system cmake-build-system)
+ (native-inputs
+ `(("perl" ,perl))) ; for pod2man
+ (home-page "https://jugit.fz-juelich.de/mlz/lmfit")
+ (synopsis "Levenberg-Marquardt minimization and least-squares fitting")
+ (description "lmfit is a C library for Levenberg-Marquardt least-squares
+minimization and curve fitting. It is mature code, based on decades-old
+algorithms from the FORTRAN library MINPACK.")
+ (license license:bsd-2)))
+
(define-public eigen
(package
(name "eigen")
--
2.26.0
Vincent Legoll wrote 5 years ago
[PATCH 3/3] gnu: Add gromacs.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200503223240.16408-3-vincent.legoll@gmail.com
* gnu/packages/chemistry.scm (gromacs): New variable.
* gnu/packages/patches/gromacs-tinyxml2.patch: New file...
* gnu/local.mk (dist_patch_DATA): ...add it here.
---
gnu/local.mk | 1 +
gnu/packages/chemistry.scm | 86 +++++++++++++++++++++
gnu/packages/patches/gromacs-tinyxml2.patch | 67 ++++++++++++++++
3 files changed, 154 insertions(+)
create mode 100644 gnu/packages/patches/gromacs-tinyxml2.patch

Toggle diff (191 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3c9a10b6bc..827e186501 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1006,6 +1006,7 @@ dist_patch_DATA = \
%D%/packages/patches/gpsbabel-qstring.patch \
%D%/packages/patches/grantlee-merge-theme-dirs.patch \
%D%/packages/patches/grep-timing-sensitive-test.patch \
+ %D%/packages/patches/gromacs-tinyxml2.patch \
%D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \
%D%/packages/patches/grub-efi-fat-serial-number.patch \
%D%/packages/patches/gsl-test-i686.patch \
diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index 5b21e3309c..42368cb482 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -33,6 +33,7 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages documentation)
#:use-module (gnu packages gl)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages gv)
#:use-module (gnu packages maths)
#:use-module (gnu packages pkg-config)
@@ -336,6 +337,91 @@ optionally velocities and the H-matrix. Coordinates and velocities are
stored with user-specified precision.")
(license license:bsd-3)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl"))
+ ;; Our version of tinyxml2 is far newer than the bundled one and
+ ;; require fixing `testutils' code. See patch header for more info
+ (patches (search-patches "gromacs-tinyxml2.patch"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
+ ;; Unbundling
+ "-DGMX_USE_LMFIT=EXTERNAL"
+ "-DGMX_BUILD_OWN_FFTW=off"
+ "-DGMX_EXTERNAL_BLAS=on"
+ "-DGMX_EXTERNAL_LAPACK=on"
+ "-DGMX_EXTERNAL_TNG=on"
+ "-DGMX_EXTERNAL_ZLIB=on"
+ "-DGMX_EXTERNAL_TINYXML2=on"
+ (string-append "-DTinyXML2_DIR="
+ (assoc-ref %build-inputs "tinyxml2"))
+ ;; Workaround for cmake/FindSphinx.cmake version parsing that does
+ ;; not understand the guix-wrapped `sphinx-build --version' answer
+ (string-append "-DSPHINX_EXECUTABLE_VERSION="
+ ,(package-version python-sphinx)))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fixes
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Still bundled: part of gromacs, source behind registration
+ ;; but free software anyways
+ ;;(delete-file-recursively "src/external/vmd_molfile")
+ ;; Still bundled: threads-based OpenMPI-compatible fallback
+ ;; designed to be bundled like that
+ ;;(delete-file-recursively "src/external/thread_mpi")
+ ;; Unbundling
+ (delete-file-recursively "src/external/lmfit")
+ (delete-file-recursively "src/external/clFFT")
+ (delete-file-recursively "src/external/fftpack")
+ (delete-file-recursively "src/external/build-fftw")
+ (delete-file-recursively "src/external/tng_io")
+ (delete-file-recursively "src/external/tinyxml2")
+ (delete-file-recursively "src/external/googletest")
+ (copy-recursively (assoc-ref inputs "googletest-source")
+ "src/external/googletest")
+ ;; This test warns about the build host hardware, disable
+ (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
+ (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
+ "void __guix_disabled()"))
+ #t)))))
+ (native-inputs
+ `(("doxygen" ,doxygen)
+ ("googletest-source" ,(package-source googletest))
+ ("graphviz" ,graphviz)
+ ("pkg-config" ,pkg-config)
+ ("python" ,python)
+ ("python-pygments" ,python-pygments)
+ ("python-sphinx" ,python-sphinx)))
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("lmfit" ,lmfit)
+ ("openblas" ,openblas)
+ ("perl" ,perl)
+ ("tinyxml2" ,tinyxml2)
+ ("tng" ,tng)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public openbabel
(package
(name "openbabel")
diff --git a/gnu/packages/patches/gromacs-tinyxml2.patch b/gnu/packages/patches/gromacs-tinyxml2.patch
new file mode 100644
index 0000000000..cc7d7459a8
--- /dev/null
+++ b/gnu/packages/patches/gromacs-tinyxml2.patch
@@ -0,0 +1,67 @@
+Unbundling tinyxml2 from gromacs and using our own, which is newer, broke gromacs
+build.
+
+This patch fixes three issues:
+
+- cmake now errors out if using multiple target_link_libraries with mixed styles
+ of signatures.
+
+- Error handling API changed, fix the testutils/refdata_xml.cpp code by using the
+ new API: document.ErrorStr() & tinyxml2::XML_SUCCESS.
+
+Those fixes will be submitted for inclusion to upstream, but may not be suitable
+there as long as they still keep the old version bundled.
+
+First hunk has already been requested for merging. Third is in discussion. Second
+will only be sent if third is OK'ed.
+
+diff -ruN gromacs-2020.2/src/testutils/CMakeLists.txt gromacs-2020.2-fixed/src/testutils/CMakeLists.txt
+--- gromacs-2020.2/src/testutils/CMakeLists.txt 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/CMakeLists.txt 2020-05-01 22:52:16.356000000 +0200
+@@ -73,7 +73,7 @@
+
+ if(HAVE_TINYXML2)
+ include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
+- target_link_libraries(testutils ${TinyXML2_LIBRARIES})
++ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+ else()
+ include_directories(BEFORE SYSTEM "../external/tinyxml2")
+ endif()
+diff -ruN gromacs-2020.2/src/testutils/refdata_xml.cpp gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp
+--- gromacs-2020.2/src/testutils/refdata_xml.cpp 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp 2020-05-01 23:17:09.556000000 +0200
+@@ -206,21 +206,12 @@
+ document.LoadFile(path.c_str());
+ if (document.Error())
+ {
+- const char* errorStr1 = document.GetErrorStr1();
+- const char* errorStr2 = document.GetErrorStr2();
++ const char* errorStr = document.ErrorStr();
+ std::string errorString("Error was ");
+- if (errorStr1)
+- {
+- errorString += errorStr1;
+- }
+- if (errorStr2)
+- {
+- errorString += errorStr2;
+- }
+- if (!errorStr1 && !errorStr2)
+- {
++ if (errorStr)
++ errorString += errorStr;
++ else
+ errorString += "not specified.";
+- }
+ GMX_THROW(TestException("Reference data not parsed successfully: " + path + "\n."
+ + errorString + "\n"));
+ }
+@@ -371,7 +362,7 @@
+ XMLElementPtr rootElement = createRootElement(&document);
+ createChildElements(rootElement, rootEntry);
+
+- if (document.SaveFile(path.c_str()) != tinyxml2::XML_NO_ERROR)
++ if (document.SaveFile(path.c_str()) != tinyxml2::XML_SUCCESS)
+ {
+ GMX_THROW(TestException("Reference data saving failed in " + path));
+ }
--
2.26.0
Vincent Legoll wrote 5 years ago
(address . 40691@debbugs.gnu.org)
ad751c6e-f814-3618-af7e-43e0cf652739@gmail.com
Will resend this one, as I forgot to amend the missing module inclusions
due to the move from bioinformatics.scm.
Vincent Legoll wrote 5 years ago
[PATCH] gnu: Add gromacs.
(address . 40691@debbugs.gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20200503223936.16554-1-vincent.legoll@gmail.com
* gnu/packages/chemistry.scm (gromacs): New variable.
* gnu/packages/patches/gromacs-tinyxml2.patch: New file...
* gnu/local.mk (dist_patch_DATA): ...add it here.
---
gnu/local.mk | 1 +
gnu/packages/chemistry.scm | 90 +++++++++++++++++++++
gnu/packages/patches/gromacs-tinyxml2.patch | 67 +++++++++++++++
3 files changed, 158 insertions(+)
create mode 100644 gnu/packages/patches/gromacs-tinyxml2.patch

Toggle diff (204 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3c9a10b6bc..827e186501 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1006,6 +1006,7 @@ dist_patch_DATA = \
%D%/packages/patches/gpsbabel-qstring.patch \
%D%/packages/patches/grantlee-merge-theme-dirs.patch \
%D%/packages/patches/grep-timing-sensitive-test.patch \
+ %D%/packages/patches/gromacs-tinyxml2.patch \
%D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \
%D%/packages/patches/grub-efi-fat-serial-number.patch \
%D%/packages/patches/gsl-test-i686.patch \
diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index 5b21e3309c..0540dfceb6 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -30,15 +30,20 @@
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages boost)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages documentation)
#:use-module (gnu packages gl)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages gv)
#:use-module (gnu packages maths)
+ #:use-module (gnu packages mpi)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
+ #:use-module (gnu packages sphinx)
#:use-module (gnu packages xml)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -336,6 +341,91 @@ optionally velocities and the H-matrix. Coordinates and velocities are
stored with user-specified precision.")
(license license:bsd-3)))
+(define-public gromacs
+ (package
+ (name "gromacs")
+ (version "2020.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ftp.gromacs.org/pub/gromacs/gromacs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1wyjgcdl30wy4hy6jvi9lkq53bqs9fgfq6fri52dhnb3c76y8rbl"))
+ ;; Our version of tinyxml2 is far newer than the bundled one and
+ ;; require fixing `testutils' code. See patch header for more info
+ (patches (search-patches "gromacs-tinyxml2.patch"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "-DGMX_DEVELOPER_BUILD=on" ; Needed to run tests
+ ;; Unbundling
+ "-DGMX_USE_LMFIT=EXTERNAL"
+ "-DGMX_BUILD_OWN_FFTW=off"
+ "-DGMX_EXTERNAL_BLAS=on"
+ "-DGMX_EXTERNAL_LAPACK=on"
+ "-DGMX_EXTERNAL_TNG=on"
+ "-DGMX_EXTERNAL_ZLIB=on"
+ "-DGMX_EXTERNAL_TINYXML2=on"
+ (string-append "-DTinyXML2_DIR="
+ (assoc-ref %build-inputs "tinyxml2"))
+ ;; Workaround for cmake/FindSphinx.cmake version parsing that does
+ ;; not understand the guix-wrapped `sphinx-build --version' answer
+ (string-append "-DSPHINX_EXECUTABLE_VERSION="
+ ,(package-version python-sphinx)))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fixes
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Still bundled: part of gromacs, source behind registration
+ ;; but free software anyways
+ ;;(delete-file-recursively "src/external/vmd_molfile")
+ ;; Still bundled: threads-based OpenMPI-compatible fallback
+ ;; designed to be bundled like that
+ ;;(delete-file-recursively "src/external/thread_mpi")
+ ;; Unbundling
+ (delete-file-recursively "src/external/lmfit")
+ (delete-file-recursively "src/external/clFFT")
+ (delete-file-recursively "src/external/fftpack")
+ (delete-file-recursively "src/external/build-fftw")
+ (delete-file-recursively "src/external/tng_io")
+ (delete-file-recursively "src/external/tinyxml2")
+ (delete-file-recursively "src/external/googletest")
+ (copy-recursively (assoc-ref inputs "googletest-source")
+ "src/external/googletest")
+ ;; This test warns about the build host hardware, disable
+ (substitute* "src/gromacs/hardware/tests/hardwaretopology.cpp"
+ (("TEST\\(HardwareTopologyTest, HwlocExecute\\)")
+ "void __guix_disabled()"))
+ #t)))))
+ (native-inputs
+ `(("doxygen" ,doxygen)
+ ("googletest-source" ,(package-source googletest))
+ ("graphviz" ,graphviz)
+ ("pkg-config" ,pkg-config)
+ ("python" ,python)
+ ("python-pygments" ,python-pygments)
+ ("python-sphinx" ,python-sphinx)))
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("hwloc" ,hwloc-2 "lib")
+ ("lmfit" ,lmfit)
+ ("openblas" ,openblas)
+ ("perl" ,perl)
+ ("tinyxml2" ,tinyxml2)
+ ("tng" ,tng)))
+ (home-page "http://www.gromacs.org/")
+ (synopsis "Molecular dynamics software package")
+ (description "GROMACS is a versatile package to perform molecular dynamics,
+i.e. simulate the Newtonian equations of motion for systems with hundreds to
+millions of particles. It is primarily designed for biochemical molecules like
+proteins, lipids and nucleic acids that have a lot of complicated bonded
+interactions, but since GROMACS is extremely fast at calculating the nonbonded
+interactions (that usually dominate simulations) many groups are also using it
+for research on non-biological systems, e.g. polymers. GROMACS supports all the
+usual algorithms you expect from a modern molecular dynamics implementation.")
+ (license license:lgpl2.1+)))
+
(define-public openbabel
(package
(name "openbabel")
diff --git a/gnu/packages/patches/gromacs-tinyxml2.patch b/gnu/packages/patches/gromacs-tinyxml2.patch
new file mode 100644
index 0000000000..cc7d7459a8
--- /dev/null
+++ b/gnu/packages/patches/gromacs-tinyxml2.patch
@@ -0,0 +1,67 @@
+Unbundling tinyxml2 from gromacs and using our own, which is newer, broke gromacs
+build.
+
+This patch fixes three issues:
+
+- cmake now errors out if using multiple target_link_libraries with mixed styles
+ of signatures.
+
+- Error handling API changed, fix the testutils/refdata_xml.cpp code by using the
+ new API: document.ErrorStr() & tinyxml2::XML_SUCCESS.
+
+Those fixes will be submitted for inclusion to upstream, but may not be suitable
+there as long as they still keep the old version bundled.
+
+First hunk has already been requested for merging. Third is in discussion. Second
+will only be sent if third is OK'ed.
+
+diff -ruN gromacs-2020.2/src/testutils/CMakeLists.txt gromacs-2020.2-fixed/src/testutils/CMakeLists.txt
+--- gromacs-2020.2/src/testutils/CMakeLists.txt 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/CMakeLists.txt 2020-05-01 22:52:16.356000000 +0200
+@@ -73,7 +73,7 @@
+
+ if(HAVE_TINYXML2)
+ include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
+- target_link_libraries(testutils ${TinyXML2_LIBRARIES})
++ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+ else()
+ include_directories(BEFORE SYSTEM "../external/tinyxml2")
+ endif()
+diff -ruN gromacs-2020.2/src/testutils/refdata_xml.cpp gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp
+--- gromacs-2020.2/src/testutils/refdata_xml.cpp 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp 2020-05-01 23:17:09.556000000 +0200
+@@ -206,21 +206,12 @@
+ document.LoadFile(path.c_str());
+ if (document.Error())
+ {
+- const char* errorStr1 = document.GetErrorStr1();
+- const char* errorStr2 = document.GetErrorStr2();
++ const char* errorStr = document.ErrorStr();
+ std::string errorString("Error was ");
+- if (errorStr1)
+- {
+- errorString += errorStr1;
+- }
+- if (errorStr2)
+- {
+- errorString += errorStr2;
+- }
+- if (!errorStr1 && !errorStr2)
+- {
++ if (errorStr)
++ errorString += errorStr;
++ else
+ errorString += "not specified.";
+- }
+ GMX_THROW(TestException("Reference data not parsed successfully: " + path + "\n."
+ + errorString + "\n"));
+ }
+@@ -371,7 +362,7 @@
+ XMLElementPtr rootElement = createRootElement(&document);
+ createChildElements(rootElement, rootEntry);
+
+- if (document.SaveFile(path.c_str()) != tinyxml2::XML_NO_ERROR)
++ if (document.SaveFile(path.c_str()) != tinyxml2::XML_SUCCESS)
+ {
+ GMX_THROW(TestException("Reference data saving failed in " + path));
+ }
--
2.26.0
Ludovic Courtès wrote 5 years ago
Re: [bug#40691] [PATCH v6 0/3] gnu: Add gromacs, tng & lmfit.
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 40691-done@debbugs.gnu.org)
87k11st7ni.fsf@gnu.org
Hi Vincent,

Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (26 lines)
>>> Vmd_molfile source is behind a registration-only web form, I'm
>>> not going there.
>>
>> Sounds reasonable: the headers say it’s part of Gromacs, and it’s
>> definitely free software, so it’s OK to keep it here.
>
> Added comment.
>
>>> Thread_mpi looks like it is made to be bundled like that, and
>>> is part of the parallelizing of gromacs which is above my
>>> level of understanding (I'm only trying to package it, I'm not
>>> a user). More info here:
>>
>> Sounds good. Perhaps a comment in the code to state that would be
>> welcome, for our future selves.
>
> Added comment.
>
> Put tng & gromacs in chemistry.scm, in fact gromacs sci domain is
> chemistry, even if also used in bioinfo. Added more comments for
> patch & still bundled 3rdparties.
>
> Moved lmfit to algebra.scm, shortened synopsis.
>
> I think I fixed all review comments.

Thanks a lot, applied! (Will push shortly.)

Ludo’.
Closed
Vincent Legoll wrote 5 years ago
Upstream patches are being merged
(address . 40691@debbugs.gnu.org)
92f2572a-7660-b4c4-69e6-cca5ec9b4c82@gmail.com
Hello,

the first hunk the the gromacs patch has been merged, and they are
interested in the remaining bits, I'll work with them to that end,
and update guix package accordingly.


--
Vincent Legoll
?
Your comment

This issue is archived.

To comment on this conversation send an email to 40691@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 40691
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help