Gentoo Archives: gentoo-commits

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