summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-libs/superlu_mt/Manifest1
-rw-r--r--sci-libs/superlu_mt/files/superlu_mt-3.1-duplicate-symbols.patch240
-rw-r--r--sci-libs/superlu_mt/metadata.xml29
-rw-r--r--sci-libs/superlu_mt/superlu_mt-3.1.ebuild103
4 files changed, 373 insertions, 0 deletions
diff --git a/sci-libs/superlu_mt/Manifest b/sci-libs/superlu_mt/Manifest
new file mode 100644
index 00000000000..5bb62bd29ab
--- /dev/null
+++ b/sci-libs/superlu_mt/Manifest
@@ -0,0 +1 @@
+DIST superlu_mt_3.1.tar.gz 1824440 SHA256 407b544b9a92b2ed536b1e713e80f986824cf3016657a4bfc2f3e7d2a76ecab6 SHA512 41b8d9808f6a9c3f8d9e983ab253b0c5aec486df1cc419d043a201bd950034fa4bdd5465410e1198a2314d072b92cb388fc117165a06f820922f04060c755971 WHIRLPOOL 4ab6ec9dc9080d6bbd0096514794d0e4c2fcf31a1a7d85865516c3afc028d693baafd06967f777d336e34668678bd8aa390680b742abccbca1f347fffe08d3c5
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
new file mode 100644
index 00000000000..cc82c2692b5
--- /dev/null
+++ b/sci-libs/superlu_mt/files/superlu_mt-3.1-duplicate-symbols.patch
@@ -0,0 +1,240 @@
+--- a/SRC/smatgen.c 2016-12-28 01:06:35.529467943 +0000
++++ b/SRC/smatgen.c 2016-12-28 01:06:06.949710330 +0000
+@@ -102,77 +102,3 @@
+
+ xa[n] = lasta;
+ }
+-
+-double dlaran_(int *iseed)
+-{
+-/* -- LAPACK auxiliary routine (version 2.0) --
+- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+- Courant Institute, Argonne National Lab, and Rice University
+- February 29, 1992
+-
+- Purpose
+- =======
+-
+- DLARAN returns a random real number from a uniform (0,1)
+- distribution.
+-
+- Arguments
+- =========
+-
+- ISEED (input/output) INT array, dimension (4)
+- On entry, the seed of the random number generator; the array
+-
+- elements must be between 0 and 4095, and ISEED(4) must be
+- odd.
+- On exit, the seed is updated.
+-
+- Further Details
+- ===============
+-
+- This routine uses a multiplicative congruential method with modulus
+- 2**48 and multiplier 33952834046453 (see G.S.Fishman,
+- 'Multiplicative congruential random number generators with modulus
+- 2**b: an exhaustive analysis for b = 32 and a partial analysis for
+- b = 48', Math. Comp. 189, pp 331-344, 1990).
+-
+- 48-bit integers are stored in 4 integer array elements with 12 bits
+- per element. Hence the routine is portable across machines with
+- integers of 32 bits or more.
+-
+- =====================================================================
+-*/
+-
+- /* Local variables */
+- int it1, it2, it3, it4;
+-
+- --iseed;
+-
+- /* multiply the seed by the multiplier modulo 2**48 */
+- it4 = iseed[4] * 2549;
+- it3 = it4 / 4096;
+- it4 -= it3 << 12;
+- it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508;
+- it2 = it3 / 4096;
+- it3 -= it2 << 12;
+- it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322;
+- it1 = it2 / 4096;
+- it2 -= it1 << 12;
+- it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4]
+- * 494;
+- it1 %= 4096;
+-
+- /* return updated seed */
+-
+- iseed[1] = it1;
+- iseed[2] = it2;
+- iseed[3] = it3;
+- iseed[4] = it4;
+-
+- /* convert 48-bit integer to a real number in the interval (0,1) */
+-
+- return ((double) it1 +
+- ((double) it2 + ((double) it3 + (double) it4 * 2.44140625e-4) *
+- 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4;
+-
+-} /* dlaran_ */
+-
+--- a/SRC/zmatgen.c 2016-12-28 01:07:05.819211056 +0000
++++ b/SRC/zmatgen.c 2016-12-28 01:07:26.329037112 +0000
+@@ -102,77 +102,3 @@
+
+ xa[n] = lasta;
+ }
+-
+-double dlaran_(int *iseed)
+-{
+-/* -- LAPACK auxiliary routine (version 2.0) --
+- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+- Courant Institute, Argonne National Lab, and Rice University
+- February 29, 1992
+-
+- Purpose
+- =======
+-
+- DLARAN returns a random real number from a uniform (0,1)
+- distribution.
+-
+- Arguments
+- =========
+-
+- ISEED (input/output) INT array, dimension (4)
+- On entry, the seed of the random number generator; the array
+-
+- elements must be between 0 and 4095, and ISEED(4) must be
+- odd.
+- On exit, the seed is updated.
+-
+- Further Details
+- ===============
+-
+- This routine uses a multiplicative congruential method with modulus
+- 2**48 and multiplier 33952834046453 (see G.S.Fishman,
+- 'Multiplicative congruential random number generators with modulus
+- 2**b: an exhaustive analysis for b = 32 and a partial analysis for
+- b = 48', Math. Comp. 189, pp 331-344, 1990).
+-
+- 48-bit integers are stored in 4 integer array elements with 12 bits
+- per element. Hence the routine is portable across machines with
+- integers of 32 bits or more.
+-
+- =====================================================================
+-*/
+-
+- /* Local variables */
+- int it1, it2, it3, it4;
+-
+- --iseed;
+-
+- /* multiply the seed by the multiplier modulo 2**48 */
+- it4 = iseed[4] * 2549;
+- it3 = it4 / 4096;
+- it4 -= it3 << 12;
+- it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508;
+- it2 = it3 / 4096;
+- it3 -= it2 << 12;
+- it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322;
+- it1 = it2 / 4096;
+- it2 -= it1 << 12;
+- it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4]
+- * 494;
+- it1 %= 4096;
+-
+- /* return updated seed */
+-
+- iseed[1] = it1;
+- iseed[2] = it2;
+- iseed[3] = it3;
+- iseed[4] = it4;
+-
+- /* convert 48-bit integer to a real number in the interval (0,1) */
+-
+- return ((double) it1 +
+- ((double) it2 + ((double) it3 + (double) it4 * 2.44140625e-4) *
+- 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4;
+-
+-} /* dlaran_ */
+-
+--- a/SRC/cmatgen.c 2016-12-28 00:57:45.513963020 +0000
++++ b/SRC/cmatgen.c 2016-12-28 00:58:46.413446529 +0000
+@@ -102,77 +102,3 @@
+
+ xa[n] = lasta;
+ }
+-
+-double dlaran_(int *iseed)
+-{
+-/* -- LAPACK auxiliary routine (version 2.0) --
+- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+- Courant Institute, Argonne National Lab, and Rice University
+- February 29, 1992
+-
+- Purpose
+- =======
+-
+- DLARAN returns a random real number from a uniform (0,1)
+- distribution.
+-
+- Arguments
+- =========
+-
+- ISEED (input/output) INT array, dimension (4)
+- On entry, the seed of the random number generator; the array
+-
+- elements must be between 0 and 4095, and ISEED(4) must be
+- odd.
+- On exit, the seed is updated.
+-
+- Further Details
+- ===============
+-
+- This routine uses a multiplicative congruential method with modulus
+- 2**48 and multiplier 33952834046453 (see G.S.Fishman,
+- 'Multiplicative congruential random number generators with modulus
+- 2**b: an exhaustive analysis for b = 32 and a partial analysis for
+- b = 48', Math. Comp. 189, pp 331-344, 1990).
+-
+- 48-bit integers are stored in 4 integer array elements with 12 bits
+- per element. Hence the routine is portable across machines with
+- integers of 32 bits or more.
+-
+- =====================================================================
+-*/
+-
+- /* Local variables */
+- int it1, it2, it3, it4;
+-
+- --iseed;
+-
+- /* multiply the seed by the multiplier modulo 2**48 */
+- it4 = iseed[4] * 2549;
+- it3 = it4 / 4096;
+- it4 -= it3 << 12;
+- it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508;
+- it2 = it3 / 4096;
+- it3 -= it2 << 12;
+- it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322;
+- it1 = it2 / 4096;
+- it2 -= it1 << 12;
+- it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4]
+- * 494;
+- it1 %= 4096;
+-
+- /* return updated seed */
+-
+- iseed[1] = it1;
+- iseed[2] = it2;
+- iseed[3] = it3;
+- iseed[4] = it4;
+-
+- /* convert 48-bit integer to a real number in the interval (0,1) */
+-
+- return ((double) it1 +
+- ((double) it2 + ((double) it3 + (double) it4 * 2.44140625e-4) *
+- 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4;
+-
+-} /* dlaran_ */
+-
diff --git a/sci-libs/superlu_mt/metadata.xml b/sci-libs/superlu_mt/metadata.xml
new file mode 100644
index 00000000000..5e07f8c182b
--- /dev/null
+++ b/sci-libs/superlu_mt/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ SuperLU is a general purpose library for the direct solution of
+ large, sparse, nonsymmetric systems of linear equations on high
+ performance machines. The library is written in C and is callable
+ from either C or Fortran. The library routines will perform an LU
+ decomposition with partial pivoting and triangular system solves
+ through forward and back substitution. The LU factorization routines
+ can handle non-square matrices but the triangular solves are
+ performed only for square matrices. The matrix columns may be
+ preordered (before factorization) either through library or user
+ supplied routines. This preordering for sparsity is completely
+ separate from the factorization. Working precision iterative
+ refinement subroutines are provided for improved backward
+ stability. Routines are also provided to equilibrate the system,
+ estimate the condition number, calculate the relative backward
+ error, and estimate error bounds for the refined solutions.
+ This is the multi-threaded version (POSIX threads or OpenMP).
+ </longdescription>
+ <use>
+ <flag name="int64">Build the 64 bits integer library</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-libs/superlu_mt/superlu_mt-3.1.ebuild b/sci-libs/superlu_mt/superlu_mt-3.1.ebuild
new file mode 100644
index 00000000000..36629854715
--- /dev/null
+++ b/sci-libs/superlu_mt/superlu_mt-3.1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit eutils toolchain-funcs versionator
+
+MYPN=SuperLU_MT
+SOVERSION=$(get_major_version)
+
+DESCRIPTION="Multithreaded sparse LU factorization library"
+HOMEPAGE="http://crd.lbl.gov/~xiaoye/SuperLU/"
+SRC_URI="${HOMEPAGE}/${PN}_${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${SOVERSION}"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples int64 openmp static-libs test threads"
+REQUIRED_USE="|| ( openmp threads )"
+
+RDEPEND="virtual/blas"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( app-shells/tcsh )"
+
+S="${WORKDIR}/${MYPN}_${PV}"
+
+PATCHES=( "${FILESDIR}"/${P}-duplicate-symbols.patch )
+
+pkg_setup() {
+ if use openmp && ! use threads; then
+ if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
+ ewarn "OpenMP is not available in your current selected gcc"
+ die "need openmp capable gcc"
+ fi
+ CTHREADS="-D__OPENMP"
+ [[ $(tc-getCC) == *gcc ]] && LDTHREADS="-fopenmp"
+ else
+ CTHREADS="-D__PTHREAD"
+ LDTHREADS="-pthread"
+ fi
+}
+
+src_prepare() {
+ default
+ cat <<-EOF > make.inc
+ CC=$(tc-getCC)
+ LOADER=$(tc-getCC)
+ ARCH=$(tc-getAR)
+ RANLIB=$(tc-getRANLIB)
+ PREDEFS=${CPPFLAGS} -DUSE_VENDOR_BLAS -DPRNTlevel=0 -DDEBUGlevel=0 $(use int64 && echo -D_LONGINT)
+ CDEFS=-DAdd_
+ CFLAGS=${CFLAGS} ${CTHREADS} \$(PIC)
+ BLASLIB=$($(tc-getPKG_CONFIG) --libs blas)
+ MATHLIB=-lm
+ NOOPTS=-O0 \$(PIC)
+ ARCHFLAGS=cr
+ LOADOPTS=${LDFLAGS} ${LDTHREADS}
+ SUPERLULIB=lib${PN}.a
+ TMGLIB=libtmglib.a
+ EOF
+ SONAME=lib${PN}.so.${SOVERSION}
+ sed -e 's|../make.inc|make.inc|' \
+ -e "s|../SRC|${EPREFIX}/usr/include/${PN}|" \
+ -e '/:.*$(SUPERLULIB)/s|../lib/$(SUPERLULIB)||g' \
+ -e 's|../lib/$(SUPERLULIB)|-lsuperlu_mt|g' \
+ -i EXAMPLE/Makefile || die
+}
+
+src_compile() {
+ # shared library
+ emake PIC="-fPIC" \
+ ARCH="echo" \
+ ARCHFLAGS="" \
+ RANLIB="echo" \
+ superlulib
+ $(tc-getCC) ${LDFLAGS} ${LDTHREADS} -shared -Wl,-soname=${SONAME} SRC/*.o \
+ $($(tc-getPKG_CONFIG) --libs blas) -lm -o lib/${SONAME} || die
+ ln -s ${SONAME} lib/libsuperlu_mt.so || die
+
+ use static-libs && rm -f SRC/*.o && \
+ emake PIC="" superlulib
+}
+
+src_test() {
+ emake -j1 tmglib
+ LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" \
+ emake SUPERLULIB="${SONAME}" testing
+}
+
+src_install() {
+ dolib.so lib/*so*
+ use static-libs && dolib.a lib/*.a
+ insinto /usr/include/${PN}
+ doins SRC/*h
+ dodoc README
+ use doc && dodoc DOC/ug.pdf
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r EXAMPLE/* make.inc
+ fi
+}