Skip to content
Merged
Show file tree
Hide file tree
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
44 changes: 35 additions & 9 deletions var/spack/repos/builtin/packages/met/package.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

Expand All @@ -14,12 +13,14 @@ class Met(AutotoolsPackage):
configurable methods to compute statistics and diagnostics"""

homepage = "https://dtcenter.org/community-code/model-evaluation-tools-met"
git = "https://github.com/dtcenter/MET"
url = "https://github.com/dtcenter/MET/archive/refs/tags/v11.0.1.tar.gz"
git = "https://github.com/dtcenter/MET"

maintainers("AlexanderRichert-NOAA", "climbfuji")

version("develop", branch="develop")
version("12.0.1", sha256="ef396a99ca6c2248855848cd194f9ceaf3b051fb5e8c01a0b0b2a00110b1fcfb")
version("12.0.0", sha256="9a54275cfefbad6010d4449a8fa756ad40fae03fa62a766cbbfda170c422e5e4")
version("11.1.1", sha256="d02f9281d46bc45c931ca233a51ce20ba2158c0dd26acac2cb76c5a68788022a")
version("11.1.0", sha256="e2e371ae1f49185ff8bf08201b1a3e90864a467aa3369b04132d231213c3c9e5")
version("11.0.2", sha256="f720d15e1d6c235c9a41fd97dbeb0eb1082fb8ae99e1bcdcb5e51be9b50bdfbf")
Expand All @@ -31,18 +32,27 @@ class Met(AutotoolsPackage):
version("10.0.0", sha256="92f37c8bd83c951d86026cce294a16e4d3aa6dd41905629d0a729fa1bebe668a")
version("9.1.3", sha256="7356a5ad79ca961fd965cadd93a7bf6c73b3aa5fb1a01a932580b94e66d0d0c8")

depends_on("cxx", type="build") # generated
depends_on("fortran", type="build") # generated

variant("openmp", default=True, description="Use OpenMP multithreading")
variant("grib2", default=False, description="Enable compilation of utilities using GRIB2")
variant("python", default=False, description="Enable python embedding")
variant("lidar2nc", default=False, description="Enable compilation of lidar2nc")
variant("modis", default=False, description="Enable compilation of modis")
variant("graphics", default=False, description="Enable compilation of mode_graphics")

# JCSDA fork only
variant(
"shared-intel",
default=False,
when="%oneapi",
description="Enable linking to shared intel libraries (libintlc instead of libirc)",
)

depends_on("cxx", type="build") # generated
depends_on("fortran", type="build") # generated

depends_on("gsl")
depends_on("bufr")
depends_on("proj", when="@12:")
depends_on("zlib-api")
depends_on("netcdf-c")
depends_on("netcdf-cxx4")
Expand All @@ -56,11 +66,12 @@ class Met(AutotoolsPackage):
depends_on("cairo", when="+graphics")
depends_on("freetype", when="+graphics")

depends_on("python@3.6.3:", when="+python")
depends_on("python@3.6.3:", when="+python", type=("build", "run"))
depends_on("py-netcdf4", when="+python", type=("build", "run"))
depends_on("py-numpy", when="+python", type=("build", "run"))
depends_on("py-xarray", when="+python", type=("build", "run"))
depends_on("py-pandas", when="+python", type=("build", "run"))
depends_on("patchelf@0.13:", when="platform=linux", type="build")

patch("openmp_shape_patch.patch", when="@10.1.0")

Expand All @@ -86,6 +97,8 @@ def url_for_version(self, version):
def setup_build_environment(self, env):
spec = self.spec
cppflags = []
fflags = []
fcflags = []
ldflags = []
libs = []

Expand All @@ -97,6 +110,10 @@ def setup_build_environment(self, env):
ldflags.append(netcdfcxx.libs.ld_flags)
libs.append(netcdfcxx.libs.link_flags)

if spec.satisfies("%oneapi") and spec.satisfies("+shared-intel"):
fflags.append("-shared-intel")
fcflags.append("-shared-intel")

netcdfc = spec["netcdf-c"]
if netcdfc.satisfies("+shared"):
cppflags.append("-I" + netcdfc.prefix.include)
Expand Down Expand Up @@ -163,6 +180,10 @@ def setup_build_environment(self, env):
env.set("MET_FREETYPE", freetype.prefix)

env.set("CPPFLAGS", " ".join(cppflags))
if fflags:
env.set("FFLAGS", " ".join(fflags))
if fcflags:
env.set("FCFLAGS", " ".join(fcflags))
env.set("LIBS", " ".join(libs))
env.set("LDFLAGS", " ".join(ldflags))

Expand All @@ -180,6 +201,11 @@ def configure_args(self):

return args

@run_after("install", when="platform=linux")
def fixup_rpaths(self):
# set rpaths of binaries Python's lib directory
rpaths = self.spec["python"].libs.directories

# def setup_run_environment(self, env):
# env.set('MET_BASE', self.prefix)
for binary in find(self.prefix.bin, "*"):
patchelf = Executable("patchelf")
patchelf("--add-rpath", ":".join(rpaths), binary)
14 changes: 11 additions & 3 deletions var/spack/repos/builtin/packages/metplus/package.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

Expand All @@ -13,12 +12,13 @@ class Metplus(Package):
"""

homepage = "https://dtcenter.org/community-code/metplus"
git = "https://github.com/dtcenter/METplus"
url = "https://github.com/dtcenter/METplus/archive/refs/tags/v4.1.0.tar.gz"
git = "https://github.com/dtcenter/METplus"

maintainers("AlexanderRichert-NOAA", "climbfuji")

version("develop", branch="develop")
version("6.0.0", sha256="e9358aede2fd2abecd81806227de7b165d68fdf2fc9defcbba24df229461b155")
version("5.1.0", sha256="e80df2d1059176a453b7991a9f123cb5a187cc7ba7f48a75313b92c7a0e68474")
version("5.0.1", sha256="0e22b4f6791496551d99f68247d382b2af02c90b34c172a64c6f060e774bdced")
version("5.0.0", sha256="59d519bd062559b4cece9f8672e2e282b200057bc77e2e0937414003d8f2dd50")
Expand All @@ -34,11 +34,19 @@ class Metplus(Package):
variant("makeplots", default=False, description="Enable MakePlots Wrapper.")
variant("plotdataplane", default=False, description="Generate images from Postscript output.")

depends_on("python@3.10.4:", when="@6:", type=("run"))
depends_on("met+python", type=("run"))
depends_on("met@12:+python", when="@6:", type=("run"))
# https://metplus.readthedocs.io/en/main_v6.0/Users_Guide/installation.html
depends_on("netcdf-c")
depends_on("netcdf-c@1.5.4:", when="@6:")
depends_on("py-python-dateutil", type=("run"))
depends_on("py-python-dateutil@2.8:", when="@6:", type=("run"))

depends_on("py-cartopy", when="+makeplots", type=("run"))
depends_on("py-cartopy@0.20.3:", when="@6: +makeplots", type=("run"))
depends_on("py-matplotlib", when="+cycloneplotter", type=("run"))
depends_on("py-matplotlib@3.5.2", when="@6: +cycloneplotter", type=("run"))
depends_on("py-cartopy", when="+cycloneplotter", type=("run"))

depends_on("r", when="+tcmpr_plotter", type=("run"))
Expand Down
Loading