Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/superlu_mt/, sci-libs/superlu_mt/files/
Date: Thu, 29 Dec 2016 07:02:36
Message-Id: 1482994888.4601ef379f6d012f1c87c80ac67bb749796bd7a8.bicatali@gentoo
1 commit: 4601ef379f6d012f1c87c80ac67bb749796bd7a8
2 Author: S├ębastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 29 07:01:09 2016 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 29 07:01:28 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4601ef37
7
8 sci-libs/superlu_mt: initial import
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 sci-libs/superlu_mt/Manifest | 1 +
13 .../files/superlu_mt-3.1-duplicate-symbols.patch | 240 +++++++++++++++++++++
14 sci-libs/superlu_mt/metadata.xml | 29 +++
15 sci-libs/superlu_mt/superlu_mt-3.1.ebuild | 103 +++++++++
16 4 files changed, 373 insertions(+)
17
18 diff --git a/sci-libs/superlu_mt/Manifest b/sci-libs/superlu_mt/Manifest
19 new file mode 100644
20 index 00000000..5bb62bd
21 --- /dev/null
22 +++ b/sci-libs/superlu_mt/Manifest
23 @@ -0,0 +1 @@
24 +DIST superlu_mt_3.1.tar.gz 1824440 SHA256 407b544b9a92b2ed536b1e713e80f986824cf3016657a4bfc2f3e7d2a76ecab6 SHA512 41b8d9808f6a9c3f8d9e983ab253b0c5aec486df1cc419d043a201bd950034fa4bdd5465410e1198a2314d072b92cb388fc117165a06f820922f04060c755971 WHIRLPOOL 4ab6ec9dc9080d6bbd0096514794d0e4c2fcf31a1a7d85865516c3afc028d693baafd06967f777d336e34668678bd8aa390680b742abccbca1f347fffe08d3c5
25
26 diff --git a/sci-libs/superlu_mt/files/superlu_mt-3.1-duplicate-symbols.patch b/sci-libs/superlu_mt/files/superlu_mt-3.1-duplicate-symbols.patch
27 new file mode 100644
28 index 00000000..cc82c26
29 --- /dev/null
30 +++ b/sci-libs/superlu_mt/files/superlu_mt-3.1-duplicate-symbols.patch
31 @@ -0,0 +1,240 @@
32 +--- a/SRC/smatgen.c 2016-12-28 01:06:35.529467943 +0000
33 ++++ b/SRC/smatgen.c 2016-12-28 01:06:06.949710330 +0000
34 +@@ -102,77 +102,3 @@
35 +
36 + xa[n] = lasta;
37 + }
38 +-
39 +-double dlaran_(int *iseed)
40 +-{
41 +-/* -- LAPACK auxiliary routine (version 2.0) --
42 +- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
43 +- Courant Institute, Argonne National Lab, and Rice University
44 +- February 29, 1992
45 +-
46 +- Purpose
47 +- =======
48 +-
49 +- DLARAN returns a random real number from a uniform (0,1)
50 +- distribution.
51 +-
52 +- Arguments
53 +- =========
54 +-
55 +- ISEED (input/output) INT array, dimension (4)
56 +- On entry, the seed of the random number generator; the array
57 +-
58 +- elements must be between 0 and 4095, and ISEED(4) must be
59 +- odd.
60 +- On exit, the seed is updated.
61 +-
62 +- Further Details
63 +- ===============
64 +-
65 +- This routine uses a multiplicative congruential method with modulus
66 +- 2**48 and multiplier 33952834046453 (see G.S.Fishman,
67 +- 'Multiplicative congruential random number generators with modulus
68 +- 2**b: an exhaustive analysis for b = 32 and a partial analysis for
69 +- b = 48', Math. Comp. 189, pp 331-344, 1990).
70 +-
71 +- 48-bit integers are stored in 4 integer array elements with 12 bits
72 +- per element. Hence the routine is portable across machines with
73 +- integers of 32 bits or more.
74 +-
75 +- =====================================================================
76 +-*/
77 +-
78 +- /* Local variables */
79 +- int it1, it2, it3, it4;
80 +-
81 +- --iseed;
82 +-
83 +- /* multiply the seed by the multiplier modulo 2**48 */
84 +- it4 = iseed[4] * 2549;
85 +- it3 = it4 / 4096;
86 +- it4 -= it3 << 12;
87 +- it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508;
88 +- it2 = it3 / 4096;
89 +- it3 -= it2 << 12;
90 +- it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322;
91 +- it1 = it2 / 4096;
92 +- it2 -= it1 << 12;
93 +- it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4]
94 +- * 494;
95 +- it1 %= 4096;
96 +-
97 +- /* return updated seed */
98 +-
99 +- iseed[1] = it1;
100 +- iseed[2] = it2;
101 +- iseed[3] = it3;
102 +- iseed[4] = it4;
103 +-
104 +- /* convert 48-bit integer to a real number in the interval (0,1) */
105 +-
106 +- return ((double) it1 +
107 +- ((double) it2 + ((double) it3 + (double) it4 * 2.44140625e-4) *
108 +- 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4;
109 +-
110 +-} /* dlaran_ */
111 +-
112 +--- a/SRC/zmatgen.c 2016-12-28 01:07:05.819211056 +0000
113 ++++ b/SRC/zmatgen.c 2016-12-28 01:07:26.329037112 +0000
114 +@@ -102,77 +102,3 @@
115 +
116 + xa[n] = lasta;
117 + }
118 +-
119 +-double dlaran_(int *iseed)
120 +-{
121 +-/* -- LAPACK auxiliary routine (version 2.0) --
122 +- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
123 +- Courant Institute, Argonne National Lab, and Rice University
124 +- February 29, 1992
125 +-
126 +- Purpose
127 +- =======
128 +-
129 +- DLARAN returns a random real number from a uniform (0,1)
130 +- distribution.
131 +-
132 +- Arguments
133 +- =========
134 +-
135 +- ISEED (input/output) INT array, dimension (4)
136 +- On entry, the seed of the random number generator; the array
137 +-
138 +- elements must be between 0 and 4095, and ISEED(4) must be
139 +- odd.
140 +- On exit, the seed is updated.
141 +-
142 +- Further Details
143 +- ===============
144 +-
145 +- This routine uses a multiplicative congruential method with modulus
146 +- 2**48 and multiplier 33952834046453 (see G.S.Fishman,
147 +- 'Multiplicative congruential random number generators with modulus
148 +- 2**b: an exhaustive analysis for b = 32 and a partial analysis for
149 +- b = 48', Math. Comp. 189, pp 331-344, 1990).
150 +-
151 +- 48-bit integers are stored in 4 integer array elements with 12 bits
152 +- per element. Hence the routine is portable across machines with
153 +- integers of 32 bits or more.
154 +-
155 +- =====================================================================
156 +-*/
157 +-
158 +- /* Local variables */
159 +- int it1, it2, it3, it4;
160 +-
161 +- --iseed;
162 +-
163 +- /* multiply the seed by the multiplier modulo 2**48 */
164 +- it4 = iseed[4] * 2549;
165 +- it3 = it4 / 4096;
166 +- it4 -= it3 << 12;
167 +- it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508;
168 +- it2 = it3 / 4096;
169 +- it3 -= it2 << 12;
170 +- it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322;
171 +- it1 = it2 / 4096;
172 +- it2 -= it1 << 12;
173 +- it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4]
174 +- * 494;
175 +- it1 %= 4096;
176 +-
177 +- /* return updated seed */
178 +-
179 +- iseed[1] = it1;
180 +- iseed[2] = it2;
181 +- iseed[3] = it3;
182 +- iseed[4] = it4;
183 +-
184 +- /* convert 48-bit integer to a real number in the interval (0,1) */
185 +-
186 +- return ((double) it1 +
187 +- ((double) it2 + ((double) it3 + (double) it4 * 2.44140625e-4) *
188 +- 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4;
189 +-
190 +-} /* dlaran_ */
191 +-
192 +--- a/SRC/cmatgen.c 2016-12-28 00:57:45.513963020 +0000
193 ++++ b/SRC/cmatgen.c 2016-12-28 00:58:46.413446529 +0000
194 +@@ -102,77 +102,3 @@
195 +
196 + xa[n] = lasta;
197 + }
198 +-
199 +-double dlaran_(int *iseed)
200 +-{
201 +-/* -- LAPACK auxiliary routine (version 2.0) --
202 +- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
203 +- Courant Institute, Argonne National Lab, and Rice University
204 +- February 29, 1992
205 +-
206 +- Purpose
207 +- =======
208 +-
209 +- DLARAN returns a random real number from a uniform (0,1)
210 +- distribution.
211 +-
212 +- Arguments
213 +- =========
214 +-
215 +- ISEED (input/output) INT array, dimension (4)
216 +- On entry, the seed of the random number generator; the array
217 +-
218 +- elements must be between 0 and 4095, and ISEED(4) must be
219 +- odd.
220 +- On exit, the seed is updated.
221 +-
222 +- Further Details
223 +- ===============
224 +-
225 +- This routine uses a multiplicative congruential method with modulus
226 +- 2**48 and multiplier 33952834046453 (see G.S.Fishman,
227 +- 'Multiplicative congruential random number generators with modulus
228 +- 2**b: an exhaustive analysis for b = 32 and a partial analysis for
229 +- b = 48', Math. Comp. 189, pp 331-344, 1990).
230 +-
231 +- 48-bit integers are stored in 4 integer array elements with 12 bits
232 +- per element. Hence the routine is portable across machines with
233 +- integers of 32 bits or more.
234 +-
235 +- =====================================================================
236 +-*/
237 +-
238 +- /* Local variables */
239 +- int it1, it2, it3, it4;
240 +-
241 +- --iseed;
242 +-
243 +- /* multiply the seed by the multiplier modulo 2**48 */
244 +- it4 = iseed[4] * 2549;
245 +- it3 = it4 / 4096;
246 +- it4 -= it3 << 12;
247 +- it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508;
248 +- it2 = it3 / 4096;
249 +- it3 -= it2 << 12;
250 +- it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322;
251 +- it1 = it2 / 4096;
252 +- it2 -= it1 << 12;
253 +- it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4]
254 +- * 494;
255 +- it1 %= 4096;
256 +-
257 +- /* return updated seed */
258 +-
259 +- iseed[1] = it1;
260 +- iseed[2] = it2;
261 +- iseed[3] = it3;
262 +- iseed[4] = it4;
263 +-
264 +- /* convert 48-bit integer to a real number in the interval (0,1) */
265 +-
266 +- return ((double) it1 +
267 +- ((double) it2 + ((double) it3 + (double) it4 * 2.44140625e-4) *
268 +- 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4;
269 +-
270 +-} /* dlaran_ */
271 +-
272
273 diff --git a/sci-libs/superlu_mt/metadata.xml b/sci-libs/superlu_mt/metadata.xml
274 new file mode 100644
275 index 00000000..5e07f8c
276 --- /dev/null
277 +++ b/sci-libs/superlu_mt/metadata.xml
278 @@ -0,0 +1,29 @@
279 +<?xml version="1.0" encoding="UTF-8"?>
280 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
281 +<pkgmetadata>
282 + <maintainer type="project">
283 + <email>sci@g.o</email>
284 + <name>Gentoo Science Project</name>
285 + </maintainer>
286 + <longdescription lang="en">
287 + SuperLU is a general purpose library for the direct solution of
288 + large, sparse, nonsymmetric systems of linear equations on high
289 + performance machines. The library is written in C and is callable
290 + from either C or Fortran. The library routines will perform an LU
291 + decomposition with partial pivoting and triangular system solves
292 + through forward and back substitution. The LU factorization routines
293 + can handle non-square matrices but the triangular solves are
294 + performed only for square matrices. The matrix columns may be
295 + preordered (before factorization) either through library or user
296 + supplied routines. This preordering for sparsity is completely
297 + separate from the factorization. Working precision iterative
298 + refinement subroutines are provided for improved backward
299 + stability. Routines are also provided to equilibrate the system,
300 + estimate the condition number, calculate the relative backward
301 + error, and estimate error bounds for the refined solutions.
302 + This is the multi-threaded version (POSIX threads or OpenMP).
303 + </longdescription>
304 + <use>
305 + <flag name="int64">Build the 64 bits integer library</flag>
306 + </use>
307 +</pkgmetadata>
308
309 diff --git a/sci-libs/superlu_mt/superlu_mt-3.1.ebuild b/sci-libs/superlu_mt/superlu_mt-3.1.ebuild
310 new file mode 100644
311 index 00000000..3662985
312 --- /dev/null
313 +++ b/sci-libs/superlu_mt/superlu_mt-3.1.ebuild
314 @@ -0,0 +1,103 @@
315 +# Copyright 1999-2016 Gentoo Foundation
316 +# Distributed under the terms of the GNU General Public License v2
317 +# $Id$
318 +
319 +EAPI=6
320 +
321 +inherit eutils toolchain-funcs versionator
322 +
323 +MYPN=SuperLU_MT
324 +SOVERSION=$(get_major_version)
325 +
326 +DESCRIPTION="Multithreaded sparse LU factorization library"
327 +HOMEPAGE="http://crd.lbl.gov/~xiaoye/SuperLU/"
328 +SRC_URI="${HOMEPAGE}/${PN}_${PV}.tar.gz"
329 +
330 +LICENSE="BSD"
331 +SLOT="0/${SOVERSION}"
332 +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
333 +IUSE="doc examples int64 openmp static-libs test threads"
334 +REQUIRED_USE="|| ( openmp threads )"
335 +
336 +RDEPEND="virtual/blas"
337 +DEPEND="${RDEPEND}
338 + virtual/pkgconfig
339 + test? ( app-shells/tcsh )"
340 +
341 +S="${WORKDIR}/${MYPN}_${PV}"
342 +
343 +PATCHES=( "${FILESDIR}"/${P}-duplicate-symbols.patch )
344 +
345 +pkg_setup() {
346 + if use openmp && ! use threads; then
347 + if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
348 + ewarn "OpenMP is not available in your current selected gcc"
349 + die "need openmp capable gcc"
350 + fi
351 + CTHREADS="-D__OPENMP"
352 + [[ $(tc-getCC) == *gcc ]] && LDTHREADS="-fopenmp"
353 + else
354 + CTHREADS="-D__PTHREAD"
355 + LDTHREADS="-pthread"
356 + fi
357 +}
358 +
359 +src_prepare() {
360 + default
361 + cat <<-EOF > make.inc
362 + CC=$(tc-getCC)
363 + LOADER=$(tc-getCC)
364 + ARCH=$(tc-getAR)
365 + RANLIB=$(tc-getRANLIB)
366 + PREDEFS=${CPPFLAGS} -DUSE_VENDOR_BLAS -DPRNTlevel=0 -DDEBUGlevel=0 $(use int64 && echo -D_LONGINT)
367 + CDEFS=-DAdd_
368 + CFLAGS=${CFLAGS} ${CTHREADS} \$(PIC)
369 + BLASLIB=$($(tc-getPKG_CONFIG) --libs blas)
370 + MATHLIB=-lm
371 + NOOPTS=-O0 \$(PIC)
372 + ARCHFLAGS=cr
373 + LOADOPTS=${LDFLAGS} ${LDTHREADS}
374 + SUPERLULIB=lib${PN}.a
375 + TMGLIB=libtmglib.a
376 + EOF
377 + SONAME=lib${PN}.so.${SOVERSION}
378 + sed -e 's|../make.inc|make.inc|' \
379 + -e "s|../SRC|${EPREFIX}/usr/include/${PN}|" \
380 + -e '/:.*$(SUPERLULIB)/s|../lib/$(SUPERLULIB)||g' \
381 + -e 's|../lib/$(SUPERLULIB)|-lsuperlu_mt|g' \
382 + -i EXAMPLE/Makefile || die
383 +}
384 +
385 +src_compile() {
386 + # shared library
387 + emake PIC="-fPIC" \
388 + ARCH="echo" \
389 + ARCHFLAGS="" \
390 + RANLIB="echo" \
391 + superlulib
392 + $(tc-getCC) ${LDFLAGS} ${LDTHREADS} -shared -Wl,-soname=${SONAME} SRC/*.o \
393 + $($(tc-getPKG_CONFIG) --libs blas) -lm -o lib/${SONAME} || die
394 + ln -s ${SONAME} lib/libsuperlu_mt.so || die
395 +
396 + use static-libs && rm -f SRC/*.o && \
397 + emake PIC="" superlulib
398 +}
399 +
400 +src_test() {
401 + emake -j1 tmglib
402 + LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" \
403 + emake SUPERLULIB="${SONAME}" testing
404 +}
405 +
406 +src_install() {
407 + dolib.so lib/*so*
408 + use static-libs && dolib.a lib/*.a
409 + insinto /usr/include/${PN}
410 + doins SRC/*h
411 + dodoc README
412 + use doc && dodoc DOC/ug.pdf
413 + if use examples; then
414 + insinto /usr/share/doc/${PF}/examples
415 + doins -r EXAMPLE/* make.inc
416 + fi
417 +}