diff options
author | Robert Pavel <rspavel@lanl.gov> | 2022-08-25 11:01:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 11:01:07 -0700 |
commit | 7214a438dc6d656db4c0626b7c0c8efd411f8350 (patch) | |
tree | 85a33216ce5e31f30c05ba59cc02bbfd8790ee01 | |
parent | 06ba4d5c281919006725de651e82d1ca13a8d17e (diff) | |
download | spack-7214a438dc6d656db4c0626b7c0c8efd411f8350.tar.gz spack-7214a438dc6d656db4c0626b7c0c8efd411f8350.tar.bz2 spack-7214a438dc6d656db4c0626b7c0c8efd411f8350.tar.xz spack-7214a438dc6d656db4c0626b7c0c8efd411f8350.zip |
Adding e3sm-kernels to Spack (#32341)
* Initial Draft of E3SM-Kernels Spackage
Initial draft of E3SM-Kernels. Currently no support for nested_loops due
to build system limitations
* Style Check and Fixed gfortran Check
Fixed style issues and changed gnu toolchain check to a gfortran check
due to hybrid compilers (e.g. clang+gfortran)
* Fixed Style Issues
-rw-r--r-- | var/spack/repos/builtin/packages/e3sm-kernels/package.py | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/e3sm-kernels/package.py b/var/spack/repos/builtin/packages/e3sm-kernels/package.py new file mode 100644 index 0000000000..2e8534ee60 --- /dev/null +++ b/var/spack/repos/builtin/packages/e3sm-kernels/package.py @@ -0,0 +1,57 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os + +from spack.package import * + + +class E3smKernels(MakefilePackage): + """ + Climate kernels for Co-design that originate from the Energy + Exascale Earth System Model (E3SM). + """ + + homepage = "https://github.com/e3SM-Project/codesign-kernels" + url = "https://github.com/E3SM-Project/codesign-kernels/archive/refs/tags/v1.0.tar.gz" + git = "https://github.com/E3SM-Project/codesign-kernels.git" + + maintainers = ["sarats", "philipwjones"] + + version("master", branch="master") + version("1.0", sha256="358249785ba9f95616feecbb6f37f7694646568499c11b2094c9233999c6cc95") + + variant( + "kernel", + default="atmosphere", + values=( + "atmosphere", + "mmf-mpdata-tracer", + ), + description="Specify E3SM Kernel to Build", + multi=False, + ) + + @property + def build_directory(self): + return self.spec.variants["kernel"].value + + @property + def build_targets(self): + # Spack will provide optimization flags + # But we still need to pass in fortran flags for gfortran + args = [] + # Test for gfortran specifically due to hybrid compilers like llvm + if "gfortran" in self.compiler.fc: + args.append("FFLAGS=-ffree-line-length-none") + return args + + def install(self, spec, prefix): + # Manually copy binaries over + mkdir(prefix.bin) + if self.spec.variants["kernel"].value == "atmosphere": + install(os.path.join("atmosphere", "atm"), prefix.bin.atm) + elif self.spec.variants["kernel"].value == "mmf-mpdata-tracer": + install(os.path.join("mmf-mpdata-tracer", "advect"), prefix.bin.advect) |