[petsc] 01/01: create mpi-version-test.patch to relax MPI version test

Drew Parsons dparsons at moszumanska.debian.org
Thu Jul 20 16:48:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

dparsons pushed a commit to branch master
in repository petsc.

commit aba34e3645cf1a6cb650903c87fefae25d25ccc3
Author: Drew Parsons <dparsons at debian.org>
Date:   Fri Jul 21 00:44:40 2017 +0800

    create mpi-version-test.patch to relax MPI version test
    
    Match to Major.Minor, not patch (release) version in include/petscsys.h.
    Should simplify future openmpi upgrades, see debian/extract_MPI_dependency.
    Taken from upstream git (commits ca70f86, 41f4af4).
    
    Closes: #865526
---
 debian/changelog                      |  9 ++++++++
 debian/extract_MPI_dependency         | 22 ++++++++++---------
 debian/patches/mpi-version-test.patch | 40 +++++++++++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 debian/rules                          |  6 +++---
 5 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e42f45e..75948c4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+petsc (3.7.6+dfsg1-3) UNRELEASED; urgency=medium
+
+  * create mpi-version-test.patch to relax MPI version test to match
+    minor, not patch (release) version in include/petscsys.h. Should
+    simplify future openmpi upgrades, see debian/extract_MPI_dependency.
+    Taken from upstream git (commits ca70f86, 41f4af4). Closes: #865526.
+
+ -- Drew Parsons <dparsons at debian.org>  Fri, 21 Jul 2017 00:24:00 +0800
+
 petsc (3.7.6+dfsg1-2) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/extract_MPI_dependency b/debian/extract_MPI_dependency
index a8dc659..02336f3 100755
--- a/debian/extract_MPI_dependency
+++ b/debian/extract_MPI_dependency
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-# PETSc depends on the specific MPI version (including release/patch version)
-# that it was built against, whether OpenMPI or MPICH.
+# PETSc depends on the specific MPI minor version (not release/patch version)
+# that it was built against, whether OpenMPI or MPICH, see include/petscsys.h.
 #
 # This script returns a string identifying the required dependency,
 # intended to be inserted as a Dependency for the version-specific PETSc -dev packages.
@@ -18,18 +18,20 @@ fi
 
 MPI_DEB_VERSION=$(dpkg -s $MPI_DEV_PACKAGE | awk '/Version:/ {print $2}')
 
-# extract the current MPI version (drop epoch and debian package version)
+# extract the current MPI version Major.Minor.Release (drop epoch and debian package version)
 MPI_VERSION=$(echo $MPI_DEB_VERSION | sed "s/^.[^:]*://; s/-[^-]*$//")
 
-# "Main" version is upstream version up to the last '.'
-MPI_MAIN_VERSION=$(echo $MPI_VERSION | sed "s/.[^.]*$//")
-# "Release" version is upstream version after the last '.'
-MPI_RELEASE_VERSION=$(echo $MPI_VERSION | sed "s/^.*\.//")
+# "Major.Minor" version drops the Release (Patch) version
+MPI_MAJOR_MINOR_VERSION=$(echo $MPI_VERSION | sed "s/.[^.]*$//")
+# "Major" version is upstream version up to the '.'
+MPI_MAJOR_VERSION=$(echo $MPI_MAJOR_MINOR_VERSION | sed "s/.[^.]*$//")
+# "Minor" version is upstream version after the '.'
+MPI_MINOR_VERSION=$(echo $MPI_MAJOR_MINOR_VERSION | sed "s/^.*\.//")
 
 # Hopefully the release version is just a number. Use it to form the "next" version.
-MPI_NEXT_VERSION=${MPI_MAIN_VERSION}.$(( $MPI_RELEASE_VERSION + 1 ))
+MPI_NEXT_VERSION=${MPI_MAJOR_VERSION}.$(( $MPI_MINOR_VERSION + 1 ))
 
-# MPI_DEV_DEPENDS is a string like "libopenmpi-dev (>= 1.10.3), libopenmpi-dev (<< 1.10.4)"
-MPI_DEV_DEPENDS="$MPI_DEV_PACKAGE (>= $MPI_VERSION), $MPI_DEV_PACKAGE (<< $MPI_NEXT_VERSION)"
+# MPI_DEV_DEPENDS is a string like "libopenmpi-dev (>= 2.1), libopenmpi-dev (<< 2.2)"
+MPI_DEV_DEPENDS="$MPI_DEV_PACKAGE (>= $MPI_MAJOR_MINOR_VERSION), $MPI_DEV_PACKAGE (<< $MPI_NEXT_VERSION)"
 
 echo $MPI_DEV_DEPENDS
diff --git a/debian/patches/mpi-version-test.patch b/debian/patches/mpi-version-test.patch
new file mode 100644
index 0000000..765fb8c
--- /dev/null
+++ b/debian/patches/mpi-version-test.patch
@@ -0,0 +1,40 @@
+Index: petsc/include/petscsys.h
+===================================================================
+--- petsc.orig/include/petscsys.h
++++ petsc/include/petscsys.h
+@@ -142,18 +142,32 @@ void assert_never_put_petsc_headers_insi
+ #  if !defined(__MPIUNI_H)
+ #    error "PETSc was configured with --with-mpi=0 but now appears to be compiling using a different mpi.h"
+ #  endif
++#elif defined(PETSC_HAVE_I_MPI_NUMVERSION)
++#  if !defined(I_MPI_NUMVERSION)
++#    error "PETSc was configured with I_MPI but now appears to be compiling using a non-I_MPI mpi.h"
++#  elif I_MPI_NUMVERSION != PETSC_HAVE_I_MPI_NUMVERSION
++#    error "PETSc was configured with one I_MPI mpi.h version but now appears to be compiling using a different I_MPI mpi.h version"
++#  endif
++#elif defined(PETSC_HAVE_MVAPICH2_NUMVERSION)
++#  if !defined(MVAPICH2_NUMVERSION)
++#    error "PETSc was configured with MVAPICH2 but now appears to be compiling using a non-MVAPICH2 mpi.h"
++#  elif MVAPICH2_NUMVERSION != PETSC_HAVE_MVAPICH2_NUMVERSION
++#    error "PETSc was configured with one MVAPICH2 mpi.h version but now appears to be compiling using a different MVAPICH2 mpi.h version"
++#  endif
+ #elif defined(PETSC_HAVE_MPICH_NUMVERSION)
+-#  if !defined(MPICH_NUMVERSION)
++#  if !defined(MPICH_NUMVERSION) || defined(MVAPICH2_NUMVERSION) || defined(I_MPI_NUMVERSION)
+ #    error "PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"
+-#  elif MPICH_NUMVERSION != PETSC_HAVE_MPICH_NUMVERSION
++#  elif (MPICH_NUMVERSION/100000 != PETSC_HAVE_MPICH_NUMVERSION/100000) || (MPICH_NUMVERSION%100000/1000 < PETSC_HAVE_MPICH_NUMVERSION%100000/1000)
+ #    error "PETSc was configured with one MPICH mpi.h version but now appears to be compiling using a different MPICH mpi.h version"
+ #  endif
+ #elif defined(PETSC_HAVE_OMPI_MAJOR_VERSION)
+ #  if !defined(OMPI_MAJOR_VERSION)
+ #    error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"
+-#  elif (OMPI_MAJOR_VERSION != PETSC_HAVE_OMPI_MAJOR_VERSION) || (OMPI_MINOR_VERSION != PETSC_HAVE_OMPI_MINOR_VERSION) || (OMPI_RELEASE_VERSION != PETSC_HAVE_OMPI_RELEASE_VERSION)
++#  elif (OMPI_MAJOR_VERSION != PETSC_HAVE_OMPI_MAJOR_VERSION) || (OMPI_MINOR_VERSION != PETSC_HAVE_OMPI_MINOR_VERSION) || (OMPI_RELEASE_VERSION < PETSC_HAVE_OMPI_RELEASE_VERSION)
+ #    error "PETSc was configured with one OpenMPI mpi.h version but now appears to be compiling using a different OpenMPI mpi.h version"
+ #  endif
++#elif defined(OMPI_MAJOR_VERSION) || defined(MPICH_NUMVERSION)
++#  error "PETSc was configured with undetermined MPI - but now appears to be compiling using either of OpenMPI or a MPICH variant"
+ #endif
+ 
+ /*
diff --git a/debian/patches/series b/debian/patches/series
index 4e8ed55..b397701 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@ soname_extension
 hurd.patch
 test_mpi_conditional_bug816101
 build-ssl1.1.patch
+mpi-version-test.patch
diff --git a/debian/rules b/debian/rules
index ec27fac..5457139 100755
--- a/debian/rules
+++ b/debian/rules
@@ -39,10 +39,10 @@ include /usr/share/mpi-default-dev/debian_defaults
 PETSC_MPI=$(ARCH_DEFAULT_MPI_IMPL)
 PETSC_MPI_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)/$(PETSC_MPI)
 
-# PETSc has a tight dependency on the MPI version:
-# the release/patch version of the current MPI must match the one that
+# PETSc has a tight dependency on the MPI minor version:
+# the Major.Minor version of the current MPI must match the one that
 # PETSc was built against, see /usr/lib/petscdir/*/x86_64-linux-gnu-real/include/petscsys.h
-# Define the required version here
+# Define the required version here:
 MPI_DEPENDS=$(shell debian/extract_MPI_dependency)
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/petsc.git



More information about the debian-science-commits mailing list