diff --git a/var/spack/repos/builtin/packages/g2/package.py b/var/spack/repos/builtin/packages/g2/package.py index 1d47e4ee3b89cf..a8f43e092fdfc1 100644 --- a/var/spack/repos/builtin/packages/g2/package.py +++ b/var/spack/repos/builtin/packages/g2/package.py @@ -59,6 +59,12 @@ def cmake_args(self): return args +# GNU compiler is complaining if not using -fno-range-check argument + def flag_handler(self, name, flags): + if name == "fflags" and self.compiler.fc.endswith("gfortran"): + flags.append("-fno-range-check") + return (None, None, flags) + def setup_run_environment(self, env): precisions = ( self.spec.variants["precision"].value if self.spec.satisfies("@3.4.6:") else ("4", "d")