summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>2021-10-12 19:39:09 +0200
committerGitHub <noreply@github.com>2021-10-12 11:39:09 -0600
commit862ce517ce96c26c11825c691607ddeb3c36c164 (patch)
treeb0b8d7479a9bec114bdfe24ef1f74ec4b725483b
parent50a2316a1572c0ff6a2649e1fe34be589089bfda (diff)
downloadspack-862ce517ce96c26c11825c691607ddeb3c36c164.tar.gz
spack-862ce517ce96c26c11825c691607ddeb3c36c164.tar.bz2
spack-862ce517ce96c26c11825c691607ddeb3c36c164.tar.xz
spack-862ce517ce96c26c11825c691607ddeb3c36c164.zip
gromacs: @2018:2020: add #include <limits> for newer %gcc builds (#26678)
gromacs@2018:2020.6 is fixed to build with gcc@11.2.0 by adding #include <limits> to a few header files. Thanks to Maciej Wójcik <w8jcik@gmail.com> for testing versions.
-rw-r--r--var/spack/repos/builtin/packages/gromacs/package.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py
index defd362c95..aeb2da8c3e 100644
--- a/var/spack/repos/builtin/packages/gromacs/package.py
+++ b/var/spack/repos/builtin/packages/gromacs/package.py
@@ -172,6 +172,20 @@ class Gromacs(CMakePackage):
relative_root=os.path.join('share', 'cmake', 'gromacs'))
def patch(self):
+ # Otherwise build fails with GCC 11 (11.2)
+ if self.spec.satisfies('@2018:2020.6'):
+ filter_file('#include <vector>', '#include <vector>\n#include <limits>',
+ 'src/gromacs/awh/biasparams.h')
+ if self.spec.satisfies('@2018:2018.8'):
+ filter_file('#include <vector>', '#include <vector>\n#include <limits>',
+ 'src/gromacs/mdlib/minimize.cpp')
+ if self.spec.satisfies('@2019:2019.6,2020:2020.6'):
+ filter_file('#include <vector>', '#include <vector>\n#include <limits>',
+ 'src/gromacs/mdrun/minimize.cpp')
+ if self.spec.satisfies('@2020:2020.6'):
+ filter_file('#include <queue>', '#include <queue>\n#include <limits>',
+ 'src/gromacs/modularsimulator/modularsimulator.h')
+
if '+plumed' in self.spec:
self.spec['plumed'].package.apply_patch(self)