public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: sci-mathematics/petsc/, sci-mathematics/petsc/files/
@ 2015-06-24  9:51 Justin Lecher
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lecher @ 2015-06-24  9:51 UTC (permalink / raw
  To: gentoo-commits

commit:     a5ec25be61777284cc15c42d6574b33388932ee9
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 23 17:37:16 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Tue Jun 23 17:37:16 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=a5ec25be

version bump

Package-Manager: portage-2.2.18

 sci-mathematics/petsc/ChangeLog                         |  8 ++++++++
 ...able-rpath.patch => petsc-3.6.0-disable-rpath.patch} |  9 +++++----
 .../petsc/files/petsc-3.6.0-fix_sandbox_violation.patch | 15 +++++++++++++++
 .../petsc/{petsc-3.5.1.ebuild => petsc-3.6.0.ebuild}    | 17 ++++++++++-------
 4 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/sci-mathematics/petsc/ChangeLog b/sci-mathematics/petsc/ChangeLog
index a29efad..858b694 100644
--- a/sci-mathematics/petsc/ChangeLog
+++ b/sci-mathematics/petsc/ChangeLog
@@ -2,6 +2,14 @@
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+*petsc-3.6.0 (23 Jun 2015)
+
+  23 Jun 2015; Matthias Maier <tamiko@gentoo.org>
+  +files/petsc-3.6.0-disable-rpath.patch,
+  +files/petsc-3.6.0-fix_sandbox_violation.patch, +petsc-3.6.0.ebuild,
+  -files/petsc-3.5.1-disable-rpath.patch, -petsc-3.5.1.ebuild:
+  version bump
+
 *petsc-3.5.3 (13 Mar 2015)
 
   13 Mar 2015; Matthias Maier <tamiko@gentoo.org>

diff --git a/sci-mathematics/petsc/files/petsc-3.5.1-disable-rpath.patch b/sci-mathematics/petsc/files/petsc-3.6.0-disable-rpath.patch
similarity index 65%
rename from sci-mathematics/petsc/files/petsc-3.5.1-disable-rpath.patch
rename to sci-mathematics/petsc/files/petsc-3.6.0-disable-rpath.patch
index 0ccf45d..88a7db5 100644
--- a/sci-mathematics/petsc/files/petsc-3.5.1-disable-rpath.patch
+++ b/sci-mathematics/petsc/files/petsc-3.6.0-disable-rpath.patch
@@ -1,6 +1,7 @@
---- 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 @@
+diff --git a/config/BuildSystem/config/setCompilers.py b/config/BuildSystem/config/setCompilers.py
+--- a/config/BuildSystem/config/setCompilers.py
++++ b/config/BuildSystem/config/setCompilers.py
+@@ -1326,12 +1326,7 @@ class Configure(config.base.Configure):
      for language in languages:
        flag = '-L'
        self.pushLanguage(language)
@@ -8,7 +9,7 @@
 -      if not Configure.isDarwin():
 -        testFlags = ['-Wl,-rpath,', '-R','-rpath ' , '-Wl,-R,']
 -      else:
--        testFlags = []
+-        testFlags = ['-Wl,-rpath,']
 -      # 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()):

diff --git a/sci-mathematics/petsc/files/petsc-3.6.0-fix_sandbox_violation.patch b/sci-mathematics/petsc/files/petsc-3.6.0-fix_sandbox_violation.patch
new file mode 100644
index 0000000..7510631
--- /dev/null
+++ b/sci-mathematics/petsc/files/petsc-3.6.0-fix_sandbox_violation.patch
@@ -0,0 +1,15 @@
+--- config/PETSc/options/installDir.py.orig	2015-06-23 18:11:25.054911894 +0200
++++ config/PETSc/options/installDir.py	2015-06-23 18:11:44.100289841 +0200
+@@ -38,12 +38,6 @@
+     self.installSudoMessage = ''
+     if self.framework.argDB['prefix']:
+       self.dir = self.framework.argDB['prefix']
+-      try:
+-        os.makedirs(os.path.join(self.dir,'PETScTestDirectory'))
+-        os.rmdir(os.path.join(self.dir,'PETScTestDirectory'))
+-      except:
+-        self.installSudoMessage = 'You do not have write permissions to the --prefix directory '+self.dir+'\nYou will be prompted for the sudo password for any external package installs'
+-        self.installSudo = 'sudo '
+     else:
+       self.dir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch))
+     self.confDir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch))

