Skip to content

Commit edd09cd

Browse files
Update met and metplus new versions. (#562)
add met 12.0.1 and metplus 6.0.0 to release/1.9.0 (from spack-stack-dev)
1 parent 5e00373 commit edd09cd

2 files changed

Lines changed: 46 additions & 12 deletions

File tree

var/spack/repos/builtin/packages/met/package.py

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
2-
# Spack Project Developers. See the top-level COPYRIGHT file for details.
1+
# Copyright Spack Project Developers. See COPYRIGHT file for details.
32
#
43
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
54

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

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

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

2221
version("develop", branch="develop")
22+
version("12.0.1", sha256="ef396a99ca6c2248855848cd194f9ceaf3b051fb5e8c01a0b0b2a00110b1fcfb")
23+
version("12.0.0", sha256="9a54275cfefbad6010d4449a8fa756ad40fae03fa62a766cbbfda170c422e5e4")
2324
version("11.1.1", sha256="d02f9281d46bc45c931ca233a51ce20ba2158c0dd26acac2cb76c5a68788022a")
2425
version("11.1.0", sha256="e2e371ae1f49185ff8bf08201b1a3e90864a467aa3369b04132d231213c3c9e5")
2526
version("11.0.2", sha256="f720d15e1d6c235c9a41fd97dbeb0eb1082fb8ae99e1bcdcb5e51be9b50bdfbf")
@@ -31,18 +32,27 @@ class Met(AutotoolsPackage):
3132
version("10.0.0", sha256="92f37c8bd83c951d86026cce294a16e4d3aa6dd41905629d0a729fa1bebe668a")
3233
version("9.1.3", sha256="7356a5ad79ca961fd965cadd93a7bf6c73b3aa5fb1a01a932580b94e66d0d0c8")
3334

34-
depends_on("cxx", type="build") # generated
35-
depends_on("fortran", type="build") # generated
36-
3735
variant("openmp", default=True, description="Use OpenMP multithreading")
3836
variant("grib2", default=False, description="Enable compilation of utilities using GRIB2")
3937
variant("python", default=False, description="Enable python embedding")
4038
variant("lidar2nc", default=False, description="Enable compilation of lidar2nc")
4139
variant("modis", default=False, description="Enable compilation of modis")
4240
variant("graphics", default=False, description="Enable compilation of mode_graphics")
4341

42+
# JCSDA fork only
43+
variant(
44+
"shared-intel",
45+
default=False,
46+
when="%oneapi",
47+
description="Enable linking to shared intel libraries (libintlc instead of libirc)",
48+
)
49+
50+
depends_on("cxx", type="build") # generated
51+
depends_on("fortran", type="build") # generated
52+
4453
depends_on("gsl")
4554
depends_on("bufr")
55+
depends_on("proj", when="@12:")
4656
depends_on("zlib-api")
4757
depends_on("netcdf-c")
4858
depends_on("netcdf-cxx4")
@@ -56,11 +66,12 @@ class Met(AutotoolsPackage):
5666
depends_on("cairo", when="+graphics")
5767
depends_on("freetype", when="+graphics")
5868

59-
depends_on("python@3.6.3:", when="+python")
69+
depends_on("python@3.6.3:", when="+python", type=("build", "run"))
6070
depends_on("py-netcdf4", when="+python", type=("build", "run"))
6171
depends_on("py-numpy", when="+python", type=("build", "run"))
6272
depends_on("py-xarray", when="+python", type=("build", "run"))
6373
depends_on("py-pandas", when="+python", type=("build", "run"))
74+
depends_on("patchelf@0.13:", when="platform=linux", type="build")
6475

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

@@ -86,6 +97,8 @@ def url_for_version(self, version):
8697
def setup_build_environment(self, env):
8798
spec = self.spec
8899
cppflags = []
100+
fflags = []
101+
fcflags = []
89102
ldflags = []
90103
libs = []
91104

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

113+
if spec.satisfies("%oneapi") and spec.satisfies("+shared-intel"):
114+
fflags.append("-shared-intel")
115+
fcflags.append("-shared-intel")
116+
100117
netcdfc = spec["netcdf-c"]
101118
if netcdfc.satisfies("+shared"):
102119
cppflags.append("-I" + netcdfc.prefix.include)
@@ -163,6 +180,10 @@ def setup_build_environment(self, env):
163180
env.set("MET_FREETYPE", freetype.prefix)
164181

165182
env.set("CPPFLAGS", " ".join(cppflags))
183+
if fflags:
184+
env.set("FFLAGS", " ".join(fflags))
185+
if fcflags:
186+
env.set("FCFLAGS", " ".join(fcflags))
166187
env.set("LIBS", " ".join(libs))
167188
env.set("LDFLAGS", " ".join(ldflags))
168189

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

181202
return args
182203

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

184-
# def setup_run_environment(self, env):
185-
# env.set('MET_BASE', self.prefix)
209+
for binary in find(self.prefix.bin, "*"):
210+
patchelf = Executable("patchelf")
211+
patchelf("--add-rpath", ":".join(rpaths), binary)

var/spack/repos/builtin/packages/metplus/package.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
2-
# Spack Project Developers. See the top-level COPYRIGHT file for details.
1+
# Copyright Spack Project Developers. See COPYRIGHT file for details.
32
#
43
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
54

@@ -13,12 +12,13 @@ class Metplus(Package):
1312
"""
1413

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

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

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

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

4046
depends_on("py-cartopy", when="+makeplots", type=("run"))
47+
depends_on("py-cartopy@0.20.3:", when="@6: +makeplots", type=("run"))
4148
depends_on("py-matplotlib", when="+cycloneplotter", type=("run"))
49+
depends_on("py-matplotlib@3.5.2", when="@6: +cycloneplotter", type=("run"))
4250
depends_on("py-cartopy", when="+cycloneplotter", type=("run"))
4351

4452
depends_on("r", when="+tcmpr_plotter", type=("run"))

0 commit comments

Comments
 (0)