Skip to content

Commit

Permalink
release/1.8.0: bug fix for compiling [email protected] with gfortran < 10 (#477)
Browse files Browse the repository at this point in the history
Bug fix for compiling [email protected] with gfortran < 10

---------

Co-authored-by: RatkoVasic-NOAA <[email protected]>
  • Loading branch information
climbfuji and RatkoVasic-NOAA committed Sep 5, 2024
1 parent 822e7c4 commit 78e0c1d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions var/spack/repos/builtin/packages/g2/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ def cmake_args(self):

return args

# https://github.com/JCSDA/spack/issues/475
def flag_handler(self, name, flags):
if self.spec.satisfies("@3.5.1") and name == "fflags" and "gfortran" in self.compiler.fc:
with self.compiler.compiler_environment():
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(
self.compiler.fc, "-dumpversion"
).split(".")[0]
)
if gfortran_major_version < 10:
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")
Expand Down

0 comments on commit 78e0c1d

Please sign in to comment.