Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/openblas/
Date: Thu, 26 Mar 2020 04:45:48
Message-Id: 1585197932.6ccd5f8d47ca9e5ddcdcf6e09ef7f10b1197fbe8.heroxbd@gentoo
1 commit: 6ccd5f8d47ca9e5ddcdcf6e09ef7f10b1197fbe8
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 26 04:44:30 2020 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 26 04:45:32 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ccd5f8d
7
8 sci-libs/openblas: version bump.
9
10 Closes: https://bugs.gentoo.org/714598
11 Package-Manager: Portage-2.3.88, Repoman-2.3.18
12 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
13
14 sci-libs/openblas/Manifest | 1 +
15 sci-libs/openblas/openblas-0.3.9.ebuild | 127 ++++++++++++++++++++++++++++++++
16 2 files changed, 128 insertions(+)
17
18 diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
19 index d1b62bde629..627ccaecb2d 100644
20 --- a/sci-libs/openblas/Manifest
21 +++ b/sci-libs/openblas/Manifest
22 @@ -1,2 +1,3 @@
23 DIST openblas-0.3.6.tar.gz 11923774 BLAKE2B 0133b83a4449fd7f86d6379129be4e4477df338d0a402a7787eec317838922b175315c6e6b014a2c7ed6aa1c58509a28f6b48c641e043af067434c4315f1fdb1 SHA512 e432ae8bfbdc8e8c6336553e05181ab38576164c140ef2a6ddb2a66479f724bd4e60a2c90f7bc15bf18eefa7045e7775dedae421fb71296b8d250132c2407b07
24 DIST openblas-0.3.7.tar.gz 11991860 BLAKE2B c4eebcbdda8c15ce384195bd2a57d3638b9a8fa9a0484dc3af9dcef0543e7bbfd8444b65ede36379f2182a9bd3df085070210d289c916dfa428da7ab6889eb43 SHA512 424d1c9c6fd97f6af4fdb7d7dce320cf5eab867a027e576531e39df934358736c4efab88782f781ec8f4afa8d992544040e3bbff3a4736c20cf4256d3a8e517d
25 +DIST openblas-0.3.9.tar.gz 12189745 BLAKE2B 3cc4c6a403d6a52845cf4ff8cef254f57587e17e3d09bfb6ed7c02ad06a6002e50b340177c73a944c2a621c12b7f494c516025751c194d019662c0b4db17f4dc SHA512 c6b8ee465f1cf53b37f21ec3ff9a28d5cafe20fec59d8c1bff5923a9e1989dfa5ae8c032a5d43988fe7722ed08c64c7957a3d30e6ae917e2e7aa2977a91e67a3
26
27 diff --git a/sci-libs/openblas/openblas-0.3.9.ebuild b/sci-libs/openblas/openblas-0.3.9.ebuild
28 new file mode 100644
29 index 00000000000..9aa17003313
30 --- /dev/null
31 +++ b/sci-libs/openblas/openblas-0.3.9.ebuild
32 @@ -0,0 +1,127 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +inherit fortran-2 toolchain-funcs
38 +
39 +DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
40 +HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
41 +SRC_URI="https://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
42 +
43 +LICENSE="BSD"
44 +SLOT="0"
45 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
46 +IUSE="dynamic eselect-ldso index-64bit openmp pthread"
47 +REQUIRED_USE="?? ( openmp pthread )"
48 +
49 +RDEPEND="
50 + eselect-ldso? ( >=app-eselect/eselect-blas-0.2
51 + !app-eselect/eselect-cblas
52 + >=app-eselect/eselect-lapack-0.2 )"
53 +
54 +DEPEND="virtual/pkgconfig"
55 +
56 +PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" )
57 +
58 +pkg_setup() {
59 + fortran-2_pkg_setup
60 + use openmp && tc-check-openmp
61 + export CC=$(tc-getCC) FC=$(tc-getFC)
62 +
63 + use dynamic && \
64 + export DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1
65 +
66 + # disable submake with -j
67 + export MAKE_NB_JOBS=-1
68 +
69 + USE_THREAD=0
70 + if use openmp; then
71 + USE_THREAD=1; USE_OPENMP=1;
72 + elif use pthread; then
73 + USE_THREAD=1; USE_OPENMP=0;
74 + fi
75 + export USE_THREAD USE_OPENMP
76 +
77 + export PREFIX="${EPREFIX}/usr"
78 +}
79 +
80 +src_unpack() {
81 + default
82 + mv "${WORKDIR}"/*OpenBLAS* "${S}" || die
83 + if use index-64bit; then
84 + cp -aL "${S}" "${S}-index-64bit" || die
85 + fi
86 +}
87 +
88 +src_compile() {
89 + emake
90 + emake -Cinterface shared-blas-lapack
91 + if use index-64bit; then
92 + emake -C"${S}-index-64bit" INTERFACE64=1 LIBPREFIX=libopenblas64
93 + fi
94 +}
95 +
96 +src_test() {
97 + emake tests
98 +}
99 +
100 +src_install() {
101 + emake install DESTDIR="${D}" OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \
102 + OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir)
103 + dodoc GotoBLAS_*.txt *.md Changelog.txt
104 +
105 + if use eselect-ldso; then
106 + dodir /usr/$(get_libdir)/blas/openblas/
107 + insinto /usr/$(get_libdir)/blas/openblas/
108 + doins interface/libblas.so.3
109 + dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so
110 + doins interface/libcblas.so.3
111 + dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so
112 +
113 + dodir /usr/$(get_libdir)/lapack/openblas/
114 + insinto /usr/$(get_libdir)/lapack/openblas/
115 + doins interface/liblapack.so.3
116 + dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so
117 + fi
118 +
119 + if use index-64bit; then
120 + insinto /usr/$(get_libdir)/
121 + dolib.so "${S}-index-64bit"/libopenblas64*.so*
122 + fi
123 +}
124 +
125 +pkg_postinst() {
126 + use eselect-ldso || return
127 + local libdir=$(get_libdir) me="openblas"
128 +
129 + # check blas
130 + eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
131 + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
132 + if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then
133 + eselect blas set ${libdir} ${me}
134 + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
135 + else
136 + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]."
137 + elog "To use blas [${me}] implementation, you have to issue (as root):"
138 + elog "\t eselect blas set ${libdir} ${me}"
139 + fi
140 +
141 + # check lapack
142 + eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
143 + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
144 + if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then
145 + eselect lapack set ${libdir} ${me}
146 + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
147 + else
148 + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
149 + elog "To use lapack [${me}] implementation, you have to issue (as root):"
150 + elog "\t eselect lapack set ${libdir} ${me}"
151 + fi
152 +}
153 +
154 +pkg_postrm() {
155 + if use eselect-ldso; then
156 + eselect blas validate
157 + eselect lapack validate
158 + fi
159 +}