Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/armadillo/
Date: Sat, 25 Jul 2015 23:39:23
Message-Id: 1437816655.b84afcb2b666160d9f0b9caeffadbb78992e476f.bircoph@gentoo
1 commit: b84afcb2b666160d9f0b9caeffadbb78992e476f
2 Author: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
3 AuthorDate: Sat Jul 25 09:29:38 2015 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 25 09:30:55 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=b84afcb2
7
8 sci-libs/armadillo: Add superlu useflag
9
10 Package-Manager: portage-2.2.20
11
12 sci-libs/armadillo/ChangeLog | 6 ++
13 sci-libs/armadillo/armadillo-5.200.2-r1.ebuild | 121 +++++++++++++++++++++++++
14 sci-libs/armadillo/metadata.xml | 4 +
15 3 files changed, 131 insertions(+)
16
17 diff --git a/sci-libs/armadillo/ChangeLog b/sci-libs/armadillo/ChangeLog
18 index ba91269..f38652d 100644
19 --- a/sci-libs/armadillo/ChangeLog
20 +++ b/sci-libs/armadillo/ChangeLog
21 @@ -2,6 +2,12 @@
22 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
23 # $Header: $
24
25 +*armadillo-5.200.2-r1 (25 Jul 2015)
26 +
27 + 25 Jul 2015; Marius Brehler <marbre@××××××××××××××.de>
28 + +armadillo-5.200.2-r1.ebuild, metadata.xml:
29 + sci-libs/armadillo: Add superlu useflag
30 +
31 25 Jul 2015; Marius Brehler <marbre@××××××××××××××.de>
32 armadillo-5.100.2.ebuild, armadillo-5.200.1.ebuild, armadillo-5.200.2.ebuild:
33 sci-libs/armadillo: Fix slots
34
35 diff --git a/sci-libs/armadillo/armadillo-5.200.2-r1.ebuild b/sci-libs/armadillo/armadillo-5.200.2-r1.ebuild
36 new file mode 100644
37 index 0000000..0f4f32e
38 --- /dev/null
39 +++ b/sci-libs/armadillo/armadillo-5.200.2-r1.ebuild
40 @@ -0,0 +1,121 @@
41 +# Copyright 1999-2015 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +# $Header: $
44 +
45 +EAPI=5
46 +
47 +CMAKE_IN_SOURCE_BUILD=1
48 +
49 +inherit cmake-utils toolchain-funcs multilib eutils
50 +
51 +DESCRIPTION="Streamlined C++ linear algebra library"
52 +HOMEPAGE="http://arma.sourceforge.net/"
53 +SRC_URI="mirror://sourceforge/arma/${P}.tar.gz"
54 +
55 +LICENSE="MPL-2.0"
56 +SLOT="0/5"
57 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
58 +IUSE="arpack atlas blas debug doc examples hdf5 lapack mkl superlu tbb test"
59 +REQUIRED_USE="test? ( lapack )"
60 +
61 +RDEPEND="
62 + dev-libs/boost
63 + arpack? ( sci-libs/arpack )
64 + atlas? ( sci-libs/atlas[lapack] )
65 + blas? ( virtual/blas )
66 + lapack? ( virtual/lapack )
67 + superlu? ( sci-libs/superlu )
68 +"
69 +DEPEND="${RDEPEND}
70 + arpack? ( virtual/pkgconfig )
71 + atlas? ( virtual/pkgconfig )
72 + blas? ( virtual/pkgconfig )
73 + hdf5? ( sci-libs/hdf5 )
74 + lapack? ( virtual/pkgconfig )
75 + mkl? ( sci-libs/mkl )
76 + tbb? ( dev-cpp/tbb )"
77 +PDEPEND="${RDEPEND}
78 + hdf5? ( sci-libs/hdf5 )
79 + mkl? ( sci-libs/mkl )
80 + tbb? ( dev-cpp/tbb )"
81 +
82 +src_prepare() {
83 + # avoid the automagic cmake macros
84 + sed -i -e '/ARMA_Find/d' CMakeLists.txt || die
85 + cmake-utils_src_prepare
86 +}
87 +
88 +src_configure() {
89 + local mycmakeargs=(
90 + -DINSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
91 + $(cmake-utils_use debug ARMA_EXTRA_DEBUG)
92 + $(cmake-utils_use mkl ARMA_USE_MKL_ALLOC)
93 + $(cmake-utils_use tbb ARMA_USE_TBB_ALLOC)
94 + )
95 + if use arpack; then
96 + mycmakeargs+=(
97 + -DARPACK_FOUND=ON
98 + -DARPACK_LIBRARY="$($(tc-getPKG_CONFIG) --libs arpack)"
99 + )
100 + fi
101 + if use atlas; then
102 + local c=atlas-cblas l=atlas-clapack
103 + $(tc-getPKG_CONFIG) --exists ${c}-threads && c+=-threads
104 + $(tc-getPKG_CONFIG) --exists ${l}-threads && l+=-threads
105 + mycmakeargs+=(
106 + -DCBLAS_FOUND=ON
107 + -DCBLAS_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I ${c} | sed 's/-I//')"
108 + -DCBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs ${c})"
109 + -DCLAPACK_FOUND=ON
110 + -DCLAPACK_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I ${l} | sed 's/-I//')"
111 + -DCLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs ${l})"
112 + )
113 + fi
114 + if use blas; then
115 + mycmakeargs+=(
116 + -DBLAS_FOUND=ON
117 + -DBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs blas)"
118 + )
119 + fi
120 + if use hdf5; then
121 + mycmakeargs+=(
122 + -DHDF5_FOUND=ON
123 + -DHDF5_LIBRARIES="-lhdf5"
124 + )
125 + fi
126 + if use lapack; then
127 + mycmakeargs+=(
128 + -DLAPACK_FOUND=ON
129 + -DLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs lapack)"
130 + )
131 + fi
132 + if use superlu; then
133 + mycmakeargs+=(
134 + -DSuperLU_FOUND=ON
135 + -DSuperLU_LIBRARIES="$($(tc-getPKG_CONFIG) --libs superlu)"
136 + )
137 + fi
138 +
139 + cmake-utils_src_configure
140 +}
141 +
142 +src_test() {
143 + pushd examples > /dev/null
144 + emake \
145 + CXXFLAGS="-I../include ${CXXFLAGS} -DARMA_USE_BLAS -DARMA_USE_LAPACK" \
146 + EXTRA_LIB_FLAGS="-L.. $($(tc-getPKG_CONFIG) --libs blas lapack)"
147 + LD_LIBRARY_PATH="..:${LD_LIBRARY_PATH}" ./example1 || die
148 + LD_LIBRARY_PATH="..:${LD_LIBRARY_PATH}" ./example2 || die
149 + emake clean
150 + popd > /dev/null
151 +}
152 +
153 +src_install() {
154 + cmake-utils_src_install
155 + dodoc README.txt
156 + use doc && dodoc *pdf && dohtml *html
157 + if use examples; then
158 + insinto /usr/share/examples/${PF}
159 + doins -r examples/*
160 + fi
161 +}
162
163 diff --git a/sci-libs/armadillo/metadata.xml b/sci-libs/armadillo/metadata.xml
164 index dfc8f30..af978f1 100644
165 --- a/sci-libs/armadillo/metadata.xml
166 +++ b/sci-libs/armadillo/metadata.xml
167 @@ -29,6 +29,10 @@
168 Use matrix allocation from the Threads Building Blocks
169 <pkg>dev-cpp/tbb</pkg>
170 </flag>
171 + <flag name="superlu">
172 + Use SuperLU for sparse linear equation solving
173 + <pkg>sci-libs/superlu</pkg>
174 + </flag>
175 </use>
176 <upstream>
177 <remote-id type="sourceforge">arma</remote-id>