diff options
Diffstat (limited to 'sci-chemistry/abinit/abinit-5.0.1.ebuild')
-rw-r--r-- | sci-chemistry/abinit/abinit-5.0.1.ebuild | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/sci-chemistry/abinit/abinit-5.0.1.ebuild b/sci-chemistry/abinit/abinit-5.0.1.ebuild new file mode 100644 index 0000000..0246017 --- /dev/null +++ b/sci-chemistry/abinit/abinit-5.0.1.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/colordiff/colordiff-1.0.5-r2.ebuild,v 1.7 2005/08/17 18:08:02 grobian Exp $ + +inherit fortran toolchain-funcs + +DESCRIPTION="Find total energy, charge density and electronic structure using density functional theory" +HOMEPAGE="http://www.abinit.org/" +SRC_URI="ftp://ftp.abinit.org/pub/abinitio/ABINIT_v${PV}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +#IUSE="mpi netcdf test" +IUSE="mpi test" + +RDEPEND="virtual/blas + virtual/lapack" +# Doesn't build with 4.1-20060210 +# netcdf? ( sci-libs/netcdf )" +DEPEND="${RDEPEND}" + +# F90 code, g77 won't work +FORTRAN="gfortran ifc" + +pkg_setup() { + fortran_pkg_setup + + # Doesn't compile with gcc-4.0, only >=4.1-20060210 + local diemsg="Requires gcc-4.1.0-beta20060210 or newer" + if [[ "${FORTRANC}" = "gfortran" ]]; then + if [[ $(gcc-major-version) -eq 4 ]]; then + if [[ $(gcc-minor-version) -lt 1 ]]; then + die "${diemsg}" + elif [[ $(gcc-minor-version) -eq 1 ]] \ + && [[ $(gcc-minor-version) -eq 0 ]]; then + # If it's not a snap, we're good, and gcc-snapshot-version() + # will be empty + if [[ -n "$(gcc-snapshot-version)" ]] \ + && [[ $(gcc-snapshot-version) -lt 20060210 ]]; then + die "${diemsg}" + fi + fi + fi + fi +} + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/change-default-directories.patch + epatch ${FILESDIR}/fix-blas-lapack-check.patch + epatch ${FILESDIR}/fix-test-tarball.patch + AT_M4DIR="config/m4" eautoreconf +} + +src_compile() { + econf \ + --with-install-type=debian \ + --disable-autodetect \ + --disable-config-file \ + --disable-mpi-search \ + --disable-library-search \ + --disable-netcdf \ + $(use_enable mpi) \ + --with-blas-prefix=/usr \ + --with-lapack-prefix=/usr \ + --with-c-optflags="${CFLAGS}" \ + --with-fortran-optflags="${FFLAGS}" \ + FC="${FORTRANC}" \ + CC="$(tc-getCC)" \ + || die "configure failed" +# $(use_enable netcdf) \ + + emake || die "make failed" +} + +src_test() { + einfo "The tests take quite a while, on the order of 2-3 hours" + einfo "on a dual Athlon 2000+." + cd ${S}/tests + emake tests_dev + + local REPORT + for REPORT in $(find . -name *fl*); do + einfo "Results for ${REPORT%%/*} tests" + cat ${REPORT} + done +} + +src_install() { + make DESTDIR="${D}" install || die "install failed" + + if use test; then + dodoc ${S}/tests/summary_tests.tar.gz + fi + + dodoc ${S}/KNOWN_PROBLEMS + prepalldocs +} + +pkg_postinst() { + ewarn "Upstream considers this version unready for production use." + ewarn "Major changes occurred in the build system since 4.x." + ewarn "If you intend to use it in production, be sure to run all tests" + ewarn "and read through the test results by emerging abinit" + ewarn "with FEATURES=test and USE=test. Also see the KNOWN_PROBLEMS document." + ewarn "The test results will be installed as summary_tests.tar.gz." +} + +gcc-snapshot-version() { + echo "$(gcc-fullversion | cut -f3 -d. | cut -f2 -d- | sed -e "s:[[:alpha:]]::g")" +} |