summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authordownloadico <download@carc.unm.edu>2023-03-02 13:48:55 -0700
committerGitHub <noreply@github.com>2023-03-02 15:48:55 -0500
commit1e2ef16b396956d2adde81f16c456792c0a5f13e (patch)
tree853730114f96208209966b5c228a536dfa22d9b7 /var
parent77355fd3484bc8297e2ee462c59eab925e65b0a1 (diff)
downloadspack-1e2ef16b396956d2adde81f16c456792c0a5f13e.tar.gz
spack-1e2ef16b396956d2adde81f16c456792c0a5f13e.tar.bz2
spack-1e2ef16b396956d2adde81f16c456792c0a5f13e.tar.xz
spack-1e2ef16b396956d2adde81f16c456792c0a5f13e.zip
Add e3sm scorpio (#35794)
* e3sm-scorpio: add e3sm-scorpio package This is the Scorpio package from the e3sm.org site. * fixed style errors * removed unneeded dependency on cmake
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/e3sm-scorpio/package.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/e3sm-scorpio/package.py b/var/spack/repos/builtin/packages/e3sm-scorpio/package.py
new file mode 100644
index 0000000000..32375cfd4a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/e3sm-scorpio/package.py
@@ -0,0 +1,54 @@
+# Copyright 2013-2023 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)
+
+from spack.package import *
+
+
+class E3smScorpio(CMakePackage):
+ """The SCORPIO (Software for Caching Output and Reads for Parallel I/O)
+ library is used by all the model components in DOE's Energy Exascale Earth
+ System Model (E3SM) for reading input data and writing model output"""
+
+ homepage = "https://e3sm.org/scorpio-parallel-io-library/"
+ url = "https://github.com/E3SM-Project/scorpio/archive/refs/tags/scorpio-v1.4.1.tar.gz"
+
+ version("1.4.1", sha256="7cb4589410080d7e547ef17ddabe68f749e6af019c1d0e6ee9f11554f3ff6b1a")
+
+ variant("timing", default="False", description="Enable timing")
+ variant("mpi", default="True", description="Enable MPI")
+
+ depends_on("gptl", when="+timing")
+ depends_on("mpi", when="+mpi")
+ depends_on("parallel-netcdf", when="+mpi")
+ depends_on("netcdf-c")
+ depends_on("netcdf-fortran")
+
+ def cmake_args(self):
+ opts = []
+ opts.append(self.define("NetCDF_C_PATH", self.spec["netcdf-c"].prefix))
+ opts.append(self.define("NetCDF_Fortran_PATH", self.spec["netcdf-fortran"].prefix))
+
+ if self.spec.satisfies("+timing"):
+ opts.append(self.define("PIO_ENABLE_TIMING", "ON"))
+ opts.append(self.define("GPTL_PATH", self.spec["gptl"].prefix))
+ else:
+ opts.append(self.define("PIO_ENABLE_TIMING", "OFF"))
+
+ if self.spec.satisfies("+mpi"):
+ opts.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc))
+ opts.append(self.define("CMAKE_CXX_COMPILER", self.spec["mpi"].mpicxx))
+ opts.append(self.define("CMAKE_Fortran_COMPILER", self.spec["mpi"].mpifc))
+ opts.append(self.define("WITH_PNETCDF", "ON"))
+ opts.append(self.define("PNETCDF_PATH", self.spec["parallel-netcdf"].prefix))
+ else:
+ opts.append(self.define("WITH_PNETCDF", "OFF"))
+
+ return opts
+
+ def setup_build_environment(self, env):
+ env.set("NetCDF_C_PATH", self.spec["netcdf-c"].prefix)
+ env.set("NetCDF_Fortran_PATH", self.spec["netcdf-fortran"].prefix)
+ if self.spec.satisfies("+mpi"):
+ env.set("PNETCDF_PATH", self.spec["parallel-netcdf"].prefix)