# Error compiling gromacs 2020.5 patched with Colvar module

**URL:** <https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048>\
**Category:** User discussions\
**Tags:** installation-error, colvars\
**Created:** [October 29, 2021, 1:01am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048 "2021-10-29T01:01:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 29, 2021, 1:01am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/1 "2021-10-29T01:01:43Z")

</div>

GROMACS version: 2020.5  
GROMACS modification: Yes

I’m try install gromacs using steps decription on official website on linux but get error, it error is related to Make[2] Error 1 or Make[]error 2.

Can any given good step to compile gromacs with it patched module?

best,

Geo

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [October 29, 2021, 2:23pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/2 "2021-10-29T14:23:07Z")

</div>

Hello Geo, can you please provide a few details:

1. First and foremost please confirm that you can build the unpatched GROMACS 2020.5 with identical commands.
2. Where did you get the code from? You mention “official website”, which is vague. Because it’s a version patched with Colvars it can’t be from the GROMACS website. Is it from [GitHub - Colvars/gromacs: Clone of the main GROMACS repository, containing additional releases featuring Colvars. (Not suitable for pull requests.)](https://github.com/Colvars/gromacs)?
3. What is the exact error message (and you should cross-reference them with warnings from CMake as well)?

Giacomo

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 29, 2021, 3:29pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/3 "2021-10-29T15:29:22Z")

</div>

Dear Prof. Giacomo,

I run compilation with gcc 11 version and them I’ve changed to gcc 7 and it compile well.

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 29, 2021, 7:38pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/4 "2021-10-29T19:38:53Z")

</div>

Dear Prof. Giacomo,

I’m try pass

indexFile name.ndx into clovar dat file, but it given an error: Error in parsing index file

What’s is right form to pass it option?

Best,

Geo.

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [October 29, 2021, 8:48pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/5 "2021-10-29T20:48:22Z")

</div>

Hi Geo, since you didn’t mention whether standard/unpatched GROMACS 2020 builds correctly, I checked myself, and in fact with GCC 11.2 (Fedora 35) I get the following.

```auto
In file included from /home/fioring2/sources/gromacs/2020.6/src/gromacs/modularsimulator/modularsimulator.cpp:44:
/home/fioring2/sources/gromacs/2020.6/src/gromacs/modularsimulator/modularsimulator.h:269:31: error: ‘numeric_limits’ is not a member of ‘std’
  269 | Step lastStep_ = std::numeric_limits<Step>::max();
      | ^ ~~~~~~~~~~~~~
/home/fioring2/sources/gromacs/2020.6/src/gromacs/modularsimulator/modularsimulator.h:269:50: error: expected primary-expression before ‘>’ token
  269 | Step lastStep_ = std::numeric_limits<Step>::max();
      | ^
/home/fioring2/sources/gromacs/2020.6/src/gromacs/modularsimulator/modularsimulator.h:269:53: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  269 | Step lastStep_ = std::numeric_limits<Step>::max();
      | ^~~
      | std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /home/fioring2/sources/gromacs/2020.6/src/gromacs/math/vectypes.h:42,
                 from /home/fioring2/sources/gromacs/2020.6/src/gromacs/mdlib/vcm.h:44,
                 from /home/fioring2/sources/gromacs/2020.6/src/gromacs/mdlib/md_support.h:40,
                 from /home/fioring2/sources/gromacs/2020.6/src/gromacs/modularsimulator/modularsimulator.h:46,
                 from /home/fioring2/sources/gromacs/2020.6/src/gromacs/modularsimulator/modularsimulator.cpp:44:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 | max(initializer_list<_Tp> __l, _Compare__ comp)
      | ^~~
gmake[2]: *** [src/gromacs/modularsimulator/CMakeFiles/modularsimulator.dir/build.make:188: src/gromacs/modularsimulator/CMakeFiles/modularsimulator.dir/modularsimulator.cpp.o] Error 1

```

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [October 29, 2021, 8:55pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/6 "2021-10-29T20:55:24Z")

</div>

Hi Geo, index files are read internally by a Colvars internal function. We have discussed that for the case of GROMACS it would be simpler all around to just read directly the index groups that GROMACS itself has defined in memory, but this is not available yet:

> <https://github.com/Colvars/colvars/issues/381>
>
> ... which could be used without specifying a separate indexFile.

Was the index file that you are providing produced with “gmx make\_ndx”? Or if it isn’t, can you check that at least GROMACS can read it when you pass it as input to the same command?

If GROMACS can read it but Colvars cannot, can you put it online somewhere and paste a public link? (It is likely too big to paste in the message itself and the format will also change)

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [October 29, 2021, 9:06pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/7 "2021-10-29T21:06:02Z")

</div>

FYI should you need GCC 11 for any reason, apply this patch, which fixes a missing include in the GROMACS files.

```auto
diff --git a/src/gromacs/awh/biasparams.cpp b/src/gromacs/awh/biasparams.cpp
index 6f9b0d387d..2bcc711a62 100644
--- a/src/gromacs/awh/biasparams.cpp
+++ b/src/gromacs/awh/biasparams.cpp
@@ -47,6 +47,7 @@
 #include "biasparams.h"
 
 #include <cmath>
+#include <limits>
 
 #include <algorithm>
 
diff --git a/src/gromacs/modularsimulator/modularsimulator.cpp b/src/gromacs/modularsimulator/modularsimulator.cpp
index 2d785ab50f..8a94e9f106 100644
--- a/src/gromacs/modularsimulator/modularsimulator.cpp
+++ b/src/gromacs/modularsimulator/modularsimulator.cpp
@@ -39,6 +39,8 @@
  * \ingroup module_modularsimulator
  */
 
+#include <limits>
+
 #include "gmxpre.h"
 
 #include "modularsimulator.h"

```

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 29, 2021, 9:22pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/8 "2021-10-29T21:22:38Z")

