Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/acml: ChangeLog acml-4.1.0.ebuild
Date: Wed, 30 Apr 2008 12:03:45
Message-Id: E1JrB27-0001ZZ-Cz@stork.gentoo.org
1 bicatali 08/04/30 12:03:35
2
3 Modified: ChangeLog
4 Added: acml-4.1.0.ebuild
5 Log:
6 Version bump. Added gfortran flag to make downloading explicit, robustified dependencies and much cleaning.
7 (Portage version: 2.1.5_rc6)
8
9 Revision Changes Path
10 1.34 sci-libs/acml/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/acml/ChangeLog?rev=1.34&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/acml/ChangeLog?rev=1.34&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/acml/ChangeLog?r1=1.33&r2=1.34
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sci-libs/acml/ChangeLog,v
19 retrieving revision 1.33
20 retrieving revision 1.34
21 diff -u -r1.33 -r1.34
22 --- ChangeLog 22 Apr 2008 08:13:19 -0000 1.33
23 +++ ChangeLog 30 Apr 2008 12:03:34 -0000 1.34
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sci-libs/acml
26 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/acml/ChangeLog,v 1.33 2008/04/22 08:13:19 bicatali Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/acml/ChangeLog,v 1.34 2008/04/30 12:03:34 bicatali Exp $
29 +
30 +*acml-4.1.0 (30 Apr 2008)
31 +
32 + 30 Apr 2008; Sébastien Fabbro <bicatali@g.o> +acml-4.1.0.ebuild:
33 + Version bump. Added gfortran flag to make downloading explicit,
34 + robustified dependencies and much cleaning.
35
36 22 Apr 2008; Sébastien Fabbro <bicatali@g.o> acml-3.6.0-r1.ebuild,
37 acml-3.6.1-r1.ebuild, acml-4.0.1.ebuild:
38
39
40
41 1.1 sci-libs/acml/acml-4.1.0.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/acml/acml-4.1.0.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/acml/acml-4.1.0.ebuild?rev=1.1&content-type=text/plain
45
46 Index: acml-4.1.0.ebuild
47 ===================================================================
48 # Copyright 1999-2008 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sci-libs/acml/acml-4.1.0.ebuild,v 1.1 2008/04/30 12:03:34 bicatali Exp $
51
52 EAPI="1"
53
54 inherit eutils toolchain-funcs fortran versionator
55
56 MY_P=${PN}-$(replace_all_version_separators -)
57
58 DESCRIPTION="AMD Core Math Library for x86 and amd64 CPUs"
59 HOMEPAGE="http://developer.amd.com/acml.jsp"
60 SRC_URI="
61 amd64? (
62 ifc? ( ${MY_P}-ifort-64bit.tgz )
63 gfortran? ( ${MY_P}-gfortran-64bit.tgz
64 int64? ( ${MY_P}-gfortran-64bit-int64.tgz ) )
65 !ifc? (
66 !gfortran? ( ${MY_P}-gfortran-64bit.tgz
67 int64? ( ${MY_P}-gfortran-64bit-int64.tgz ) ) ) )
68 x86? (
69 ifc? ( ${MY_P}-ifort-32bit.tgz ) )"
70
71 # add to amd64? when proper tar balls
72 # int64? ( ${MY_P}-ifort-64bit-int64.tgz ) )
73 # add to x86? if one day they exist
74 # gfortran? ( ${MY_P}-gfortran-32bit.tgz )
75 # !ifc? ( !gfortran ( ${MY_P}-gfortran-32bit.tgz ) ) )"
76
77 IUSE="doc examples gfortran ifc int64 openmp test"
78 KEYWORDS="~amd64 ~x86"
79
80 RESTRICT="strip fetch"
81 LICENSE="ACML"
82 SLOT="0"
83
84 CDEPEND="ifc? ( dev-lang/ifc )
85 gfortran? ( sys-devel/gcc:4.2 )
86 !gfortran? ( !ifc? ( sys-devel/gcc:4.2 ) )"
87
88 DEPEND="test? ( ${CDEPEND} )
89 app-admin/eselect-blas
90 app-admin/eselect-lapack"
91
92 RDEPEND="${CDEPEND}
93 app-admin/eselect-blas
94 app-admin/eselect-lapack
95 doc? ( app-doc/blas-docs app-doc/lapack-docs )"
96
97 S="${WORKDIR}"
98
99 pkg_nofetch() {
100 einfo "Please download the ACML from:"
101 einfo "${HOMEPAGE}"
102 einfo "and place it in ${DISTDIR}."
103 einfo "The previous versions could be found at"
104 einfo "http://developer.amd.com/acmlarchive.jsp"
105 einfo "SRC=${A} $SRC_URI"
106 }
107
108 pkg_setup() {
109 FORTRAN=""
110 if use test; then
111 use gfortran && FORTRAN="${FORTRAN} gfortran"
112 use ifc && FORTRAN="${FORTRAN} ifc"
113 use gfortran || use ifc || FORTRAN="gfortran"
114 fortran_pkg_setup
115 # work around incomplete fortran eclass
116 if [[ ${FORTRANC} == gfortran ]] &&
117 [[ $(gcc-version) != 4.2 ]]
118 then
119 eerror "You need gfortran-4.2 to test acml"
120 eerror "Please use gcc-config to switch gcc version 4.2"
121 die "gfortran check failed"
122 fi
123 fi
124 }
125
126 src_unpack() {
127 unpack ${A}
128 unpack ./contents-acml-*.tgz
129 use openmp || rm -rf *_mp*
130 }
131
132 src_test() {
133 # only testing with current chosen compiler
134 for fdir in ${FORTRANC}*; do
135 einfo "Testing acml in ${fdir}"
136 for d in . acml_mv; do
137 cd "${S}"/${fdir}/examples/${d}
138 emake \
139 ACMLDIR="${S}"/${fdir} \
140 F77=${FORTRANC} \
141 CC="$(tc-getCC)" \
142 CPLUSPLUS="$(tc-getCXX)" \
143 || die "emake test in ${fdir}/examples/${d} failed"
144 emake clean
145 done
146 done
147 }
148
149 make_acml_profile_name() {
150 local fort=${1%%[[:digit:]]*}
151 local opt=${1#*[0-9][0-9]}
152 echo ${PN}-${fort}${opt} | tr '_' '-'
153 }
154
155 src_install() {
156 # respect acml default install dir (and FHS)
157 local instdir=/opt/${PN}${PV}
158 dodir ${instdir}
159
160 for lib in */lib; do
161 local fdir=${lib%/*}
162 # install acml
163 use examples || rm -rf "${S}"/${fdir}/examples
164 cp -pPR "${S}"/${fdir} "${D}"${instdir} || die "copy ${fdir} failed"
165
166 # install profiles
167 local prof=$(make_acml_profile_name ${fdir})
168 local acmldir=${instdir}/${fdir}
169 local acmllibs="-lacml -lacml_mv"
170 local libname=${acmldir}/lib/libacml
171 local extlibs
172 local extflags
173 [[ ${fdir} =~ int64 ]] && extflags="${extflags} -fdefault-integer-8"
174 [[ ${fdir} =~ gfortran ]] && extlibs="${extlibs} -lgfortran"
175 if [[ ${fdir} =~ _mp ]]; then
176 extlibs="${extlibs} -lpthread"
177 extflags="${extflags} -fopenmp"
178 acmllibs="-lacml_mp -lacml_mv"
179 libname=${libname}_mp
180 fi
181 for x in blas lapack; do
182 # pkgconfig files
183 sed -e "s:@LIBDIR@:$(get_libdir):" \
184 -e "s:@PV@:${PV}:" \
185 -e "s:@ACMLDIR@:${acmldir}:g" \
186 -e "s:@ACMLLIBS@:${acmllibs}:g" \
187 -e "s:@EXTLIBS@:${extlibs}:g" \
188 -e "s:@EXTFLAGS@:${extflags}:g" \
189 "${FILESDIR}"/${x}.pc.in > ${x}.pc \
190 || die "sed ${x}.pc failed"
191 insinto ${acmldir}/lib
192 doins ${x}.pc || die "doins ${x}.pc failed"
193
194 # eselect files
195 cat > eselect.${prof}.${x} <<-EOF
196 ${libname}.so /usr/@LIBDIR@/lib${l}.so.0
197 ${libname}.so /usr/@LIBDIR@/lib${l}.so
198 ${libname}.a /usr/@LIBDIR@/lib${l}.a
199 ${acmldir}/lib/${x}.pc /usr/@LIBDIR@/pkgconfig/${x}.pc
200 EOF
201 eselect ${x} add $(get_libdir) eselect.${prof}.${x} ${prof}
202 done
203 done
204 use doc || rm -rf "${S}"/Doc/acml.pdf "${S}"/Doc/html
205 cp -pPR "${S}"/Doc "${D}"${instdir} || die "copy doc failed"
206 }
207
208 pkg_postinst() {
209 # construct default profile dprof from default ddir
210 local ddir=gfortran
211 use ifc && ddir=ifort
212 use x86 && ddir="${ddir}32" || ddir="${ddir}64"
213 use openmp && ddir="${ddir}_mp"
214 use int64 && ddir="${ddir}_int64"
215 local dprof="$(make_acml_profile_name ${ddir})"
216 for x in blas lapack; do
217 local cprof=$(eselect ${x} show | cut -d' ' -f2)
218 if [[ ${cprof} == ${dprof} || -z ${cprof} ]]; then
219 # work around eselect bug #189942
220 local configfile="${ROOT}"/etc/env.d/${x}/$(get_libdir)/config
221 [[ -e ${configfile} ]] && rm -f ${configfile}
222 eselect ${x} set ${dprof}
223 elog "${x} has been eselected to ${dprof}"
224 else
225 elog "Current eselected ${x} implementation is ${cprof}"
226 elog "To use you have one of ${PN}, issue (as root):"
227 elog "\t eselect ${x} set <profile>"
228 fi
229 done
230 }
231
232
233
234 --
235 gentoo-commits@l.g.o mailing list