diff options
author | Thomas Kahle <tom111@gmx.de> | 2010-09-14 00:26:03 +0200 |
---|---|---|
committer | Thomas Kahle <tom111@gmx.de> | 2010-09-14 00:26:03 +0200 |
commit | b43492e6d6f7af321b27af6b7f04d4269384c7f0 (patch) | |
tree | 66612bf0cb752d84f5dd6ff6064a3d0669b5bf9c /sci-mathematics/petsc | |
parent | Respect LDFLAGS, #335590. Fix metadata. (diff) | |
download | sci-b43492e6d6f7af321b27af6b7f04d4269384c7f0.tar.gz sci-b43492e6d6f7af321b27af6b7f04d4269384c7f0.tar.bz2 sci-b43492e6d6f7af321b27af6b7f04d4269384c7f0.zip |
New package: sci-mathematics/petsc
Ebuild due to J. M. Gottfried
Corresponding Bug: 53386 (Meeh... that's from 2004!)
Diffstat (limited to 'sci-mathematics/petsc')
-rw-r--r-- | sci-mathematics/petsc/ChangeLog | 10 | ||||
-rw-r--r-- | sci-mathematics/petsc/Manifest | 6 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/fix-configure-pic.patch | 11 | ||||
-rw-r--r-- | sci-mathematics/petsc/files/fix-mpiuni.patch | 12 | ||||
-rw-r--r-- | sci-mathematics/petsc/metadata.xml | 8 | ||||
-rw-r--r-- | sci-mathematics/petsc/petsc-3.1_p4.ebuild | 135 |
6 files changed, 182 insertions, 0 deletions
diff --git a/sci-mathematics/petsc/ChangeLog b/sci-mathematics/petsc/ChangeLog new file mode 100644 index 000000000..4e78ecba4 --- /dev/null +++ b/sci-mathematics/petsc/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for sci-mathematics/petsc +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*petsc-3.1_p4 (13 Sep 2010) + + 13 Sep 2010; Thomas Kahle <tom111@gmx.de> +petsc-3.1_p4.ebuild, + +files/fix-configure-pic.patch, +files/fix-mpiuni.patch, +metadata.xml: + New package. Ebuild by J. M. Gottfried. Corresponding bug is 53386. + diff --git a/sci-mathematics/petsc/Manifest b/sci-mathematics/petsc/Manifest new file mode 100644 index 000000000..d39fc8f3c --- /dev/null +++ b/sci-mathematics/petsc/Manifest @@ -0,0 +1,6 @@ +AUX fix-configure-pic.patch 533 RMD160 f24a17f653d67f42cb13701b0798704bcae95ec0 SHA1 3508bdce47619f3b29d86da4792e63c152a8314c SHA256 cfe886eb1343841e6f1b47a8a7c9ad7be66616af48eff6fce9efab64ecfb2589 +AUX fix-mpiuni.patch 456 RMD160 2e69463821de6c3279a3b04b3b4b149ee354fffe SHA1 6c754380ac2b737b3f57f8ee252916c27aaa63ea SHA256 df0765040477b6dddb5f0db595477a983fa7ad3bb431747ad4c812853cd77a75 +DIST petsc-3.1-p4.tar.gz 15455558 RMD160 42d1c587ab1a2676f62de866afe8c43365a1b236 SHA1 4516e74e7ea349fed58b26963cfa3747ef07c62e SHA256 4e9abb2d6a07e49ba77459398871c3f91c50669979f7e9d5017009615d2a24af +EBUILD petsc-3.1_p4.ebuild 4140 RMD160 83b6d5d7f8af7275bf278b5ab3bf20d024f9840a SHA1 9330a235095d9879face9c6d2fae48af58fef822 SHA256 886caa9ea78f9ef08349ad0867afefeab8ff0c550713f4522ca61b317471f54f +MISC ChangeLog 362 RMD160 271f8d0af2f9068035d5c26ef20caa8c50e83939 SHA1 03da821dc26c1fbc47ce88b598088798865fac4c SHA256 4608c7dac23e71ded9fe2b6e572daf87869e04bf6463d603e15b4886b15a9b1c +MISC metadata.xml 270 RMD160 095cc24d79cf505fb399f4efe83c1fbd669a4777 SHA1 d694ac481815815d35bc28c0653b02b3c4bbcd08 SHA256 34185c01f89f4dac0de8133ad0d6f6e36f0e2c83f958a6cb03d0ae0f30fda007 diff --git a/sci-mathematics/petsc/files/fix-configure-pic.patch b/sci-mathematics/petsc/files/fix-configure-pic.patch new file mode 100644 index 000000000..51e11328e --- /dev/null +++ b/sci-mathematics/petsc/files/fix-configure-pic.patch @@ -0,0 +1,11 @@ +--- 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']: ++ for testFlag in ['-fPIC', '-PIC', '-KPIC']: + try: + self.framework.logPrint('Trying '+language+' compiler flag '+testFlag) + if not self.checkLinkerFlag(testFlag): diff --git a/sci-mathematics/petsc/files/fix-mpiuni.patch b/sci-mathematics/petsc/files/fix-mpiuni.patch new file mode 100644 index 000000000..b41805fd2 --- /dev/null +++ b/sci-mathematics/petsc/files/fix-mpiuni.patch @@ -0,0 +1,12 @@ +--- include/mpiuni/mpi.h 2009-12-16 16:56:33.000000000 +0100 ++++ include/mpiuni/mpi.h 2009-12-16 16:57:43.000000000 +0100 +@@ -627,8 +627,7 @@ + MPI_SUCCESS) + #define MPI_Comm_rank(comm,rank) \ + (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\ +- *(rank)=0,\ +- MPI_SUCCESS) ++ *(rank)=0) + #define MPI_Comm_compare(comm1,comm2,result) \ + (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm1),\ + MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm2),\ diff --git a/sci-mathematics/petsc/metadata.xml b/sci-mathematics/petsc/metadata.xml new file mode 100644 index 000000000..ba0d57077 --- /dev/null +++ b/sci-mathematics/petsc/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>sci-mathematics</herd> +<use> + <flag name="mpi">Build support for the message passing interface in virtual/mpi</flag> +</use> +</pkgmetadata> diff --git a/sci-mathematics/petsc/petsc-3.1_p4.ebuild b/sci-mathematics/petsc/petsc-3.1_p4.ebuild new file mode 100644 index 000000000..1cb5879b6 --- /dev/null +++ b/sci-mathematics/petsc/petsc-3.1_p4.ebuild @@ -0,0 +1,135 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=3 + +inherit flag-o-matic toolchain-funcs + +MY_P="${PN}-${PV/_/-}" + +DESCRIPTION="Portable, Extensible Toolkit for Scientific Computation" +HOMEPAGE="http://www.mcs.anl.gov/petsc/petsc-as/" +SRC_URI="http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${MY_P}.tar.gz" + +LICENSE="petsc" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="mpi X cxx debug static-libs fortran doc" + +RDEPEND="mpi? ( virtual/mpi[cxx?,fortran?] ) + X? ( x11-libs/libX11 ) + virtual/lapack + virtual/blas" + +DEPEND="${RDEPEND} + sys-devel/gcc[-nocxx,fortran?]" + +S="${WORKDIR}/${MY_P}" + +src_prepare(){ + epatch "${FILESDIR}/fix-configure-pic.patch" + epatch "${FILESDIR}/fix-mpiuni.patch" + # My failed tries on the parallel build QA warnings: + # sed -i "s/-\?\(@\?\)\${OMAKE}/\1\${MAKE}/g" makefile || die "sed failed" + # sed -i "s/\ make /\ ${MAKE} /g" makefile || die "sed failed" +} + +src_configure(){ + local mylang + local myopt + local myconf + + use cxx && mylang="cxx" || mylang="c" + use debug && myopt="debug" || myopt="opt" + + export PETSC_DIR="${S}" || die + export PETSC_ARCH="linux-gnu-${mylang}-${myopt}" || die + + if use mpi; then + ## this works independently of the used mpi implementation + ## (openmpi/mpich2) + myconf="${myconf} --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx" + myconf="${myconf} --with-fc=/usr/bin/mpif77" + myconf="${myconf} --with-mpi=1 --with-mpi-compilers=1" + + ## of openmpi is used, the following works too, but fails with mpich2 + #myconf="${myconf} --with-mpi-include=/usr/include" + ## adding mpi libraries, -lmpi only is not sufficient if compiling + ## with g++, mpi_f77 needed when using fortran (mpi_f90 caused errors) + #myconf="${myconf} --with-mpi-lib=[/usr/$(get_libdir)/libmpi.so" + #use cxx && myconf="${myconf},/usr/$(get_libdir)/libmpi_cxx.so" + #use fortran && myconf="${myconf},/usr/$(get_libdir)/libmpi_f77.so" + #myconf="${myconf}]" + #myconf="${myconf} --known-mpi-shared=1" + else + myconf="${myconf} --with-cc=$(tc-getCC) --with-cxx=$(tc-getCXX)" + myconf="${myconf} --with-mpi=0" + fi + + use X \ + && myconf="${myconf} --with-X=1" \ + || myconf="${myconf} --with-X=0" + use static-libs \ + && myconf="${myconf} --with-shared=0" \ + || myconf="${myconf} --with-shared=1" + use amd64 \ + && myconf="${myconf} --with-64-bit-indices=1" \ + || myconf="${myconf} --with-64-bit-indices=0" + use fortran \ + && myconf="${myconf} --with-fortran=1" \ + || myconf="${myconf} --with-fortran=0" + + if use debug; then + strip-flags + filter-flags -O* + myconf="${myconf} --with-debugging=1" + else + myconf="${myconf} --with-debugging=0" + fi + + python "${S}"/config/configure.py "${myconf}" \ + CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" \ + --with-windows-graphics=0 --with-matlab=0 --with-python=0 \ + --with-clanguage="${mylang}" --with-single-library=1 \ + --with-petsc-arch="${PETSC_ARCH}" --with-precision=double \ + --with-blas-lapack-lib="$(pkg-config --libs lapack)" \ + || die "PETSc configuration failed" +} + +src_install(){ + insinto /usr/include/"${PN}" + doins "${S}"/include/*.h "${S}"/include/*.hh + doins "${S}/${PETSC_ARCH}"/include/*.h + + insinto /usr/include/"${PN}"/private + doins "${S}"/include/private/*.h + + # fix paths stored in petscconf.h + dosed "s:${S}:/usr:g" /usr/include/"${PN}"/petscconf.h + dosed "s:${PETSC_ARCH}/lib:$(get_libdir):g" /usr/include/"${PN}"/petscconf.h \ + + if ! use mpi ; then + insinto /usr/include/"${PN}"/mpiuni + doins "${S}"/include/mpiuni/*.h + fi + + if use doc ; then + dodoc docs/manual.pdf + dohtml -r docs/*.html docs/changes docs/manualpages + fi + + use static-libs \ + && dolib.a "${S}/${PETSC_ARCH}"/lib/*.a \ + || dolib.so "${S}/${PETSC_ARCH}"/lib/*.so +} + +pkg_postinst() { + elog "The petsc ebuild is still under development." + elog "Help us improve the ebuild in:" + elog "http://bugs.gentoo.org/show_bug.cgi?id=53386" + elog "This ebuild is known to have parallel build issues, " + elog "hopefully resolved by upstream soon." + elog "Another problem is that you can break this package by" + elog "switching your mpi implementation without rebuild petsc." +}
\ No newline at end of file |