Error compiling gromacs-2018.8

GROMACS version: 2018.8
GROMACS modification: No

Hi Gromacs users, I have been trying to compile gromacs-2018.8, but without success. However I have been able to install 2021.2, 2021.3 and 2021.5. The error occurs during the compilation:

/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:9: note: in expansion of macro ‘GMX_RELEASE_ASSERT
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:2575: src/gromacs/CMakeFiles/libgromacs.dir/awh/biasparams.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [CMakeFiles/Makefile2:3495: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

I am using Fedora 35, with a gcc 11.3.1.
Could someone give me any hint about how to solve this problem?

Thank you very much.
Sergio

Hi Sergio,

Just FYI: GROMACS 2018 is not maintained and does not support new compilers, so the preferred solution would be to switch to an older compiler or use a newer GROMACS version.

If that’s not an option for you, you can add #include <limits> at the top (among other include’s) of src/gromacs/awh/biasparams.cpp and src/gromacs/mdlib/minimize.cpp files. It should work fine.

Thanks al42and for your time! Unfortunately I have to work with GROMACS 2018 althoug I know it doesn’t have support anymore.
I added the line that you suggested in biasparams.cpp and minimize.cpp, but I stil get some errors during compilation:

[ 26%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/gmxana/eigio.cpp.o
[ 26%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/gmxana/fitahx.cpp.o
[ 26%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/gmxana/gmx_anadock.cpp.o
In file included from /home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/arrayref.h:54,
from /home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:55:
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp: In function ‘gmx_int64_t gmx::{anonymous}::calcCheckCoveringInterval(const gmx::AwhParams&, const std::vectorgmx::DimParams&, const std::vectorgmx::GridAxis&)’:
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:62: error: ‘numeric_limits’ is not a member of ‘std’
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~~~~~~~~~~~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/gmxassert.h:67:15: note: in definition of macro ‘GMX_RELEASE_ASSERT’
67 | ((void) ((condition) ? (void)0 :
| ^~~~~~~~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:77: error: expected primary-expression before ‘int’
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/gmxassert.h:67:15: note: in definition of macro ‘GMX_RELEASE_ASSERT’
67 | ((void) ((condition) ? (void)0 :
| ^~~~~~~~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:77: error: expected ‘)’ before ‘int’
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/gmxassert.h:67:15: note: in definition of macro ‘GMX_RELEASE_ASSERT’
67 | ((void) ((condition) ? (void)0 :
| ^~~~~~~~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/gmxassert.h:67:14: note: to match this ‘(’
67 | ((void) ((condition) ? (void)0 :
| ^
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:9: note: in expansion of macro ‘GMX_RELEASE_ASSERT’
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~~~~~~~~~~~~~~~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:147: error: expected ‘)’ before ‘;’ token
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^
In file included from /home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/arrayref.h:54,
from /home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:55:
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/gmxassert.h:67:13: note: to match this ‘(’
67 | ((void) ((condition) ? (void)0 :
| ^
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:9: note: in expansion of macro ‘GMX_RELEASE_ASSERT’
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~~~~~~~~~~~~~~~~
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:147: error: expected ‘)’ before ‘;’ token
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^
In file included from /home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/arrayref.h:54,
from /home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:55:
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/utility/gmxassert.h:67:5: note: to match this ‘(’
67 | ((void) ((condition) ? (void)0 :
| ^
/home/sgaray/Downloads/gromacs-2018.8/src/gromacs/awh/biasparams.cpp:137:9: note: in expansion of macro ‘GMX_RELEASE_ASSERT’
137 | GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits::max(), “The axis length in units of sigma should fit in an int”);
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:2575: src/gromacs/CMakeFiles/libgromacs.dir/awh/biasparams.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [CMakeFiles/Makefile2:3495: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Thank you in advance for your help!
Sergio

Hi al42and! my mistake!! Your solution worked perfectly.

I really appreciate your time!!

Glad to help :)