diff options
author | Sébastien Fabbro <bicatali@gentoo.org> | 2010-11-12 07:13:26 +0000 |
---|---|---|
committer | Sébastien Fabbro <bicatali@gentoo.org> | 2010-11-12 07:13:26 +0000 |
commit | 358d93b3402f730869d71e0dff953d0fecf5903e (patch) | |
tree | 9d74fcab3912fa9f182dcb68ce906f4469d35420 /sci-libs/gotoblas2/gotoblas2-1.13.ebuild | |
parent | manifest (diff) | |
download | bicatali-358d93b3402f730869d71e0dff953d0fecf5903e.tar.gz bicatali-358d93b3402f730869d71e0dff953d0fecf5903e.tar.bz2 bicatali-358d93b3402f730869d71e0dff953d0fecf5903e.zip |
added gotoblas2
Diffstat (limited to 'sci-libs/gotoblas2/gotoblas2-1.13.ebuild')
-rw-r--r-- | sci-libs/gotoblas2/gotoblas2-1.13.ebuild | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/sci-libs/gotoblas2/gotoblas2-1.13.ebuild b/sci-libs/gotoblas2/gotoblas2-1.13.ebuild new file mode 100644 index 0000000..ba657fc --- /dev/null +++ b/sci-libs/gotoblas2/gotoblas2-1.13.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=3 + +inherit eutils toolchain-funcs + +MYPN="GotoBLAS2" +MYP="${MYPN}-${PV}" + +DESCRIPTION="Fast implementations of the Basic Linear Algebra Subroutines" +HOMEPAGE="http://www.tacc.utexas.edu/tacc-projects/gotoblas2/" +SRC_URI="${MYP}.tar.gz" + +LICENSE="tacc" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="cblas int64 dynamic openmp static-libs threads" + +RESTRICT="fetch mirror" +DOWNLOAD_URL="${HOMEPAGE}" + +RDEPEND="" +DEPEND="app-admin/eselect-blas + cblas? ( app-admin/eselect-cblas )" + +S="${WORKDIR}/${MYPN}" + +src_prepare() { + epatch "${FILESDIR}"/${P}-dynamic.patch + epatch "${FILESDIR}"/${P}-sharedlibs.patch + if ! use dynamic; then + sed -i \ + -e "/^COMMON_OPT/s/-O2/${CFLAGS}/" \ + Makefile.rule || die + fi + # fix executable stacks + for i in $(find . -name \*.S); do + cat >> ${i} <<-EOF + #if defined(__ELF__) + .section .note.GNU-stack,"",%progbits + #endif + EOF + done + LIBNAME=libgoto2 +} + +src_configure() { + local bits=32 + if use amd64 || use alpha || use ppc64 || use sparc || use ia64; then + bits=64 + fi + GOTO_MAKEFLAGS=( CC=$(tc-getCC) FC=$(tc-getFC) ) + GOTO_MAKEFLAGS+=( + BINARY=${bits} + USE_THREAD=$(use threads && echo 1 || echo 0) + USE_OPENMP=$(use openmp && echo 1) + DYNAMIC_ARCH=$(use dynamic && echo 1) + INTERFACE64=$(use int64 && echo 1) + NO_CBLAS=$(use cblas || echo 1) + ) +} + +src_compile() { + emake libs shared "${GOTO_MAKEFLAGS[@]}" || die "emake failed" + if use static-libs; then + rename so so_sav *.so && emake clean + emake libs "${GOTO_MAKEFLAGS[@]}" NEED_PIC= || die "emake static failed" + rename so_sav so *.so_sav + fi +} + +src_test() { + emake tests "${GOTO_MAKEFLAGS[@]}" || die "emake tests failed" +} + +src_install() { + mv $(readlink ${LIBNAME}.so) ${LIBNAME}.so + dolib.so ${LIBNAME}.so || die "installing shared lib failed" + if use static-libs; then + mv $(readlink ${LIBNAME}.a) ${LIBNAME}.a + dolib.a ${LIBNAME}.a || die "installing static lib failed" + fi + dodoc 01Readme.txt 03FAQ.txt 05LargePage 06WeirdPerformance + cat <<-EOF > ${PN}.pc + prefix="${EPREFIX}"/usr + libdir=\${prefix}/$(get_libdir) + includedir=\${prefix}/include + + Name: ${MYPN} + Description: ${DESCRIPTION} + Version: ${PV} + URL: ${HOMEPAGE} + Libs: -L\${libdir} -l${LIBNAME} + EOF + local prof=${PN} + echo > eselect.blas.${prof} \ + "${PN}.pc ${EPREFIX}/usr/$(get_libdir)/pkgconfig/blas.pc" + eselect blas add $(get_libdir) eselect.blas.${prof} ${prof} + + if use cblas; then + insinto /usr/include/${PN} + doins cblas.h || die + echo >> ${PN}.pc "Cflags: -I\${includedir}" + cat <<-EOF > eselect.cblas.${PN} + ${PN}.pc "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/cblas.pc + ${PN}/cblas.h "${EPREFIX}"/usr/include/cblas.h + EOF + eselect cblas add $(get_libdir) eselect.cblas.${prof} ${prof} + fi + insinto /usr/$(get_libdir)/pkgconfig + doins ${PN}.pc +} |