GNU bug report logs - #40691
[PATCH 0/1] gnu: Add gromacs.

Previous Next

Package: guix-patches;

Reported by: Vincent Legoll <vincent.legoll <at> gmail.com>

Date: Fri, 17 Apr 2020 22:24:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40691 in the body.
You can then email your comments to 40691 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Fri, 17 Apr 2020 22:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincent Legoll <vincent.legoll <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 17 Apr 2020 22:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/1] gnu: Add gromacs.
Date: Sat, 18 Apr 2020 00:22:54 +0200
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




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Fri, 17 Apr 2020 22:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH] gnu: Add gromacs.
Date: Sat, 18 Apr 2020 00:24:44 +0200
* gnu/packages/bioinformatics.scm (gromacs): New variable.
---
 gnu/packages/bioinformatics.scm | 39 +++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

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 <at> gnu.org>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Fri, 17 Apr 2020 22:49:01 GMT) Full text and rfc822 format available.

Message #11 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Subject: Re: gromacs - WIP, submitted
Date: Sat, 18 Apr 2020 00:48:01 +0200
And now I see I've copy/pasted the fftwf input when
I probably should have put one of the other fftws...

WDYT ?




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 19 Apr 2020 22:21:01 GMT) Full text and rfc822 format available.

Message #14 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH 0/1] gnu: Add gromacs.
Date: Mon, 20 Apr 2020 00:19:57 +0200
Hi Vincent,

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

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

Heheh.  :-)

> Not sure if we want more cmake flags.

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

> 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?

> -- 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Mon, 20 Apr 2020 22:16:02 GMT) Full text and rfc822 format available.

Message #17 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v2 1/1] gnu: Add gromacs.
Date: Tue, 21 Apr 2020 00:15:05 +0200
[Message part 1 (text/plain, inline)]
Hello,

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

Done, it'to build test executables.

>> 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

>> -- 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


[0001-gnu-Add-gromacs.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Wed, 22 Apr 2020 15:39:01 GMT) Full text and rfc822 format available.

Message #20 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v2 1/1] gnu: Add gromacs.
Date: Wed, 22 Apr 2020 17:38:09 +0200
Hi Vincent,

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

> From 650247f97a56f2967d068ee8b1911fae6412ce4d Mon Sep 17 00:00:00 2001
> From: Vincent Legoll <vincent.legoll <at> 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:

--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 <at> 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?

It may be reasonable to just skip it.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Thu, 23 Apr 2020 13:08:01 GMT) Full text and rfc822 format available.

Message #23 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v3 1/1] gnu: Add gromacs.
Date: Thu, 23 Apr 2020 15:07:42 +0200
[Message part 1 (text/plain, inline)]
On 22/04/2020 17:38, Ludovic Courtès wrote:

> 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 <at> 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.

> 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
[0001-gnu-Add-gromacs.v3.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Thu, 23 Apr 2020 19:54:02 GMT) Full text and rfc822 format available.

Message #26 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v3 1/1] gnu: Add gromacs.
Date: Thu, 23 Apr 2020 21:52:51 +0200
Hi Vincent,

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

>> 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.

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

[...]

> +         (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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Fri, 01 May 2020 22:31:02 GMT) Full text and rfc822 format available.

Message #29 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v3 1/1] gnu: Add gromacs.
Date: Sat, 2 May 2020 00:30:35 +0200
Hello,

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.

> 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




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 13:36:02 GMT) Full text and rfc822 format available.

Message #32 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v3 1/1] gnu: Add gromacs.
Date: Sat, 02 May 2020 15:35:03 +0200
Hi,

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

> 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.

>> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 13:47:02 GMT) Full text and rfc822 format available.

Message #35 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v4 0/3] gnu: Add gromacs, tng & lmfit.
Date: Sat, 2 May 2020 15:46:49 +0200
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:
http://www.gromacs.org/Documentation/Acceleration_and_parallelization#Multithreading_with_thread-MPI

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.

-- 
Vincent Legoll




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 13:49:01 GMT) Full text and rfc822 format available.

Message #38 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 1/3] gnu: Add tng.
Date: Sat,  2 May 2020 15:48:13 +0200
* gnu/packages/bioinformatics.scm (tng): New variable.
---
 gnu/packages/bioinformatics.scm | 36 +++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

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 <at> gnu.org>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 13:49:02 GMT) Full text and rfc822 format available.

Message #41 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 2/3] gnu: Add lmfit.
Date: Sat,  2 May 2020 15:48:14 +0200
* gnu/packages/bioinformatics.scm (lmfit): New variable.
---
 gnu/packages/bioinformatics.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 13:49:02 GMT) Full text and rfc822 format available.

Message #44 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 3/3] gnu: Add gromacs.
Date: Sat,  2 May 2020 15:48:15 +0200
* 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

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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 13:55:02 GMT) Full text and rfc822 format available.

Message #47 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Subject: Re: [PATCH v4 0/3]: Add gromacs.
Date: Sat, 2 May 2020 15:53:40 +0200
I'll fix the lint warnings (and check indentation) then resend, but
after getting feedback / fixing what's needed.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 16:45:01 GMT) Full text and rfc822 format available.

