forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add patch for py-netcdf4 so that we can build it ~mpi #502
Merged
climbfuji
merged 1 commit into
JCSDA:spack-stack-dev
from
climbfuji:bugfix/pynetcdf4_nompi
Jan 21, 2025
+19
−2
Merged
Changes from all commits
Commits
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,11 @@ | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -392,7 +392,8 @@ if 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:] and '--version' n | ||
(netcdf_lib_version > "4.4" and netcdf_lib_version < "4.5"): | ||
has_cdf5_format = True | ||
|
||
- has_parallel_support = check_has_parallel_support(inc_dirs) | ||
+ #has_parallel_support = check_has_parallel_support(inc_dirs) | ||
+ has_parallel_support = False | ||
has_has_not = "has" if has_parallel_support else "does not have" | ||
print(f"netcdf lib {has_has_not} parallel functions") |
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 |
---|---|---|
|
@@ -42,9 +42,9 @@ class PyNetcdf4(PythonPackage): | |
# https://github.com/Unidata/netcdf4-python/pull/1317 | ||
depends_on("py-numpy@:1", when="@:1.6", type=("build", "link", "run")) | ||
depends_on("py-mpi4py", when="+mpi", type=("build", "run")) | ||
depends_on("netcdf-c", when="-mpi") | ||
depends_on("netcdf-c", when="~mpi") | ||
depends_on("netcdf-c+mpi", when="+mpi") | ||
depends_on("[email protected]:+hl", when="-mpi") | ||
depends_on("[email protected]:+hl", when="~mpi") | ||
depends_on("[email protected]:+hl+mpi", when="+mpi") | ||
|
||
# The installation script tries to find hdf5 using pkg-config. However, the | ||
|
@@ -54,6 +54,12 @@ class PyNetcdf4(PythonPackage): | |
# following patch disables the usage of pkg-config at all. | ||
patch("disable_pkgconf.patch") | ||
|
||
# Allow building py-netcdf4 ~mpi when netCDF was build with +mpi. This patch | ||
# overrides the auto-decect feature (has_parallel_support) in setup.py. The | ||
# logic in setup.py changed between 1.6.5 and 1.7.1, therefore this patch | ||
# only works for versions 1.7.1 and later. | ||
patch("nompi.patch", when="@1.7.1: ~mpi") | ||
|
||
# https://github.com/Unidata/netcdf4-python/pull/1322 | ||
patch( | ||
"https://github.com/Unidata/netcdf4-python/commit/49dcd0b5bd25824c254770c0d41445133fc13a46.patch?full_index=1", | ||
|
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 would take out the
when="~mpi"
but functionally I don't think it matters.