Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/petsc/files/, sci-mathematics/petsc/
Date: Thu, 14 Nov 2019 21:45:53
Message-Id: 1573767853.e9ecfd9bd462516d8b933dd5f6a5dc8f7a2d07da.tamiko@gentoo
1 commit: e9ecfd9bd462516d8b933dd5f6a5dc8f7a2d07da
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 14 20:21:22 2019 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 14 21:44:13 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9ecfd9b
7
8 sci-mathematics/petsc: fix configuration with USE=hypre
9
10 Someone smarter than me has to figure out how to properly fix this
11 python build system...
12
13 Package-Manager: Portage-2.3.79, Repoman-2.3.18
14 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
15
16 .../files/petsc-3.12.1-make_hypre_configure.patch | 90 ++++++++++++++++++++++
17 sci-mathematics/petsc/petsc-3.12.1.ebuild | 5 +-
18 2 files changed, 93 insertions(+), 2 deletions(-)
19
20 diff --git a/sci-mathematics/petsc/files/petsc-3.12.1-make_hypre_configure.patch b/sci-mathematics/petsc/files/petsc-3.12.1-make_hypre_configure.patch
21 new file mode 100644
22 index 00000000000..9460d57e461
23 --- /dev/null
24 +++ b/sci-mathematics/petsc/files/petsc-3.12.1-make_hypre_configure.patch
25 @@ -0,0 +1,90 @@
26 +diff --git a/config/BuildSystem/config/packages/hypre.py b/config/BuildSystem/config/packages/hypre.py
27 +index 869a1661..76067c8d 100644
28 +--- a/config/BuildSystem/config/packages/hypre.py
29 ++++ b/config/BuildSystem/config/packages/hypre.py
30 +@@ -5,10 +5,6 @@ class Configure(config.package.GNUPackage):
31 + def __init__(self, framework):
32 + config.package.GNUPackage.__init__(self, framework)
33 + self.version = '2.18.1'
34 +- self.minversion = '2.14'
35 +- self.versionname = 'HYPRE_RELEASE_VERSION'
36 +- self.versioninclude = 'HYPRE_config.h'
37 +- self.requiresversion = 1
38 + self.gitcommit = 'v'+self.version
39 + self.download = ['git://https://github.com/hypre-space/hypre','https://github.com/hypre-space/hypre/archive/'+self.gitcommit+'.tar.gz']
40 + self.functions = ['HYPRE_IJMatrixCreate']
41 +diff --git a/include/petsc/private/petschypre.h b/include/petsc/private/petschypre.h
42 +index 81ca7136..b403e70e 100644
43 +--- a/include/petsc/private/petschypre.h
44 ++++ b/include/petsc/private/petschypre.h
45 +@@ -6,12 +6,6 @@
46 + #include <HYPRE_config.h>
47 + #include <HYPRE_utilities.h>
48 +
49 +-/* from version 2.16 on, HYPRE_BigInt is 64 bit for 64bit installations
50 +- and 32 bit for 32bit installations -> not the best name for a variable */
51 +-#if PETSC_PKG_HYPRE_VERSION_LT(2,16,0)
52 +-typedef PetscInt HYPRE_BigInt;
53 +-#endif
54 +-
55 + /*
56 + With scalar type == real, HYPRE_Complex == PetscScalar;
57 + With scalar type == complex, HYPRE_Complex is double __complex__ while PetscScalar may be std::complex<double>
58 +diff --git a/src/mat/impls/hypre/mhypre.c b/src/mat/impls/hypre/mhypre.c
59 +index 8e8fe678..3533b99a 100644
60 +--- a/src/mat/impls/hypre/mhypre.c
61 ++++ b/src/mat/impls/hypre/mhypre.c
62 +@@ -15,10 +15,6 @@
63 + #include <_hypre_parcsr_ls.h>
64 + #include <_hypre_sstruct_ls.h>
65 +
66 +-#if PETSC_PKG_HYPRE_VERSION_LT(2,18,0)
67 +-#define hypre_ParCSRMatrixClone(A,B) hypre_ParCSRMatrixCompleteClone(A)
68 +-#endif
69 +-
70 + PETSC_INTERN PetscErrorCode MatPtAP_IS_XAIJ(Mat,Mat,MatReuse,PetscReal,Mat*);
71 +
72 + static PetscErrorCode MatHYPRE_CreateFromMat(Mat,Mat_HYPRE*);
73 +@@ -65,7 +61,6 @@ static PetscErrorCode MatHYPRE_IJMatrixPreallocate(Mat A_d, Mat A_o, HYPRE_IJMat
74 + nnz_o[i] = 0;
75 + }
76 + }
77 +-#if PETSC_PKG_HYPRE_VERSION_GE(2,16,0)
78 + { /* If we don't do this, the columns of the matrix will be all zeros! */
79 + hypre_AuxParCSRMatrix *aux_matrix;
80 + aux_matrix = (hypre_AuxParCSRMatrix*)hypre_IJMatrixTranslator(ij);
81 +@@ -75,9 +70,6 @@ static PetscErrorCode MatHYPRE_IJMatrixPreallocate(Mat A_d, Mat A_o, HYPRE_IJMat
82 + aux_matrix = (hypre_AuxParCSRMatrix*)hypre_IJMatrixTranslator(ij);
83 + hypre_AuxParCSRMatrixNeedAux(aux_matrix) = 1;
84 + }
85 +-#else
86 +- PetscStackCallStandard(HYPRE_IJMatrixSetDiagOffdSizes,(ij,nnz_d,nnz_o));
87 +-#endif
88 + ierr = PetscFree(nnz_d);CHKERRQ(ierr);
89 + ierr = PetscFree(nnz_o);CHKERRQ(ierr);
90 + }
91 +@@ -235,11 +227,7 @@ static PetscErrorCode MatHYPRE_IJMatrixFastCopy_MPIAIJ(Mat A, HYPRE_IJMatrix ij)
92 + /* need to shift the diag column indices (hdiag->j) back to global numbering since hypre is expecting this */
93 + hjj = hdiag->j;
94 + pjj = pdiag->j;
95 +-#if PETSC_PKG_HYPRE_VERSION_GE(2,16,0)
96 + for (i=0; i<pdiag->nz; i++) hjj[i] = pjj[i];
97 +-#else
98 +- for (i=0; i<pdiag->nz; i++) hjj[i] = cstart + pjj[i];
99 +-#endif
100 + ierr = PetscArraycpy(hdiag->data,pdiag->a,pdiag->nz);CHKERRQ(ierr);
101 + if (sameint) {
102 + ierr = PetscArraycpy(hoffd->i,poffd->i,pA->A->rmap->n + 1);CHKERRQ(ierr);
103 +@@ -249,12 +237,8 @@ static PetscErrorCode MatHYPRE_IJMatrixFastCopy_MPIAIJ(Mat A, HYPRE_IJMatrix ij)
104 +
105 + /* need to move the offd column indices (hoffd->j) back to global numbering since hypre is expecting this
106 + If we hacked a hypre a bit more we might be able to avoid this step */
107 +-#if PETSC_PKG_HYPRE_VERSION_GE(2,16,0)
108 + PetscStackCallStandard(hypre_CSRMatrixBigInitialize,(hoffd));
109 + jj = (PetscInt*) hoffd->big_j;
110 +-#else
111 +- jj = (PetscInt*) hoffd->j;
112 +-#endif
113 + pjj = poffd->j;
114 + for (i=0; i<poffd->nz; i++) jj[i] = garray[pjj[i]];
115 +
116
117 diff --git a/sci-mathematics/petsc/petsc-3.12.1.ebuild b/sci-mathematics/petsc/petsc-3.12.1.ebuild
118 index 50ce3b7f663..c2b32ce1afb 100644
119 --- a/sci-mathematics/petsc/petsc-3.12.1.ebuild
120 +++ b/sci-mathematics/petsc/petsc-3.12.1.ebuild
121 @@ -36,7 +36,7 @@ RDEPEND="
122 boost? ( dev-libs/boost )
123 fftw? ( sci-libs/fftw:3.0[mpi?] )
124 hdf5? ( sci-libs/hdf5[mpi?] )
125 - hypre? ( >=sci-libs/hypre-2.8.0b[mpi?] )
126 + hypre? ( >=sci-libs/hypre-2.18.0[mpi?] )
127 metis? ( >=sci-libs/parmetis-4 )
128 mpi? ( virtual/mpi[cxx?,fortran?] )
129 mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack )
130 @@ -53,8 +53,9 @@ DEPEND="${RDEPEND}
131 "
132
133 PATCHES=(
134 - "${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch \
135 + "${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch
136 "${FILESDIR}"/${PN}-3.9.0-fix_sandbox_violation.patch
137 + "${FILESDIR}"/${PN}-3.12.1-make_hypre_configure.patch
138 )
139
140 src_prepare() {