public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Justin Lecher" <jlec@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/h5py/files/, dev-python/h5py/
Date: Tue, 17 Nov 2015 09:26:09 +0000 (UTC)	[thread overview]
Message-ID: <1447752366.3f54a597796ca0ada6dca781c84e83466ca9ce1b.jlec@gentoo> (raw)

commit:     3f54a597796ca0ada6dca781c84e83466ca9ce1b
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 17 09:23:23 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Tue Nov 17 09:26:06 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f54a597

dev-python/h5py: Backport support for mpi4py-2

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=563890

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 dev-python/h5py/files/h5py-2.5.0-mpi4py2.backport | 55 +++++++++++++++++++++++
 dev-python/h5py/h5py-2.5.0.ebuild                 |  4 ++
 2 files changed, 59 insertions(+)

diff --git a/dev-python/h5py/files/h5py-2.5.0-mpi4py2.backport b/dev-python/h5py/files/h5py-2.5.0-mpi4py2.backport
new file mode 100644
index 0000000..06bdb83
--- /dev/null
+++ b/dev-python/h5py/files/h5py-2.5.0-mpi4py2.backport
@@ -0,0 +1,55 @@
+commit 364a77403199087168786234554f459e7d985063
+Author: Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk>
+Date:   Tue Nov 3 14:18:48 2015 +0000
+
+    setup: Support building with current mpi4py version
+    
+    mpi4py migrated the mpi4py.mpi_c module to mpi4py.libmpi in April 2014.
+    After the release of v1.3.1 but before v2.  Sniff this in setup
+    configure and import MPI types from the appropriate module in h5p.pyx,
+    to allow building with MPI on and modern mpi4py versions.
+
+diff --git a/h5py/h5p.pyx b/h5py/h5p.pyx
+index da175dd..8a1cbb0 100644
+--- a/h5py/h5p.pyx
++++ b/h5py/h5p.pyx
+@@ -25,7 +25,11 @@ from h5py import _objects
+ from ._objects import phil, with_phil
+ 
+ if MPI:
+-    from mpi4py.mpi_c cimport MPI_Comm, MPI_Info, MPI_Comm_dup, MPI_Info_dup, \
++    if MPI4PY_V2:
++        from mpi4py.libmpi cimport MPI_Comm, MPI_Info, MPI_Comm_dup, MPI_Info_dup, \
++                               MPI_Comm_free, MPI_Info_free
++    else:
++        from mpi4py.mpi_c cimport MPI_Comm, MPI_Info, MPI_Comm_dup, MPI_Info_dup, \
+                                MPI_Comm_free, MPI_Info_free
+ 
+ # Initialization
+diff --git a/setup_build.py b/setup_build.py
+index ccc0f27..e49a4e8 100644
+--- a/setup_build.py
++++ b/setup_build.py
+@@ -162,14 +162,22 @@ class h5py_build_ext(build_ext):
+         # Rewrite config.pxi file if needed
+         if not op.isfile(config_file) or config.rebuild_required:
+             with open(config_file, 'wb') as f:
++                if config.mpi:
++                    import mpi4py
++                    from distutils.version import StrictVersion
++                    v2 = StrictVersion(mpi4py.__version__) > StrictVersion("1.3.1")
++                else:
++                    v2 = False
+                 s = """\
+ # This file is automatically generated by the h5py setup script.  Don't modify.
+ 
+ DEF MPI = %(mpi)s
++DEF MPI4PY_V2 = %(mpi4py_v2)s
+ DEF HDF5_VERSION = %(version)s
+ DEF SWMR_MIN_HDF5_VERSION = (1,9,178)
+ """
+                 s %= {'mpi': bool(config.mpi),
++                      'mpi4py_v2': bool(v2),
+                       'version': tuple(int(x) for x in config.hdf5_version.split('.'))}
+                 s = s.encode('utf-8')
+                 f.write(s)

diff --git a/dev-python/h5py/h5py-2.5.0.ebuild b/dev-python/h5py/h5py-2.5.0.ebuild
index 5947f06..f7c87dc 100644
--- a/dev-python/h5py/h5py-2.5.0.ebuild
+++ b/dev-python/h5py/h5py-2.5.0.ebuild
@@ -31,6 +31,10 @@ DEPEND="${RDEPEND}
 		)
 	mpi? ( dev-python/mpi4py[${PYTHON_USEDEP}] )"
 
+PATCHES=(
+	"${FILESDIR}"/${P}-mpi4py2.backport
+)
+
 pkg_setup() {
 	use mpi && export CC=mpicc
 }


             reply	other threads:[~2015-11-17  9:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17  9:26 Justin Lecher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-01-25  3:53 [gentoo-commits] repo/gentoo:master commit in: dev-python/h5py/files/, dev-python/h5py/ Benda XU
2021-04-12 10:13 Michał Górny
2023-02-24  4:50 Michał Górny
2023-08-12 16:16 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447752366.3f54a597796ca0ada6dca781c84e83466ca9ce1b.jlec@gentoo \
    --to=jlec@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox