[petsc] 01/02: set tight dev package dependency on MPI version

Drew Parsons dparsons at moszumanska.debian.org
Fri Jul 1 10:21:06 UTC 2016


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

dparsons pushed a commit to branch master
in repository petsc.

commit af0d71bcaa0e0beca36d8d472e90aab5ba44356a
Author: Drew Parsons <dparsons at debian.org>
Date:   Fri Jul 1 13:13:27 2016 +0800

    set tight dev package dependency on MPI version
    
    PETSc has a tight dependency on the MPI version:
    the release/patch 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
    (whether OpenMPI or MPICH).
    
    Define the required Dependency using the script debian/extract_MPI_dependency
    
    Closes: #828987
---
 debian/changelog              |  6 ++++++
 debian/control                |  4 ++--
 debian/extract_MPI_dependency | 35 +++++++++++++++++++++++++++++++++++
 debian/rules                  | 13 +++++++++++--
 4 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ee4dd05..8afe4de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+petsc (3.6.4.dfsg1-3) UNRELEASED; urgency=high
+
+  * Set tight dev package dependency on MPI version. Closes: #828987.
+
+ -- Drew Parsons <dparsons at debian.org>  Fri, 01 Jul 2016 13:15:34 +0800
+
 petsc (3.6.4.dfsg1-2) unstable; urgency=medium
 
   * Use alternatives to set default versions for soname (3.6) in
diff --git a/debian/control b/debian/control
index 12dbbe1..412cda4 100644
--- a/debian/control
+++ b/debian/control
@@ -42,7 +42,7 @@ Package: libpetsc3.6.4-dev
 Multi-Arch: same
 Architecture: linux-any hurd-any
 Section: libdevel
-Depends: libpetsc3.6.4 (= ${binary:Version}), mpi-default-dev (>= 1.0.2), libsuitesparse-dev, libspooles-dev,
+Depends: libpetsc3.6.4 (= ${binary:Version}), ${MPI:Depends}, libsuitesparse-dev, libspooles-dev,
  libhypre-dev (>= 2.0.0.dfsg-7), libptscotch-dev, libblacs-mpi-dev, libscalapack-mpi-dev,
  libmumps-dev, libfftw3-dev, libfftw3-mpi-dev, libssl-dev, libgfortran-5-dev,
  ${misc:Depends}, ${python:Depends}
@@ -162,7 +162,7 @@ Package: libpetsc-complex-3.6.4-dev
 Architecture: linux-any hurd-any
 Multi-Arch: same
 Section: libdevel
-Depends: libpetsc-complex-3.6.4 (= ${binary:Version}), mpi-default-dev (>= 1.0.2), libsuitesparse-dev, libspooles-dev,
+Depends: libpetsc-complex-3.6.4 (= ${binary:Version}), ${MPI:Depends}, libsuitesparse-dev, libspooles-dev,
  libhypre-dev (>= 2.0.0.dfsg-7), libptscotch-dev, libblacs-mpi-dev, libscalapack-mpi-dev,
  libmumps-dev, libfftw3-dev, libfftw3-mpi-dev, libssl-dev, libgfortran-5-dev,
  ${misc:Depends}, ${python:Depends}
diff --git a/debian/extract_MPI_dependency b/debian/extract_MPI_dependency
new file mode 100755
index 0000000..a8dc659
--- /dev/null
+++ b/debian/extract_MPI_dependency
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# PETSc depends on the specific MPI version (including release/patch version)
+# that it was built against, whether OpenMPI or MPICH.
+#
+# This script returns a string identifying the required dependency,
+# intended to be inserted as a Dependency for the version-specific PETSc -dev packages.
+
+source <(sed "s/=/=\"/; s/$/\"/"  /usr/share/mpi-default-dev/debian_defaults)
+
+if [ "x$ARCH_DEFAULT_MPI_IMPL" != "xopenmpi" ]; then
+    # "not OpenMPI", assume MPICH
+    MPI_DEV_PACKAGE=libmpich-dev
+else
+    # OpenMPI
+    MPI_DEV_PACKAGE=libopenmpi-dev
+fi
+
+MPI_DEB_VERSION=$(dpkg -s $MPI_DEV_PACKAGE | awk '/Version:/ {print $2}')
+
+# extract the current MPI version (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/^.*\.//")
+
+# 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_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)"
+
+echo $MPI_DEV_DEPENDS
diff --git a/debian/rules b/debian/rules
index fabcc58..4f4d7ab 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,6 +37,13 @@ include /usr/share/mpi-default-dev/debian_defaults
 PETSC_MPI=$(ARCH_DEFAULT_MPI_IMPL)
 PETSC_MPI_DIR=/usr/lib/$(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 was built against, see /usr/lib/petscdir/*/x86_64-linux-gnu-real/include/petscsys.h
+# Define the required version here
+MPI_DEPENDS=$(shell debian/extract_MPI_dependency)
+
+
 # facilitate build-time testing (invoking OpenMPI) when building in a chroot (pbuilder or sbuild)
 export OMPI_MCA_plm_rsh_agent=/bin/false
 
@@ -69,7 +76,7 @@ PETSC_COMPLEX_VERSIONED_DEV_PACKAGE=lib$(PETSC_COMPLEX_NAME)-dev
 PETSC_COMPLEX_VERSIONED_PACKAGE=lib$(PETSC_COMPLEX_NAME)
 PETSC_COMPLEX_DEBUG_PACKAGE=lib$(PETSC_COMPLEX_NAME)-dbg
 
-# install into /usr/lib/petscdir rather than /usr/lib/petsc 
+# install into /usr/lib/petscdir rather than /usr/lib/petsc
 # to allow /usr/lib/petsc to be configured by alternatives
 PETSC_DIR_PREFIX=/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-real
 PETSC_DIR_DEBUG_PREFIX=/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-real-debug
@@ -105,7 +112,6 @@ CONFIGURATION_OPTIONS=--with-shared-libraries \
 %:
 	dh $@ --with python2
 
-
 override_dh_auto_clean:
 	if [ -d $(PETSC_DEBUG_BUILD_DIR) ]; then \
 	  dh_auto_clean -p$(PETSC_DEBUG_PACKAGE) -p$(PETSC_DOC_PACKAGE) -- \
@@ -268,6 +274,8 @@ override_dh_installdeb:
 	  sed -i -e 's/__PETSC_SONAME_VERSION__/$(PETSC_SONAME_VERSION)/; s/__PETSC_VERSION__/$(PETSC_VERSION)/; s/__DEB_HOST_MULTIARCH__/$(DEB_HOST_MULTIARCH)/' debian/$$pkg/DEBIAN/*; \
 	done
 
+override_dh_gencontrol:
+	dh_gencontrol -- -VMPI:Depends="$(MPI_DEPENDS)"
 
 override_dh_strip:
 	dh_strip --dbg-package=$(PETSC_DEBUG_PACKAGE)
@@ -281,3 +289,4 @@ USCAN_DESTDIR := $(CURDIR)
 
 get-orig-source:
 	uscan --no-conf --download-current-version --repack --compression xz
+

-- 
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