Gentoo Archives: gentoo-commits

From: Marius Brehler <marbre@××××××××××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-mathematics/petsc/
Date: Tue, 12 Jul 2016 19:57:29
Message-Id: 1468082121.a4d74bf5cf42a039a93e81264382eb3bb159b052.marbre@gentoo
1 commit: a4d74bf5cf42a039a93e81264382eb3bb159b052
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 9 16:35:21 2016 +0000
4 Commit: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
5 CommitDate: Sat Jul 9 16:35:21 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=a4d74bf5
7
8 sci-mathematics/petsc: drop old
9
10 Package-Manager: portage-2.2.28
11
12 sci-mathematics/petsc/petsc-3.6.0.ebuild | 247 ------------------------------
13 sci-mathematics/petsc/petsc-3.6.3.ebuild | 247 ------------------------------
14 sci-mathematics/petsc/petsc-3.7.0.ebuild | 255 -------------------------------
15 3 files changed, 749 deletions(-)
16
17 diff --git a/sci-mathematics/petsc/petsc-3.6.0.ebuild b/sci-mathematics/petsc/petsc-3.6.0.ebuild
18 deleted file mode 100644
19 index 58ff3bd..0000000
20 --- a/sci-mathematics/petsc/petsc-3.6.0.ebuild
21 +++ /dev/null
22 @@ -1,247 +0,0 @@
23 -# Copyright 1999-2015 Gentoo Foundation
24 -# Distributed under the terms of the GNU General Public License v2
25 -# $Id$
26 -
27 -EAPI=5
28 -
29 -PYTHON_COMPAT=( python2_7 )
30 -
31 -inherit eutils flag-o-matic fortran-2 python-any-r1 toolchain-funcs versionator
32 -
33 -MY_P="${PN}-$(replace_version_separator _ -)"
34 -
35 -DESCRIPTION="Portable, Extensible Toolkit for Scientific Computation"
36 -HOMEPAGE="http://www.mcs.anl.gov/petsc/"
37 -SRC_URI="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${MY_P}.tar.gz"
38 -
39 -LICENSE="petsc"
40 -SLOT="0"
41 -KEYWORDS="~x86 ~amd64"
42 -IUSE="afterimage boost complex-scalars cxx debug doc fftw
43 - fortran hdf5 hypre mpi mumps scotch sparse superlu threads X"
44 -# Failed: imagemagick metis
45 -
46 -# hypre and superlu curretly exclude each other due to missing linking to hypre
47 -# if both are enabled
48 -REQUIRED_USE="
49 - afterimage? ( X )
50 - hdf5? ( mpi )
51 - hypre? ( cxx mpi )
52 - mumps? ( mpi scotch )
53 - scotch? ( mpi )
54 - ^^ ( hypre superlu )
55 -"
56 -# imagemagick? ( X )
57 -
58 -RDEPEND="
59 - virtual/blas
60 - virtual/lapack
61 - afterimage? ( media-libs/libafterimage )
62 - boost? ( dev-libs/boost )
63 - fftw? ( sci-libs/fftw:3.0[mpi?] )
64 - hdf5? ( sci-libs/hdf5[mpi?] )
65 - hypre? ( >=sci-libs/hypre-2.8.0b[mpi?] )
66 - mpi? ( virtual/mpi[cxx?,fortran?] )
67 - mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack )
68 - scotch? ( sci-libs/scotch[mpi?] )
69 - sparse? ( sci-libs/suitesparse >=sci-libs/cholmod-1.7.0 )
70 - superlu? ( sci-libs/superlu )
71 - X? ( x11-libs/libX11 )
72 -"
73 -# metis? ( sci-libs/parmetis )
74 -# imagemagick? ( media-gfx/imagemagick )
75 -
76 -DEPEND="${RDEPEND}
77 - ${PYTHON_DEPS}
78 - virtual/pkgconfig
79 - dev-util/cmake
80 -"
81 -# cmake is used for parallel building
82 -# in some configuration setups, legacy build is used (slow)
83 -
84 -#
85 -# PETSc does not want its Makefiles to be invoked with anything higher than
86 -# -j1. The underlying build system does automatically invoke a parallel
87 -# build. This might not be what you want, but *hey* not your choice.
88 -#
89 -MAKEOPTS="${MAKEOPTS} -j1"
90 -
91 -S="${WORKDIR}/${MY_P}"
92 -
93 -src_prepare() {
94 - epatch \
95 - "${FILESDIR}"/${P%_*}-disable-rpath.patch \
96 - "${FILESDIR}"/${P%_*}-fix_sandbox_violation.patch
97 -
98 - sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die
99 -}
100 -
101 -src_configure() {
102 - # bug 548498
103 - # PETSc runs mpi processes during configure that result in a sandbox
104 - # violation by trying to open /proc/mtrr rw. This is not easy to
105 - # mitigate because it happens in libpciaccess.so called by libhwloc.so,
106 - # which is used by libmpi.so.
107 - addpredict /proc/mtrr
108 -
109 - # petsc uses --with-blah=1 and --with-blah=0 to en/disable options
110 - petsc_enable() {
111 - use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0"
112 - }
113 - # add external library:
114 - # petsc_with use_flag libname libdir
115 - # petsc_with use_flag libname include linking_libs
116 - petsc_with() {
117 - local myuse p=${2:-${1}}
118 - if use ${1}; then
119 - myuse="--with-${p}=1"
120 - if [[ $# -ge 4 ]]; then
121 - myuse="${myuse} --with-${p}-include=${EPREFIX}${3}"
122 - shift 3
123 - myuse="${myuse} --with-${p}-lib=$@"
124 - else
125 - myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}"
126 - fi
127 - else
128 - myuse="--with-${p}=0"
129 - fi
130 - echo ${myuse}
131 - }
132 -
133 - # select between configure options depending on use flag
134 - petsc_select() {
135 - use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4"
136 - }
137 -
138 - local mylang
139 - local myopt
140 -
141 - use cxx && mylang="cxx" || mylang="c"
142 - use debug && myopt="debug" || myopt="opt"
143 -
144 - # environmental variables expected by petsc during build
145 - export PETSC_DIR="${S}"
146 - export PETSC_ARCH="linux-gnu-${mylang}-${myopt}"
147 -
148 - if use debug; then
149 - strip-flags
150 - filter-flags -O*
151 - fi
152 -
153 - # C Support on Cxx builds is enabled if possible
154 - # i.e. when not using complex scalars
155 - # (no complex type for both available at the same time)
156 -
157 - # run petsc configure script
158 - econf \
159 - scrollOutput=1 \
160 - CFLAGS="${CFLAGS}" \
161 - CXXFLAGS="${CXXFLAGS}" \
162 - LDFLAGS="${LDFLAGS}" \
163 - --with-shared-libraries \
164 - --with-single-library \
165 - --with-clanguage=${mylang} \
166 - $(use cxx && ! use complex-scalars && echo "with-c-support=1") \
167 - --with-petsc-arch=${PETSC_ARCH} \
168 - --with-precision=double \
169 - --with-gnu-compilers \
170 - --with-blas-lapack-lib="$($(tc-getPKG_CONFIG) --libs lapack)" \
171 - $(petsc_enable debug debugging) \
172 - $(petsc_enable mpi) \
173 - $(petsc_select mpi cc mpicc $(tc-getCC)) \
174 - $(petsc_select mpi cxx mpicxx $(tc-getCXX)) \
175 - $(petsc_enable fortran) \
176 - $(use fortran && echo "$(petsc_select mpi fc mpif77 $(tc-getF77))") \
177 - $(petsc_enable mpi mpi-compilers) \
178 - $(petsc_select complex-scalars scalar-type complex real) \
179 - --with-windows-graphics=0 \
180 - --with-matlab=0 \
181 - --with-cmake=cmake \
182 - $(petsc_enable threads pthread) \
183 - $(petsc_with afterimage afterimage \
184 - /usr/include/libAfterImage -lAfterImage) \
185 - $(petsc_with hdf5) \
186 - $(petsc_with hypre hypre \
187 - /usr/include/hypre -lHYPRE) \
188 - $(petsc_with sparse suitesparse) \
189 - $(petsc_with superlu superlu \
190 - /usr/include/superlu -lsuperlu) \
191 - $(petsc_with X x) \
192 - $(petsc_with X x11) \
193 - $(petsc_with scotch ptscotch \
194 - /usr/include/scotch \
195 - [-lptesmumps,-lptscotch,-lptscotcherr,-lscotch,-lscotcherr]) \
196 - $(petsc_with mumps scalapack \
197 - /usr/include/scalapack -lscalapack) \
198 - $(petsc_with mumps mumps \
199 - /usr/include \
200 - [-lcmumps,-ldmumps,-lsmumps,-lzmumps,-lmumps_common,-lpord]) \
201 - --with-imagemagick=0 \
202 - --with-python=0 \
203 - $(petsc_with boost) \
204 - $(petsc_with fftw)
205 -
206 -# not yet tested:
207 -# python bindings, netcdf, fftw
208 -
209 -# failed dependencies, perhaps fixed in upstream soon:
210 -# $(petsc_with metis parmetis) \ # needs metis too (>=5.0.2)
211 -# $(petsc_with imagemagick imagemagick \
212 -# /usr/include/ImageMagick $($(tc-getPKG_CONFIG) --libs MagickCore)) \
213 -# $(petsc_enable threads pthreadclasses) \
214 -}
215 -
216 -src_install() {
217 - # petsc install structure is very different from
218 - # installing headers to /usr/include/petsc and lib to /usr/lib
219 - # it also installs many unneeded executables and scripts
220 - # so manual install is easier than cleanup after "emake install"
221 - insinto /usr/include/${PN}
222 - doins include/*.h*
223 - insinto /usr/include/${PN}/${PETSC_ARCH}/include
224 - doins ${PETSC_ARCH}/include/*
225 - if use fortran; then
226 - insinto /usr/include/${PN}/finclude
227 - doins -r include/${PN}/finclude/*
228 - fi
229 - if ! use mpi ; then
230 - insinto /usr/include/${PN}/mpiuni
231 - doins include/mpiuni/*.h
232 - fi
233 - insinto /usr/include/${PN}/conf
234 - doins lib/${PN}/conf/{variables,rules,test}
235 - insinto /usr/include/${PN}/${PETSC_ARCH}/conf
236 - doins ${PETSC_ARCH}/lib/${PN}/conf/{petscrules,petscvariables,RDict.db}
237 - insinto /usr/include/${PN}/private
238 - doins include/${PN}/private/*.h
239 -
240 - # fix configuration files: replace "${S}" by installed location
241 - sed -i \
242 - -e "s:"${S}"::g" \
243 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h \
244 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die
245 - sed -i \
246 - -e "s:-I/include:-I${EPREFIX}/usr/include/${PN}:g" \
247 - -e "s:-I/linux-gnu-cxx-opt/include:-I${EPREFIX}/usr/include/${PN}/${PETSC_ARCH}/include/:g" \
248 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die
249 - sed -i \
250 - -e "s:usr/lib:usr/$(get_libdir):g" \
251 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h || die
252 -
253 - # add information about installation directory and
254 - # PETSC_ARCH to environmental variables
255 - cat >> 99petsc <<- EOF
256 - PETSC_ARCH=${PETSC_ARCH}
257 - PETSC_DIR=${EPREFIX}/usr/include/${PN}
258 - EOF
259 - doenvd 99petsc
260 -
261 - dolib.so ${PETSC_ARCH}/lib/*.so
262 - dolib.so ${PETSC_ARCH}/lib/*.so.*
263 -
264 - if use doc ; then
265 - einfo "installing documentation (this could take a while)"
266 - dodoc docs/manual.pdf
267 - dohtml -r docs/*.html docs/changes docs/manualpages
268 - fi
269 -}
270
271 diff --git a/sci-mathematics/petsc/petsc-3.6.3.ebuild b/sci-mathematics/petsc/petsc-3.6.3.ebuild
272 deleted file mode 100644
273 index 87537cb..0000000
274 --- a/sci-mathematics/petsc/petsc-3.6.3.ebuild
275 +++ /dev/null
276 @@ -1,247 +0,0 @@
277 -# Copyright 1999-2015 Gentoo Foundation
278 -# Distributed under the terms of the GNU General Public License v2
279 -# $Id$
280 -
281 -EAPI=5
282 -
283 -PYTHON_COMPAT=( python2_7 )
284 -
285 -inherit eutils flag-o-matic fortran-2 python-any-r1 toolchain-funcs versionator
286 -
287 -MY_P="${PN}-$(replace_version_separator _ -)"
288 -
289 -DESCRIPTION="Portable, Extensible Toolkit for Scientific Computation"
290 -HOMEPAGE="http://www.mcs.anl.gov/petsc/"
291 -SRC_URI="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${MY_P}.tar.gz"
292 -
293 -LICENSE="petsc"
294 -SLOT="0"
295 -KEYWORDS="~x86 ~amd64"
296 -IUSE="afterimage boost complex-scalars cxx debug doc fftw
297 - fortran hdf5 hypre mpi mumps scotch sparse superlu threads X"
298 -# Failed: imagemagick metis
299 -
300 -# hypre and superlu curretly exclude each other due to missing linking to hypre
301 -# if both are enabled
302 -REQUIRED_USE="
303 - afterimage? ( X )
304 - hdf5? ( mpi )
305 - hypre? ( cxx mpi )
306 - mumps? ( mpi scotch )
307 - scotch? ( mpi )
308 - ^^ ( hypre superlu )
309 -"
310 -# imagemagick? ( X )
311 -
312 -RDEPEND="
313 - virtual/blas
314 - virtual/lapack
315 - afterimage? ( media-libs/libafterimage )
316 - boost? ( dev-libs/boost )
317 - fftw? ( sci-libs/fftw:3.0[mpi?] )
318 - hdf5? ( sci-libs/hdf5[mpi?] )
319 - hypre? ( >=sci-libs/hypre-2.8.0b[mpi?] )
320 - mpi? ( virtual/mpi[cxx?,fortran?] )
321 - mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack )
322 - scotch? ( sci-libs/scotch[mpi?] )
323 - sparse? ( sci-libs/suitesparse >=sci-libs/cholmod-1.7.0 )
324 - superlu? ( sci-libs/superlu )
325 - X? ( x11-libs/libX11 )
326 -"
327 -# metis? ( sci-libs/parmetis )
328 -# imagemagick? ( media-gfx/imagemagick )
329 -
330 -DEPEND="${RDEPEND}
331 - ${PYTHON_DEPS}
332 - virtual/pkgconfig
333 - dev-util/cmake
334 -"
335 -# cmake is used for parallel building
336 -# in some configuration setups, legacy build is used (slow)
337 -
338 -#
339 -# PETSc does not want its Makefiles to be invoked with anything higher than
340 -# -j1. The underlying build system does automatically invoke a parallel
341 -# build. This might not be what you want, but *hey* not your choice.
342 -#
343 -MAKEOPTS="${MAKEOPTS} -j1"
344 -
345 -S="${WORKDIR}/${MY_P}"
346 -
347 -src_prepare() {
348 - epatch \
349 - "${FILESDIR}"/${PN}-3.6.0-disable-rpath.patch \
350 - "${FILESDIR}"/${PN}-3.6.0-fix_sandbox_violation.patch
351 -
352 - sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die
353 -}
354 -
355 -src_configure() {
356 - # bug 548498
357 - # PETSc runs mpi processes during configure that result in a sandbox
358 - # violation by trying to open /proc/mtrr rw. This is not easy to
359 - # mitigate because it happens in libpciaccess.so called by libhwloc.so,
360 - # which is used by libmpi.so.
361 - addpredict /proc/mtrr
362 -
363 - # petsc uses --with-blah=1 and --with-blah=0 to en/disable options
364 - petsc_enable() {
365 - use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0"
366 - }
367 - # add external library:
368 - # petsc_with use_flag libname libdir
369 - # petsc_with use_flag libname include linking_libs
370 - petsc_with() {
371 - local myuse p=${2:-${1}}
372 - if use ${1}; then
373 - myuse="--with-${p}=1"
374 - if [[ $# -ge 4 ]]; then
375 - myuse="${myuse} --with-${p}-include=${EPREFIX}${3}"
376 - shift 3
377 - myuse="${myuse} --with-${p}-lib=$@"
378 - else
379 - myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}"
380 - fi
381 - else
382 - myuse="--with-${p}=0"
383 - fi
384 - echo ${myuse}
385 - }
386 -
387 - # select between configure options depending on use flag
388 - petsc_select() {
389 - use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4"
390 - }
391 -
392 - local mylang
393 - local myopt
394 -
395 - use cxx && mylang="cxx" || mylang="c"
396 - use debug && myopt="debug" || myopt="opt"
397 -
398 - # environmental variables expected by petsc during build
399 - export PETSC_DIR="${S}"
400 - export PETSC_ARCH="linux-gnu-${mylang}-${myopt}"
401 -
402 - if use debug; then
403 - strip-flags
404 - filter-flags -O*
405 - fi
406 -
407 - # C Support on Cxx builds is enabled if possible
408 - # i.e. when not using complex scalars
409 - # (no complex type for both available at the same time)
410 -
411 - # run petsc configure script
412 - econf \
413 - scrollOutput=1 \
414 - CFLAGS="${CFLAGS}" \
415 - CXXFLAGS="${CXXFLAGS}" \
416 - LDFLAGS="${LDFLAGS}" \
417 - --with-shared-libraries \
418 - --with-single-library \
419 - --with-clanguage=${mylang} \
420 - $(use cxx && ! use complex-scalars && echo "with-c-support=1") \
421 - --with-petsc-arch=${PETSC_ARCH} \
422 - --with-precision=double \
423 - --with-gnu-compilers \
424 - --with-blas-lapack-lib="$($(tc-getPKG_CONFIG) --libs lapack)" \
425 - $(petsc_enable debug debugging) \
426 - $(petsc_enable mpi) \
427 - $(petsc_select mpi cc mpicc $(tc-getCC)) \
428 - $(petsc_select mpi cxx mpicxx $(tc-getCXX)) \
429 - $(petsc_enable fortran) \
430 - $(use fortran && echo "$(petsc_select mpi fc mpif77 $(tc-getF77))") \
431 - $(petsc_enable mpi mpi-compilers) \
432 - $(petsc_select complex-scalars scalar-type complex real) \
433 - --with-windows-graphics=0 \
434 - --with-matlab=0 \
435 - --with-cmake=cmake \
436 - $(petsc_enable threads pthread) \
437 - $(petsc_with afterimage afterimage \
438 - /usr/include/libAfterImage -lAfterImage) \
439 - $(petsc_with hdf5) \
440 - $(petsc_with hypre hypre \
441 - /usr/include/hypre -lHYPRE) \
442 - $(petsc_with sparse suitesparse) \
443 - $(petsc_with superlu superlu \
444 - /usr/include/superlu -lsuperlu) \
445 - $(petsc_with X x) \
446 - $(petsc_with X x11) \
447 - $(petsc_with scotch ptscotch \
448 - /usr/include/scotch \
449 - [-lptesmumps,-lptscotch,-lptscotcherr,-lscotch,-lscotcherr]) \
450 - $(petsc_with mumps scalapack \
451 - /usr/include/scalapack -lscalapack) \
452 - $(petsc_with mumps mumps \
453 - /usr/include \
454 - [-lcmumps,-ldmumps,-lsmumps,-lzmumps,-lmumps_common,-lpord]) \
455 - --with-imagemagick=0 \
456 - --with-python=0 \
457 - $(petsc_with boost) \
458 - $(petsc_with fftw)
459 -
460 -# not yet tested:
461 -# python bindings, netcdf, fftw
462 -
463 -# failed dependencies, perhaps fixed in upstream soon:
464 -# $(petsc_with metis parmetis) \ # needs metis too (>=5.0.2)
465 -# $(petsc_with imagemagick imagemagick \
466 -# /usr/include/ImageMagick $($(tc-getPKG_CONFIG) --libs MagickCore)) \
467 -# $(petsc_enable threads pthreadclasses) \
468 -}
469 -
470 -src_install() {
471 - # petsc install structure is very different from
472 - # installing headers to /usr/include/petsc and lib to /usr/lib
473 - # it also installs many unneeded executables and scripts
474 - # so manual install is easier than cleanup after "emake install"
475 - insinto /usr/include/${PN}
476 - doins include/*.h*
477 - insinto /usr/include/${PN}/${PETSC_ARCH}/include
478 - doins ${PETSC_ARCH}/include/*
479 - if use fortran; then
480 - insinto /usr/include/${PN}/finclude
481 - doins -r include/${PN}/finclude/*
482 - fi
483 - if ! use mpi ; then
484 - insinto /usr/include/${PN}/mpiuni
485 - doins include/mpiuni/*.h
486 - fi
487 - insinto /usr/include/${PN}/conf
488 - doins lib/${PN}/conf/{variables,rules,test}
489 - insinto /usr/include/${PN}/${PETSC_ARCH}/conf
490 - doins ${PETSC_ARCH}/lib/${PN}/conf/{petscrules,petscvariables,RDict.db}
491 - insinto /usr/include/${PN}/private
492 - doins include/${PN}/private/*.h
493 -
494 - # fix configuration files: replace "${S}" by installed location
495 - sed -i \
496 - -e "s:"${S}"::g" \
497 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h \
498 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die
499 - sed -i \
500 - -e "s:-I/include:-I${EPREFIX}/usr/include/${PN}:g" \
501 - -e "s:-I/linux-gnu-cxx-opt/include:-I${EPREFIX}/usr/include/${PN}/${PETSC_ARCH}/include/:g" \
502 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die
503 - sed -i \
504 - -e "s:usr/lib:usr/$(get_libdir):g" \
505 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h || die
506 -
507 - # add information about installation directory and
508 - # PETSC_ARCH to environmental variables
509 - cat >> 99petsc <<- EOF
510 - PETSC_ARCH=${PETSC_ARCH}
511 - PETSC_DIR=${EPREFIX}/usr/include/${PN}
512 - EOF
513 - doenvd 99petsc
514 -
515 - dolib.so ${PETSC_ARCH}/lib/*.so
516 - dolib.so ${PETSC_ARCH}/lib/*.so.*
517 -
518 - if use doc ; then
519 - einfo "installing documentation (this could take a while)"
520 - dodoc docs/manual.pdf
521 - dohtml -r docs/*.html docs/changes docs/manualpages
522 - fi
523 -}
524
525 diff --git a/sci-mathematics/petsc/petsc-3.7.0.ebuild b/sci-mathematics/petsc/petsc-3.7.0.ebuild
526 deleted file mode 100644
527 index bcf8cc5..0000000
528 --- a/sci-mathematics/petsc/petsc-3.7.0.ebuild
529 +++ /dev/null
530 @@ -1,255 +0,0 @@
531 -# Copyright 1999-2015 Gentoo Foundation
532 -# Distributed under the terms of the GNU General Public License v2
533 -# $Id$
534 -
535 -EAPI=5
536 -
537 -PYTHON_COMPAT=( python2_7 )
538 -
539 -inherit eutils flag-o-matic fortran-2 python-any-r1 toolchain-funcs versionator
540 -
541 -MY_P="${PN}-$(replace_version_separator _ -)"
542 -
543 -DESCRIPTION="Portable, Extensible Toolkit for Scientific Computation"
544 -HOMEPAGE="http://www.mcs.anl.gov/petsc/"
545 -SRC_URI="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${MY_P}.tar.gz"
546 -
547 -LICENSE="petsc"
548 -SLOT="0"
549 -KEYWORDS="~x86 ~amd64"
550 -IUSE="afterimage boost complex-scalars cxx debug doc fftw
551 - fortran hdf5 hypre mpi mumps scotch sparse superlu threads X"
552 -# Failed: imagemagick metis
553 -
554 -# hypre and superlu curretly exclude each other due to missing linking to hypre
555 -# if both are enabled
556 -REQUIRED_USE="
557 - afterimage? ( X )
558 - hdf5? ( mpi )
559 - hypre? ( cxx mpi )
560 - mumps? ( mpi scotch )
561 - scotch? ( mpi )
562 - ^^ ( hypre superlu )
563 -"
564 -# imagemagick? ( X )
565 -
566 -RDEPEND="
567 - virtual/blas
568 - virtual/lapack
569 - afterimage? ( media-libs/libafterimage )
570 - boost? ( dev-libs/boost )
571 - fftw? ( sci-libs/fftw:3.0[mpi?] )
572 - hdf5? ( sci-libs/hdf5[mpi?] )
573 - hypre? ( >=sci-libs/hypre-2.8.0b[mpi?] )
574 - mpi? ( virtual/mpi[cxx?,fortran?] )
575 - mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack )
576 - scotch? ( sci-libs/scotch[mpi?] )
577 - sparse? ( sci-libs/suitesparse >=sci-libs/cholmod-1.7.0 )
578 - superlu? ( sci-libs/superlu )
579 - X? ( x11-libs/libX11 )
580 -"
581 -# metis? ( sci-libs/parmetis )
582 -# imagemagick? ( media-gfx/imagemagick )
583 -
584 -DEPEND="${RDEPEND}
585 - ${PYTHON_DEPS}
586 - virtual/pkgconfig
587 - dev-util/cmake
588 -"
589 -# cmake is used for parallel building
590 -# in some configuration setups, legacy build is used (slow)
591 -
592 -#
593 -# PETSc does not want its Makefiles to be invoked with anything higher than
594 -# -j1. The underlying build system does automatically invoke a parallel
595 -# build. This might not be what you want, but *hey* not your choice.
596 -#
597 -# V=1 enables verbose output with full compiler and linker invocation
598 -#
599 -MAKEOPTS="${MAKEOPTS} -j1 V=1"
600 -
601 -S="${WORKDIR}/${MY_P}"
602 -
603 -src_prepare() {
604 - epatch \
605 - "${FILESDIR}"/${P}-disable-rpath.patch \
606 - "${FILESDIR}"/${P}-fix_sandbox_violation.patch
607 -
608 - sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die
609 -}
610 -
611 -src_configure() {
612 - # bug 548498
613 - # PETSc runs mpi processes during configure that result in a sandbox
614 - # violation by trying to open /proc/mtrr rw. This is not easy to
615 - # mitigate because it happens in libpciaccess.so called by libhwloc.so,
616 - # which is used by libmpi.so.
617 - addpredict /proc/mtrr
618 -
619 - # petsc uses --with-blah=1 and --with-blah=0 to en/disable options
620 - petsc_enable() {
621 - use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0"
622 - }
623 - # add external library:
624 - # petsc_with use_flag libname libdir
625 - # petsc_with use_flag libname include linking_libs
626 - petsc_with() {
627 - local myuse p=${2:-${1}}
628 - if use ${1}; then
629 - myuse="--with-${p}=1"
630 - if [[ $# -ge 4 ]]; then
631 - myuse="${myuse} --with-${p}-include=${EPREFIX}${3}"
632 - shift 3
633 - myuse="${myuse} --with-${p}-lib=$@"
634 - else
635 - myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}"
636 - fi
637 - else
638 - myuse="--with-${p}=0"
639 - fi
640 - echo ${myuse}
641 - }
642 -
643 - # select between configure options depending on use flag
644 - petsc_select() {
645 - use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4"
646 - }
647 -
648 - local mylang
649 - local myopt
650 -
651 - use cxx && mylang="cxx" || mylang="c"
652 - use debug && myopt="debug" || myopt="opt"
653 -
654 - # environmental variables expected by petsc during build
655 - export PETSC_DIR="${S}"
656 - export PETSC_ARCH="linux-gnu-${mylang}-${myopt}"
657 -
658 - if use debug; then
659 - strip-flags
660 - filter-flags -O*
661 - fi
662 -
663 - # C Support on Cxx builds is enabled if possible
664 - # i.e. when not using complex scalars
665 - # (no complex type for both available at the same time)
666 -
667 - # run petsc configure script
668 - econf \
669 - scrollOutput=1 \
670 - FFLAGS="${FFLAGS} -fPIC" \
671 - CFLAGS="${CFLAGS} -fPIC" \
672 - CXXFLAGS="${CXXFLAGS} -fPIC" \
673 - LDFLAGS="${LDFLAGS}" \
674 - --with-shared-libraries \
675 - --with-single-library \
676 - --with-clanguage=${mylang} \
677 - $(use cxx && ! use complex-scalars && echo "with-c-support=1") \
678 - --with-petsc-arch=${PETSC_ARCH} \
679 - --with-precision=double \
680 - --with-gnu-compilers \
681 - --with-blas-lapack-lib="$($(tc-getPKG_CONFIG) --libs lapack)" \
682 - $(petsc_enable debug debugging) \
683 - $(petsc_enable mpi) \
684 - $(petsc_select mpi cc mpicc $(tc-getCC)) \
685 - $(petsc_select mpi cxx mpicxx $(tc-getCXX)) \
686 - $(petsc_enable fortran) \
687 - $(use fortran && echo "$(petsc_select mpi fc mpif77 $(tc-getF77))") \
688 - $(petsc_enable mpi mpi-compilers) \
689 - $(petsc_select complex-scalars scalar-type complex real) \
690 - --with-windows-graphics=0 \
691 - --with-matlab=0 \
692 - --with-cmake=cmake \
693 - $(petsc_enable threads pthread) \
694 - $(petsc_with afterimage afterimage \
695 - /usr/include/libAfterImage -lAfterImage) \
696 - $(petsc_with hdf5) \
697 - $(petsc_with hypre hypre \
698 - /usr/include/hypre -lHYPRE) \
699 - $(petsc_with sparse suitesparse) \
700 - $(petsc_with superlu superlu \
701 - /usr/include/superlu -lsuperlu) \
702 - $(petsc_with X x) \
703 - $(petsc_with X x11) \
704 - $(petsc_with scotch ptscotch \
705 - /usr/include/scotch \
706 - [-lptesmumps,-lptscotch,-lptscotcherr,-lscotch,-lscotcherr]) \
707 - $(petsc_with mumps scalapack \
708 - /usr/include/scalapack -lscalapack) \
709 - $(petsc_with mumps mumps \
710 - /usr/include \
711 - [-lcmumps,-ldmumps,-lsmumps,-lzmumps,-lmumps_common,-lpord]) \
712 - --with-imagemagick=0 \
713 - --with-python=0 \
714 - $(petsc_with boost) \
715 - $(petsc_with fftw)
716 -
717 -# not yet tested:
718 -# python bindings, netcdf, fftw
719 -
720 -# failed dependencies, perhaps fixed in upstream soon:
721 -# $(petsc_with metis parmetis) \ # needs metis too (>=5.0.2)
722 -# $(petsc_with imagemagick imagemagick \
723 -# /usr/include/ImageMagick $($(tc-getPKG_CONFIG) --libs MagickCore)) \
724 -# $(petsc_enable threads pthreadclasses) \
725 -}
726 -
727 -src_install() {
728 - # petsc install structure is very different from
729 - # installing headers to /usr/include/petsc and lib to /usr/lib
730 - # it also installs many unneeded executables and scripts
731 - # so manual install is easier than cleanup after "emake install"
732 - insinto /usr/include/${PN}
733 - doins include/*.h*
734 - insinto /usr/include/${PN}/${PETSC_ARCH}/include
735 - doins ${PETSC_ARCH}/include/*
736 - if use fortran; then
737 - insinto /usr/include/${PN}/finclude
738 - doins -r include/${PN}/finclude/*
739 - fi
740 - if ! use mpi ; then
741 - insinto /usr/include/${PN}/mpiuni
742 - doins include/mpiuni/*.h
743 - fi
744 - insinto /usr/include/${PN}/conf
745 - doins lib/${PN}/conf/{variables,rules,test}
746 - insinto /usr/include/${PN}/${PETSC_ARCH}/conf
747 - doins ${PETSC_ARCH}/lib/${PN}/conf/{petscrules,petscvariables,RDict.db}
748 - insinto /usr/include/${PN}/private
749 - doins include/${PN}/private/*.h
750 -
751 - # fix configuration files: replace "${S}" by installed location
752 - sed -i \
753 - -e "s:"${S}"::g" \
754 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h \
755 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die
756 - sed -i \
757 - -e "s:-I/include:-I${EPREFIX}/usr/include/${PN}:g" \
758 - -e "s:-I/linux-gnu-cxx-opt/include:-I${EPREFIX}/usr/include/${PN}/${PETSC_ARCH}/include/:g" \
759 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die
760 - sed -i \
761 - -e "s:usr/lib:usr/$(get_libdir):g" \
762 - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h || die
763 -
764 - # fix the include path of petscvariables in lib/${PN}/conf/variables
765 - # bug #559172
766 - sed -i -e 's#lib/petsc/conf/#conf/#g' \
767 - "${ED}"/usr/include/${PN}/conf/variables || die
768 -
769 - # add information about installation directory and
770 - # PETSC_ARCH to environmental variables
771 - cat >> 99petsc <<- EOF
772 - PETSC_ARCH=${PETSC_ARCH}
773 - PETSC_DIR=${EPREFIX}/usr/include/${PN}
774 - EOF
775 - doenvd 99petsc
776 -
777 - dolib.so ${PETSC_ARCH}/lib/*.so
778 - dolib.so ${PETSC_ARCH}/lib/*.so.*
779 -
780 - if use doc ; then
781 - einfo "installing documentation (this could take a while)"
782 - dodoc docs/manual.pdf
783 - dohtml -r docs/*.html docs/changes docs/manualpages
784 - fi
785 -}