/[gentoo-x86]/sci-libs/blas-atlas/blas-atlas-3.7.17.ebuild
Gentoo

Contents of /sci-libs/blas-atlas/blas-atlas-3.7.17.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Sep 11 20:54:00 2006 UTC (14 years ago) by markusle
Branch: MAIN
Bumped to new development snapshot and removed old version (see bug #144314).
(Portage version: 2.1.1)

1 markusle 1.1 # Copyright 1999-2006 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.7.15.ebuild,v 1.4 2006/08/30 01:32:45 markusle Exp $
4    
5     inherit eutils toolchain-funcs fortran
6    
7     DESCRIPTION="Automatically Tuned Linear Algebra Software BLAS implementation"
8     HOMEPAGE="http://math-atlas.sourceforge.net/"
9     MY_PN=${PN/blas-/}
10     SRC_URI="mirror://sourceforge/math-atlas/${MY_PN}${PV}.tar.bz2
11     mirror://gentoo/${MY_PN}-3.7.15-shared-libs.patch.bz2"
12    
13     LICENSE="BSD"
14     SLOT="0"
15     KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
16     IUSE="doc"
17    
18    
19     RDEPEND="app-admin/eselect-blas
20     app-admin/eselect-cblas"
21     DEPEND="${RDEPEND}
22     >=sys-devel/libtool-1.5"
23     PROVIDE="virtual/blas"
24    
25    
26     S="${WORKDIR}/ATLAS"
27     BLD_DIR="${S}/gentoo-build"
28     RPATH="${DESTTREE}/$(get_libdir)/blas"
29     FORTRAN="g77 gfortran"
30    
31     pkg_setup() {
32     fortran_pkg_setup
33     echo
34     ewarn "Please make sure to disable CPU throttling completely"
35     ewarn "during the compile of blas-atlas. Otherwise, all atlas"
36     ewarn "generated timings will be completely random and the"
37     ewarn "performance of the resulting libraries will be degraded"
38     ewarn "considerably."
39     echo
40     epause 8
41     }
42    
43     src_unpack() {
44     unpack ${A}
45     cd ${S}
46    
47     epatch "${DISTDIR}"/${MY_PN}-3.7.15-shared-libs.patch.bz2
48    
49     # make sure shared libs link against proper libraries
50     if [[ ${FORTRANC} == "gfortran" ]]; then
51     libs="${LDFLAGS} -lpthread -lgfortran"
52     else
53     libs="${LDFLAGS} -lpthread -lg2c"
54     fi
55     sed -e "s/SHRD_LNK/${libs}/g" -i Make.top || \
56     die "Failed to add addtional libs to shared object build"
57    
58     mkdir ${BLD_DIR} || die "failed to generate build directory"
59     cp "${FILESDIR}"/war ${BLD_DIR} && chmod a+x ${BLD_DIR}/war || \
60     die "failed to install war"
61    
62     cd ${BLD_DIR} && ../configure -Si cputhrchk 0 \
63     || die "configure failed"
64    
65     sed -e "s:GENTOO_GCC:$(tc-getCC):" \
66     -e "s:GENTOO_FORTRAN:${FORTRANC}:" \
67     -e "s:GENTOO_CFLAGS:${CFLAGS}:" \
68     -e "s:GENTOO_FFLAGS:${FFLAGS}:" \
69     -i Make.inc || die "Failed to fix Make.inc"
70     }
71    
72     src_compile() {
73     cd ${BLD_DIR}
74     make || die "make failed"
75    
76     make shared-strip RPATH=${RPATH}/atlas || \
77     die "failed to build shared libraries"
78    
79     # build shared libraries of threaded libraries if applicable
80     if [ -d gentoo/libptf77blas.a ]; then
81     make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
82     die "failed to build threaded shared libraries"
83     fi
84     }
85    
86     src_install () {
87     dodir "${RPATH}"/atlas
88     cd ${BLD_DIR}/gentoo/libs
89     cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
90     die "Failed to install libatlas"
91     cp -P *blas* "${D}/${RPATH}"/atlas || \
92     die "Failed to install blas/cblas"
93    
94     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
95     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
96    
97     if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
98     then
99     dodir "${RPATH}"/threaded-atlas
100     cd ${BLD_DIR}/gentoo/threaded-libs
101     cp -P * "${D}/${RPATH}"/threaded-atlas || \
102     die "Failed to install threaded atlas"
103    
104     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
105     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
106     fi
107    
108     insinto "${DESTTREE}"/include/atlas
109     doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
110     "${S}"/include/atlas_enum.h || \
111     die "failed to install headers"
112    
113     # These headers contain the architecture-specific
114     # optimizations determined by ATLAS. The atlas-lapack build
115     # is much shorter if they are available, so save them:
116     doins ${BLD_DIR}/include/*.h || \
117     die "failed to install timing headers"
118    
119     #some docs
120     cd "${S}"
121     dodoc README doc/{AtlasCredits.txt,ChangeLog}
122     use doc && dodoc doc/*.ps
123     }
124    
125     pkg_postinst() {
126     local THREADED
127    
128     if [ -d "${RPATH}"/threaded-atlas ]
129     then
130     THREADED="threaded-"
131     fi
132     if [[ -z "$(eselect blas show)" ]]; then
133     eselect blas set ${THREADED}atlas
134     fi
135     if [[ -z "$(eselect cblas show)" ]]; then
136     eselect cblas set ${THREADED}atlas
137     fi
138    
139     elog
140     elog "Fortran users link using -lblas"
141     elog
142     elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
143     elog "link using -lcblas"
144     elog
145     elog "If using threaded ATLAS, you may also need to link with -lpthread."
146     elog
147     elog "Configuration now uses eselect rather than blas-config."
148     }

  ViewVC Help
Powered by ViewVC 1.1.20