diff options
author | Matthias Maier <tamiko@gentoo.org> | 2017-05-25 09:56:47 -0500 |
---|---|---|
committer | Matthias Maier <tamiko@gentoo.org> | 2017-05-25 09:59:21 -0500 |
commit | 90e296f6819c2972bbe441e8dcf26aba2105a60f (patch) | |
tree | 9064f020c2f2724f72911347f7588719a146a593 /sci-mathematics/petsc | |
parent | sci-libs/dealii: remove erroneous package version (diff) | |
download | sci-90e296f6819c2972bbe441e8dcf26aba2105a60f.tar.gz sci-90e296f6819c2972bbe441e8dcf26aba2105a60f.tar.bz2 sci-90e296f6819c2972bbe441e8dcf26aba2105a60f.zip |
sci-mathematics/petsc: version bump to 3.6.5, major overhaul
- bump to EAPI 6
- respect upstream decision to install in a monolithic way. Now, the full
petsc distribution is installed into
/usr/lib/petsc
- add metis support
Package-Manager: Portage-2.3.5, Repoman-2.3.2
Diffstat (limited to 'sci-mathematics/petsc')
-rw-r--r-- | sci-mathematics/petsc/Manifest | 3 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/petsc-3.3-configure-pic.patch | 11 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/petsc-3.3-disable-rpath.patch | 16 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/petsc-3.3-fix-complex-threads.patch | 62 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/petsc-3.4.2-disable-rpath.patch | 16 | ||||
-rw-r--r-- | sci-mathematics/petsc/metadata.xml | 1 | ||||
-rw-r--r-- | sci-mathematics/petsc/petsc-3.4.2.ebuild | 240 | ||||
-rw-r--r-- | sci-mathematics/petsc/petsc-3.7.6.ebuild (renamed from sci-mathematics/petsc/petsc-3.7.5.ebuild) | 148 |
8 files changed, 48 insertions, 449 deletions
diff --git a/sci-mathematics/petsc/Manifest b/sci-mathematics/petsc/Manifest index 3fca09f39..812a209c3 100644 --- a/sci-mathematics/petsc/Manifest +++ b/sci-mathematics/petsc/Manifest @@ -1,4 +1,3 @@ -DIST petsc-3.4.2.tar.gz 18658689 SHA256 f13b0dc978fe0dcc1df032f8142a2fd345217f02b9967936d9aac26ce4b2b52e SHA512 f839e4cfadbee720e53993eb8de74a2d82bfe2a46a418f528b4cdb2e9245b8ecafbc02d6d1718034cfe80d291095187b0946ebe237c8f985e4213c4c35bc345b WHIRLPOOL a00f4340e5dc151c57d9f5e2b764a609a508490756d8337d52bec4712fb26b8c06edf46293ed838f08ff34e1c068549ea9680657b7282cb884df4c1314c58cdb DIST petsc-3.5.4.tar.gz 20750322 SHA256 a85febf92c9ed2dd9a8f4305f31cd51f9514c01d3c31fb9fb69fb6f22bd3a960 SHA512 248b0c7d6c0076f65d66a325265baa20b8846d4f6902044c4fcd16ecfc586618075c4b0f470d2a674eaa954b8b7e08afadcea783bb84ae276091728607323204 WHIRLPOOL 42e3cb00778cebb7de08b7410ff5ea3fa48964679413959f56aff10b46d436cb9d9e2317d7314bd4501fdd4fb9f964f4e572f07b58a197f3d435b6f625d91c41 DIST petsc-3.6.4.tar.gz 21792990 SHA256 eb09925a139b52b4dd5a071b3da4fe2165f1d6e8f71d410479603c9976c940f0 SHA512 3e0a69b35424c519c9af43e2323b14f5ba650bf8fc653985769fe65d618223418ebd03c166bca0b7d3affaffa51b907a50b5d9cf714f2f94d044e9c592a84965 WHIRLPOOL b94faf0140e948cb01962fd9e240e5470858e76e7d26f007056001750cc6579724fcc01cab88bfa6cbb66ced8b177ec7d7fecd171c047df0b7c03454b2ecb250 -DIST petsc-3.7.5.tar.gz 23194357 SHA256 493ab0b6c1b3fe68e71d990eff87c84f499f680e6d2c0c394e78646a82ed4be3 SHA512 6583bb5fbb0703d96024e1a665c626d81c7a9d7dae56bae15b0396f8a01b9fac05230ba378587cf79bed8bfa08056595a43be89d3b6180243c0a3f1497335625 WHIRLPOOL b8a7cbf828edec25c51c82c75b34250483db80dcf20171bf91ce2cd611dd152784f80d1670d7c05b02d1d98631b95362451f6cd92662af7a548b7cae355e0c79 +DIST petsc-3.7.6.tar.gz 23197699 SHA256 3c8ee051349587d45baa7910c54ce8e0a571592e3b40f3054a7b7f986919d449 SHA512 a5a18bbd24034b22e7d4847bbf382502f92117b072b5a9bb0e2067a60c16eaa2edcae9c9b0c57f54047ecd36d307d668af5e3029759582cec77dd59070b4ebb0 WHIRLPOOL 238d7ff27fb2e750d937068e3c0991a814c5833a470cbc734da1fa2c9ac2bef371e536b63ccb8b67d52de79fe2f708850dcc01911631f6c088c06a73e734a8ae diff --git a/sci-mathematics/petsc/files/petsc-3.3-configure-pic.patch b/sci-mathematics/petsc/files/petsc-3.3-configure-pic.patch deleted file mode 100644 index bbfdae1c8..000000000 --- a/sci-mathematics/petsc/files/petsc-3.3-configure-pic.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- config/BuildSystem/config/setCompilers.py.old 2010-09-07 21:41:32.693103846 +0200 -+++ config/BuildSystem/config/setCompilers.py 2010-09-07 21:41:45.322093881 +0200 -@@ -875,7 +875,7 @@ - languages.append('FC') - for language in languages: - self.pushLanguage(language) -- for testFlag in ['-PIC', '-fPIC', '-KPIC','-qpic']: -+ for testFlag in ['-fPIC', '-PIC', '-KPIC', '-qpic']: - try: - self.framework.logPrint('Trying '+language+' compiler flag '+testFlag) - if not self.checkLinkerFlag(testFlag): diff --git a/sci-mathematics/petsc/files/petsc-3.3-disable-rpath.patch b/sci-mathematics/petsc/files/petsc-3.3-disable-rpath.patch deleted file mode 100644 index 3c443b29f..000000000 --- a/sci-mathematics/petsc/files/petsc-3.3-disable-rpath.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- config/BuildSystem/config/setCompilers.py 2010-11-24 18:01:17.110124425 +0100 -+++ config/BuildSystem/config/setCompilers.py 2010-11-24 18:02:28.710104226 +0100 -@@ -1186,12 +1186,7 @@ - for language in languages: - flag = '-L' - self.pushLanguage(language) -- # test '-R' before '-rpath' as sun compilers [c,fortran] don't give proper errors with wrong options. -- if not Configure.isDarwin(): -- testFlags = ['-Wl,-rpath,', '-R','-rpath ' , '-Wl,-R,'] -- else: -- testFlags = [] -- # test '-R' before '-Wl,-rpath' for SUN compilers [as cc on linux accepts -Wl,-rpath, but f90 & CC do not. -+ testFlags = [] - if self.isSun(self.framework.getCompiler()): - testFlags.insert(0,'-R') - for testFlag in testFlags: diff --git a/sci-mathematics/petsc/files/petsc-3.3-fix-complex-threads.patch b/sci-mathematics/petsc/files/petsc-3.3-fix-complex-threads.patch deleted file mode 100644 index ae41bab66..000000000 --- a/sci-mathematics/petsc/files/petsc-3.3-fix-complex-threads.patch +++ /dev/null @@ -1,62 +0,0 @@ -As reported by disperato -at https://github.com/gentoo-science/sci/issues/47 -compilation fails if complex scalars are used together with -threads support. -This fix to VecNorm_SeqPThread(...) was inspired by the -implementation of VecNorm_Seq(...) in src/vec/vec/impls/seq/bvec2.c - -Index: petsc-3.3-p5/src/vec/vec/impls/seq/seqpthread/vecpthread.c -=================================================================== ---- a/src/vec/vec/impls/seq/seqpthread/vecpthread.c -+++ b/src/vec/vec/impls/seq/seqpthread/vecpthread.c -@@ -589,17 +589,33 @@ PetscErrorCode VecNorm_SeqPThread(...) - } - ierr = PetscThreadsRunKernel(VecNorm_Kernel,(void**)vec_pdata,tmap->nthreads,tmap->affinity); - /* collect results */ -- *z = (PetscReal)vec_kerneldatap[0].result; -+#if defined(PETSC_USE_COMPLEX) -+ *z = PetscRealPart(vec_kerneldatap[0].result); -+#else -+ *z = (PetscReal)vec_kerneldatap[0].result; -+#endif - if(type == NORM_1) { - for(i=1; i<tmap->nthreads; i++) { -- *z += (PetscReal)vec_kerneldatap[i].result; -+#if defined(PETSC_USE_COMPLEX) -+ *z += PetscRealPart(vec_kerneldatap[i].result); -+#else -+ *z += (PetscReal)vec_kerneldatap[i].result; -+#endif - } - ierr = PetscLogFlops(PetscMax(xin->map->n-1.0+tmap->nthreads-1,0.0));CHKERRQ(ierr); - } - else if(type == NORM_2 || type == NORM_FROBENIUS) { -- *z = (PetscReal)vec_kerneldatap[0].result; -+#if defined(PETSC_USE_COMPLEX) -+ *z = PetscRealPart(vec_kerneldatap[0].result); -+#else -+ *z = (PetscReal)vec_kerneldatap[0].result; -+#endif - for(i=1; i<tmap->nthreads; i++) { -- *z += (PetscReal)vec_kerneldatap[i].result; -+#if defined(PETSC_USE_COMPLEX) -+ *z += PetscRealPart(vec_kerneldatap[i].result); -+#else -+ *z += (PetscReal)vec_kerneldatap[i].result; -+#endif - } - *z = PetscSqrtReal(*z); - ierr = PetscLogFlops(PetscMax(2.0*xin->map->n-1+tmap->nthreads-1,0.0));CHKERRQ(ierr); -@@ -607,7 +623,11 @@ - else { - PetscReal maxv = 0.0,tmp; - for(i=0; i<tmap->nthreads; i++) { -- tmp = (PetscReal)vec_kerneldatap[i].result; -+#if defined(PETSC_USE_COMPLEX) -+ tmp = PetscRealPart(vec_kerneldatap[i].result); -+#else -+ tmp = (PetscReal)vec_kerneldatap[i].result; -+#endif - if(tmp>maxv) { - maxv = tmp; - } diff --git a/sci-mathematics/petsc/files/petsc-3.4.2-disable-rpath.patch b/sci-mathematics/petsc/files/petsc-3.4.2-disable-rpath.patch deleted file mode 100644 index 0ccf45ded..000000000 --- a/sci-mathematics/petsc/files/petsc-3.4.2-disable-rpath.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- config/BuildSystem/config/setCompilers.py 2013-10-08 19:45:00.581513389 +0200 -+++ config/BuildSystem/config/setCompilers.py 2013-05-13 23:35:20.000000000 +0200 -@@ -1303,12 +1303,7 @@ - for language in languages: - flag = '-L' - self.pushLanguage(language) -- # test '-R' before '-rpath' as sun compilers [c,fortran] don't give proper errors with wrong options. -- if not Configure.isDarwin(): -- testFlags = ['-Wl,-rpath,', '-R','-rpath ' , '-Wl,-R,'] -- else: -- testFlags = [] -- # test '-R' before '-Wl,-rpath' for SUN compilers [as cc on linux accepts -Wl,-rpath, but f90 & CC do not. -+ testFlags = [] - if self.isSun(self.framework.getCompiler()): - testFlags.insert(0,'-R') - for testFlag in testFlags: diff --git a/sci-mathematics/petsc/metadata.xml b/sci-mathematics/petsc/metadata.xml index 4a93a4e06..e2722b4e3 100644 --- a/sci-mathematics/petsc/metadata.xml +++ b/sci-mathematics/petsc/metadata.xml @@ -10,6 +10,7 @@ <flag name="boost">Use boost (dev-libs/boost)</flag> <flag name="hypre">Use HYPRE (sci-mathematics/hypre) and for preconditioning</flag> <flag name="complex-scalars">Make scalars complex</flag> + <flag name="metis">Add support for metis (<pkg>sci-libs/parmetis</pkg>)</flag> <flag name="sparse">Use suitesparse (sci-libs/suitesparse) including cholmod (sci-libs/cholmod) for sparse factorization</flag> <flag name="superlu">Use superlu (sci-libs/superlu) for preconditioning</flag> <flag name="mumps">PLEASE FIX MY DESCRIPTION</flag> diff --git a/sci-mathematics/petsc/petsc-3.4.2.ebuild b/sci-mathematics/petsc/petsc-3.4.2.ebuild deleted file mode 100644 index 6e5c434c7..000000000 --- a/sci-mathematics/petsc/petsc-3.4.2.ebuild +++ /dev/null @@ -1,240 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 - -PYTHON_COMPAT=( python2_7 ) - -inherit eutils flag-o-matic fortran-2 python-any-r1 toolchain-funcs versionator - -MY_P="${PN}-$(replace_version_separator _ -)" - -DESCRIPTION="Portable, Extensible Toolkit for Scientific Computation" -HOMEPAGE="http://www.mcs.anl.gov/petsc/" -SRC_URI="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${MY_P}.tar.gz" - -LICENSE="petsc" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="afterimage complex-scalars cxx debug doc - fortran hdf5 hypre mpi mumps scotch sparse superlu threads X" -# Failed: boost imagemagick metis - -# hypre and superlu curretly exclude each other due to missing linking to hypre -# if both are enabled -REQUIRED_USE=" - afterimage? ( X ) - hdf5? ( mpi ) - hypre? ( cxx mpi ) - mumps? ( mpi scotch ) - scotch? ( mpi ) - ^^ ( hypre superlu ) -" -# imagemagick? ( X ) - -RDEPEND=" - virtual/blas - virtual/lapack - afterimage? ( media-libs/libafterimage ) - hdf5? ( sci-libs/hdf5[mpi?] ) - hypre? ( >=sci-libs/hypre-2.8.0b[mpi?] ) - mpi? ( virtual/mpi[cxx?,fortran?] ) - mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack ) - scotch? ( sci-libs/scotch[mpi?] ) - sparse? ( sci-libs/suitesparse >=sci-libs/cholmod-1.7.0 ) - superlu? ( sci-libs/superlu ) - X? ( x11-libs/libX11 ) -" -# boost? ( dev-libs/boost ) -# metis? ( sci-libs/parmetis ) -# imagemagick? ( media-gfx/imagemagick ) - -DEPEND="${RDEPEND} - ${PYTHON_DEPS} - virtual/pkgconfig - dev-util/cmake -" -# cmake is used for parallel building -# in some configuration setups, legacy build is used (slow) - -# -# PETSc does not want its Makefiles to be invoked with anything higher than -# -j1. The underlying build system does automatically invoke a parallel -# build. This might not be what you want, but *hey* not your choice. -# -MAKEOPTS="${MAKEOPTS} -j1" - -S="${WORKDIR}/${MY_P}" - -src_prepare() { - epatch "${FILESDIR}"/${P%_*}-disable-rpath.patch - sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die -} - -src_configure() { - # petsc uses --with-blah=1 and --with-blah=0 to en/disable options - petsc_enable() { - use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0" - } - # add external library: - # petsc_with use_flag libname libdir - # petsc_with use_flag libname include linking_libs - petsc_with() { - local myuse p=${2:-${1}} - if use ${1}; then - myuse="--with-${p}=1" - if [[ $# -ge 4 ]]; then - myuse="${myuse} --with-${p}-include=${EPREFIX}${3}" - shift 3 - myuse="${myuse} --with-${p}-lib=$@" - else - myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}" - fi - else - myuse="--with-${p}=0" - fi - echo ${myuse} - } - - # select between configure options depending on use flag - petsc_select() { - use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4" - } - - local mylang - local myopt - - use cxx && mylang="cxx" || mylang="c" - use debug && myopt="debug" || myopt="opt" - - # environmental variables expected by petsc during build - export PETSC_DIR="${S}" - export PETSC_ARCH="linux-gnu-${mylang}-${myopt}" - - if use debug; then - strip-flags - filter-flags -O* - fi - - # C Support on Cxx builds is enabled if possible - # i.e. when not using complex scalars - # (no complex type for both available at the same time) - - if use threads; then - ewarn "Threads support may be incomplete on $PN-3.3 release and is not officially supported." - ewarn "Upstream recommends not to enable threads support for production runs." - fi - - # run petsc configure script - econf \ - scrollOutput=1 \ - CFLAGS="${CFLAGS}" \ - CXXFLAGS="${CXXFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - --with-shared-libraries \ - --with-single-library \ - --with-clanguage=${mylang} \ - $(use cxx && ! use complex-scalars && echo "with-c-support=1") \ - --with-petsc-arch=${PETSC_ARCH} \ - --with-precision=double \ - --with-gnu-compilers \ - --with-blas-lapack-lib="$($(tc-getPKG_CONFIG) --libs lapack)" \ - $(petsc_enable debug debugging) \ - $(petsc_enable mpi) \ - $(petsc_select mpi cc mpicc $(tc-getCC)) \ - $(petsc_select mpi cxx mpicxx $(tc-getCXX)) \ - $(petsc_enable fortran) \ - $(use fortran && echo "$(petsc_select mpi fc mpif77 $(tc-getF77))") \ - $(petsc_enable mpi mpi-compilers) \ - $(petsc_enable threads pthread) \ - $(petsc_enable threads pthreadclasses) \ - $(petsc_select complex-scalars scalar-type complex real) \ - --with-windows-graphics=0 \ - --with-matlab=0 \ - --with-cmake=cmake \ - $(petsc_with afterimage afterimage \ - /usr/include/libAfterImage -lAfterImage) \ - $(petsc_with hdf5) \ - $(petsc_with hypre hypre \ - /usr/include/hypre -lHYPRE) \ - $(petsc_with sparse cholmod) \ - $(petsc_with superlu superlu \ - /usr/include/superlu -lsuperlu) \ - $(petsc_with X x) \ - $(petsc_with X x11) \ - $(petsc_with scotch ptscotch \ - /usr/include/scotch \ - [-lptesmumps,-lptscotch,-lptscotcherr,-lscotch,-lscotcherr]) \ - $(petsc_with mumps scalapack \ - /usr/include/scalapack -lscalapack) \ - $(petsc_with mumps mumps \ - /usr/include \ - [-lcmumps,-ldmumps,-lsmumps,-lzmumps,-lmumps_common,-lpord]) \ - --with-imagemagick=0 \ - --with-python=0 - -# not yet tested: -# python bindings, netcdf -# non-working: -# fftw: no mpi-implementaion available in gentoo - -# failed dependencies, perhaps fixed in upstream soon: -# $(petsc_with metis parmetis) \ # needs metis too (>=5.0.2) -# $(petsc_with boost) \ -# $(petsc_with imagemagick imagemagick \ -# /usr/include/ImageMagick $($(tc-getPKG_CONFIG) --libs MagickCore)) \ -} - -src_install() { - # petsc install structure is very different from - # installing headers to /usr/include/petsc and lib to /usr/lib - # it also installs many unneeded executables and scripts - # so manual install is easier than cleanup after "emake install" - insinto /usr/include/${PN} - doins include/*.h* - insinto /usr/include/${PN}/${PETSC_ARCH}/include - doins ${PETSC_ARCH}/include/* - if use fortran; then - insinto /usr/include/${PN}/finclude - doins include/finclude/*.h - fi - if ! use mpi ; then - insinto /usr/include/${PN}/mpiuni - doins include/mpiuni/*.h - fi - insinto /usr/include/${PN}/conf - doins conf/{variables,rules,test} - insinto /usr/include/${PN}/${PETSC_ARCH}/conf - doins ${PETSC_ARCH}/conf/{petscrules,petscvariables,RDict.db} - insinto /usr/include/${PN}/petsc-private - doins include/petsc-private/*.h - - # fix configuration files: replace "${S}" by installed location - sed -i \ - -e "s:"${S}"::g" \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die - sed -i \ - -e "s:-I/include:-I${EPREFIX}/usr/include/${PN}:g" \ - -e "s:-I/linux-gnu-cxx-opt/include:-I${EPREFIX}/usr/include/${PN}/${PETSC_ARCH}/include/:g" \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die - sed -i \ - -e "s:usr/lib:usr/$(get_libdir):g" \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h || die - - # add information about installation directory and - # PETSC_ARCH to environmental variables - cat >> 99petsc <<- EOF - PETSC_ARCH=${PETSC_ARCH} - PETSC_DIR=${EPREFIX}/usr/include/${PN} - EOF - doenvd 99petsc - - dolib.so ${PETSC_ARCH}/lib/*.so - - if use doc ; then - einfo "installing documentation (this could take a while)" - dodoc docs/manual.pdf - dohtml -r docs/*.html docs/changes docs/manualpages - fi -} diff --git a/sci-mathematics/petsc/petsc-3.7.5.ebuild b/sci-mathematics/petsc/petsc-3.7.6.ebuild index 1ac1003d5..fb856204a 100644 --- a/sci-mathematics/petsc/petsc-3.7.5.ebuild +++ b/sci-mathematics/petsc/petsc-3.7.6.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -EAPI=5 +EAPI=6 PYTHON_COMPAT=( python2_7 ) @@ -17,8 +17,7 @@ LICENSE="petsc" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="afterimage boost complex-scalars cxx debug doc fftw - fortran hdf5 hypre mpi mumps scotch sparse superlu threads X" -# Failed: imagemagick metis + fortran hdf5 hypre mpi metis mumps scotch sparse superlu threads X" # hypre and superlu curretly exclude each other due to missing linking to hypre # if both are enabled @@ -30,7 +29,6 @@ REQUIRED_USE=" scotch? ( mpi ) ^^ ( hypre superlu ) " -# imagemagick? ( X ) RDEPEND=" virtual/blas @@ -40,6 +38,7 @@ RDEPEND=" fftw? ( sci-libs/fftw:3.0[mpi?] ) hdf5? ( sci-libs/hdf5[mpi?] ) hypre? ( >=sci-libs/hypre-2.8.0b[mpi?] ) + metis? ( >=sci-libs/parmetis-4 ) mpi? ( virtual/mpi[cxx?,fortran?] ) mumps? ( sci-libs/mumps[mpi?] sci-libs/scalapack ) scotch? ( sci-libs/scotch[mpi?] ) @@ -47,16 +46,12 @@ RDEPEND=" superlu? ( sci-libs/superlu ) X? ( x11-libs/libX11 ) " -# metis? ( sci-libs/parmetis ) -# imagemagick? ( media-gfx/imagemagick ) DEPEND="${RDEPEND} ${PYTHON_DEPS} virtual/pkgconfig dev-util/cmake " -# cmake is used for parallel building -# in some configuration setups, legacy build is used (slow) # # PETSc does not want its Makefiles to be invoked with anything higher than @@ -69,14 +64,46 @@ MAKEOPTS="${MAKEOPTS} -j1 V=1" S="${WORKDIR}/${MY_P}" +PATCHES=( + "${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch \ + "${FILESDIR}"/${PN}-3.7.0-fix_sandbox_violation.patch +) + src_prepare() { - epatch \ - "${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch \ - "${FILESDIR}"/${PN}-3.7.0-fix_sandbox_violation.patch + default sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die } +# petsc uses --with-blah=1 and --with-blah=0 to en/disable options +petsc_enable() { + use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0" +} +# add external library: +# petsc_with use_flag libname libdir +# petsc_with use_flag libname include linking_libs +petsc_with() { + local myuse p=${2:-${1}} + if use ${1}; then + myuse="--with-${p}=1" + if [[ $# -ge 4 ]]; then + myuse="${myuse} --with-${p}-include=${EPREFIX}${3}" + shift 3 + myuse="${myuse} --with-${p}-lib=$@" + else + myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}" + fi + else + myuse="--with-${p}=0" + fi + echo ${myuse} +} + +# select between configure options depending on use flag +petsc_select() { + use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4" +} + src_configure() { # bug 548498 # PETSc runs mpi processes during configure that result in a sandbox @@ -89,35 +116,6 @@ src_configure() { # governor rw. addpredict /sys/devices/system/cpu/ - # petsc uses --with-blah=1 and --with-blah=0 to en/disable options - petsc_enable() { - use "$1" && echo "--with-${2:-$1}=1" || echo "--with-${2:-$1}=0" - } - # add external library: - # petsc_with use_flag libname libdir - # petsc_with use_flag libname include linking_libs - petsc_with() { - local myuse p=${2:-${1}} - if use ${1}; then - myuse="--with-${p}=1" - if [[ $# -ge 4 ]]; then - myuse="${myuse} --with-${p}-include=${EPREFIX}${3}" - shift 3 - myuse="${myuse} --with-${p}-lib=$@" - else - myuse="${myuse} --with-${p}-dir=${EPREFIX}${3:-/usr}" - fi - else - myuse="--with-${p}=0" - fi - echo ${myuse} - } - - # select between configure options depending on use flag - petsc_select() { - use "$1" && echo "--with-$2=$3" || echo "--with-$2=$4" - } - local mylang local myopt @@ -125,6 +123,7 @@ src_configure() { use debug && myopt="debug" || myopt="opt" # environmental variables expected by petsc during build + export PETSC_DIR="${S}" export PETSC_ARCH="linux-gnu-${mylang}-${myopt}" @@ -133,17 +132,16 @@ src_configure() { filter-flags -O* fi - # C Support on Cxx builds is enabled if possible - # i.e. when not using complex scalars - # (no complex type for both available at the same time) + # C Support on CXX builds is enabled if possible i.e. when not using + # complex scalars (no complex type for both available at the same time) - # run petsc configure script econf \ scrollOutput=1 \ FFLAGS="${FFLAGS} -fPIC" \ CFLAGS="${CFLAGS} -fPIC" \ CXXFLAGS="${CXXFLAGS} -fPIC" \ LDFLAGS="${LDFLAGS}" \ + --prefix="${EPREFIX}/usr/$(get_libdir)/petsc" \ --with-shared-libraries \ --with-single-library \ --with-clanguage=${mylang} \ @@ -186,73 +184,19 @@ src_configure() { --with-python=0 \ $(petsc_with boost) \ $(petsc_with fftw) - -# not yet tested: -# python bindings, netcdf, fftw - -# failed dependencies, perhaps fixed in upstream soon: -# $(petsc_with metis parmetis) \ # needs metis too (>=5.0.2) -# $(petsc_with imagemagick imagemagick \ -# /usr/include/ImageMagick $($(tc-getPKG_CONFIG) --libs MagickCore)) \ -# $(petsc_enable threads pthreadclasses) \ } src_install() { - # petsc install structure is very different from - # installing headers to /usr/include/petsc and lib to /usr/lib - # it also installs many unneeded executables and scripts - # so manual install is easier than cleanup after "emake install" - insinto /usr/include/${PN} - doins include/*.h* - insinto /usr/include/${PN}/${PETSC_ARCH}/include - doins ${PETSC_ARCH}/include/* - if use fortran; then - insinto /usr/include/${PN}/finclude - doins -r include/${PN}/finclude/* - fi - if ! use mpi ; then - insinto /usr/include/${PN}/mpiuni - doins include/mpiuni/*.h - fi - insinto /usr/include/${PN}/conf - doins lib/${PN}/conf/{variables,rules,test} - insinto /usr/include/${PN}/${PETSC_ARCH}/conf - doins ${PETSC_ARCH}/lib/${PN}/conf/{petscrules,petscvariables,RDict.db} - insinto /usr/include/${PN}/private - doins include/${PN}/private/*.h - - # fix configuration files: replace "${S}" by installed location - sed -i \ - -e "s:"${S}"::g" \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die - sed -i \ - -e "s:-I/include:-I${EPREFIX}/usr/include/${PN}:g" \ - -e "s:-I/linux-gnu-cxx-opt/include:-I${EPREFIX}/usr/include/${PN}/${PETSC_ARCH}/include/:g" \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/conf/petscvariables || die - sed -i \ - -e "s:usr/lib:usr/$(get_libdir):g" \ - "${ED}"/usr/include/${PN}/${PETSC_ARCH}/include/petscconf.h || die + emake DESTDIR="${D}/usr/$(get_libdir)/petsc" install - # fix the include path of petscvariables in lib/${PN}/conf/variables - # bug #559172 - sed -i -e 's#lib/petsc/conf/#conf/#g' \ - "${ED}"/usr/include/${PN}/conf/variables || die - - # add information about installation directory and - # PETSC_ARCH to environmental variables + # add PETSC_DIR to environmental variables cat >> 99petsc <<- EOF - PETSC_ARCH=${PETSC_ARCH} - PETSC_DIR=${EPREFIX}/usr/include/${PN} + PETSC_DIR=${EPREFIX}/usr/$(get_libdir)/petsc EOF doenvd 99petsc - dolib.so ${PETSC_ARCH}/lib/*.so - dolib.so ${PETSC_ARCH}/lib/*.so.* - if use doc ; then - einfo "installing documentation (this could take a while)" - dodoc docs/manual.pdf + dodoc docs/developers.pdf docs/manual.pdf dohtml -r docs/*.html docs/changes docs/manualpages fi } |