From e830ce0ba21dc6f00708dadaf1eb70e61ebf24a2 Mon Sep 17 00:00:00 2001 From: RatkoVasic-NOAA <37597874+RatkoVasic-NOAA@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:25:00 -0400 Subject: [PATCH 1/2] G2 lib with GNU compiler fix --- var/spack/repos/builtin/packages/g2/package.py | 6 ++++++ 1 file changed, 6 insertions(+) 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") From 82828e8c1ffad12be747d4b2fd5d92e5b8978859 Mon Sep 17 00:00:00 2001 From: RatkoVasic-NOAA <37597874+RatkoVasic-NOAA@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:56:22 -0400 Subject: [PATCH 2/2] Cosmetic change --- var/spack/repos/builtin/packages/g2/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/g2/package.py b/var/spack/repos/builtin/packages/g2/package.py index a8f43e092fdfc1..b86abbb065ef03 100644 --- a/var/spack/repos/builtin/packages/g2/package.py +++ b/var/spack/repos/builtin/packages/g2/package.py @@ -59,7 +59,7 @@ def cmake_args(self): return args -# GNU compiler is complaining if not using -fno-range-check argument + # 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")