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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Jul 21 13:42:28 2008 UTC (11 years, 11 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Version bump and removed old ebuilds.
(Portage version: 2.2_rc1/cvs/Linux 2.6.25-SENTINEL-4 i686)

1 # Copyright 1999-2008 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.8.1.ebuild,v 1.6 2008/06/04 13:09:55 markusle Exp $
4
5 inherit eutils toolchain-funcs fortran multilib
6
7 PATCH_V="3.7.39"
8
9 DESCRIPTION="Automatically Tuned Linear Algebra Software BLAS implementation"
10 HOMEPAGE="http://math-atlas.sourceforge.net/"
11 MY_PN=${PN/blas-/}
12 SRC_URI="mirror://sourceforge/math-atlas/${MY_PN}${PV}.tar.bz2
13 mirror://gentoo/${MY_PN}-${PATCH_V}-shared-libs.patch.bz2"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
18 IUSE="doc"
19
20 RDEPEND="app-admin/eselect-blas
21 app-admin/eselect-cblas
22 doc? ( app-doc/blas-docs )"
23 DEPEND="app-admin/eselect-blas
24 app-admin/eselect-cblas
25 >=sys-devel/libtool-1.5"
26
27 S="${WORKDIR}/ATLAS"
28
29 pkg_setup() {
30 # icc won't compile (as of icc-10.0.026)
31 # and will blow out $PORTAGE_TMPDIR
32 if [[ $(tc-getCC) = icc* ]]; then
33 eerror "icc compiler is not supported with sci-libs/blas-atlas"
34 die "blas-atlas won't compile with icc"
35 fi
36
37 FORTRAN="g77 gfortran ifc"
38 fortran_pkg_setup
39 echo
40 ewarn "Please make sure to disable CPU throttling completely"
41 ewarn "during the compile of blas-atlas. Otherwise, all atlas"
42 ewarn "generated timings will be completely random and the"
43 ewarn "performance of the resulting libraries will be degraded"
44 ewarn "considerably."
45 echo
46 ewarn "For users of <=gcc-4.1.1 only:"
47 ewarn "If you experience failing SANITY tests during"
48 ewarn "atlas' compile please try passing -mfpmath=387; this"
49 ewarn "option might also result in much better performance"
50 ewarn "than using then sse instruction set depending on your"
51 ewarn "CPU."
52 echo
53 epause 10
54 }
55
56 src_unpack() {
57 unpack ${A}
58
59 cd "${S}"
60 epatch "${DISTDIR}"/${MY_PN}-${PATCH_V}-shared-libs.patch.bz2
61 epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
62 epatch "${FILESDIR}"/${MY_PN}-${PATCH_V}-decl-fix.patch
63 epatch "${FILESDIR}"/${P}-gemm-fix.patch
64
65 BLD_DIR="${S}"/gentoo-build
66 mkdir "${BLD_DIR}" || die "failed to generate build directory"
67 cd "${BLD_DIR}"
68 cp "${FILESDIR}"/war . && chmod a+x war || die "failed to install war"
69
70 local archselect=
71 if use amd64 || use ppc64; then
72 archselect="-b 64"
73 elif use alpha; then
74 archselect=""
75 else
76 archselect="-b 32"
77 fi
78
79 ../configure \
80 --cc="$(tc-getCC)" \
81 --cflags="${CFLAGS}" \
82 --prefix="${D}/${DESTTREE}" \
83 --libdir="${D}/${DESTTREE}"/$(get_libdir)/atlas \
84 --incdir="${D}/${DESTTREE}"/include \
85 -C ac "$(tc-getCC)" -F ac "${CFLAGS}" \
86 -C if ${FORTRANC} -F if "${FFLAGS:-'-O2'}" \
87 -Ss pmake "\$(MAKE) ${MAKEOPTS}" \
88 -Si cputhrchk 0 ${archselect} \
89 || die "configure failed"
90 }
91
92 src_compile() {
93 cd "${BLD_DIR}"
94
95 # atlas does its own parallel builds
96 emake -j1 || die "emake failed"
97
98 RPATH="${DESTTREE}"/$(get_libdir)/blas
99 make \
100 LIBDIR=$(get_libdir) \
101 RPATH="${RPATH}"/atlas \
102 shared || die "failed to build shared libraries"
103
104 # build shared libraries of threaded libraries if applicable
105 if [[ -d gentoo/libptcblas.a ]]; then
106 make \
107 LIBDIR=$(get_libdir) \
108 RPATH="${RPATH}"/threaded-atlas \
109 ptshared || die "failed to build threaded shared libraries"
110 fi
111 }
112
113 src_test() {
114 # make check does not work because
115 # we don't build lapack libs
116 for i in F77 C; do
117 einfo "Testing ${i} interface"
118 cd "${BLD_DIR}"/interfaces/blas/${i}/testing
119 make sanity_test || die "emake tests for ${i} failed"
120 if [[ -d "${BLD_DIR}"/gentoo/libptf77blas.a ]]; then
121 make ptsanity_test || die "emake tests threaded for ${i}failed"
122 fi
123 done
124 echo "Timing ATLAS"
125 cd "${BLD_DIR}"
126 emake time || die "emake time failed"
127 }
128
129 src_install () {
130 dodir "${RPATH}"/atlas
131 cd "${BLD_DIR}"/gentoo/libs
132 cp -P libatlas* "${D}/${DESTTREE}"/$(get_libdir) \
133 || die "Failed to install libatlas"
134
135 # pkgconfig files
136 local extlibs="-lm"
137 local threadlibs
138 [[ ${FORTRANC} == gfortran ]] && extlibs="${extlibs} -lgfortran"
139 [[ ${FORTRANC} == g77 ]] && extlibs="${extlibs} -lg2c"
140 cp "${FILESDIR}"/blas.pc.in blas.pc
141 cp "${FILESDIR}"/cblas.pc.in cblas.pc
142 sed -i \
143 -e "s:@LIBDIR@:$(get_libdir):" \
144 -e "s:@PV@:${PV}:" \
145 -e "s:@EXTLIBS@:${extlibs}:g" \
146 -e "s:@THREADLIBS@:${threadlibs}:g" \
147 *blas.pc || die "sed *blas.pc failed"
148
149 cp -P *blas* "${D}/${RPATH}"/atlas \
150 || die "Failed to install blas/cblas"
151
152 ESELECT_PROF=atlas
153 eselect blas add $(get_libdir) "${FILESDIR}"/eselect.blas.atlas ${ESELECT_PROF}
154 eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas.atlas ${ESELECT_PROF}
155
156 if [[ -d "${BLD_DIR}"/gentoo/threaded-libs ]]; then
157 dodir "${RPATH}"/threaded-atlas
158 cd "${BLD_DIR}"/gentoo/threaded-libs
159
160 # pkgconfig files
161 cp "${FILESDIR}"/blas.pc.in blas.pc
162 cp "${FILESDIR}"/cblas.pc.in cblas.pc
163 threadlibs="-lpthread"
164 sed -i \
165 -e "s:@LIBDIR@:$(get_libdir):" \
166 -e "s:@PV@:${PV}:" \
167 -e "s:@EXTLIBS@:${extlibs}:g" \
168 -e "s:@THREADLIBS@:${threadlibs}:g" \
169 *blas.pc || die "sed *blas.pc failed"
170
171 cp -P * "${D}/${RPATH}"/threaded-atlas \
172 || die "Failed to install threaded atlas"
173 ESELECT_PROF=atlas-threads
174
175 eselect blas add $(get_libdir) "${FILESDIR}"/eselect.blas.threaded-atlas ${ESELECT_PROF}
176 eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas.threaded-atlas ${ESELECT_PROF}
177 fi
178
179 insinto "${DESTTREE}"/include/atlas
180 doins \
181 "${S}"/include/cblas.h \
182 "${S}"/include/atlas_misc.h \
183 "${S}"/include/atlas_enum.h \
184 || die "failed to install headers"
185
186 # These headers contain the architecture-specific
187 # optimizations determined by ATLAS. The atlas-lapack build
188 # is much shorter if they are available, so save them:
189 doins "${BLD_DIR}"/include/*.h \
190 || die "failed to install timing headers"
191
192 # some docs
193 cd "${S}"/doc
194 dodoc INDEX.txt AtlasCredits.txt ChangeLog || die "dodoc failed"
195 # atlas specific doc (blas generic docs installed by blas-docs)
196 if use doc; then
197 insinto /usr/share/doc/${PF}
198 doins atlas*pdf cblasqref.pdf || die "doins docs failed"
199 fi
200 }
201
202 pkg_postinst() {
203 for p in blas cblas; do
204 local current_p=$(eselect ${p} show | cut -d' ' -f2)
205 # this snippet works around the eselect bug #189942 and makes
206 # sure that users upgrading from a previous blas-atlas
207 # version pick up the new pkg-config files
208 if [[ ${current_p} == ${ESELECT_PROF} \
209 || ${current_p} == "threaded-atlas" \
210 || -z ${current_p} ]]; then
211 local configfile="${ROOT}"/etc/env.d/${p}/$(get_libdir)/config
212 [[ -e ${configfile} ]] && rm -f ${configfile}
213 eselect ${p} set ${ESELECT_PROF}
214 elog "${p} has been eselected to ${ESELECT_PROF}"
215 else
216 elog "Current eselected ${p} is ${current_p}"
217 elog "To use the ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
218 elog "\t eselect ${p} set ${ESELECT_PROF}"
219 fi
220 done
221 }

  ViewVC Help
Powered by ViewVC 1.1.20