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 )
0 commit comments