g2 package bugfix (#39923)
* g2 package bugfix * g2: fix w3emc dep * fix setup_run_environment * Update package.py * Update package.py * Update package.py * Update package.py * Update package.py * style fix * Update var/spack/repos/builtin/packages/g2/package.py Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com> * Update var/spack/repos/builtin/packages/g2/package.py Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com> --------- Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
parent
002e833993
commit
b7c2411b50
@ -7,43 +7,58 @@
|
|||||||
|
|
||||||
|
|
||||||
class G2(CMakePackage):
|
class G2(CMakePackage):
|
||||||
"""The NCEPLIBS-g2 library reads and writes GRIB2 files. GRIdded Binary or General
|
"""Utilities for coding/decoding GRIB2 messages. This library contains
|
||||||
Regularly-distributed Information in Binary form (GRIB) is a data format for
|
Fortran 90 decoder/encoder routines for GRIB edition 2, as well as
|
||||||
meteorological and forecast data, standardized by the World Meteorological
|
indexing/searching utility routines.
|
||||||
Organization (WMO).
|
|
||||||
|
|
||||||
This is part of the NCEPLIBS project."""
|
This is part of the NCEPLIBS project."""
|
||||||
|
|
||||||
homepage = "https://noaa-emc.github.io/NCEPLIBS-g2"
|
homepage = "https://noaa-emc.github.io/NCEPLIBS-g2"
|
||||||
url = "https://github.com/NOAA-EMC/NCEPLIBS-g2/archive/refs/tags/v3.4.3.tar.gz"
|
url = "https://github.com/NOAA-EMC/NCEPLIBS-g2/archive/refs/tags/v3.4.3.tar.gz"
|
||||||
|
git = "https://github.com/NOAA-EMC/NCEPLIBS-g2"
|
||||||
|
|
||||||
maintainers("AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett")
|
maintainers("AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett")
|
||||||
|
|
||||||
|
version("develop", branch="develop")
|
||||||
|
version("3.4.7", sha256="d6530611e3a515122f11ed4aeede7641f6f8932ef9ee0d4828786572767304dc")
|
||||||
version("3.4.6", sha256="c4b03946365ce0bacf1e10e8412a5debd72d8671d1696aa4fb3f3adb119175fe")
|
version("3.4.6", sha256="c4b03946365ce0bacf1e10e8412a5debd72d8671d1696aa4fb3f3adb119175fe")
|
||||||
version("3.4.5", sha256="c18e991c56964953d778632e2d74da13c4e78da35e8d04cb742a2ca4f52737b6")
|
version("3.4.5", sha256="c18e991c56964953d778632e2d74da13c4e78da35e8d04cb742a2ca4f52737b6")
|
||||||
version("3.4.3", sha256="679ea99b225f08b168cbf10f4b29f529b5b011232f298a5442ce037ea84de17c")
|
version("3.4.3", sha256="679ea99b225f08b168cbf10f4b29f529b5b011232f298a5442ce037ea84de17c")
|
||||||
|
|
||||||
|
variant("pic", default=True, description="Build with position-independent-code")
|
||||||
variant(
|
variant(
|
||||||
"build_with_w3emc",
|
"precision",
|
||||||
description="Enable GRIB1 conversion routine",
|
default=("4", "d"),
|
||||||
default=True,
|
values=("4", "d"),
|
||||||
when="@3.4.5:",
|
multi=True,
|
||||||
|
description="Set precision (_4/_d library versions)",
|
||||||
|
when="@3.4.6:",
|
||||||
)
|
)
|
||||||
|
variant("w3emc", default=True, description="Enable GRIB1 through w3emc", when="@3.4.6:")
|
||||||
|
|
||||||
|
depends_on("jasper@:2.0.32")
|
||||||
depends_on("libpng")
|
depends_on("libpng")
|
||||||
depends_on("bacio")
|
depends_on("bacio", when="@3.4.6:")
|
||||||
depends_on("jasper@:2.0.32", when="@:3.4.5")
|
with when("+w3emc"):
|
||||||
depends_on("jasper", when="@3.4.6:")
|
depends_on("w3emc")
|
||||||
depends_on("w3emc", when="@:3.4.5")
|
depends_on("w3emc precision=4", when="precision=4")
|
||||||
|
depends_on("w3emc precision=d", when="precision=d")
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
args = []
|
args = [
|
||||||
|
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
|
||||||
|
self.define_from_variant("BUILD_WITH_W3EMC", "w3emc"),
|
||||||
|
self.define("BUILD_4", self.spec.satisfies("precision=4")),
|
||||||
|
self.define("BUILD_D", self.spec.satisfies("precision=d")),
|
||||||
|
]
|
||||||
|
|
||||||
if self.spec.satisfies("@3.4.5:"):
|
return args
|
||||||
args.append(self.define_from_variant("BUILD_WITH_W3EMC", "build_with_w3emc"))
|
|
||||||
|
|
||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
for suffix in ("4", "d"):
|
precisions = (
|
||||||
|
self.spec.variants["precision"].value if self.spec.satisfies("@3.4.6:") else ("4", "d")
|
||||||
|
)
|
||||||
|
for suffix in precisions:
|
||||||
lib = find_libraries("libg2_" + suffix, root=self.prefix, shared=False, recursive=True)
|
lib = find_libraries("libg2_" + suffix, root=self.prefix, shared=False, recursive=True)
|
||||||
env.set("G2_LIB" + suffix, lib[0])
|
env.set("G2_LIB" + suffix, lib[0])
|
||||||
env.set("G2_INC" + suffix, join_path(self.prefix, "include_" + suffix))
|
env.set("G2_INC" + suffix, join_path(self.prefix, "include_" + suffix))
|
||||||
|
Loading…
Reference in New Issue
Block a user