forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patch for py-netcdf4 so that we can build py-netcdf4 with ~mpi wh…
…en netCDF was built with +mpi
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 deletions.
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", | ||
|