# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sci-libs/acml/acml-3.1.0-r1.ebuild,v 1.4 2006/08/17 20:06:58 dberkholz Exp $ inherit eutils fortran DESCRIPTION="The AMD Core Math Library (ACML) is a set of numerical routines tuned specifically for AMD64 platform processors (including Opteron and Athlon64 )." HOMEPAGE="http://developer.amd.com/acml.jsp" MY_PV=${PV//\./\-} FORTRAN="gfortran g77 ifc" fortran_pkg_setup >/dev/null RESTRICT="fetch nostrip" LICENSE="ACML" KEYWORDS="~amd64 ~x86" SLOT="0" IUSE="$FORTRAN int64 openmp example" RDEPEND="app-admin/eselect-blas app-admin/eselect-cblas app-admin/eselect-lapack" # Configure variables for appropriate ACML build if use gfortran || [[ ${FORTRANC} = "gfortran" ]] ; then need_fortran gfortran >/dev/null && FORT=gfortran elif use g77 || [[ ${FORTRANC} = "g77" ]] ; then need_fortran g77 >/dev/null && FORT=gnu elif use ifc || [[ ${FORTRANC} = "ifc" ]] ; then need_fortran ifc >/dev/null && FORT=ifort else : fi [[ ${ARCH} = "amd64" ]] && BITS=64 [[ ${ARCH} = "x86" ]] && BITS=32 use int64 && use gfortran && INT64="-int64" # Specific for acml 3.6.1, remove it for other versions!!! [[ ${PV} = 3.6.1 ]] && [[ $FORT != gfortran ]] && MY_PV=${MY_PV//1/0} SRC_URI="acml-${MY_PV}-${FORT}-${BITS}bit${INT64}.tgz" pkg_nofetch() { einfo "Please download the ACML from:" einfo "${HOMEPAGE}" einfo "and place it in ${DISTDIR}" einfo "The previous version could be found at" einfo "http://developer.amd.com/acmlarchive.jsp" } S=${WORKDIR} src_unpack() { ewarn "From version 3.5.0 on, ACML no longer supports" ewarn "hardware without SSE/SSE2 instructions. " ewarn "For older 32-bit hardware that does not support SSE/SSE2," ewarn "you must continue to use an older version (ACML 3.1.0 and ealier)." epause unpack ${A} (DISTDIR="${S}" unpack contents-acml-${MY_PV}-${FORT}-${BITS}bit${INT64}.tgz) } src_compile() { return } src_install() { use int64 && use gfortran && INT64="_int64" use openmp && use gfortran && MP="_mp" DIR=${S}/${FORT}${BITS}${MP}${INT64} # Documentation cd ${S}/Doc dohtml html/* dodoc acml.txt doinfo acml.info* insinto /usr/share/doc/${PF} doins acml.pdf # Headers dodir /usr/include/acml insinto /usr/include/acml doins ${DIR}/include/* for FILE in `ls /usr/include/acml`; do dosym /usr/include/acml/${FILE} /usr/include/${FILE} done # Libraries dolib ${DIR}/lib/* # Examples if use example ; then insinto /usr/share/doc/${PF}/examples doins examples/* fi # eselect files eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas acml eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas acml eselect lapack add $(get_libdir) ${FILESDIR}/eselect.lapack acml } pkg_postinst() { if [[ -z "$(eselect blas show)" ]]; then eselect blas set acml fi if [[ -z "$(eselect cblas show)" ]]; then eselect cblas set acml fi if [[ -z "$(eselect lapack show)" ]]; then eselect lapack set acml fi elog "To use ACML's BLAS features, you have to issue (as root):" elog "\n\teselect blas set acml" elog "To use ACML's CBLAS features, you have to issue (as root):" elog "\n\teselect cblas set acml" elog "To use ACML's LAPACK features, you have to issue (as root):" elog "\n\teselect lapack set acml" }