Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/blas-atlas: blas-atlas-3.9.23-r2.ebuild ChangeLog blas-atlas-3.9.23-r3.ebuild
Date: Tue, 20 Apr 2010 18:26:57
Message-Id: 20100420182652.2FFEE2C04B@corvid.gentoo.org
1 jlec 10/04/20 18:26:51
2
3 Modified: blas-atlas-3.9.23-r2.ebuild ChangeLog
4 Added: blas-atlas-3.9.23-r3.ebuild
5 Log:
6 Fixing for prefix
7 (Portage version: 2.2_rc67/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.2 sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild?rev=1.2&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild?rev=1.2&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild?r1=1.1&r2=1.2
15
16 Index: blas-atlas-3.9.23-r2.ebuild
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild,v
19 retrieving revision 1.1
20 retrieving revision 1.2
21 diff -u -r1.1 -r1.2
22 --- blas-atlas-3.9.23-r2.ebuild 15 Apr 2010 20:20:43 -0000 1.1
23 +++ blas-atlas-3.9.23-r2.ebuild 20 Apr 2010 18:26:51 -0000 1.2
24 @@ -1,6 +1,6 @@
25 # Copyright 1999-2010 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License v2
27 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild,v 1.1 2010/04/15 20:20:43 jlec Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r2.ebuild,v 1.2 2010/04/20 18:26:51 jlec Exp $
29
30 EAPI="3"
31
32 @@ -15,7 +15,7 @@
33
34 LICENSE="BSD"
35 SLOT="0"
36 -KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
37 +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
38 IUSE="doc"
39
40 RDEPEND="app-admin/eselect-blas
41
42
43
44 1.100 sci-libs/blas-atlas/ChangeLog
45
46 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/ChangeLog?rev=1.100&view=markup
47 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/ChangeLog?rev=1.100&content-type=text/plain
48 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/ChangeLog?r1=1.99&r2=1.100
49
50 Index: ChangeLog
51 ===================================================================
52 RCS file: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/ChangeLog,v
53 retrieving revision 1.99
54 retrieving revision 1.100
55 diff -u -r1.99 -r1.100
56 --- ChangeLog 15 Apr 2010 20:20:43 -0000 1.99
57 +++ ChangeLog 20 Apr 2010 18:26:51 -0000 1.100
58 @@ -1,6 +1,12 @@
59 # ChangeLog for sci-libs/blas-atlas
60 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
61 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/ChangeLog,v 1.99 2010/04/15 20:20:43 jlec Exp $
62 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/ChangeLog,v 1.100 2010/04/20 18:26:51 jlec Exp $
63 +
64 +*blas-atlas-3.9.23-r3 (20 Apr 2010)
65 +
66 + 20 Apr 2010; Justin Lecher <jlec@g.o> blas-atlas-3.9.23-r2.ebuild,
67 + +blas-atlas-3.9.23-r3.ebuild:
68 + Fixing for prefix
69
70 *blas-atlas-3.9.23-r2 (15 Apr 2010)
71
72
73
74
75 1.1 sci-libs/blas-atlas/blas-atlas-3.9.23-r3.ebuild
76
77 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r3.ebuild?rev=1.1&view=markup
78 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r3.ebuild?rev=1.1&content-type=text/plain
79
80 Index: blas-atlas-3.9.23-r3.ebuild
81 ===================================================================
82 # Copyright 1999-2010 Gentoo Foundation
83 # Distributed under the terms of the GNU General Public License v2
84 # $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-atlas/blas-atlas-3.9.23-r3.ebuild,v 1.1 2010/04/20 18:26:51 jlec Exp $
85
86 EAPI="3"
87
88 inherit eutils toolchain-funcs fortran multilib
89
90 DESCRIPTION="Automatically Tuned Linear Algebra Software BLAS implementation"
91 HOMEPAGE="http://math-atlas.sourceforge.net/"
92 MY_PN=${PN/blas-/}
93 PATCH_V="3.9.21"
94 SRC_URI="mirror://sourceforge/math-atlas/${MY_PN}${PV}.tar.bz2
95 mirror://gentoo/${MY_PN}-${PATCH_V}-shared-libs.2.patch.bz2"
96
97 LICENSE="BSD"
98 SLOT="0"
99 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
100 IUSE="doc"
101
102 RDEPEND="app-admin/eselect-blas
103 app-admin/eselect-cblas
104 doc? ( app-doc/blas-docs )"
105 DEPEND="app-admin/eselect-blas
106 app-admin/eselect-cblas
107 >=sys-devel/libtool-1.5"
108
109 S="${WORKDIR}/ATLAS"
110 BLD_DIR="${S}"/gentoo-build
111 RPATH=/usr/$(get_libdir)/blas
112
113 pkg_setup() {
114 # icc won't compile (as of icc-10.0.026)
115 # and will blow out $PORTAGE_TMPDIR
116 if [[ $(tc-getCC) = icc* ]]; then
117 eerror "icc compiler is not supported with sci-libs/blas-atlas"
118 die "blas-atlas won't compile with icc"
119 fi
120
121 FORTRAN="g77 gfortran ifc"
122 fortran_pkg_setup
123 echo
124 ewarn "Please make sure to disable CPU throttling completely"
125 ewarn "during the compile of blas-atlas. Otherwise, all atlas"
126 ewarn "generated timings will be completely random and the"
127 ewarn "performance of the resulting libraries will be degraded"
128 ewarn "considerably."
129 echo
130 ewarn "For users of <=gcc-4.1 only:"
131 ewarn "If you experience failing SANITY tests during"
132 ewarn "atlas' compile please try passing -mfpmath=387; this"
133 ewarn "option might also result in much better performance"
134 ewarn "than using then sse instruction set depending on your"
135 ewarn "CPU."
136 echo
137 ewarn "If blas-atlas fails during linking with a message"
138 ewarn "'relocation R_X86_64_32 .... recompile with -fPIC.'"
139 ewarn "please re-emerge libtool and then try again."
140 echo
141 }
142
143 src_prepare() {
144 epatch "${DISTDIR}"/${MY_PN}-${PATCH_V}-shared-libs.2.patch.bz2
145 epatch "${FILESDIR}"/${MY_PN}-${PV}-ger-fix.patch
146 epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
147
148 cp "${FILESDIR}"/eselect.{,c}blas.{,threaded-}atlas "${T}"/
149 sed -i -e "s:/usr:${EPREFIX}/usr:" \
150 "${T}"/eselect.{,c}blas.{,threaded-}atlas || die
151 if [[ ${CHOST} == *-darwin* ]] ; then
152 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
153 "${T}"/eselect.{,c}blas.{,threaded-}atlas || die
154 sed -e /LIBTOOL/s/libtool/glibtool/ -i CONFIG/src/SpewMakeInc.c
155 epatch "${FILESDIR}"/${PN}-3.9.3-darwin-make-top.patch
156 fi
157
158 mkdir "${BLD_DIR}" || die "failed to generate build directory"
159 cd "${BLD_DIR}"
160 cp "${FILESDIR}"/war . && chmod a+x war || die "failed to install war"
161 sed -i -e '1c\#!'"${EPREFIX}"'/bin/bash' war || die
162 }
163
164 src_configure() {
165 cd "${BLD_DIR}"
166 local archselect=
167 if use amd64 || use ppc64; then
168 archselect="-b 64"
169 elif use alpha; then
170 archselect=""
171 else
172 archselect="-b 32"
173 fi
174
175 # Remove -m64 on alpha, since the compiler doesn't support it
176 use alpha && sed -i -e 's/-m64//g' "${S}"/CONFIG/src/probe_comp.c
177
178 # unfortunately, atlas-3.9.0 chokes when passed
179 # x86_64-pc-linux-gnu-gcc and friends instead of
180 # plain gcc. Hence, we'll have to workaround this
181 # until it is fixed by upstream
182 local c_compiler=$(tc-getCC)
183 if [[ "${c_compiler}" == *gcc* ]]; then
184 c_compiler="gcc"
185 fi
186
187 ../configure \
188 --cc="${c_compiler}" \
189 --cflags="${CFLAGS}" \
190 --prefix="${ED}"/usr \
191 --libdir="${ED}"/usr/$(get_libdir)/atlas \
192 --incdir="${ED}"/usr/include \
193 -C ac "${c_compiler}" -F ac "${CFLAGS}" \
194 -C if ${FORTRANC} -F if "${FFLAGS:-'-O2'}" \
195 -Ss pmake "\$(MAKE) ${MAKEOPTS}" \
196 -Si cputhrchk 0 ${archselect} \
197 || die "configure failed"
198
199 # fix LDFLAGS
200 sed -e "s|LDFLAGS =.*|LDFLAGS = ${LDFLAGS}|" \
201 -i "${BLD_DIR}"/Make.inc
202 }
203
204 src_compile() {
205 cd "${BLD_DIR}"
206
207 # atlas does its own parallel builds
208 # — and it fails parallel make, bug #294172
209 emake -j1 || die "emake failed"
210
211 emake -j1 \
212 LIBDIR=$(get_libdir) \
213 RPATH="${EPREFIX}/${RPATH}"/atlas \
214 shared || die "failed to build shared libraries"
215
216 # build shared libraries of threaded libraries if applicable
217 if [[ -d gentoo/libptcblas.a ]]; then
218 emake -j1 \
219 LIBDIR=$(get_libdir) \
220 RPATH="${EPREFIX}${RPATH}"/threaded-atlas \
221 ptshared || die "failed to build threaded shared libraries"
222 fi
223 }
224
225 src_test() {
226 # make check does not work because
227 # we don't build lapack libs
228 for i in F77 C; do
229 einfo "Testing ${i} interface"
230 cd "${BLD_DIR}"/interfaces/blas/${i}/testing
231 make sanity_test || die "emake tests for ${i} failed"
232 if [[ -d "${BLD_DIR}"/gentoo/libptf77blas.a ]]; then
233 make ptsanity_test || die "emake tests threaded for ${i}failed"
234 fi
235 done
236 echo "Timing ATLAS"
237 cd "${BLD_DIR}"
238 emake time || die "emake time failed"
239 }
240
241 src_install () {
242 dodir "${RPATH}"/atlas
243 cd "${BLD_DIR}"/gentoo/libs
244 cp -P libatlas* "${ED}"/usr/$(get_libdir) \
245 || die "Failed to install libatlas"
246
247 # pkgconfig files
248 local extlibs="-lm"
249 local threadlibs
250 [[ ${FORTRANC} == gfortran ]] && extlibs="${extlibs} -lgfortran"
251 [[ ${FORTRANC} == g77 ]] && extlibs="${extlibs} -lg2c"
252 cp "${FILESDIR}"/blas.pc.in blas.pc
253 cp "${FILESDIR}"/cblas.pc.in cblas.pc
254 sed -i \
255 -e "s:=/usr:=${EPREFIX}/usr:" \
256 -e "s:@LIBDIR@:$(get_libdir)/blas/atlas:" \
257 -e "s:@PV@:${PV}:" \
258 -e "s:@EXTLIBS@:${extlibs}:g" \
259 -e "s:@THREADLIBS@:${threadlibs}:g" \
260 *blas.pc || die "sed *blas.pc failed"
261
262 cp -P *blas* "${ED}/${RPATH}"/atlas \
263 || die "Failed to install blas/cblas"
264
265 ESELECT_PROF=atlas
266 eselect blas add $(get_libdir) "${T}"/eselect.blas.atlas ${ESELECT_PROF}
267 eselect cblas add $(get_libdir) "${T}"/eselect.cblas.atlas ${ESELECT_PROF}
268
269 if [[ -d "${BLD_DIR}"/gentoo/threaded-libs ]]; then
270 dodir "${RPATH}"/threaded-atlas
271 cd "${BLD_DIR}"/gentoo/threaded-libs
272
273 # pkgconfig files
274 cp "${FILESDIR}"/blas.pc.in blas.pc
275 cp "${FILESDIR}"/cblas.pc.in cblas.pc
276 threadlibs="-lpthread"
277 sed -i \
278 -e "s:=/usr:=${EPREFIX}/usr:" \
279 -e "s:@LIBDIR@:$(get_libdir)/blas/threaded-atlas:" \
280 -e "s:@PV@:${PV}:" \
281 -e "s:@EXTLIBS@:${extlibs}:g" \
282 -e "s:@THREADLIBS@:${threadlibs}:g" \
283 *blas.pc || die "sed *blas.pc failed"
284
285 cp -P * "${ED}/${RPATH}"/threaded-atlas \
286 || die "Failed to install threaded atlas"
287 ESELECT_PROF=atlas-threads
288
289 eselect blas add $(get_libdir) "${T}"/eselect.blas.threaded-atlas ${ESELECT_PROF}
290 eselect cblas add $(get_libdir) "${T}"/eselect.cblas.threaded-atlas ${ESELECT_PROF}
291 fi
292
293 insinto /usr/include/atlas
294 doins \
295 "${S}"/include/cblas.h \
296 "${S}"/include/atlas_misc.h \
297 "${S}"/include/atlas_enum.h \
298 "${S}"/include/atlas_aux.h \
299 || die "failed to install headers"
300
301 # These headers contain the architecture-specific
302 # optimizations determined by ATLAS. The atlas-lapack build
303 # is much shorter if they are available, so save them:
304 doins "${BLD_DIR}"/include/*.h \
305 || die "failed to install timing headers"
306
307 sed \
308 -e "s:/usr/:${EPREFIX}/usr/:g" \
309 -e "s: /usr/lib: ${EPREFIX}/usr/lib:g" \
310 -e "s:${EPREFIX}${EPREFIX}:${EPREFIX}:g" \
311 -i \
312 ${ED}/usr/$(get_libdir)/*.la \
313 ${ED}/usr/$(get_libdir)/blas/*/*.la \
314 || die
315
316 # some docs
317 cd "${S}"/doc
318 dodoc INDEX.txt AtlasCredits.txt ChangeLog || die "dodoc failed"
319 # atlas specific doc (blas generic docs installed by blas-docs)
320 if use doc; then
321 insinto /usr/share/doc/${PF}
322 doins atlas*pdf cblasqref.pdf || die "doins docs failed"
323 fi
324 }
325
326 pkg_postinst() {
327 for p in blas cblas; do
328 local current_p=$(eselect ${p} show | cut -d' ' -f2)
329 # this snippet works around the eselect bug #189942 and makes
330 # sure that users upgrading from a previous blas-atlas
331 # version pick up the new pkg-config files
332 if [[ ${current_p} == ${ESELECT_PROF} \
333 || ${current_p} == "threaded-atlas" \
334 || -z ${current_p} ]]; then
335 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
336 [[ -e ${configfile} ]] && rm -f ${configfile}
337 eselect ${p} set ${ESELECT_PROF}
338 elog "${p} has been eselected to ${ESELECT_PROF}"
339 else
340 elog "Current eselected ${p} is ${current_p}"
341 elog "To use the ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
342 elog "\t eselect ${p} set ${ESELECT_PROF}"
343 fi
344 done
345 }