Message #50 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 1/3] gnu: Add tng.
Date: Sat,  2 May 2020 18:43:23 +0200
* gnu/packages/bioinformatics.scm (tng): New variable.
---
 gnu/packages/bioinformatics.scm | 36 +++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

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 <at> gnu.org>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 16:45:01 GMT) Full text and rfc822 format available.

Message #53 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 2/3] gnu: Add lmfit.
Date: Sat,  2 May 2020 18:43:24 +0200
* gnu/packages/bioinformatics.scm (lmfit): New variable.
---
 gnu/packages/bioinformatics.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 16:45:02 GMT) Full text and rfc822 format available.

Message #56 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 3/3] gnu: Add gromacs.
Date: Sat,  2 May 2020 18:43:25 +0200
* 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

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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sat, 02 May 2020 17:05:02 GMT) Full text and rfc822 format available.

Message #59 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Subject: Fwd: Re: [PATCH v5 0/3] gnu: Add gromacs.
Date: Sat, 2 May 2020 19:03:54 +0200
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 <at> gmail.com>
To: Vincent Legoll <vincent.legoll <at> 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)




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 10:40:02 GMT) Full text and rfc822 format available.

Message #62 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v4 0/3] gnu: Add gromacs, tng & lmfit.
Date: Sun, 03 May 2020 12:39:32 +0200
Hi Vincent,

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

> 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.

> 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.

> 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.

> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 10:42:02 GMT) Full text and rfc822 format available.

Message #65 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH 1/3] gnu: Add tng.
Date: Sun, 03 May 2020 12:41:04 +0200
Vincent Legoll <vincent.legoll <at> gmail.com> skribis:

> * gnu/packages/bioinformatics.scm (tng): New variable.

[...]

> +    (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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 10:45:02 GMT) Full text and rfc822 format available.

Message #68 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH 2/3] gnu: Add lmfit.
Date: Sun, 03 May 2020 12:43:40 +0200
Vincent Legoll <vincent.legoll <at> gmail.com> skribis:

> * gnu/packages/bioinformatics.scm (lmfit): New variable.

[...]

> +    (home-page "https://jugit.fz-juelich.de/mlz/lmfit")
> +    (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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 10:47:01 GMT) Full text and rfc822 format available.

Message #71 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH 3/3] gnu: Add gromacs.
Date: Sun, 03 May 2020 12:46:36 +0200
Vincent Legoll <vincent.legoll <at> gmail.com> skribis:

> * 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?

> --- /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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 22:32:02 GMT) Full text and rfc822 format available.

Message #74 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40691 <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v6 0/3] gnu: Add gromacs, tng & lmfit.
Date: Mon, 4 May 2020 00:31:34 +0200
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.

>> 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, patches follow.

-- 
Vincent Legoll




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 22:33:02 GMT) Full text and rfc822 format available.

Message #77 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 1/3] gnu: Add tng.
Date: Mon,  4 May 2020 00:32:38 +0200
* gnu/packages/chemistry.scm (tng): New variable.
---
 gnu/packages/chemistry.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

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 <at> flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 22:34:01 GMT) Full text and rfc822 format available.

Message #80 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 2/3] gnu: Add lmfit.
Date: Mon,  4 May 2020 00:32:39 +0200
* gnu/packages/algebra.scm (lmfit): New variable.
---
 gnu/packages/algebra.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

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 <at> member.fsf.org>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 22:34:02 GMT) Full text and rfc822 format available.

Message #83 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH 3/3] gnu: Add gromacs.
Date: Mon,  4 May 2020 00:32:40 +0200
* 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

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





Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 22:40:01 GMT) Full text and rfc822 format available.

Message #86 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Subject: Re: [PATCH 3/3] gnu: Add gromacs.
Date: Mon, 4 May 2020 00:39:13 +0200
Will resend this one, as I forgot to amend the missing module inclusions
due to the move from bioinformatics.scm.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Sun, 03 May 2020 22:40:02 GMT) Full text and rfc822 format available.

Message #89 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Cc: Vincent Legoll <vincent.legoll <at> gmail.com>
Subject: [PATCH] gnu: Add gromacs.
Date: Mon,  4 May 2020 00:39:36 +0200
* 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

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





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 04 May 2020 08:41:01 GMT) Full text and rfc822 format available.

Notification sent to Vincent Legoll <vincent.legoll <at> gmail.com>:
bug acknowledged by developer. (Mon, 04 May 2020 08:41:02 GMT) Full text and rfc822 format available.

Message #94 received at 40691-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vincent Legoll <vincent.legoll <at> gmail.com>
Cc: 40691-done <at> debbugs.gnu.org
Subject: Re: [bug#40691] [PATCH v6 0/3] gnu: Add gromacs, tng & lmfit.
Date: Mon, 04 May 2020 10:40:33 +0200
Hi Vincent,

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

>>> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#40691; Package guix-patches. (Tue, 05 May 2020 21:28:02 GMT) Full text and rfc822 format available.

Message #97 received at 40691 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Legoll <vincent.legoll <at> gmail.com>
To: 40691 <at> debbugs.gnu.org
Subject: Upstream patches are being merged
Date: Tue, 5 May 2020 23:27:31 +0200
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.

https://gitlab.com/gromacs/gromacs/-/merge_requests/153

-- 
Vincent Legoll




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 03 Jun 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 74 days ago.

Previous Next


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