/[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.2 - (hide annotations) (download)
Wed Sep 27 19:14:49 2006 UTC (13 years, 10 months ago) by markusle
Branch: MAIN
Changes since 1.1: +11 -4 lines
Replaced the faulty 'ASM VOLATILE' patch with a proper fix to the offending clobbered bx registers in camm_dpa.h.
(Portage version: 2.1.2_pre1-r1)

1 markusle 1.1 # Copyright 1999-2006 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 markusle 1.2 # $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.7.17.ebuild,v 1.1 2006/09/11 20:54:00 markusle Exp $
4 markusle 1.1
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 markusle 1.2 mirror://gentoo/${MY_PN}-${PV}-shared-libs.patch.bz2"
12 markusle 1.1
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 markusle 1.2 ewarn "Also, if you experience failing SANITY tests during"
41     ewarn "atlas' compile please try passing -mfpmath=387; this"
42     ewarn "option might also result in much better performance"
43     ewarn "than using then sse instruction set depending on your"
44     ewarn "CPU."
45     echo
46     epause 10
47 markusle 1.1 }
48    
49     src_unpack() {
50     unpack ${A}
51     cd ${S}
52    
53 markusle 1.2 epatch "${DISTDIR}"/${MY_PN}-${PV}-shared-libs.patch.bz2
54     epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
55 markusle 1.1
56     # make sure shared libs link against proper libraries
57     if [[ ${FORTRANC} == "gfortran" ]]; then
58     libs="${LDFLAGS} -lpthread -lgfortran"
59     else
60     libs="${LDFLAGS} -lpthread -lg2c"
61     fi
62     sed -e "s/SHRD_LNK/${libs}/g" -i Make.top || \
63     die "Failed to add addtional libs to shared object build"
64    
65     mkdir ${BLD_DIR} || die "failed to generate build directory"
66     cp "${FILESDIR}"/war ${BLD_DIR} && chmod a+x ${BLD_DIR}/war || \
67     die "failed to install war"
68    
69     cd ${BLD_DIR} && ../configure -Si cputhrchk 0 \
70     || die "configure failed"
71    
72     sed -e "s:GENTOO_GCC:$(tc-getCC):" \
73     -e "s:GENTOO_FORTRAN:${FORTRANC}:" \
74     -e "s:GENTOO_CFLAGS:${CFLAGS}:" \
75     -e "s:GENTOO_FFLAGS:${FFLAGS}:" \
76     -i Make.inc || die "Failed to fix Make.inc"
77     }
78    
79     src_compile() {
80     cd ${BLD_DIR}
81     make || die "make failed"
82    
83     make shared-strip RPATH=${RPATH}/atlas || \
84     die "failed to build shared libraries"
85    
86     # build shared libraries of threaded libraries if applicable
87     if [ -d gentoo/libptf77blas.a ]; then
88     make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
89     die "failed to build threaded shared libraries"
90     fi
91     }
92    
93     src_install () {
94     dodir "${RPATH}"/atlas
95     cd ${BLD_DIR}/gentoo/libs
96     cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
97     die "Failed to install libatlas"
98     cp -P *blas* "${D}/${RPATH}"/atlas || \
99     die "Failed to install blas/cblas"
100    
101     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
102     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
103    
104     if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
105     then
106     dodir "${RPATH}"/threaded-atlas
107     cd ${BLD_DIR}/gentoo/threaded-libs
108     cp -P * "${D}/${RPATH}"/threaded-atlas || \
109     die "Failed to install threaded atlas"
110    
111     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
112     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
113     fi
114    
115     insinto "${DESTTREE}"/include/atlas
116     doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
117     "${S}"/include/atlas_enum.h || \
118     die "failed to install headers"
119    
120     # These headers contain the architecture-specific
121     # optimizations determined by ATLAS. The atlas-lapack build
122     # is much shorter if they are available, so save them:
123     doins ${BLD_DIR}/include/*.h || \
124     die "failed to install timing headers"
125    
126     #some docs
127     cd "${S}"
128     dodoc README doc/{AtlasCredits.txt,ChangeLog}
129     use doc && dodoc doc/*.ps
130     }
131    
132     pkg_postinst() {
133     local THREADED
134    
135     if [ -d "${RPATH}"/threaded-atlas ]
136     then
137     THREADED="threaded-"
138     fi
139     if [[ -z "$(eselect blas show)" ]]; then
140     eselect blas set ${THREADED}atlas
141     fi
142     if [[ -z "$(eselect cblas show)" ]]; then
143     eselect cblas set ${THREADED}atlas
144     fi
145    
146     elog
147     elog "Fortran users link using -lblas"
148     elog
149     elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
150     elog "link using -lcblas"
151     elog
152     elog "If using threaded ATLAS, you may also need to link with -lpthread."
153     elog
154     elog "Configuration now uses eselect rather than blas-config."
155     }

  ViewVC Help
Powered by ViewVC 1.1.20