Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/plasma/
Date: Tue, 28 Jan 2014 19:02:17
Message-Id: 1390935582.b20f011da70601e1e003141148c7e6da5d959776.bicatali@gentoo
1 commit: b20f011da70601e1e003141148c7e6da5d959776
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 28 18:59:42 2014 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 28 18:59:42 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=b20f011d
7
8 sci-libs/plasma: Version bump
9
10 Package-Manager: portage-2.2.8-prefix
11
12 ---
13 sci-libs/plasma/ChangeLog | 7 +-
14 sci-libs/plasma/plasma-2.6.0.ebuild | 142 ++++++++++++++++++++++++++++++++++++
15 2 files changed, 148 insertions(+), 1 deletion(-)
16
17 diff --git a/sci-libs/plasma/ChangeLog b/sci-libs/plasma/ChangeLog
18 index 6311120..6072d19 100644
19 --- a/sci-libs/plasma/ChangeLog
20 +++ b/sci-libs/plasma/ChangeLog
21 @@ -1,7 +1,12 @@
22 # ChangeLog for sci-libs/plasma
23 -# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
24 +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
25 # $Header: $
26
27 +*plasma-2.6.0 (28 Jan 2014)
28 +
29 + 28 Jan 2014; Sébastien Fabbro <bicatali@g.o> +plasma-2.6.0.ebuild:
30 + sci-libs/plasma: Version bump
31 +
32 09 Dec 2013; Sébastien Fabbro <bicatali@g.o> plasma-2.5.2.ebuild:
33 sci-libs/plasma: Version bump
34
35
36 diff --git a/sci-libs/plasma/plasma-2.6.0.ebuild b/sci-libs/plasma/plasma-2.6.0.ebuild
37 new file mode 100644
38 index 0000000..067d27c
39 --- /dev/null
40 +++ b/sci-libs/plasma/plasma-2.6.0.ebuild
41 @@ -0,0 +1,142 @@
42 +# Copyright 1999-2014 Gentoo Foundation
43 +# Distributed under the terms of the GNU General Public License v2
44 +# $Header: $
45 +
46 +EAPI=5
47 +inherit eutils fortran-2 toolchain-funcs versionator multilib flag-o-matic
48 +
49 +MYP=${PN}_${PV}
50 +SOVER=$(get_version_component_range 1)
51 +
52 +DESCRIPTION="Parallel Linear Algebra for Scalable Multi-core Architecture"
53 +HOMEPAGE="http://icl.cs.utk.edu/plasma/"
54 +SRC_URI="http://icl.cs.utk.edu/projectsfiles/plasma/pubs/${MYP}.tar.gz"
55 +
56 +LICENSE="BSD"
57 +SLOT="0/${SOVER}"
58 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
59 +IUSE="doc examples fortran static-libs test"
60 +
61 +RDEPEND="
62 + sys-apps/hwloc
63 + virtual/blas
64 + virtual/cblas
65 + virtual/lapack
66 + virtual/lapacke"
67 +DEPEND="${RDEPEND}
68 + virtual/pkgconfig
69 + test? ( sci-libs/lapacke-reference[tmg] )"
70 +
71 +S="${WORKDIR}/${MYP}"
72 +
73 +# TODO: virtual/{blas,cblas,lapack} serial and threaded. plasma works properly
74 +# with serial blas/lapack (see README). not doable dynamically with atlas
75 +
76 +static_to_shared() {
77 + local libstatic=${1}; shift
78 + local libname=$(basename ${libstatic%.a})
79 + local soname=${libname}$(get_libname ${SOVER})
80 + local libdir=$(dirname ${libstatic})
81 +
82 + einfo "Making ${soname} from ${libstatic}"
83 + if [[ ${CHOST} == *-darwin* ]] ; then
84 + ${LINK:-$(tc-getCC)} ${LDFLAGS} \
85 + -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
86 + -Wl,-all_load -Wl,${libstatic} \
87 + "$@" -o ${libdir}/${soname} || die "${soname} failed"
88 + else
89 + ${LINK:-$(tc-getCC)} ${LDFLAGS} \
90 + -shared -Wl,-soname=${soname} \
91 + -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
92 + "$@" -o ${libdir}/${soname} || die "${soname} failed"
93 + [[ $(get_version_component_count) -gt 1 ]] && \
94 + ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version))
95 + ln -s ${soname} ${libdir}/${libname}$(get_libname)
96 + fi
97 +}
98 +
99 +src_prepare() {
100 + # rename plasma to avoid collision (https://github.com/gentoo-science/sci/issues/34)
101 + # lib name conflict with kde plasma, rename
102 + PLASMA_LIBNAME=plasmca
103 + sed -i \
104 + -e "s/-lplasma/-l${PLASMA_LIBNAME}/g" \
105 + -e "s/libplasma.a/lib${PLASMA_LIBNAME}.a/" \
106 + Makefile.internal || die
107 +
108 + # distributed pc file not so useful, so redo it
109 + cat <<-EOF > ${PN}.pc
110 + prefix=${EPREFIX}/usr
111 + libdir=\${prefix}/$(get_libdir)
112 + includedir=\${prefix}/include/${PN}
113 + Name: ${PN}
114 + Description: ${DESCRIPTION}
115 + Version: ${PV}
116 + URL: ${HOMEPAGE}
117 + Libs: -L\${libdir} -l${PLASMA_LIBNAME} -lcoreblas -lquark
118 + Libs.private: -lm
119 + Cflags: -I\${includedir}
120 + Requires: blas cblas lapack lapacke hwloc
121 + EOF
122 +}
123 +
124 +src_configure() {
125 + cat <<-EOF > make.inc
126 + ARCH = $(tc-getAR)
127 + ARCHFLAGS = cr
128 + RANLIB = $(tc-getRANLIB)
129 + CC = $(tc-getCC)
130 + FC = $(tc-getFC)
131 + CFLAGS = ${CFLAGS} -DADD_ -fPIC $(has_version ">=virtual/lapacke-3.5" && echo "-DDOXYGEN_SHOULD_SKIP_THIS=1")
132 + FFLAGS = ${FFLAGS} -fPIC
133 + LOADER = $(tc-getFC)
134 + LIBBLAS = $($(tc-getPKG_CONFIG) --libs blas)
135 + LIBCBLAS = $($(tc-getPKG_CONFIG) --libs cblas)
136 + LIBLAPACK = $($(tc-getPKG_CONFIG) --libs lapack) -ltmglib
137 + LIBCLAPACK = $($(tc-getPKG_CONFIG) --libs lapacke)
138 + $(use fortran && echo "PLASMA_F90 = 1")
139 + EOF
140 +}
141 +
142 +src_compile() {
143 + emake lib
144 + #mv lib/libplasma.a lib/lib${PLASMA_LIBNAME}.a || die
145 + static_to_shared quark/libquark.a $($(tc-getPKG_CONFIG --libs hwloc)) -pthread
146 + static_to_shared lib/libcoreblas.a quark/libquark.so $($(tc-getPKG_CONFIG --libs cblas lapacke))
147 + static_to_shared lib/lib${PLASMA_LIBNAME}.a quark/libquark.so lib/libcoreblas.so
148 + if use static-libs; then
149 + emake cleanall
150 + sed 's/-fPIC//g' make.inc
151 + emake lib
152 + fi
153 +}
154 +
155 +src_test() {
156 + emake test
157 + cd testing
158 + LD_LIBRARY_PATH="../lib:../quark:${LD_LIBRARY_PATH}" ./plasma_testing.py || die
159 +}
160 +
161 +src_install() {
162 + dolib.so lib/lib*$(get_libname)* quark/libquark$(get_libname)*
163 + use static-libs && dolib.a lib/lib*.a quark/libquark.a
164 + insinto /usr/include/${PN}
165 + doins quark/quark{,_unpack_args}.h quark/icl_{hash,list}.h include/*.h
166 + use fortran && doins include/*.mod
167 + insinto /usr/$(get_libdir)/pkgconfig
168 + doins ${PN}.pc
169 + dodoc README ToDo ReleaseNotes
170 + use doc && dodoc docs/pdf/*.pdf && dohtml docs/doxygen/out/html/*
171 + if use examples; then
172 + emake -C examples cleanall
173 + insinto /usr/share/doc/${PF}
174 + doins -r examples
175 + fi
176 +}
177 +
178 +pkg_postinst() {
179 + elog "The plasma linear algebra library file has been renamed ${PLASMA_LIBNAME}"
180 + elog "to avoid collision with KDE plasma."
181 + elog "Compile and link your programs using the following command:"
182 + elog " pkg-config --cflags --libs plasma"
183 +}