summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Herbener <32968781+srherbener@users.noreply.github.com>2024-09-20 15:46:42 -0600
committerGitHub <noreply@github.com>2024-09-20 15:46:42 -0600
commitfc6cd7c51f21a6cd7d4a7be8b0f4430358d02006 (patch)
tree803fd1f5b77306ec49feda57d12509f7b21c2809
parentcfee88a5bb56a1c8ec892879e04cb6a17c4f9404 (diff)
downloadspack-fc6cd7c51f21a6cd7d4a7be8b0f4430358d02006.tar.gz
spack-fc6cd7c51f21a6cd7d4a7be8b0f4430358d02006.tar.bz2
spack-fc6cd7c51f21a6cd7d4a7be8b0f4430358d02006.tar.xz
spack-fc6cd7c51f21a6cd7d4a7be8b0f4430358d02006.zip
Introduce the bufr_query library from NOAA-EMC (#45920)
* Introduce the bufr_query library from NOAA-EMC (#461) This PR adds in a new package.py script for the new bufr_query library from NOAA-EMC. This is being used by JEDI and other applications. * Add explicit build dependency spec to the pybind11 depends_on spec Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Convert patch file to the URL form which pulls the changes from github. Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * Added new version (0.0.3) and removed obsolete site-packages.patch file --------- Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/bufr-query/package.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/bufr-query/package.py b/var/spack/repos/builtin/packages/bufr-query/package.py
new file mode 100644
index 0000000000..bf79f5f581
--- /dev/null
+++ b/var/spack/repos/builtin/packages/bufr-query/package.py
@@ -0,0 +1,59 @@
+# Copyright 2013-2024 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 BufrQuery(CMakePackage, PythonExtension):
+ """The NOAA bufr-query Library can be used to read NCEP and WMO formated BUFR
+ files using a simple interface that does not require the user to know the
+ details of the BUFR format. Detailed documentation for the BUFR Library can
+ be found at https://bufr-query.readthedocs.io/en/latest/index.html"""
+
+ homepage = "https://github.com/NOAA-EMC/bufr-query"
+ url = "https://github.com/NOAA-EMC/bufr-query/archive/refs/tags/v0.0.1.tar.gz"
+ maintainers("srherbener", "rmclaren")
+
+ license("Apache-2.0", checked_by="srherbener")
+
+ version("0.0.3", sha256="f2952a190cc1d7714a3bfe481fb1545459639ba304fc31b941062b471dea1d41")
+ version("0.0.2", sha256="b87a128246e79e3c76e3158d89823e2ae38e9ee1a5a81b6f7b423837bdb93a1f")
+ version("0.0.1", sha256="001990d864533c101b93d1c351edf50cf8b5ccc575e442d174735f6c332d3d03")
+
+ # Required dependencies
+ depends_on("ecbuild", type=("build"))
+ depends_on("llvm-openmp", when="%apple-clang", type=("build", "run"))
+ depends_on("mpi", type=("build", "run"))
+ depends_on("eckit@1.24.4:", type=("build", "run"))
+ depends_on("eigen@3:", type=("build", "run"))
+ depends_on("gsl-lite", type=("build", "run"))
+ depends_on("netcdf-c", type=("build", "run"))
+ depends_on("netcdf-cxx4", type=("build", "run"))
+ depends_on("bufr", type=("build", "run"))
+
+ # Optional dependencies
+ variant("python", default=True, description="Enable Python interface")
+
+ with when("+python"):
+ extends("python")
+ depends_on("py-pybind11", type="build")
+
+ # Patches
+ patch(
+ "https://github.com/NOAA-EMC/bufr-query/pull/20.patch?full_index=1",
+ sha256="3acf11082c9e76e64dbbda4f62ac0cbc234dca7e60c85a275e778417cfd65001",
+ when="+python @:0.0.2",
+ )
+
+ # CMake configuration
+ def cmake_args(self):
+ args = [self.define_from_variant("BUILD_PYTHON_BINDINGS", "python")]
+
+ # provide path to netcdf-c include files
+ nc_include_dir = Executable("nc-config")("--includedir", output=str).strip()
+ args.append("-DCMAKE_C_FLAGS=-I" + nc_include_dir)
+ args.append("-DCMAKE_CXX_FLAGS=-I" + nc_include_dir)
+
+ return args