Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ESMF to support clang with gfortran and clang with flang (spack #48026); replace [email protected] with [email protected] #490

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions var/spack/repos/builtin/packages/esmf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Esmf(MakefilePackage, PythonExtension):
# Develop is a special name for spack and is always considered the newest version
version("develop", branch="develop")
# generate chksum with 'spack checksum [email protected]'
version("8.8.0b06", commit="aed3278586544bb7687bb03b5c9b65dff67c18a8")
version("8.8.0b10", commit="dc03809c35e37482fc349011540f80c191c452eb")
version("8.7.0", sha256="d7ab266e2af8c8b230721d4df59e61aa03c612a95cc39c07a2d5695746f21f56")
version("8.6.1", sha256="dc270dcba1c0b317f5c9c6a32ab334cb79468dda283d1e395d98ed2a22866364")
version("8.6.0", sha256="ed057eaddb158a3cce2afc0712b49353b7038b45b29aee86180f381457c0ebe7")
Expand Down Expand Up @@ -271,14 +271,18 @@ def setup_build_environment(self, env):
# to avoid having to add clang OpenMP libraries to the
# Fortran linker command.
env.set("ESMF_OPENMP", "OFF")
#
env.set("ESMF_COMPILER", "gfortranclang")
with self.pkg.compiler.compiler_environment():
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(
self.pkg.compiler.fc, "-dumpversion"
).split(".")[0]
)
if "flang" in self.pkg.compiler.fc:
env.set("ESMF_COMPILER", "llvm")
elif "gfortran" in self.pkg.compiler.fc:
env.set("ESMF_COMPILER", "gfortranclang")
with self.pkg.compiler.compiler_environment():
gfortran_major_version = int(
spack.compiler.get_compiler_version_output(
self.pkg.compiler.fc, "-dumpversion"
).split(".")[0]
)
else:
raise InstallError("Unsupported C/C++/Fortran compiler combination")
elif self.pkg.compiler.name == "nag":
env.set("ESMF_COMPILER", "nag")
elif self.pkg.compiler.name == "pgi":
Expand Down Expand Up @@ -313,6 +317,7 @@ def setup_build_environment(self, env):

if (
self.pkg.compiler.name in ["gcc", "clang", "apple-clang"]
and "gfortran" in self.pkg.compiler.fc
and gfortran_major_version >= 10
and (self.spec.satisfies("@:8.2.99") or self.spec.satisfies("@8.3.0b09"))
):
Expand Down
Loading