gfortran version fix (#36351)

* gfortran version fix
* modified approach to get gfortran version
* add checksum for v8.4.1
This commit is contained in:
Jim Edwards 2023-03-24 13:47:44 -04:00 committed by GitHub
parent 6bf33b2b7f
commit 15f7b72557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@ class Esmf(MakefilePackage):
# Develop is a special name for spack and is always considered the newest version
version("develop", branch="develop")
# generate chksum with spack checksum esmf@x.y.z
version("8.4.1", sha256="1b54cee91aacaa9df400bd284614cbb0257e175f6f3ec9977a2d991ed8aa1af6")
version("8.4.0", sha256="28531810bf1ae78646cda6494a53d455d194400f19dccd13d6361871de42ed0f")
version("8.3.1", sha256="6c39261e55dcdf9781cdfa344417b9606f7f961889d5ec626150f992f04f146d")
version("8.3.0", sha256="0ff43ede83d1ac6beabd3d5e2a646f7574174b28a48d1b9f2c318a054ba268fd")
@ -172,22 +173,25 @@ def setup_build_environment(self, env):
# ESMF_COMPILER must be set to select which Fortran and
# C++ compilers are being used to build the ESMF library.
if self.compiler.name == "gcc":
env.set("ESMF_COMPILER", "gfortran")
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(self.compiler.fc, "-dumpversion").split(
"."
)[0]
)
with self.compiler.compiler_environment():
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(
self.compiler.fc, "-dumpversion"
).split(".")[0]
)
elif self.compiler.name == "intel" or self.compiler.name == "oneapi":
env.set("ESMF_COMPILER", "intel")
elif self.compiler.name in ["clang", "apple-clang"]:
env.set("ESMF_COMPILER", "gfortranclang")
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(self.compiler.fc, "-dumpversion").split(
"."
)[0]
)
with self.compiler.compiler_environment():
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(
self.compiler.fc, "-dumpversion"
).split(".")[0]
)
elif self.compiler.name == "nag":
env.set("ESMF_COMPILER", "nag")
elif self.compiler.name == "pgi":