1 |
commit: 2c0aea17b396af99413234f7a84607817f31dbd3 |
2 |
Author: Fabio Rossi <rossi.f <AT> inwind <DOT> it> |
3 |
AuthorDate: Wed Dec 1 18:04:37 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 1 21:25:12 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c0aea17 |
7 |
|
8 |
sci-mathematics/petsc: version bump to 3.16.0 and bugfix |
9 |
|
10 |
The latest release is needed to backport the patch from upstream |
11 |
to solve the issue of Gentoo bug #827185 (build issue with |
12 |
USE="fftw -mpi"). |
13 |
|
14 |
Upstream fix is at https://gitlab.com/petsc/petsc/-/merge_requests/4604 |
15 |
|
16 |
Closes: https://bugs.gentoo.org/827185 |
17 |
Signed-off-by: Fabio Rossi <rossi.f <AT> inwind.it> |
18 |
Closes: https://github.com/gentoo/gentoo/pull/23136 |
19 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
20 |
|
21 |
sci-mathematics/petsc/Manifest | 2 + |
22 |
.../files/petsc-3.16.0-fix_sandbox_violation.patch | 15 ++ |
23 |
sci-mathematics/petsc/petsc-3.16.0.ebuild | 192 +++++++++++++++++++++ |
24 |
3 files changed, 209 insertions(+) |
25 |
|
26 |
diff --git a/sci-mathematics/petsc/Manifest b/sci-mathematics/petsc/Manifest |
27 |
index b8a099ec30dc..66543b456f86 100644 |
28 |
--- a/sci-mathematics/petsc/Manifest |
29 |
+++ b/sci-mathematics/petsc/Manifest |
30 |
@@ -1,3 +1,5 @@ |
31 |
DIST petsc-3.13.1.tar.gz 35097687 BLAKE2B fccf64fd3694deffdd0dc561069ffa7e9342fe279b5c9123edeb011df931874083839d27b7b9a0c63faea6487b104b54fd4ce68a88a074c82de91e8baaf270b0 SHA512 41c3138a6ae6c1f2d9077b464c6aeda96287e5a76849582b8f432e2ee93d2594a78ba2181eac0054a77b6165692be5f1a057049313f2be9743d4246383dfdc77 |
32 |
DIST petsc-3.14.6.tar.gz 39719179 BLAKE2B d3047baf87c67eb64ef02c0c54d6313ea06f091b377b3cdf6dcf6d96c7d68cec5958a007ddd84b52a3ab39bfc0adf146307fa1785a10f39386393371186a3fba SHA512 9766e164446ac5a69b8bf761a0e8a235b1a2b85ed9c96a7fd59e668ae4cceb9d9559a38b175b4aa9747e78d7b44d0018a3c02748dcd3d783d28f861f8382d44c |
33 |
DIST petsc-3.15.0.tar.gz 15976488 BLAKE2B babfbeb05321c9cb2f7d70ef8ffca974a016eae73ca1a3359d9a8d38aa5aa90ff34571169a5711627d738b93f89fdee3d0a0ff1bd0e51cb7300bbb9b0a8675cb SHA512 d1565823d8a5ce5e1c2c576bbe1b4ebf467cef20bbd8e0cf6c303c6c2af2bf902b66c79468f4e125496f9242be4bd6ac162535ee30252cfb902c0d906a6f27c0 |
34 |
+DIST petsc-3.16.0-fftw-without-mpi.patch.bz2 5824 BLAKE2B 59615b1bbaf8ca1da92d7d193a45a2dd434f762cd741d711d4f408183a201a276ac3c968a3e7d740d19212120271701bce52bb7b0f4e311268f40915c81f9dcb SHA512 8e07dfe56a9150ce9a3a5ab8012657875ef84e6e7daa60560bbdd9062078c876a826057f3f3eaf1697ce046a82756ee6eb6a8b819eb51245367c9d5c8a72ee8e |
35 |
+DIST petsc-3.16.0.tar.gz 16748960 BLAKE2B 87f9fdb79a9c44e5f476fa4746ad0cbe72f3eda9f6039f2e4743105626701d7c8d6c010fdb9d89becf8619288d0b7a60c8bc4e2fc0793eac5b39030b02c04fd9 SHA512 5280032fb4ec4d058733788bb0ae674e7400565e204133bd10ed88a2965230ec7adeaca2d498267ce661377ca7e6f9d948992206b1d679587606cb422c004655 |
36 |
|
37 |
diff --git a/sci-mathematics/petsc/files/petsc-3.16.0-fix_sandbox_violation.patch b/sci-mathematics/petsc/files/petsc-3.16.0-fix_sandbox_violation.patch |
38 |
new file mode 100644 |
39 |
index 000000000000..d1ed880bddfd |
40 |
--- /dev/null |
41 |
+++ b/sci-mathematics/petsc/files/petsc-3.16.0-fix_sandbox_violation.patch |
42 |
@@ -0,0 +1,15 @@ |
43 |
+--- a/config/PETSc/options/installDir.py |
44 |
++++ b/config/PETSc/options/installDir.py |
45 |
+@@ -40,13 +40,7 @@ class Configure(config.base.Configure): |
46 |
+ self.dir = os.path.abspath(os.path.expanduser(self.framework.argDB['prefix'])) |
47 |
+ self.petscDir = self.dir |
48 |
+ self.petscArch = '' |
49 |
+- try: |
50 |
+- os.makedirs(os.path.join(self.dir,'PETScTestDirectory')) |
51 |
+- os.rmdir(os.path.join(self.dir,'PETScTestDirectory')) |
52 |
+- except Exception as e: |
53 |
+- self.logPrint('Error trying to to test write permissions on directory '+str(e)) |
54 |
+- self.installSudo = 'sudo ' |
55 |
+ else: |
56 |
+ self.dir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch)) |
57 |
+ self.petscDir = self.petscdir.dir |
58 |
|
59 |
diff --git a/sci-mathematics/petsc/petsc-3.16.0.ebuild b/sci-mathematics/petsc/petsc-3.16.0.ebuild |
60 |
new file mode 100644 |
61 |
index 000000000000..f39f87d8c281 |
62 |
--- /dev/null |
63 |
+++ b/sci-mathematics/petsc/petsc-3.16.0.ebuild |
64 |
@@ -0,0 +1,192 @@ |
65 |
+# Copyright 1999-2021 Gentoo Authors |
66 |
+# Distributed under the terms of the GNU General Public License v2 |
67 |
+ |
68 |
+EAPI=7 |
69 |
+ |
70 |
+PYTHON_COMPAT=( python3_{8..10} ) |
71 |
+ |
72 |
+inherit flag-o-matic fortran-2 python-any-r1 toolchain-funcs |
73 |
+ |
74 |
+DESCRIPTION="Portable, Extensible Toolkit for Scientific Computation" |
75 |
+HOMEPAGE="https://www.mcs.anl.gov/petsc/" |
76 |
+SRC_URI="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${P}.tar.gz" |
77 |
+SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-fftw-without-mpi.patch.bz2" |
78 |
+ |
79 |
+LICENSE="BSD-2" |
80 |
+SLOT="0" |
81 |
+KEYWORDS="~amd64 ~x86" |
82 |
+IUSE="afterimage boost complex-scalars cxx debug fftw |
83 |
+ fortran hdf5 hypre mpi metis mumps scotch sparse superlu threads X" |
84 |
+ |
85 |
+# hypre and superlu curretly exclude each other due to missing linking to hypre |
86 |
+# if both are enabled |
87 |
+REQUIRED_USE=" |
88 |
+ afterimage? ( X ) |
89 |
+ complex-scalars? ( !hypre !superlu ) |
90 |
+ hdf5? ( mpi ) |
91 |
+ hypre? ( cxx mpi !superlu ) |
92 |
+ mumps? ( mpi scotch ) |
93 |
+ scotch? ( mpi ) |
94 |
+ superlu? ( !hypre ) |
95 |
+" |
96 |
+ |
97 |
+RDEPEND=" |
98 |
+ virtual/blas |
99 |
+ virtual/lapack |
100 |
+ afterimage? ( media-libs/libafterimage ) |
101 |
+ boost? ( dev-libs/boost ) |
102 |
+ fftw? ( sci-libs/fftw:3.0[mpi?] ) |
103 |
+ hdf5? ( sci-libs/hdf5[mpi?] ) |
104 |
+ hypre? ( >=sci-libs/hypre-2.18.0[mpi?] ) |
105 |
+ metis? ( >=sci-libs/parmetis-4 ) |
106 |
+ mpi? ( virtual/mpi[cxx?,fortran?] ) |
107 |
+ mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack ) |
108 |
+ scotch? ( sci-libs/scotch[mpi?] ) |
109 |
+ sparse? ( sci-libs/suitesparse >=sci-libs/cholmod-1.7.0 ) |
110 |
+ superlu? ( >=sci-libs/superlu-5 ) |
111 |
+ X? ( x11-libs/libX11 ) |
112 |
+" |
113 |
+ |
114 |
+DEPEND="${RDEPEND} |
115 |
+ ${PYTHON_DEPS} |
116 |
+ virtual/pkgconfig |
117 |
+ dev-util/cmake |
118 |
+ sys-apps/which |
119 |
+" |
120 |
+ |
121 |
+PATCHES=( |
122 |
+ "${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch |
123 |
+ "${FILESDIR}"/${P}-fix_sandbox_violation.patch |
124 |
+ "${WORKDIR}"/${P}-fftw-without-mpi.patch |
125 |
+) |
126 |
+ |
127 |
+# petsc uses --with-blah=1 and --with-blah=0 to en/disable options |
128 |
+petsc_enable() { |
129 |
+ use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0" |
130 |
+} |
131 |
+# add external library: |
132 |
+# petsc_with use_flag libname libdir |
133 |
+# petsc_with use_flag libname include linking_libs |
134 |
+petsc_with() { |
135 |
+ local myuse p=${2:-${1}} |
136 |
+ if use ${1}; then |
137 |
+ myuse="--with-${p}=1" |
138 |
+ if [[ $# -ge 4 ]]; then |
139 |
+ myuse="${myuse} --with-${p}-include=${EPREFIX}${3}" |
140 |
+ shift 3 |
141 |
+ myuse="${myuse} --with-${p}-lib=$@" |
142 |
+ else |
143 |
+ myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}" |
144 |
+ fi |
145 |
+ else |
146 |
+ myuse="--with-${p}=0" |
147 |
+ fi |
148 |
+ echo ${myuse} |
149 |
+} |
150 |
+ |
151 |
+# select between configure options depending on use flag |
152 |
+petsc_select() { |
153 |
+ use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4" |
154 |
+} |
155 |
+ |
156 |
+src_configure() { |
157 |
+ # bug 548498 |
158 |
+ # PETSc runs mpi processes during configure that result in a sandbox |
159 |
+ # violation by trying to open /proc/mtrr rw. This is not easy to |
160 |
+ # mitigate because it happens in libpciaccess.so called by libhwloc.so, |
161 |
+ # which is used by libmpi.so. |
162 |
+ addpredict /proc/mtrr |
163 |
+ # if mpi is built with knem support it needs /dev/knem too |
164 |
+ addpredict /dev/knem |
165 |
+ |
166 |
+ # configureMPITypes with openmpi-2* insists on accessing the scaling |
167 |
+ # governor rw. |
168 |
+ addpredict /sys/devices/system/cpu/ |
169 |
+ |
170 |
+ # bug 771711 |
171 |
+ # configureMPIEXEC and configureMPITypes access /dev/nvidiactl |
172 |
+ addpredict /dev/nvidiactl |
173 |
+ |
174 |
+ # bug 810841 |
175 |
+ addpredict /dev/kfd |
176 |
+ |
177 |
+ local mylang |
178 |
+ local myopt |
179 |
+ |
180 |
+ use cxx && mylang="cxx" || mylang="c" |
181 |
+ use debug && myopt="debug" || myopt="opt" |
182 |
+ |
183 |
+ # environmental variables expected by petsc during build |
184 |
+ |
185 |
+ export PETSC_DIR="${S}" |
186 |
+ export PETSC_ARCH="linux-gnu-${mylang}-${myopt}" |
187 |
+ |
188 |
+ if use debug; then |
189 |
+ strip-flags |
190 |
+ filter-flags -O* |
191 |
+ fi |
192 |
+ |
193 |
+ # C Support on CXX builds is enabled if possible i.e. when not using |
194 |
+ # complex scalars (no complex type for both available at the same time) |
195 |
+ |
196 |
+ econf \ |
197 |
+ scrollOutput=1 \ |
198 |
+ FFLAGS="${FFLAGS} -fPIC" \ |
199 |
+ CFLAGS="${CFLAGS} -fPIC" \ |
200 |
+ CXXFLAGS="${CXXFLAGS} -fPIC" \ |
201 |
+ LDFLAGS="${LDFLAGS}" \ |
202 |
+ --prefix="${EPREFIX}/usr/$(get_libdir)/petsc" \ |
203 |
+ --with-shared-libraries \ |
204 |
+ --with-single-library \ |
205 |
+ --with-clanguage=${mylang} \ |
206 |
+ $(use cxx && ! use complex-scalars && echo "with-c-support=1") \ |
207 |
+ --with-petsc-arch=${PETSC_ARCH} \ |
208 |
+ --with-precision=double \ |
209 |
+ --with-gnu-compilers \ |
210 |
+ --with-blas-lapack-lib="$($(tc-getPKG_CONFIG) --libs blas lapack)" \ |
211 |
+ $(petsc_enable debug debugging) \ |
212 |
+ $(petsc_enable mpi) \ |
213 |
+ $(petsc_select mpi cc mpicc $(tc-getCC)) \ |
214 |
+ $(petsc_select mpi cxx mpicxx $(tc-getCXX)) \ |
215 |
+ $(petsc_enable fortran) \ |
216 |
+ $(use fortran && echo "$(petsc_select mpi fc mpif77 $(tc-getF77))") \ |
217 |
+ $(petsc_enable mpi mpi-compilers) \ |
218 |
+ $(petsc_select complex-scalars scalar-type complex real) \ |
219 |
+ --with-windows-graphics=0 \ |
220 |
+ --with-matlab=0 \ |
221 |
+ --with-cmake:BOOL=1 \ |
222 |
+ $(petsc_enable threads pthread) \ |
223 |
+ $(petsc_with afterimage afterimage \ |
224 |
+ /usr/include/libAfterImage -lAfterImage) \ |
225 |
+ $(use_with hdf5) \ |
226 |
+ $(petsc_with hypre hypre \ |
227 |
+ /usr/include/hypre -lHYPRE) \ |
228 |
+ $(use_with sparse suitesparse) \ |
229 |
+ $(petsc_with superlu superlu \ |
230 |
+ /usr/include/superlu -lsuperlu) \ |
231 |
+ $(use_with X x) \ |
232 |
+ $(use_with X x11) \ |
233 |
+ $(petsc_with scotch ptscotch \ |
234 |
+ /usr/include/scotch \ |
235 |
+ [-lptesmumps,-lptscotch,-lptscotcherr,-lscotch,-lscotcherr]) \ |
236 |
+ $(petsc_with mumps scalapack \ |
237 |
+ /usr/include/scalapack -lscalapack) \ |
238 |
+ $(use_with mumps mumps \ |
239 |
+ /usr/include \ |
240 |
+ [-lcmumps,-ldmumps,-lsmumps,-lzmumps,-lmumps_common,-lpord]) \ |
241 |
+ --with-imagemagick=0 \ |
242 |
+ --with-python=0 \ |
243 |
+ $(use_with boost) \ |
244 |
+ $(use_with fftw) |
245 |
+} |
246 |
+ |
247 |
+src_install() { |
248 |
+ emake DESTDIR="${ED}" install |
249 |
+ |
250 |
+ # add PETSC_DIR to environmental variables |
251 |
+ cat >> 99petsc <<- EOF |
252 |
+ PETSC_DIR=${EPREFIX}/usr/$(get_libdir)/petsc |
253 |
+ LDPATH=${EPREFIX}/usr/$(get_libdir)/petsc/lib |
254 |
+ EOF |
255 |
+ doenvd 99petsc |
256 |
+} |