Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/bicatali:master commit in: sci-libs/armadillo/
Date: Mon, 23 Nov 2015 23:09:42
Message-Id: 1447977078.f08452b60ccd4e03c721a86c7b1de7823c0eab4e.bicatali@gentoo
1 commit: f08452b60ccd4e03c721a86c7b1de7823c0eab4e
2 Author: S├ębastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 19 23:51:18 2015 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 19 23:51:18 2015 +0000
6 URL: https://gitweb.gentoo.org/dev/bicatali.git/commit/?id=f08452b6
7
8 sci-libs/armadillo: version bump, fix superlu detection
9
10 Package-Manager: portage-2.2.25
11
12 sci-libs/armadillo/Manifest | 1 +
13 sci-libs/armadillo/armadillo-6.200.4.ebuild | 122 ++++++++++++++++++++++++++++
14 sci-libs/armadillo/metadata.xml | 40 +++++++++
15 3 files changed, 163 insertions(+)
16
17 diff --git a/sci-libs/armadillo/Manifest b/sci-libs/armadillo/Manifest
18 new file mode 100644
19 index 0000000..c204c54
20 --- /dev/null
21 +++ b/sci-libs/armadillo/Manifest
22 @@ -0,0 +1 @@
23 +DIST armadillo-6.200.4.tar.gz 5442156 SHA256 346ecb98cadafcf13493f09c970a2843af58d47a7a801ebce0b5df5b5a39f416 SHA512 9fe261a9b7634f4b1a1adcfab0f4cd850163648a5ead187a978ff2d6ecdc47a73c541e446e96560ea509e7d0fabb8441140b4e95793e332eaf735f2f11154679 WHIRLPOOL a27c097caabadb7d69c93d126f49adb6e36f7a5375f325d8bf72a92affce2dac0fb46e1c3ce15aea83f6f74f0508820103abea69c471443fa9b17eb97445ddb9
24
25 diff --git a/sci-libs/armadillo/armadillo-6.200.4.ebuild b/sci-libs/armadillo/armadillo-6.200.4.ebuild
26 new file mode 100644
27 index 0000000..852b25b
28 --- /dev/null
29 +++ b/sci-libs/armadillo/armadillo-6.200.4.ebuild
30 @@ -0,0 +1,122 @@
31 +# Copyright 1999-2015 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=5
36 +
37 +CMAKE_IN_SOURCE_BUILD=1
38 +
39 +inherit cmake-utils toolchain-funcs multilib eutils
40 +
41 +DESCRIPTION="Streamlined C++ linear algebra library"
42 +HOMEPAGE="http://arma.sourceforge.net/"
43 +SRC_URI="mirror://sourceforge/arma/${P}.tar.gz"
44 +
45 +LICENSE="MPL-2.0"
46 +SLOT="0/6"
47 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
48 +IUSE="arpack atlas blas debug doc examples hdf5 lapack mkl superlu tbb test"
49 +REQUIRED_USE="test? ( lapack )"
50 +
51 +RDEPEND="
52 + dev-libs/boost
53 + arpack? ( sci-libs/arpack )
54 + atlas? ( sci-libs/atlas[lapack] )
55 + blas? ( virtual/blas )
56 + lapack? ( virtual/lapack )
57 + superlu? ( sci-libs/superlu )
58 +"
59 +DEPEND="${RDEPEND}
60 + arpack? ( virtual/pkgconfig )
61 + atlas? ( virtual/pkgconfig )
62 + blas? ( virtual/pkgconfig )
63 + hdf5? ( sci-libs/hdf5 )
64 + lapack? ( virtual/pkgconfig )
65 + mkl? ( sci-libs/mkl )
66 + tbb? ( dev-cpp/tbb )"
67 +PDEPEND="${RDEPEND}
68 + hdf5? ( sci-libs/hdf5 )
69 + mkl? ( sci-libs/mkl )
70 + tbb? ( dev-cpp/tbb )"
71 +
72 +src_prepare() {
73 + # avoid the automagic cmake macros
74 + sed -i -e '/ARMA_Find/d' CMakeLists.txt || die
75 + cmake-utils_src_prepare
76 +}
77 +
78 +src_configure() {
79 + local mycmakeargs=(
80 + -DINSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
81 + $(cmake-utils_use debug ARMA_EXTRA_DEBUG)
82 + $(cmake-utils_use mkl ARMA_USE_MKL_ALLOC)
83 + $(cmake-utils_use tbb ARMA_USE_TBB_ALLOC)
84 + )
85 + if use arpack; then
86 + mycmakeargs+=(
87 + -DARPACK_FOUND=ON
88 + -DARPACK_LIBRARY="$($(tc-getPKG_CONFIG) --libs arpack)"
89 + )
90 + fi
91 + if use atlas; then
92 + local c=atlas-cblas l=atlas-clapack
93 + $(tc-getPKG_CONFIG) --exists ${c}-threads && c+=-threads
94 + $(tc-getPKG_CONFIG) --exists ${l}-threads && l+=-threads
95 + mycmakeargs+=(
96 + -DCBLAS_FOUND=ON
97 + -DCBLAS_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I ${c} | sed 's/-I//')"
98 + -DCBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs ${c})"
99 + -DCLAPACK_FOUND=ON
100 + -DCLAPACK_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I ${l} | sed 's/-I//')"
101 + -DCLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs ${l})"
102 + )
103 + fi
104 + if use blas; then
105 + mycmakeargs+=(
106 + -DBLAS_FOUND=ON
107 + -DBLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs blas)"
108 + )
109 + fi
110 + if use hdf5; then
111 + mycmakeargs+=(
112 + -DHDF5_FOUND=ON
113 + -DHDF5_LIBRARIES="-lhdf5"
114 + )
115 + fi
116 + if use lapack; then
117 + mycmakeargs+=(
118 + -DLAPACK_FOUND=ON
119 + -DLAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs lapack)"
120 + )
121 + fi
122 + if use superlu; then
123 + mycmakeargs+=(
124 + -DSuperLU_FOUND=ON
125 + -DSuperLU_LIBRARIES="$($(tc-getPKG_CONFIG) --libs superlu)"
126 + -DSuperLU_INCLUDE_DIR="$($(tc-getPKG_CONFIG) --cflags-only-I superlu | awk '{print $1}' | sed 's/-I//')"
127 + )
128 + fi
129 +
130 + cmake-utils_src_configure
131 +}
132 +
133 +src_test() {
134 + pushd examples > /dev/null
135 + emake \
136 + CXXFLAGS="-I../include ${CXXFLAGS} -DARMA_USE_BLAS -DARMA_USE_LAPACK" \
137 + EXTRA_LIB_FLAGS="-L.. $($(tc-getPKG_CONFIG) --libs blas lapack)"
138 + LD_LIBRARY_PATH="..:${LD_LIBRARY_PATH}" ./example1 || die
139 + LD_LIBRARY_PATH="..:${LD_LIBRARY_PATH}" ./example2 || die
140 + emake clean
141 + popd > /dev/null
142 +}
143 +
144 +src_install() {
145 + cmake-utils_src_install
146 + dodoc README.txt
147 + use doc && dodoc *pdf && dohtml *html
148 + if use examples; then
149 + insinto /usr/share/examples/${PF}
150 + doins -r examples/*
151 + fi
152 +}
153
154 diff --git a/sci-libs/armadillo/metadata.xml b/sci-libs/armadillo/metadata.xml
155 new file mode 100644
156 index 0000000..af978f1
157 --- /dev/null
158 +++ b/sci-libs/armadillo/metadata.xml
159 @@ -0,0 +1,40 @@
160 +<?xml version="1.0" encoding="UTF-8"?>
161 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
162 +<pkgmetadata>
163 + <herd>sci</herd>
164 + <longdescription lang="en">
165 + Armadillo is a C++ linear algebra library (matrix maths) aiming
166 + towards a good balance between speed and ease of use. Integer,
167 + floating point and complex numbers are supported, as well as a
168 + subset of trigonometric and statistics functions. Various matrix
169 + decompositions are provided through optional integration with LAPACK
170 + and ATLAS libraries.
171 + A delayed evaluation approach is employed (during compile time) to
172 + combine several operations into one and reduce (or eliminate) the
173 + need for temporaries. This is accomplished through recursive
174 + templates and template meta-programming.
175 +</longdescription>
176 + <use>
177 + <flag name="atlas">
178 + Link with <pkg>sci-libs/atlas</pkg> libraries for cblas and
179 + clapack
180 + </flag>
181 + <flag name="arpack">
182 + Link with <pkg>sci-libs/arpack</pkg> libraries for eigen decomposition
183 + </flag>
184 + <flag name="mkl">
185 + Use matrix allocation from the Intel MKL <pkg>sci-libs/mkl</pkg>
186 + </flag>
187 + <flag name="tbb">
188 + Use matrix allocation from the Threads Building Blocks
189 + <pkg>dev-cpp/tbb</pkg>
190 + </flag>
191 + <flag name="superlu">
192 + Use SuperLU for sparse linear equation solving
193 + <pkg>sci-libs/superlu</pkg>
194 + </flag>
195 + </use>
196 + <upstream>
197 + <remote-id type="sourceforge">arma</remote-id>
198 + </upstream>
199 +</pkgmetadata>