forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #490 from climbfuji/feature/esmf_clang_flang
Update ESMF to support clang with gfortran and clang with flang (spack spack#48026); replace [email protected] with [email protected]
- Loading branch information
Showing
1 changed file
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
|
@@ -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": | ||
|
@@ -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")) | ||
): | ||
|