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/lapack/
Date: Wed, 26 Jun 2019 03:12:04
Message-Id: 1561518698.77adee6db459011c15b367044c0171f61be8b531.heroxbd@gentoo
1 commit: 77adee6db459011c15b367044c0171f61be8b531
2 Author: Mo Zhou <cdluminate <AT> gmail <DOT> com>
3 AuthorDate: Wed Jun 26 02:24:04 2019 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 26 03:11:38 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77adee6d
7
8 sci-libs/lapack: new ebuild for lapack that enables runtime switching.
9
10 This ebuild replaces {blas,cblas,lapack,lapacke}-reference ebuild
11 files.
12
13 Closes: https://github.com/gentoo/gentoo/pull/12319
14
15 Signed-off-by: Mo Zhou <cdluminate <AT> gmail.com>
16 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
17
18 sci-libs/lapack/Manifest | 1 +
19 sci-libs/lapack/lapack-3.8.0.ebuild | 88 +++++++++++++++++++++++++++++++++++++
20 sci-libs/lapack/metadata.xml | 28 ++++++++++++
21 3 files changed, 117 insertions(+)
22
23 diff --git a/sci-libs/lapack/Manifest b/sci-libs/lapack/Manifest
24 new file mode 100644
25 index 00000000000..fe865c2bdc8
26 --- /dev/null
27 +++ b/sci-libs/lapack/Manifest
28 @@ -0,0 +1 @@
29 +DIST lapack-3.8.0.tar.gz 7426094 BLAKE2B 27cd75eea498250382b2df6f5d7dc95fdee8d37b1a0faba5296ca0145ec40a1165a4ecc727aa1647086be6783b50cf475f79cea0f30f541da789051db99b2f37 SHA512 17786cb7306fccdc9b4a242de7f64fc261ebe6a10b6ec55f519deb4cb673cb137e8742aa5698fd2dc52f1cd56d3bd116af3f593a01dcf6770c4dcc86c50b2a7f
30
31 diff --git a/sci-libs/lapack/lapack-3.8.0.ebuild b/sci-libs/lapack/lapack-3.8.0.ebuild
32 new file mode 100644
33 index 00000000000..df848e027d5
34 --- /dev/null
35 +++ b/sci-libs/lapack/lapack-3.8.0.ebuild
36 @@ -0,0 +1,88 @@
37 +# Copyright 1999-2019 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +CMAKE_MAKEFILE_GENERATOR=emake
42 +inherit cmake-utils
43 +
44 +DESCRIPTION="BLAS,CBLAS,LAPACK,LAPACKE reference implementations"
45 +HOMEPAGE="http://www.netlib.org/lapack/"
46 +SRC_URI="http://www.netlib.org/${PN}/${P}.tar.gz"
47 +
48 +LICENSE="BSD"
49 +SLOT="0"
50 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
51 +IUSE="lapacke doc"
52 +# TODO: static-libs 64bit-index
53 +
54 +RDEPEND="
55 + >=app-eselect/eselect-blas-0.2
56 + >=app-eselect/eselect-lapack-0.2
57 + !app-eselect/eselect-cblas
58 + !sci-libs/blas-reference
59 + !sci-libs/cblas-reference
60 + !sci-libs/lapack-reference
61 + !sci-libs/lapacke-reference
62 + doc? ( app-doc/blas-docs )
63 + virtual/pkgconfig"
64 +DEPEND="${RDEPEND}
65 + virtual/fortran"
66 +
67 +src_configure() {
68 + local mycmakeargs=(
69 + -DCBLAS=ON
70 + -DLAPACKE=$(usex lapacke)
71 + -DCMAKE_INSTALL_PREFIX="${EPREFIX}"/usr
72 + -DBUILD_SHARED_LIBS=ON
73 + )
74 + cmake-utils_src_configure
75 +}
76 +
77 +src_install () {
78 + cmake-utils_src_install
79 +
80 + # Create private lib directory for eselect::blas (ld.so.conf)
81 + dodir /usr/$(get_libdir)/blas/reference
82 + dosym ../../libblas.so usr/$(get_libdir)/blas/reference/libblas.so
83 + dosym ../../libblas.so.3 usr/$(get_libdir)/blas/reference/libblas.so.3
84 + dosym ../../libcblas.so usr/$(get_libdir)/blas/reference/libcblas.so
85 + dosym ../../libcblas.so.3 usr/$(get_libdir)/blas/reference/libcblas.so.3
86 +
87 + # Create private lib directory for eselect::lapack (ld.so.conf)
88 + dodir /usr/$(get_libdir)/lapack/reference
89 + dosym ../../liblapack.so usr/$(get_libdir)/lapack/reference/liblapack.so
90 + dosym ../../liblapack.so.3 usr/$(get_libdir)/lapack/reference/liblapack.so.3
91 +}
92 +
93 +pkg_postinst () {
94 + local me=reference libdir=$(get_libdir)
95 +
96 + # check eselect-blas
97 + eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
98 + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
99 + if [[ ${current_blas} == ${me} || -z ${current_blas} ]]; then
100 + eselect blas set ${libdir} ${me}
101 + elog "Current eselect: BLAS ($libdir) -> [${current_blas}]."
102 + else
103 + elog "Current eselect: BLAS ($libdir) -> [${current_blas}]."
104 + elog "To use blas [${me}] implementation, you have to issue (as root):"
105 + elog "\t eselect blas set ${libdir} ${me}"
106 + fi
107 +
108 + # check eselect-lapack
109 + eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
110 + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
111 + if [[ ${current_lapack} == ${me} || -z ${current_lapack} ]]; then
112 + eselect lapack set ${libdir} ${me}
113 + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
114 + else
115 + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
116 + elog "To use lapack [${me}] implementation, you have to issue (as root):"
117 + elog "\t eselect lapack set ${libdir} ${me}"
118 + fi
119 +}
120 +
121 +pkg_postrm () {
122 + eselect blas validate
123 + eselect lapack validate
124 +}
125
126 diff --git a/sci-libs/lapack/metadata.xml b/sci-libs/lapack/metadata.xml
127 new file mode 100644
128 index 00000000000..7b291ef6bfd
129 --- /dev/null
130 +++ b/sci-libs/lapack/metadata.xml
131 @@ -0,0 +1,28 @@
132 +<?xml version="1.0" encoding="UTF-8"?>
133 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
134 +<pkgmetadata>
135 + <maintainer type="project">
136 + <email>sci@g.o</email>
137 + <name>Gentoo Science Project</name>
138 + </maintainer>
139 + <longdescription lang="en">
140 +The BLAS (Basic Linear Algebra Subprograms) are high quality "building
141 +block" routines for performing basic vector and matrix operations. Level 1
142 +BLAS do vector-vector operations, Level 2 BLAS do matrix-vector operations,
143 +and Level 3 BLAS do matrix-matrix operations. Because the BLAS are
144 +efficient, portable, and widely available, they're commonly used in the
145 +development of high quality linear algebra software, LAPACK for
146 +example. This packages implements the reference FORTRAN 77 library,
147 +the reference C library as a wrapper to the FORTRAN 77 BLAS library.
148 +
149 +LAPACK is a comprehensive library that does linear algebra
150 +operations including matrix inversions, least squared solutions to
151 +linear sets of equations, eigenvector analysis, singular value
152 +decomposition, etc. It is a very comprehensive and reputable package
153 +that has found extensive use in the scientific community.
154 +This package installs the reference FORTRAN 77 implementation from Netlib.
155 + </longdescription>
156 + <use>
157 + <flag name="lapacke">Build LAPACKE</flag>
158 + </use>
159 +</pkgmetadata>