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