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/lapack-atlas: ChangeLog lapack-atlas-3.9.21-r1.ebuild
Date: Sat, 06 Feb 2010 17:09:54
Message-Id: E1NdoAI-0001jr-ET@stork.gentoo.org
1 markusle 10/02/06 17:09:50
2
3 Modified: ChangeLog
4 Added: lapack-atlas-3.9.21-r1.ebuild
5 Log:
6 Updated pkgconfig file to include atlas headers (see bug #302951).
7 (Portage version: 2.1.7.17/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.77 sci-libs/lapack-atlas/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/lapack-atlas/ChangeLog?rev=1.77&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/lapack-atlas/ChangeLog?rev=1.77&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/lapack-atlas/ChangeLog?r1=1.76&r2=1.77
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/ChangeLog,v
19 retrieving revision 1.76
20 retrieving revision 1.77
21 diff -u -r1.76 -r1.77
22 --- ChangeLog 29 Jan 2010 04:44:09 -0000 1.76
23 +++ ChangeLog 6 Feb 2010 17:09:49 -0000 1.77
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sci-libs/lapack-atlas
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/ChangeLog,v 1.76 2010/01/29 04:44:09 markusle Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/lapack-atlas/ChangeLog,v 1.77 2010/02/06 17:09:49 markusle Exp $
29 +
30 +*lapack-atlas-3.9.21-r1 (06 Feb 2010)
31 +
32 + 06 Feb 2010; Markus Dittrich <markusle@g.o>
33 + +lapack-atlas-3.9.21-r1.ebuild, files/lapack.pc.in:
34 + Updated pkgconfig file to include atlas headers (see bug #302951).
35
36 29 Jan 2010; Markus Dittrich <markusle@g.o>
37 lapack-atlas-3.9.21.ebuild:
38
39
40
41 1.1 sci-libs/lapack-atlas/lapack-atlas-3.9.21-r1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/lapack-atlas/lapack-atlas-3.9.21-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/lapack-atlas/lapack-atlas-3.9.21-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: lapack-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/lapack-atlas/lapack-atlas-3.9.21-r1.ebuild,v 1.1 2010/02/06 17:09:49 markusle Exp $
51
52 inherit eutils flag-o-matic toolchain-funcs fortran autotools versionator
53
54 MY_PN="${PN/lapack-/}"
55 PATCH_V="3.9.0"
56 L_PN="lapack"
57 L_PV="3.1.1"
58 BlasRelease=$(get_version_component_range 1-3)
59
60 DESCRIPTION="F77 and C LAPACK implementations using available ATLAS routines"
61 LICENSE="BSD"
62 HOMEPAGE="http://math-atlas.sourceforge.net/"
63 SRC_URI1="mirror://sourceforge/math-atlas/${MY_PN}${PV}.tar.bz2"
64 SRC_URI2="http://www.netlib.org/${L_PN}/${L_PN}-lite-${L_PV}.tgz"
65 SRC_URI="${SRC_URI1} ${SRC_URI2}
66 mirror://gentoo/${MY_PN}-${PV}-shared-libs.2.patch.bz2
67 mirror://gentoo/${L_PN}-reference-${L_PV}-autotools.patch.bz2"
68
69 SLOT="0"
70 IUSE="doc"
71 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
72
73 CDEPEND="virtual/blas
74 virtual/cblas
75 app-admin/eselect-lapack
76 ~sci-libs/blas-atlas-${BlasRelease}"
77 DEPEND="${CDEPEND}
78 dev-util/pkgconfig
79 >=sys-devel/libtool-1.5"
80 RDEPEND="${CDEPEND}
81 doc? ( app-doc/lapack-docs )"
82
83 FORTRAN="g77 gfortran ifc"
84
85 S="${WORKDIR}/ATLAS"
86 S_LAPACK="${WORKDIR}/${L_PN}-lite-${L_PV}"
87 BLD_DIR="${S}/gentoo-build"
88 RPATH="${DESTTREE}/$(get_libdir)/${L_PN}/${MY_PN}"
89
90 src_unpack() {
91 unpack ${A}
92
93 cd "${S}"
94 epatch "${DISTDIR}"/${MY_PN}-${PV}-shared-libs.2.patch.bz2
95 epatch "${FILESDIR}"/${MY_PN}-asm-gentoo.patch
96 epatch "${FILESDIR}"/${P}-lam.patch
97
98 # make sure the compile picks up the proper includes
99 sed -i \
100 -e "s|INCLUDES.*=|INCLUDES = -I/usr/include/atlas/|" \
101 "${S}"/CONFIG/src/SpewMakeInc.c \
102 || die "failed to append proper includes"
103
104 BLD_DIR="${S}"/gentoo-build
105 mkdir "${BLD_DIR}" || die "failed to generate build directory"
106 cd "${BLD_DIR}"
107 cp "${FILESDIR}"/war . && chmod a+x war || die "failed to install war"
108
109 # force proper 32/64bit libs
110 local archselect
111 if use amd64 || use ppc64; then
112 archselect="-b 64"
113 elif use alpha; then
114 archselect=""
115 else
116 archselect="-b 32"
117 fi
118
119 # Remove -m64 on alpha, since the compiler doesn't support it
120 use alpha && sed -i -e 's/-m64//g' "${S}"/CONFIG/src/probe_comp.c
121
122 # unfortunately, atlas-3.9.0 chokes when passed
123 # x86_64-pc-linux-gnu-gcc and friends instead of
124 # plain gcc. Hence, we'll have to workaround this
125 # until it is fixed by upstream
126 local c_compiler=$(tc-getCC)
127 if [[ "${c_compiler}" == *gcc* ]]; then
128 c_compiler="gcc"
129 fi
130
131 ../configure \
132 --cc="${c_compiler}" \
133 --cflags="${CFLAGS}" \
134 --prefix="${D}/${DESTTREE}" \
135 --libdir="${D}/${DESTTREE}"/$(get_libdir)/atlas \
136 --incdir="${D}/${DESTTREE}"/include \
137 -C ac "${c_compiler}" -F ac "${CFLAGS}" \
138 -C if ${FORTRANC} -F if "${FFLAGS:-'-O2'}" \
139 -Ss pmake "\$(MAKE) ${MAKEOPTS}" \
140 -Si cputhrchk 0 ${archselect} \
141 || die "configure failed"
142
143 cd "${S_LAPACK}"
144 epatch "${WORKDIR}"/${L_PN}-reference-${L_PV}-autotools.patch
145 epatch "${FILESDIR}"/${L_PN}-reference-${L_PV}-test-fix.patch
146 eautoreconf
147
148 # set up the testing routines
149 sed -e "s:g77:${FORTRANC}:" \
150 -e "s:-funroll-all-loops -O3:${FFLAGS} $(pkg-config --cflags blas cblas):" \
151 -e "s:LOADOPTS =:LOADOPTS = ${LDFLAGS} $(pkg-config --cflags blas cblas):" \
152 -e "s:../../blas\$(PLAT).a:$(pkg-config --libs blas cblas):" \
153 -e "s:lapack\$(PLAT).a:SRC/.libs/liblapack.so -Wl,-rpath,${S_LAPACK}/SRC/.libs:" \
154 -e "s:EXT_ETIME$:INT_CPU_TIME:" \
155 make.inc.example > make.inc \
156 || die "Failed to set up make.inc"
157 }
158
159 src_compile() {
160 # build atlas' part of lapack
161 cd "${BLD_DIR}"
162 for d in src/lapack interfaces/lapack/C/src interfaces/lapack/F77/src interfaces/lapack/C2F/src; do
163 cd "${BLD_DIR}"/${d}
164 make lib || die "Failed to make lib in ${d}"
165 done
166
167 # build rest of lapack
168 S_LAPACK="${WORKDIR}"/${L_PN}-lite-${L_PV}
169 cd "${S_LAPACK}"
170 econf || die "Failed to configure reference lapack lib"
171 emake || die "Failed to make reference lapack lib"
172
173 cd "${S_LAPACK}"/SRC
174 einfo "Copying liblapack.a/*.o to ${S_LAPACK}/SRC"
175 cp -sf "${BLD_DIR}"/gentoo/liblapack.a/*.o .
176 einfo "Copying liblapack.a/*.lo to ${S_LAPACK}/SRC"
177 cp -sf "${BLD_DIR}"/gentoo/liblapack.a/*.lo .
178 einfo "Copying liblapack.a/.libs/*.o to ${S_LAPACK}/SRC"
179 cp -sf "${BLD_DIR}"/gentoo/liblapack.a/.libs/*.o .libs/
180
181 RPATH="${DESTTREE}"/$(get_libdir)/${L_PN}/${MY_PN}
182 local flibs
183 [[ ${FORTRANC} == gfortran ]] && flibs=-lgfortran
184 [[ ${FORTRANC} == g77 ]] && flibs=-lg2c
185 ../libtool --mode=link --tag=F77 ${FORTRANC} ${LDFLAGS} \
186 $(pkg-config --libs blas cblas) -latlas ${flibs} \
187 -o liblapack.la *.lo -rpath "${RPATH}" \
188 || die "Failed to create liblapack.la"
189
190 # making pkg-config file
191 sed -e "s:@LIBDIR@:$(get_libdir)/lapack/atlas:" \
192 -e "s:@PV@:${PV}:" \
193 -e "s:@EXTLIBS@:-lm ${flibs}:g" \
194 "${FILESDIR}"/lapack.pc.in > "${S}"/lapack.pc \
195 || die "sed lapack.pc failed"
196 }
197
198 src_install () {
199 dodir "${RPATH}"
200
201 cd "${S_LAPACK}"/SRC
202 ../libtool --mode=install cp liblapack.la "${D}/${RPATH}" \
203 || die "Failed to install lapack-atlas library"
204
205 ESELECT_PROF=atlas
206 eselect lapack add $(get_libdir) "${FILESDIR}"/eselect.lapack.atlas ${ESELECT_PROF}
207
208 insinto /usr/include/atlas
209 doins "${S}"/include/clapack.h || die "Failed to install clapack.h"
210 dosym atlas/clapack.h /usr/include/clapack.h
211
212 cd "${S}"
213 dodoc README doc/AtlasCredits.txt doc/ChangeLog \
214 || die "Failed to install docs"
215
216 insinto /usr/$(get_libdir)/lapack/atlas
217 doins "${S}"/lapack.pc || die "Failed to install lapack.pc"
218 }
219
220 src_test() {
221 cd "${S_LAPACK}"/TESTING/MATGEN
222 emake || die "Failed to create tmglib.a"
223 cd ..
224 emake || die "lapack-reference tests failed"
225 }
226
227 pkg_postinst() {
228 local current_lib=$(eselect lapack show | cut -d' ' -f2)
229 # this snippet works around the eselect bug #189942 and makes
230 # sure that users upgrading from a previous lapack-atlas
231 # version pick up the new pkg-config files
232 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
233 local configfile="${ROOT}"/etc/env.d/lapack/$(get_libdir)/config
234 [[ -e ${configfile} ]] && rm -f ${configfile}
235 eselect lapack set ${ESELECT_PROF}
236 elog "lapack has been eselected to ${ESELECT_PROF}"
237 else
238 elog "Current eselected lapack is ${current_lib}"
239 elog "To use blas ${ESELECT_PROF} implementation, you have to issue (as root):"
240 elog "\t eselect lapack set ${ESELECT_PROF}"
241 fi
242 }