# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs DESCRIPTION="ScaLAPACK: Scalable LAPACK" HOMEPAGE="http://www.netlib.org/scalapack/scalapack_home.html" SRC_URI="http://www.netlib.org/scalapack/scalapack.tgz" LICENSE="as-is" SLOT="0" KEYWORDS="mips" DEPEND="sci-libs/blacs sci-libs/blas-atlas || ( sys-cluster/mpich sys-cluster/mpich2 )" IUSE="debug doc multilib" src_unpack() { if use debug; then debug=1; else debug=0; fi unpack ${A} # SLmake.patch replaces some values in SLmake.inc with flags. # The seds replace these flags with portage-friendly values. cd ${S} #epatch ${FILESDIR}/SLmake.patch sed -i -e "s:= \$(HOME)/SCALAPACK:= ${S}:" SLmake.inc ||die "sed failed" #sed -i -e "s:SFLAG:${S}:" SLmake.inc || die "sed 1 failed" #sed -i -e "s:DEBUGFLAG:${DEBUG}:" SLmake.inc || die "sed 2 failed" #sed -i -e "s:LIBFLAG:$(get_libdir):" SLmake.inc || die "sed 3 failed" #sed -i -e "s:FCOMPILER:$(tc-getF77):" SLmake.inc || die "sed 4 failed" #sed -i -e "s:CCOMPILER:$(tc-getCC):" SLmake.inc || die "sed 5 failed" } src_compile() { MAKE="BLACSDBGLVL=${debug} BLACSdir=/usr/$(get_libdir) \ SMPLIB=/usr/$(get_libdir)/libmpich.a F77=$(tc-getF77) CC=$(tc-getCC) \ BLASLIB='/usr/$(get_libdir)/libf77blas.a /usr/$(get_libdir)/libatlas.a' " make "${MAKE}" all || die "make failed" } src_install() { cd ${S} dolib libscalapack.a if use doc; then dodoc README cd ${S}/INSTALL dodoc scalapack_install.ps fi }