[pypar/f16] Fix BZ #647147.

Jussi Lehtola jussilehtola at fedoraproject.org
Thu Nov 17 19:52:42 UTC 2011


commit a6ffca6f4ad8745238b7f91becf64126afb08edb
Author: Jussi Lehtola <jussilehtola at fedoraproject.org>
Date:   Thu Nov 17 21:52:38 2011 +0200

    Fix BZ #647147.

 pypar-mpich.patch |   16 ++++++++++++++++
 pypar.spec        |   21 ++++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/pypar-mpich.patch b/pypar-mpich.patch
new file mode 100644
index 0000000..805fd62
--- /dev/null
+++ b/pypar-mpich.patch
@@ -0,0 +1,16 @@
+diff -up pypar_2.1.4_94/source/pypar.py.orig pypar_2.1.4_94/source/pypar.py
+--- pypar_2.1.4_94/source/pypar.py.orig	2009-12-20 06:46:05.000000000 +0200
++++ pypar_2.1.4_94/source/pypar.py	2011-11-17 13:02:19.385697586 +0200
+@@ -857,12 +857,6 @@ else:
+          MAX, MIN, SUM, PROD, LAND, BAND,\
+          LOR, BOR, LXOR, BXOR
+ 
+-    # Work around bug in OpenMPI (December 2009): 
+-    # https://bugs.launchpad.net/ubuntu/+source/petsc4py/+bug/232036
+-    from ctypes import *
+-    mpi = CDLL('libmpi.so.0', RTLD_GLOBAL)
+-    # End work around
+-
+     # Initialise MPI with cmd line (needed by MPICH/Linux)
+     init(sys.argv) 
+ 
diff --git a/pypar.spec b/pypar.spec
index 2b00724..bae6f89 100644
--- a/pypar.spec
+++ b/pypar.spec
@@ -2,12 +2,15 @@
 
 Name:		pypar
 Version:	2.1.4_94
-Release:	4%{?dist}
+Release:	5%{?dist}
 Summary:	Parallel programming with Python
 Group:		Development/Libraries
 License:	GPLv2+
 URL:		http://sourceforge.net/projects/pypar
 Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
+# Get rid of OpenMPI specific stuff
+Patch0:		pypar-mpich.patch
+
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:	numpy
@@ -80,6 +83,18 @@ done
 # Clean out unneeded dir
 rm -rf pypar_%{version}
 
+# Prepare mpich2 source
+cd mpich2
+%patch0 -p1
+cd ..
+
+# Prepare OpenMPI source
+libmpiso=$(ls -1 %{_libdir}/openmpi/lib/libmpi.so.? | tail -n 1)
+if [ -n "$libmpiso" -a -f "$libmpiso" ] ; then
+ sed -i "s|libmpi.so.0|$(basename $libmpiso)|g" openmpi/source/pypar.py
+else
+ exit 1
+fi
 
 %build
 export CC=mpicc
@@ -142,6 +157,10 @@ rm -rf %{buildroot}
 %{python_sitearch}/mpich2/Pypar*.egg-info
 
 %changelog
+* Thu Nov 17 2011 Jussi Lehtola <jussilehtola at fedoraproject.org> - 2.1.4_94-5
+- Drop OpenMPI specific workaround in pypar.py from MPICH2 version.
+- Patch in correct version of OpenMPI in pypar.py (BZ #754262).
+
 * Wed Mar 30 2011 Deji Akingunola <dakingun at gmail.com> - 2.1.4_94-4
 - Rebuild for mpich2 soname bump
 


More information about the scm-commits mailing list