diff options
Diffstat (limited to 'sci-mathematics/petsc')
-rw-r--r-- | sci-mathematics/petsc/Manifest | 6 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch | 32 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/petsc-3.12.1-make_hypre_configure.patch | 90 | ||||
-rw-r--r-- | sci-mathematics/petsc/petsc-3.11.3.ebuild | 2 | ||||
-rw-r--r-- | sci-mathematics/petsc/petsc-3.12.1.ebuild | 195 |
5 files changed, 323 insertions, 2 deletions
diff --git a/sci-mathematics/petsc/Manifest b/sci-mathematics/petsc/Manifest index a44ec7dfeb4e..126511a8fbea 100644 --- a/sci-mathematics/petsc/Manifest +++ b/sci-mathematics/petsc/Manifest @@ -1,5 +1,9 @@ +AUX petsc-3.12.1-do_not_run_mpiexec.patch 2648 BLAKE2B 521db3b12644ec692134f11e96d2ec633f3600199e2ac4da5cf2ee6be566fc6e65d0b6a67437752b0c1cf656561ba6c991d2ad603d3975f334b66362d275483c SHA512 b5eb5406203ae4df21d94755f8ccb996c7d6822ef93a60ebe3a82f404436f1aa314809f63bbcbdc15a5613ff143df80e3e69b3e3f48dc9521a2e2855dad73e25 +AUX petsc-3.12.1-make_hypre_configure.patch 3970 BLAKE2B 562cab7e3176acf2bce1b40d4a8563718d419be95881b7fb68fee563591db8bc9fac7444885139c9887e3ab8fe790c4568dbc58cff43f718dbace335564ec1fb SHA512 7f954e6a9a2e3eabe15c9eca6dd385a6a50a5cb7dcda8fd0de8fa2ff49667850fcad62a3b3caade0bc024a1eef1bf4f1f429385e9208b95badb77d814480357c AUX petsc-3.7.0-disable-rpath.patch 909 BLAKE2B b9b6064886d6c10b382982778398cb7fa254242e5ed0dfb86dd4cd6c094dc51eecfd625f6de5c2779bfc5b3beda351ac44145c69ac246d814a728d7565da8086 SHA512 8241c593d903615feb175bfe8213792ace739a18ac5f4c1d1890155ccea7de30b5ef5d97e2fa3b043e9a1e520e022abedeb038d0b4db671f89045e04edc65a68 AUX petsc-3.9.0-fix_sandbox_violation.patch 916 BLAKE2B f58ba79c3082d253c9a95b0c9ce0bcc6373fa91b4155fac5a6d4688c21805d938f5c04a939ab9d8b810732e79699e7156bd4916717b9ab0217ab257ca64bb92e SHA512 cde22a54f0f6c73cfa326ea0c0026878b3099381ec703154bb8d2746a502ffc9ae82e65082f63579abce5b3d3f89bccf0cbc7db7d031e642c5c02ca8281e616c DIST petsc-3.11.3.tar.gz 33279017 BLAKE2B 870b8245e5e06d8538ea3ee1d01fa2cebade4a0bd79dfcf17d74e6201f41d21ca021e206744ece28847b434ece142a2789851b5514a8a1e3f82a8551288b695b SHA512 e545f69e87bc72950939ff3cec3e0ba225a5b3e7f1cb93b0fb6123194eb7240ac1d97ba397235d8ab872c653caab1427673124e5e1e706b796c0ae46ec1bcffa -EBUILD petsc-3.11.3.ebuild 5339 BLAKE2B e864ef1479ee6bfc878e8ea5ba294d7987b0a810555d51ef2cfa3aa96fa07e3de4b2acbbea80c2bd80d0aaf2618636d18f916e2ccb990adb05a0f68bb7968039 SHA512 1e1ceacac2c4c03f1cb634f7695180832eb7042e21089df0f76a0fee2ae3a4c8935ed9286497f2ea8268a5d4b4179a9e535fadd4b61ab4982d8104843d3f2037 +DIST petsc-3.12.1.tar.gz 34592587 BLAKE2B b48056a1fe1d507338f7d145f5fceeab2b2f576470d8af90c9d7828de9b775daadf11198fecc46b5e48fcf1eb38addb366e3a908dab5c4ffaf7f9b71ff17b3d8 SHA512 df33170922c0b34136d2fd5bdc3c68a80d3a5873d66bfb03b2cea4a6456393c7181a8da673911b89ea0fcb51d5fd89b5b4c8b76ddb1df573180a92d029fbc1fb +EBUILD petsc-3.11.3.ebuild 5337 BLAKE2B bdd7062ad5b5b55de97c676a30437901838749d9ee910d274711668de7b43d1f0c630b53e1f4f0b50442ea05b3a9900f5b3f2d5a7d10de3e124f7012ecd0b8b5 SHA512 2e67e5399c57a587e2afac1a412919faf383e4bfa00011ebf54bc3d4af6a353890500463b5f8a138fac7079eccec6b590c161be1419c5193d924fd1be1377f49 +EBUILD petsc-3.12.1.ebuild 5431 BLAKE2B 06e00d3f76c1eb2548fb2973014a7f674ecd2bb3b8928b12fa531acf3704fc8a85d22c194ad3d07c2ba470e228ccb4c5393b9f819e1a914d82dec6da2dd29e5b SHA512 2bfe62beb35946bf365925bc4b7b5c790f45fe6a3a37e45de420b69b983eba7d0d723a0eee3fa5e712a8abf87974baaf6120e8414f99a80dc5b353f5f90654e1 MISC metadata.xml 1131 BLAKE2B db15101bb24374026158a0b45bab1b4b38ab6869bb13fc1df48eef96ca003cea0a8b9118033a3d53c735cefd5ca7563e074d458aee32e038a39e68a6a91b7364 SHA512 19cf1bcddd8bc1378bf85c47b090dd684474f29896c1877bfbeb53a24b1112ed4bb6e823cbc830ee40c886727c6c90d0852081488b1df63f8b4f071d3d453630 diff --git a/sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch b/sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch new file mode 100644 index 000000000000..9c3d5047b0a6 --- /dev/null +++ b/sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch @@ -0,0 +1,32 @@ +diff --git a/config/BuildSystem/config/packages/MPI.py b/config/BuildSystem/config/packages/MPI.py +index c85bb504..7720eba9 100644 +--- a/config/BuildSystem/config/packages/MPI.py ++++ b/config/BuildSystem/config/packages/MPI.py +@@ -209,26 +209,11 @@ shared libraries and run with --known-mpi-shared-libraries=1') + raise RuntimeError('Could not locate MPIEXEC - please specify --with-mpiexec option') + # Support for spaces and () in executable names; also needs to handle optional arguments at the end + # TODO: This support for spaces and () should be moved to core BuildSystem +- self.mpiexec = self.mpiexec.replace(' ', '\\ ').replace('(', '\\(').replace(')', '\\)').replace('\ -',' -') +- if (hasattr(self, 'ompi_major_version') and int(self.ompi_major_version) >= 3): +- (out, err, ret) = Configure.executeShellCommand(self.mpiexec+' -help all', checkCommand = noCheck, timeout = 10, log = self.log) +- if out.find('--oversubscribe') >=0: +- self.mpiexec = self.mpiexec + ' --oversubscribe' ++ self.mpiexec = self.mpiexec + ' --oversubscribe' + + # using mpiexec environmental variables make sure mpiexec matches the MPI libraries and save the variables for testing in PetscInitialize() + # the variable HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE is not currently used. PetscInitialize() can check the existence of the environmental variable to + # determine if the program has been started with the correct mpiexec (will only be set for parallel runs so not clear how to check appropriately) +- (out, err, ret) = Configure.executeShellCommand(self.mpiexec+' -n 1 printenv', checkCommand = noCheck, timeout = 10, log = self.log) +- if ret: raise RuntimeError('Unable to run '+self.mpiexec+' with option "-n 1"\n'+err) +- if out.find('MPIR_CVAR_CH3') > -1: +- if hasattr(self,'ompi_major_version'): raise RuntimeError("Your libraries are from OpenMPI but it appears your mpiexec is from MPICH"); +- self.addDefine('HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE', 'MPIR_CVAR_CH3') +- elif out.find('MPIR_CVAR_CH3') > -1: +- if hasattr(self,'ompi_major_version'): raise RuntimeError("Your libraries are from OpenMPI but it appears your mpiexec is from MPICH"); +- self.addDefine('HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE', 'MPICH') +- elif out.find('OMPI_COMM_WORLD_SIZE') > -1: +- if hasattr(self,'mpich_numversion'): raise RuntimeError("Your libraries are from MPICH but it appears your mpiexec is from OpenMPI"); +- self.addDefine('HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE', 'OMP') + self.addMakeMacro('MPIEXEC', self.mpiexec) + self.mpiexec = self.mpiexec + ' -n 1' + 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 new file mode 100644 index 000000000000..9460d57e4617 --- /dev/null +++ b/sci-mathematics/petsc/files/petsc-3.12.1-make_hypre_configure.patch @@ -0,0 +1,90 @@ +diff --git a/config/BuildSystem/config/packages/hypre.py b/config/BuildSystem/config/packages/hypre.py +index 869a1661..76067c8d 100644 +--- a/config/BuildSystem/config/packages/hypre.py ++++ b/config/BuildSystem/config/packages/hypre.py +@@ -5,10 +5,6 @@ class Configure(config.package.GNUPackage): + def __init__(self, framework): + config.package.GNUPackage.__init__(self, framework) + self.version = '2.18.1' +- self.minversion = '2.14' +- self.versionname = 'HYPRE_RELEASE_VERSION' +- self.versioninclude = 'HYPRE_config.h' +- self.requiresversion = 1 + self.gitcommit = 'v'+self.version + self.download = ['git://https://github.com/hypre-space/hypre','https://github.com/hypre-space/hypre/archive/'+self.gitcommit+'.tar.gz'] + self.functions = ['HYPRE_IJMatrixCreate'] +diff --git a/include/petsc/private/petschypre.h b/include/petsc/private/petschypre.h +index 81ca7136..b403e70e 100644 +--- a/include/petsc/private/petschypre.h ++++ b/include/petsc/private/petschypre.h +@@ -6,12 +6,6 @@ + #include <HYPRE_config.h> + #include <HYPRE_utilities.h> + +-/* from version 2.16 on, HYPRE_BigInt is 64 bit for 64bit installations +- and 32 bit for 32bit installations -> not the best name for a variable */ +-#if PETSC_PKG_HYPRE_VERSION_LT(2,16,0) +-typedef PetscInt HYPRE_BigInt; +-#endif +- + /* + With scalar type == real, HYPRE_Complex == PetscScalar; + With scalar type == complex, HYPRE_Complex is double __complex__ while PetscScalar may be std::complex<double> +diff --git a/src/mat/impls/hypre/mhypre.c b/src/mat/impls/hypre/mhypre.c +index 8e8fe678..3533b99a 100644 +--- a/src/mat/impls/hypre/mhypre.c ++++ b/src/mat/impls/hypre/mhypre.c +@@ -15,10 +15,6 @@ + #include <_hypre_parcsr_ls.h> + #include <_hypre_sstruct_ls.h> + +-#if PETSC_PKG_HYPRE_VERSION_LT(2,18,0) +-#define hypre_ParCSRMatrixClone(A,B) hypre_ParCSRMatrixCompleteClone(A) +-#endif +- + PETSC_INTERN PetscErrorCode MatPtAP_IS_XAIJ(Mat,Mat,MatReuse,PetscReal,Mat*); + + static PetscErrorCode MatHYPRE_CreateFromMat(Mat,Mat_HYPRE*); +@@ -65,7 +61,6 @@ static PetscErrorCode MatHYPRE_IJMatrixPreallocate(Mat A_d, Mat A_o, HYPRE_IJMat + nnz_o[i] = 0; + } + } +-#if PETSC_PKG_HYPRE_VERSION_GE(2,16,0) + { /* If we don't do this, the columns of the matrix will be all zeros! */ + hypre_AuxParCSRMatrix *aux_matrix; + aux_matrix = (hypre_AuxParCSRMatrix*)hypre_IJMatrixTranslator(ij); +@@ -75,9 +70,6 @@ static PetscErrorCode MatHYPRE_IJMatrixPreallocate(Mat A_d, Mat A_o, HYPRE_IJMat + aux_matrix = (hypre_AuxParCSRMatrix*)hypre_IJMatrixTranslator(ij); + hypre_AuxParCSRMatrixNeedAux(aux_matrix) = 1; + } +-#else +- PetscStackCallStandard(HYPRE_IJMatrixSetDiagOffdSizes,(ij,nnz_d,nnz_o)); +-#endif + ierr = PetscFree(nnz_d);CHKERRQ(ierr); + ierr = PetscFree(nnz_o);CHKERRQ(ierr); + } +@@ -235,11 +227,7 @@ static PetscErrorCode MatHYPRE_IJMatrixFastCopy_MPIAIJ(Mat A, HYPRE_IJMatrix ij) + /* need to shift the diag column indices (hdiag->j) back to global numbering since hypre is expecting this */ + hjj = hdiag->j; + pjj = pdiag->j; +-#if PETSC_PKG_HYPRE_VERSION_GE(2,16,0) + for (i=0; i<pdiag->nz; i++) hjj[i] = pjj[i]; +-#else +- for (i=0; i<pdiag->nz; i++) hjj[i] = cstart + pjj[i]; +-#endif + ierr = PetscArraycpy(hdiag->data,pdiag->a,pdiag->nz);CHKERRQ(ierr); + if (sameint) { + ierr = PetscArraycpy(hoffd->i,poffd->i,pA->A->rmap->n + 1);CHKERRQ(ierr); +@@ -249,12 +237,8 @@ static PetscErrorCode MatHYPRE_IJMatrixFastCopy_MPIAIJ(Mat A, HYPRE_IJMatrix ij) + + /* need to move the offd column indices (hoffd->j) back to global numbering since hypre is expecting this + If we hacked a hypre a bit more we might be able to avoid this step */ +-#if PETSC_PKG_HYPRE_VERSION_GE(2,16,0) + PetscStackCallStandard(hypre_CSRMatrixBigInitialize,(hoffd)); + jj = (PetscInt*) hoffd->big_j; +-#else +- jj = (PetscInt*) hoffd->j; +-#endif + pjj = poffd->j; + for (i=0; i<poffd->nz; i++) jj[i] = garray[pjj[i]]; + diff --git a/sci-mathematics/petsc/petsc-3.11.3.ebuild b/sci-mathematics/petsc/petsc-3.11.3.ebuild index 88fb1f58da1c..50ce3b7f6631 100644 --- a/sci-mathematics/petsc/petsc-3.11.3.ebuild +++ b/sci-mathematics/petsc/petsc-3.11.3.ebuild @@ -154,7 +154,7 @@ src_configure() { $(petsc_enable threads pthread) \ $(petsc_with afterimage afterimage \ /usr/include/libAfterImage -lAfterImage) \ - $(petsc_with hdf5) \ + $(use_with hdf5) \ $(petsc_with hypre hypre \ /usr/include/hypre -lHYPRE) \ $(petsc_with sparse suitesparse) \ diff --git a/sci-mathematics/petsc/petsc-3.12.1.ebuild b/sci-mathematics/petsc/petsc-3.12.1.ebuild new file mode 100644 index 000000000000..845d7ff75d69 --- /dev/null +++ b/sci-mathematics/petsc/petsc-3.12.1.ebuild @@ -0,0 +1,195 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +inherit flag-o-matic fortran-2 python-any-r1 toolchain-funcs + +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/${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="afterimage boost complex-scalars cxx debug doc fftw + 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 +REQUIRED_USE=" + afterimage? ( X ) + complex-scalars? ( !hypre !superlu ) + hdf5? ( mpi ) + hypre? ( cxx mpi !superlu ) + mumps? ( mpi scotch ) + scotch? ( mpi ) + superlu? ( !hypre ) +" + +RDEPEND=" + virtual/blas + virtual/lapack + afterimage? ( media-libs/libafterimage ) + boost? ( dev-libs/boost ) + fftw? ( sci-libs/fftw:3.0[mpi?] ) + hdf5? ( sci-libs/hdf5[mpi?] ) + hypre? ( >=sci-libs/hypre-2.18.0[mpi?] ) + metis? ( >=sci-libs/parmetis-4 ) + 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-5 ) + X? ( x11-libs/libX11 ) +" + +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + virtual/pkgconfig + dev-util/cmake +" + +PATCHES=( + "${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch + "${FILESDIR}"/${PN}-3.9.0-fix_sandbox_violation.patch + "${FILESDIR}"/${PN}-3.12.1-make_hypre_configure.patch + "${FILESDIR}"/${PN}-3.12.1-do_not_run_mpiexec.patch +) + +src_prepare() { + 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 + # violation by trying to open /proc/mtrr rw. This is not easy to + # mitigate because it happens in libpciaccess.so called by libhwloc.so, + # which is used by libmpi.so. + addpredict /proc/mtrr + # if mpi is built with knem support it needs /dev/knem too + addpredict /dev/knem + + # configureMPITypes with openmpi-2* insists on accessing the scaling + # governor rw. + addpredict /sys/devices/system/cpu/ + + 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) + + 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} \ + $(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 blas 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_select complex-scalars scalar-type complex real) \ + --with-windows-graphics=0 \ + --with-matlab=0 \ + --with-cmake:BOOL=1 \ + $(petsc_enable threads pthread) \ + $(petsc_with afterimage afterimage \ + /usr/include/libAfterImage -lAfterImage) \ + $(use_with hdf5) \ + $(petsc_with hypre hypre \ + /usr/include/hypre -lHYPRE) \ + $(use_with sparse suitesparse) \ + $(petsc_with superlu superlu \ + /usr/include/superlu -lsuperlu) \ + $(use_with X x) \ + $(use_with X x11) \ + $(petsc_with scotch ptscotch \ + /usr/include/scotch \ + [-lptesmumps,-lptscotch,-lptscotcherr,-lscotch,-lscotcherr]) \ + $(petsc_with mumps scalapack \ + /usr/include/scalapack -lscalapack) \ + $(use_with mumps mumps \ + /usr/include \ + [-lcmumps,-ldmumps,-lsmumps,-lzmumps,-lmumps_common,-lpord]) \ + --with-imagemagick=0 \ + --with-python=0 \ + $(use_with boost) \ + $(use_with fftw) +} + +src_install() { + emake DESTDIR="${ED}" install + + # add PETSC_DIR to environmental variables + cat >> 99petsc <<- EOF + PETSC_DIR=${EPREFIX}/usr/$(get_libdir)/petsc + LDPATH=${EPREFIX}/usr/$(get_libdir)/petsc/lib + EOF + doenvd 99petsc + + if use doc ; then + docinto html + dodoc -r docs/*.html docs/changes docs/manualpages + fi +} |