diff --git a/sci-mathematics/petsc/petsc-3.5.1.ebuild b/sci-mathematics/petsc/petsc-3.6.0.ebuild
similarity index 94%
rename from sci-mathematics/petsc/petsc-3.5.1.ebuild
rename to sci-mathematics/petsc/petsc-3.6.0.ebuild
index 3d01eee..6c96de3 100644
--- a/sci-mathematics/petsc/petsc-3.5.1.ebuild
+++ b/sci-mathematics/petsc/petsc-3.6.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
@@ -69,7 +69,10 @@ MAKEOPTS="${MAKEOPTS} -j1"
 S="${WORKDIR}/${MY_P}"
 
 src_prepare() {
-	epatch "${FILESDIR}"/${P%_*}-disable-rpath.patch
+	epatch \
+		"${FILESDIR}"/${P%_*}-disable-rpath.patch \
+		"${FILESDIR}"/${P%_*}-fix_sandbox_violation.patch
+
 	sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die
 }
 
@@ -192,18 +195,18 @@ src_install() {
 	doins ${PETSC_ARCH}/include/*
 	if use fortran; then
 		insinto /usr/include/${PN}/finclude
-		doins -r include/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 conf/{variables,rules,test}
+	doins lib/${PN}/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
+	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 \


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/sci:master commit in: sci-mathematics/petsc/, sci-mathematics/petsc/files/
@ 2016-07-12 19:57 Marius Brehler
  0 siblings, 0 replies; 3+ messages in thread
From: Marius Brehler @ 2016-07-12 19:57 UTC (permalink / raw
  To: gentoo-commits

commit:     d3626423dea598c19550b3af5e7857412e1b4bac
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  9 10:21:40 2016 +0000
Commit:     Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
CommitDate: Sat Jul  9 12:09:53 2016 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=d3626423

sci-mathematics/petsc: version bump to 3.7.0

Package-Manager: portage-2.2.28
Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 .../petsc/files/petsc-3.7.0-disable-rpath.patch    |  18 ++
 .../files/petsc-3.7.0-fix_sandbox_violation.patch  |  17 ++
 sci-mathematics/petsc/petsc-3.7.0.ebuild           | 255 +++++++++++++++++++++
 3 files changed, 290 insertions(+)

diff --git a/sci-mathematics/petsc/files/petsc-3.7.0-disable-rpath.patch b/sci-mathematics/petsc/files/petsc-3.7.0-disable-rpath.patch
new file mode 100644
index 0000000..8d0d993
--- /dev/null
+++ b/sci-mathematics/petsc/files/petsc-3.7.0-disable-rpath.patch
@@ -0,0 +1,18 @@
+diff --git a/config/BuildSystem/config/setCompilers.py b/config/BuildSystem/config/setCompilers.py
+index 219a35b..ad2ed8c 100644
+--- a/config/BuildSystem/config/setCompilers.py
++++ b/config/BuildSystem/config/setCompilers.py
+@@ -1385,12 +1385,7 @@ class Configure(config.base.Configure):
+     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(self.log):
+-        testFlags = ['-Wl,-rpath,', '-R','-rpath ' , '-Wl,-R,']
+-      else:
+-        testFlags = ['-Wl,-rpath,']
+-      # 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(), self.log):
+         testFlags.insert(0,'-R')
+       for testFlag in testFlags:

diff --git a/sci-mathematics/petsc/files/petsc-3.7.0-fix_sandbox_violation.patch b/sci-mathematics/petsc/files/petsc-3.7.0-fix_sandbox_violation.patch
new file mode 100644
index 0000000..191ca18
--- /dev/null
+++ b/sci-mathematics/petsc/files/petsc-3.7.0-fix_sandbox_violation.patch
@@ -0,0 +1,17 @@
+diff --git a/config/PETSc/options/installDir.py b/config/PETSc/options/installDir.py
+index 0e2567c..bf782b5 100644
+--- a/config/PETSc/options/installDir.py
++++ b/config/PETSc/options/installDir.py
+@@ -38,12 +38,6 @@ class Configure(config.base.Configure):
+     self.installSudoMessage = ''
+     if self.framework.argDB['prefix']:
+       self.dir = os.path.abspath(os.path.expanduser(self.framework.argDB['prefix']))
+-      try:
+-        os.makedirs(os.path.join(self.dir,'PETScTestDirectory'))
+-        os.rmdir(os.path.join(self.dir,'PETScTestDirectory'))
+-      except:
+-        self.installSudoMessage = 'You do not have write permissions to the --prefix directory '+self.dir+'\nYou will be prompted for the sudo password for any external package installs'
+-        self.installSudo = 'sudo '
+     else:
+       self.dir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch))
+     self.confDir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch))

diff --git a/sci-mathematics/petsc/petsc-3.7.0.ebuild b/sci-mathematics/petsc/petsc-3.7.0.ebuild
new file mode 100644
index 0000000..bcf8cc5
--- /dev/null
+++ b/sci-mathematics/petsc/petsc-3.7.0.ebuild
@@ -0,0 +1,255 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 boost complex-scalars cxx debug doc fftw
+	fortran hdf5 hypre mpi mumps scotch sparse superlu threads X"
+# Failed: 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 )
+	boost? ( dev-libs/boost )
+	fftw? ( sci-libs/fftw:3.0[mpi?] )
+	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 )
+"
+#	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.
+#
+# V=1 enables verbose output with full compiler and linker invocation
+#
+MAKEOPTS="${MAKEOPTS} -j1 V=1"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+	epatch \
+		"${FILESDIR}"/${P}-disable-rpath.patch \
+		"${FILESDIR}"/${P}-fix_sandbox_violation.patch
+
+	sed -i -e 's%/usr/bin/env python%/usr/bin/env python2%' configure || die
+}
+
+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
+
+	# 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)
+
+	# run petsc configure script
+	econf \
+		scrollOutput=1 \
+		FFLAGS="${FFLAGS} -fPIC" \
+		CFLAGS="${CFLAGS} -fPIC" \
+		CXXFLAGS="${CXXFLAGS} -fPIC" \
+		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_select complex-scalars scalar-type complex real) \
+		--with-windows-graphics=0 \
+		--with-matlab=0 \
+		--with-cmake=cmake \
+		$(petsc_enable threads pthread) \
+		$(petsc_with afterimage afterimage \
+			/usr/include/libAfterImage -lAfterImage) \
+		$(petsc_with hdf5) \
+		$(petsc_with hypre hypre \
+			/usr/include/hypre -lHYPRE) \
+		$(petsc_with sparse suitesparse) \
+		$(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 \
+		$(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
+
+	# 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
+	cat >> 99petsc <<- EOF
+		PETSC_ARCH=${PETSC_ARCH}
+		PETSC_DIR=${EPREFIX}/usr/include/${PN}
+	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
+		dohtml -r docs/*.html docs/changes docs/manualpages
+	fi
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/sci:master commit in: sci-mathematics/petsc/, sci-mathematics/petsc/files/
@ 2018-03-19  3:40 Matthias Maier
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Maier @ 2018-03-19  3:40 UTC (permalink / raw
  To: gentoo-commits

commit:     df1d306bdeb962a086a64749ee1ad9eb84152752
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 19 03:25:55 2018 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Mon Mar 19 03:25:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=df1d306b

sci-mathematics/petsc: version bump to 3.8.3

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../files/petsc-3.8.3-fix_sandbox_violation.patch  |  17 ++
 sci-mathematics/petsc/petsc-3.8.3.ebuild           | 204 +++++++++++++++++++++
 2 files changed, 221 insertions(+)

diff --git a/sci-mathematics/petsc/files/petsc-3.8.3-fix_sandbox_violation.patch b/sci-mathematics/petsc/files/petsc-3.8.3-fix_sandbox_violation.patch
new file mode 100644
index 000000000..4f51aee81
--- /dev/null
+++ b/sci-mathematics/petsc/files/petsc-3.8.3-fix_sandbox_violation.patch
@@ -0,0 +1,17 @@
+diff --git a/config/PETSc/options/installDir.py b/config/PETSc/options/installDir.py
+index 975dc8a..c216941 100644
+--- a/config/PETSc/options/installDir.py
++++ b/config/PETSc/options/installDir.py
+@@ -39,12 +39,6 @@ class Configure(config.base.Configure):
+     if self.framework.argDB['prefix']:
+       self.dir = os.path.abspath(os.path.expanduser(self.framework.argDB['prefix']))
+       self.addMakeMacro('PREFIXDIR',self.dir)
+-      try:
+-        os.makedirs(os.path.join(self.dir,'PETScTestDirectory'))
+-        os.rmdir(os.path.join(self.dir,'PETScTestDirectory'))
+-      except:
+-        self.installSudoMessage = 'You do not have write permissions to the --prefix directory '+self.dir+'\nYou will be prompted for the sudo password for any external package installs'
+-        self.installSudo = 'sudo '
+     else:
+       self.dir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch))
+     self.confDir = os.path.abspath(os.path.join(self.petscdir.dir, self.arch.arch))

diff --git a/sci-mathematics/petsc/petsc-3.8.3.ebuild b/sci-mathematics/petsc/petsc-3.8.3.ebuild
new file mode 100644
index 000000000..33ec0bd93
--- /dev/null
+++ b/sci-mathematics/petsc/petsc-3.8.3.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+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="BSD-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+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 )
+	hdf5? ( mpi )
+	hypre? ( cxx mpi )
+	mumps? ( mpi scotch )
+	scotch? ( mpi )
+	^^ ( hypre superlu )
+"
+
+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.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?] )
+	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
+"
+
+#
+# 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.
+#
+# V=1 enables verbose output with full compiler and linker invocation
+#
+MAKEOPTS="${MAKEOPTS} -j1 V=1"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch \
+	"${FILESDIR}"/${PN}-3.8.3-fix_sandbox_violation.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 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=cmake \
+		$(petsc_enable threads pthread) \
+		$(petsc_with afterimage afterimage \
+			/usr/include/libAfterImage -lAfterImage) \
+		$(petsc_with hdf5) \
+		$(petsc_with hypre hypre \
+			/usr/include/hypre -lHYPRE) \
+		$(petsc_with sparse suitesparse) \
+		$(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 \
+		$(petsc_with boost) \
+		$(petsc_with fftw)
+}
+
+src_install() {
+	emake DESTDIR="${D}/usr/$(get_libdir)/petsc" install
+
+	# add PETSC_DIR to environmental variables
+	cat >> 99petsc <<- EOF
+		PETSC_DIR=${EPREFIX}/usr/$(get_libdir)/petsc
+	EOF
+	doenvd 99petsc
+
+	if use doc ; then
+		dodoc docs/developers.pdf docs/manual.pdf
+		dohtml -r docs/*.html docs/changes docs/manualpages
+	fi
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-19  3:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24  9:51 [gentoo-commits] proj/sci:master commit in: sci-mathematics/petsc/, sci-mathematics/petsc/files/ Justin Lecher
  -- strict thread matches above, loose matches on Subject: below --
2016-07-12 19:57 Marius Brehler
2018-03-19  3:40 Matthias Maier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox