1 |
commit: b25061d0cf0d41213c90ebab0845ed3f50403eef |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 28 20:48:56 2021 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 28 20:48:56 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b25061d0 |
7 |
|
8 |
sci-libs/superlu_mt: apply Alex's PREDEFS patch |
9 |
|
10 |
New revision because it changes runtime behaviour for USE=int64 users. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/817680 |
13 |
Closes: https://github.com/gentoo/gentoo/pull/23063 |
14 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
15 |
|
16 |
sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild | 105 +++++++++++++++++++++++++++ |
17 |
1 file changed, 105 insertions(+) |
18 |
|
19 |
diff --git a/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild b/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 000000000000..23f70df88150 |
22 |
--- /dev/null |
23 |
+++ b/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild |
24 |
@@ -0,0 +1,105 @@ |
25 |
+# Copyright 1999-2021 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=8 |
29 |
+ |
30 |
+inherit toolchain-funcs |
31 |
+ |
32 |
+MY_PN=SuperLU_MT |
33 |
+SOVERSION=$(ver_cut 1) |
34 |
+ |
35 |
+DESCRIPTION="Multithreaded sparse LU factorization library" |
36 |
+HOMEPAGE="https://portal.nersc.gov/project/sparse/superlu/" |
37 |
+SRC_URI="https://portal.nersc.gov/project/sparse/superlu/${PN}_${PV}.tar.gz" |
38 |
+ |
39 |
+LICENSE="BSD" |
40 |
+SLOT="0/${SOVERSION}" |
41 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" |
42 |
+IUSE="doc examples int64 openmp static-libs test threads" |
43 |
+RESTRICT="!test? ( test )" |
44 |
+REQUIRED_USE="|| ( openmp threads )" |
45 |
+ |
46 |
+RDEPEND="virtual/blas" |
47 |
+DEPEND="${RDEPEND}" |
48 |
+BDEPEND="virtual/pkgconfig |
49 |
+ test? ( app-shells/tcsh )" |
50 |
+ |
51 |
+S="${WORKDIR}/${MY_PN}_${PV}" |
52 |
+ |
53 |
+PATCHES=( |
54 |
+ "${FILESDIR}"/${PN}-3.1-duplicate-symbols.patch |
55 |
+ "${FILESDIR}"/${PN}-3.1-fix-predefs.patch |
56 |
+) |
57 |
+ |
58 |
+pkg_setup() { |
59 |
+ if use openmp && ! use threads; then |
60 |
+ if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then |
61 |
+ ewarn "OpenMP is not available in your current selected gcc" |
62 |
+ die "need openmp capable gcc" |
63 |
+ fi |
64 |
+ CTHREADS="-D__OPENMP" |
65 |
+ [[ $(tc-getCC) == *gcc ]] && LDTHREADS="-fopenmp" |
66 |
+ else |
67 |
+ CTHREADS="-D__PTHREAD" |
68 |
+ LDTHREADS="-pthread" |
69 |
+ fi |
70 |
+} |
71 |
+ |
72 |
+src_prepare() { |
73 |
+ default |
74 |
+ cat <<-EOF > make.inc |
75 |
+ CC=$(tc-getCC) |
76 |
+ LOADER=$(tc-getCC) |
77 |
+ ARCH=$(tc-getAR) |
78 |
+ RANLIB=$(tc-getRANLIB) |
79 |
+ PREDEFS=${CPPFLAGS} -DUSE_VENDOR_BLAS -DPRNTlevel=0 -DDEBUGlevel=0 $(use int64 && echo -D_LONGINT) |
80 |
+ CDEFS=-DAdd_ |
81 |
+ CFLAGS=${CFLAGS} ${CTHREADS} \$(PIC) |
82 |
+ BLASLIB=$($(tc-getPKG_CONFIG) --libs blas) |
83 |
+ MATHLIB=-lm |
84 |
+ NOOPTS=-O0 \$(PIC) |
85 |
+ ARCHFLAGS=cr |
86 |
+ LOADOPTS=${LDFLAGS} ${LDTHREADS} |
87 |
+ SUPERLULIB=lib${PN}.a |
88 |
+ TMGLIB=libtmglib.a |
89 |
+ EOF |
90 |
+ SONAME=lib${PN}.so.${SOVERSION} |
91 |
+ sed -e "s|../SRC|${EPREFIX}/usr/include/${PN}|" \ |
92 |
+ -e '/:.*$(SUPERLULIB)/s|../lib/$(SUPERLULIB)||g' \ |
93 |
+ -e 's|../lib/$(SUPERLULIB)|-lsuperlu_mt|g' \ |
94 |
+ -i EXAMPLE/Makefile || die |
95 |
+} |
96 |
+ |
97 |
+src_compile() { |
98 |
+ # shared library |
99 |
+ emake PIC="-fPIC" \ |
100 |
+ ARCH="echo" \ |
101 |
+ ARCHFLAGS="" \ |
102 |
+ RANLIB="echo" \ |
103 |
+ superlulib |
104 |
+ $(tc-getCC) ${LDFLAGS} ${LDTHREADS} -shared -Wl,-soname=${SONAME} SRC/*.o \ |
105 |
+ $($(tc-getPKG_CONFIG) --libs blas) -lm -o lib/${SONAME} || die |
106 |
+ ln -s ${SONAME} lib/libsuperlu_mt.so || die |
107 |
+ |
108 |
+ use static-libs && rm -f SRC/*.o && \ |
109 |
+ emake PIC="" superlulib |
110 |
+} |
111 |
+ |
112 |
+src_test() { |
113 |
+ emake -j1 tmglib |
114 |
+ LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" \ |
115 |
+ emake SUPERLULIB="${SONAME}" testing |
116 |
+} |
117 |
+ |
118 |
+src_install() { |
119 |
+ dolib.so lib/*so* |
120 |
+ use static-libs && dolib.a lib/*.a |
121 |
+ insinto /usr/include/${PN} |
122 |
+ doins SRC/*h |
123 |
+ dodoc README |
124 |
+ use doc && dodoc DOC/ug.pdf |
125 |
+ if use examples; then |
126 |
+ docinto /examples |
127 |
+ dodoc -r EXAMPLE/* make.inc |
128 |
+ fi |
129 |
+} |