# 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//\./\-} # We need a FORTRAN compiler. 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" # Having at least one FORTRAN compiler. # set $FORT according to the USE flags: ensure only one is enabled use gfortran && ! use g77 && ! use ifc && FORT=gfortran ! use gfortran && use g77 && ! use ifc && FORT=gnu ! use gfortran && ! use g77 && use ifc && FORT=ifort # If none or more than one FORTRAN USE flags are enabled, give a message # and set $FORT according to $FORTRANC if [[ -z $FORT ]] ; then einfo "You have enabled none or more than one FORTRAN USE flags," einfo "\ti.e. gfortran, g77 and ifc." einfo "We will use the first availible Fortran compiler in" einfo "\tgfortran, g77, ifc." einfo "If you don't want this, please enable exactly ONE" einfo "\tof those FORTRAN related USE flags. " epause [[ $FORTRANC = "gfortran" ]] && FORT=gfortran [[ $FORTRANC = "g77" ]] && FORT=gnu [[ $FORTRANC = "ifc" ]] && FORT=ifort fi # $BITS [[ ${ARCH} = "amd64" ]] && BITS=64 [[ ${ARCH} = "x86" ]] && BITS=32 # $INT64 use int64 && [[ $FORT = "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} # Finally! 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() { if [[ $FORT = gfortran ]] ; then use int64 && INT64="_int64" use openmp && MP="_mp" fi 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" }