ESMF package: support clang with flang
So far, the ESMF package recipe in spack assumes that the spack compilers clang and apple-clang are using gfortran as the Fortran compiler. But with the latest improvements to the LLVM compilers, we need to also support clang with flang.
This commit is contained in:
parent
fc4316cafa
commit
25cfea48f3
@ -270,6 +270,9 @@ def setup_build_environment(self, env):
|
||||
elif self.pkg.compiler.name == "intel" or self.pkg.compiler.name == "oneapi":
|
||||
env.set("ESMF_COMPILER", "intel")
|
||||
elif self.pkg.compiler.name in ["clang", "apple-clang"]:
|
||||
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(
|
||||
@ -277,6 +280,8 @@ def setup_build_environment(self, env):
|
||||
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 == "nvhpc":
|
||||
@ -309,6 +314,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"))
|
||||
):
|
||||
|
Loading…
Reference in New Issue
Block a user