</div>

Thanks so much Prof. Giacomo,

With respecto to IndexFile I’ve create it with write\_export from MDAnalysis, and check if it is same that these create with make\_ndx tool is same for me (not know if I’m missing anything)

With respect to gcc 11 I’ve same error and should apply it suggest for you!.

Thanks so much.

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [October 29, 2021, 9:50pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/9 "2021-10-29T21:50:18Z")

</div>

Well, I can read from Colvars an index file generated by MDAnalysis without problems, so that rules out an issue with MDA. You also mentioned that you can read the same index file with GROMACS.

Does the group name contain spaces by any chance? That looks like the only way that the Colvars parser could be throwing the message “Error: in parsing index file”

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 30, 2021, 12:50am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/10 "2021-10-30T00:50:51Z")

</div>

Dear Prof.

Mu error result when make

indexFile rest\_index.ndx

And group name containing space example : [PROB] , as it.

I’m attach imagen from my index file generate with MDAnalysis.

 ![Screen Shot 2021-10-29 at 19.49.55.png](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/8/83130404a49f7aa1092666bd519a7d714d05a842.png)

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [October 30, 2021, 1:35am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/11 "2021-10-30T01:35:36Z")

</div>

Ok, I see. Just replace spaces in the middle of a group’s name with something else, e.g. underscores, and you will be fine.

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 30, 2021, 1:56am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/12 "2021-10-30T01:56:46Z")

</div>

Thanks so much prof. It fix problem with index file.

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [October 31, 2021, 10:56pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/13 "2021-10-31T22:56:57Z")

</div>

Dear Prof.

A trivial questions, force and position into colvar gromcs are into kj/mol\*nm^2 ; nanometros?

Or is same what in NAMD?

best.

Geo.

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [November 1, 2021, 1:47am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/14 "2021-11-01T01:47:16Z")

</div>

Hi, Colvars uses the same units as the MD engine, in this case GROMACS. If you’re adapting a configuration file from NAMD, you should convert force constants and positions/distances accordingly. XYZ files are assumed to be in Å for consistency with what VMD expects.

[https://colvars.github.io/colvars-refman-gromacs/colvars-refman-gromacs.html#sec:units](https://colvars.github.io/colvars-refman-gromacs/colvars-refman-gromacs.html#sec:units)

Giacomo

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [November 1, 2021, 2:01am UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/15 "2021-11-01T02:01:40Z")

</div>

Prof. Giacomo thanks so much for advice.

Geo.

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [November 3, 2021, 5:57pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/16 "2021-11-03T17:57:33Z")

</div>

Professor Giacomo,

I want to compile gromacs 2020.6 with colvar, but I only have the code for 2020.5 available, so can I copy the colvar folder from 2020.5 to the same path in the 2020.6 folder?

Or do I need to do something else so that the compilation is correct?

best,

Geo

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [November 3, 2021, 9:16pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/17 "2021-11-03T21:16:18Z")

</div>

Hi Geo, thanks for pointing that out. I just updated the patching mechanism so that 2020.6 is the original GROMACS release used for reference.

For the record, you can’t just copy over the colvars folder because there are also some small edits to the GROMACS files to integrate Colvars in the workflow. You should re-run the patching procedure described in the Colvars README, or alternatively use a Git branch instead of a specific release tag.

For example, bugfix and small updates to the standard 2020 release are available here before they get included in a minor release (next one being 2020.7):

> **[Files · release-2020 · GROMACS / GROMACS](https://gitlab.com/gromacs/gromacs/tree/release-2020)**
>
> The GROMACS molecular simulation toolkit.

and this is the corresponding branch with the Colvars patch:

> **[GitHub - Colvars/gromacs at release-2020-colvars](https://github.com/Colvars/gromacs/tree/release-2020-colvars)**
>
> release-2020-colvars

Giacomo

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [November 3, 2021, 9:32pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/18 "2021-11-03T21:32:34Z")

</div>

Thanks so much Prof. Giacomo for reply.

For case of update patching only following step documented into Github , right?

Best,

Geo.

---

<div class="post-metadata">

**Author:** ![giacomo.fiorin](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/giacomo.fiorin/32/2862_2.png) [@giacomo.fiorin](https://gromacs.bioexcel.eu/u/giacomo.fiorin)\
**Post date:** [November 3, 2021, 9:56pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/19 "2021-11-03T21:56:09Z")

</div>

I don’t understand the question completely. You can download the patched 2020.6 release here:

> **[Release v2020.6-colvars · Colvars/gromacs](https://github.com/Colvars/gromacs/releases/tag/v2020.6-colvars)**
>
> Add Colvars module version 2021-10-13

Patching by yourself the standard GROMACS release also works, but it takes more work and it is sensitive to future changes. The GROMACS files used in the interface also happen to be heavily revised between different standard GROMACS versions. Unless you are following the GitHub conversation, it’s just easier to use a pre-patched release.

Giacomo

---

<div class="post-metadata">

**Author:** ![galileo92](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@galileo92](https://gromacs.bioexcel.eu/u/galileo92)\
**Post date:** [November 3, 2021, 10:38pm UTC](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048/20 "2021-11-03T22:38:18Z")

</div>

Prof. Giacomo I’ve found into collars web [https://github.com/Colvars/colvars](https://github.com/Colvars/colvars) 2020.6 version , I’ve and question can use it same to patch too with plumed?, them can I’ve un gromacs version with plumed and collars same time (plumed support to patch with 2020.6 version)

Best

Geo

[Next page](https://gromacs.bioexcel.eu/t/error-compiling-gromacs-2020-5-patched-with-colvar-module/3048.md?page=2)
