forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce the bufr_query library from NOAA-EMC #461
Merged
climbfuji
merged 11 commits into
JCSDA:spack-stack-dev
from
srherbener:feature/intro-bufr-query
Aug 21, 2024
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8ac7ecc
Added bufr-query package script
srherbener 07af7ad
Removed blank line from the documentation blurb
srherbener 17c6038
Merge remote-tracking branch 'jcsda/spack-stack-dev' into feature/int…
srherbener 506cf8e
Added v0.0.2 for bufr_query. Build works on generic Linux env
srherbener 9a1d972
Fixed coding style errors.
srherbener fefcde6
More code style errors
srherbener 256c26d
More coding style fixes
srherbener a476583
Merge remote-tracking branch 'jcsda/spack-stack-dev' into HEAD
srherbener f49994d
Used the built in python extension to set up pybind11 dependencies in
srherbener 6d7bbd9
Added patch to bufr-query to get the package to install the python
srherbener 1a834c4
Merge remote-tracking branch 'jcsda/spack-stack-dev' into HEAD
srherbener File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 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): | ||
"""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.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("[email protected]:", 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") | ||
depends_on("python@3:", type=("build", "run"), when="+python") | ||
depends_on("py-pybind11", type=("build"), when="+python") | ||
|
||
# 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) | ||
climbfuji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return args |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the correct syntax for Python is something like
extends(python)
and then use the PythonBuilder to build and install the Python interface. See https://github.com/spack/spack/pull/45504/files for how this is done. I haven't implemented a package this way myself yet, but I understand that this is how it is supposed to be.At the minimum, please remove
@3:
because the minimum version that spack supports is3.7
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I grabbed this from another package script too. The example you give looks a lot nicer. I can take a look at that. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched the code over to use the extend("python") mechanism (as is done in the example PR you noted).