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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Jan 3 02:36:46 2007 UTC (13 years, 7 months ago) by markusle
Branch: MAIN
Changes since 1.1: +4 -2 lines
Removed forcing of non-existent -m32 CFLAG for alpha and rely on atlas' autodetection to do the right thing (see bug #159002).
(Portage version: 2.1.2_rc4-r4)

1 markusle 1.2 # Copyright 1999-2007 Gentoo Foundation
2 markusle 1.1 # 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.24.ebuild,v 1.1 2006/12/19 23:09:21 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     mirror://gentoo/${MY_PN}-3.7.23-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     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     }
48    
49     src_unpack() {
50     unpack ${A}
51     cd ${S}
52    
53     epatch "${DISTDIR}"/${MY_PN}-3.7.23-shared-libs.patch.bz2
54     epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
55    
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     # force proper 32/64bit libs
70     local archselect
71     if [[ "${ARCH}" == "amd64" || "${ARCH}" == "ppc64" ]]; then
72     archselect="-b 64"
73 markusle 1.2 elif [ "${ARCH}" == "alpha" ]; then
74     archselect=""
75 markusle 1.1 else
76     archselect="-b 32"
77     fi
78    
79     # set up compiler/flags using atlas' native configure
80     local compdefs
81     compdefs="${compdefs} -C xc '$(tc-getCC)' -F xc '${CFLAGS}'"
82     compdefs="${compdefs} -C ic '$(tc-getCC)' -F ic '${CFLAGS}'"
83     compdefs="${compdefs} -C sk '$(tc-getCC)' -F sk '${CFLAGS}'"
84     compdefs="${compdefs} -C dk '$(tc-getCC)' -F dk '${CFLAGS}'"
85     compdefs="${compdefs} -C sm '$(tc-getCC)' -F sm '${CFLAGS}'"
86     compdefs="${compdefs} -C dm '$(tc-getCC)' -F dm '${CFLAGS}'"
87     compdefs="${compdefs} -C if '${FORTRANC}' -F if '${FFLAGS}'"
88     compdefs="${compdefs} -Ss pmake '\$(MAKE) ${MAKEOPTS}'"
89     compdefs="${compdefs} -Si cputhrchk 0 ${archselect}"
90    
91     cd ${BLD_DIR} && ../configure ${compdefs} \
92     || die "configure failed"
93     }
94    
95     src_compile() {
96     cd ${BLD_DIR}
97     emake -j1 || die "make failed"
98    
99     make shared-strip RPATH=${RPATH}/atlas || \
100     die "failed to build shared libraries"
101    
102     # build shared libraries of threaded libraries if applicable
103     if [ -d gentoo/libptf77blas.a ]; then
104     make ptshared-strip RPATH=${RPATH}/threaded-atlas || \
105     die "failed to build threaded shared libraries"
106     fi
107     }
108    
109     src_install () {
110     dodir "${RPATH}"/atlas
111     cd ${BLD_DIR}/gentoo/libs
112     cp -P libatlas* "${D}/${DESTTREE}/$(get_libdir)" || \
113     die "Failed to install libatlas"
114     cp -P *blas* "${D}/${RPATH}"/atlas || \
115     die "Failed to install blas/cblas"
116    
117     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas atlas
118     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas atlas
119    
120     if [ -d ${BLD_DIR}/gentoo/threaded-libs ]
121     then
122     dodir "${RPATH}"/threaded-atlas
123     cd ${BLD_DIR}/gentoo/threaded-libs
124     cp -P * "${D}/${RPATH}"/threaded-atlas || \
125     die "Failed to install threaded atlas"
126    
127     eselect blas add $(get_libdir) ${FILESDIR}/eselect.blas-threaded threaded-atlas
128     eselect cblas add $(get_libdir) ${FILESDIR}/eselect.cblas-threaded threaded-atlas
129     fi
130    
131     insinto "${DESTTREE}"/include/atlas
132     doins "${S}"/include/cblas.h "${S}"/include/atlas_misc.h \
133     "${S}"/include/atlas_enum.h || \
134     die "failed to install headers"
135    
136     # These headers contain the architecture-specific
137     # optimizations determined by ATLAS. The atlas-lapack build
138     # is much shorter if they are available, so save them:
139     doins ${BLD_DIR}/include/*.h || \
140     die "failed to install timing headers"
141    
142     #some docs
143     cd "${S}"
144     dodoc README doc/{AtlasCredits.txt,ChangeLog}
145     use doc && dodoc doc/*.ps
146     }
147    
148     pkg_postinst() {
149     local THREADED
150    
151     if [ -d "${RPATH}"/threaded-atlas ]
152     then
153     THREADED="threaded-"
154     fi
155     if [[ -z "$(eselect blas show)" ]]; then
156     eselect blas set ${THREADED}atlas
157     fi
158     if [[ -z "$(eselect cblas show)" ]]; then
159     eselect cblas set ${THREADED}atlas
160     fi
161    
162     elog
163     elog "Fortran users link using -lblas"
164     elog
165     elog "C users compile against the header ${ROOT}usr/include/atlas/cblas.h and"
166     elog "link using -lcblas"
167     elog
168     elog "If using threaded ATLAS, you may also need to link with -lpthread."
169     elog
170     elog "Configuration now uses eselect rather than blas-config."
171     }

  ViewVC Help
Powered by ViewVC 1.1.20