Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/eigen/files/, dev-cpp/eigen/
Date: Mon, 22 Feb 2016 09:36:06
Message-Id: 1456133749.49ac69328112878890edafb2a1b6ce13bff20d44.jlec@gentoo
1 commit: 49ac69328112878890edafb2a1b6ce13bff20d44
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 22 09:33:04 2016 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 22 09:35:49 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49ac6932
7
8 dev-cpp/eigen: Drop -g2 from build flags
9
10 * Bump to EAPI=6
11 * Add missing test deps
12 * Add missing USE
13
14 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=575354
15
16 Package-Manager: portage-2.2.27
17 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
18
19 dev-cpp/eigen/eigen-3.2.7.ebuild | 67 +++++++++++++++++++---
20 .../eigen/files/eigen-3.2.8-adaolc-backport.patch | 40 +++++++++++++
21 .../files/eigen-3.2.8-pastix-5.2-backport.patch | 42 ++++++++++++++
22 3 files changed, 141 insertions(+), 8 deletions(-)
23
24 diff --git a/dev-cpp/eigen/eigen-3.2.7.ebuild b/dev-cpp/eigen/eigen-3.2.7.ebuild
25 index be503c9..f0cc3dd 100644
26 --- a/dev-cpp/eigen/eigen-3.2.7.ebuild
27 +++ b/dev-cpp/eigen/eigen-3.2.7.ebuild
28 @@ -2,9 +2,11 @@
29 # Distributed under the terms of the GNU General Public License v2
30 # $Id$
31
32 -EAPI=5
33 +EAPI=6
34
35 -inherit cmake-utils
36 +FORTRAN_NEEDED="test"
37 +
38 +inherit cmake-utils fortran-2
39
40 DESCRIPTION="C++ template library for linear algebra"
41 HOMEPAGE="http://eigen.tuxfamily.org/"
42 @@ -13,10 +15,43 @@ SRC_URI="https://bitbucket.org/eigen/eigen/get/${PV}.tar.bz2 -> ${P}.tar.bz2"
43 LICENSE="LGPL-2 GPL-3"
44 SLOT="3"
45 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
46 -IUSE="debug doc"
47 +IUSE="altivec debug doc openmp test"
48 +IUSE+=" cpu_flags_x86_sse2"
49 +IUSE+=" cpu_flags_x86_sse3"
50 +IUSE+=" cpu_flags_x86_sse4_1"
51 +IUSE+=" cpu_flags_x86_sse4_2"
52 +IUSE+=" cpu_flags_x86_ssse3"
53 +#IUSE+=" cpu_flags_x86_x87"
54
55 -DEPEND="doc? ( app-doc/doxygen[dot,latex] )"
56 RDEPEND="!dev-cpp/eigen:0"
57 +DEPEND="
58 + doc? ( app-doc/doxygen[dot,latex] )
59 + test? (
60 + dev-libs/gmp:0
61 + dev-libs/mpfr:0
62 + media-libs/freeglut
63 + media-libs/glew
64 + sci-libs/adolc
65 + sci-libs/cholmod
66 + sci-libs/fftw:3.0
67 + sci-libs/pastix
68 + sci-libs/umfpack
69 + sci-libs/scotch
70 + sci-libs/spqr
71 + sci-libs/superlu
72 + dev-qt/qtcore:4
73 + virtual/opengl
74 + virtual/pkgconfig
75 + )
76 + "
77 +# Missing:
78 +# METIS-5
79 +# GOOGLEHASH
80 +
81 +PATCHES=(
82 + "${FILESDIR}"/${P}-pastix-5.2-backport.patch
83 + "${FILESDIR}"/${P}-adaolc-backport.patch
84 +)
85
86 src_unpack() {
87 default
88 @@ -24,12 +59,21 @@ src_unpack() {
89 }
90
91 src_prepare() {
92 + sed \
93 + -e 's:-g2::g' \
94 + -i cmake/EigenConfigureTesting.cmake || die
95 +
96 sed -i CMakeLists.txt \
97 -e "/add_subdirectory(demos/d" \
98 - -e "/add_subdirectory(blas/d" \
99 - -e "/add_subdirectory(lapack/d" \
100 || die "sed disable unused bundles failed"
101
102 + if ! use test; then
103 + sed -i CMakeLists.txt \
104 + -e "/add_subdirectory(blas/d" \
105 + -e "/add_subdirectory(lapack/d" \
106 + || die "sed disable unused bundles failed"
107 + fi
108 +
109 sed -i -e "/Unknown build type/d" CMakeLists.txt || die
110
111 sed \
112 @@ -47,10 +91,17 @@ src_compile() {
113 src_test() {
114 local mycmakeargs=(
115 -DEIGEN_BUILD_TESTS=ON
116 - -DEIGEN_TEST_NO_FORTRAN=ON
117 - -DEIGEN_TEST_NO_OPENGL=ON
118 + -DEIGEN_TEST_ALTIVEC="$(usex altivec)"
119 + -DEIGEN_TEST_OPENMP="$(usex openmp)"
120 + -DEIGEN_TEST_SSE2="$(usex cpu_flags_x86_sse2)"
121 + -DEIGEN_TEST_SSE3="$(usex cpu_flags_x86_sse3)"
122 + -DEIGEN_TEST_SSE4_1="$(usex cpu_flags_x86_sse4_1)"
123 + -DEIGEN_TEST_SSE4_2="$(usex cpu_flags_x86_sse4_2)"
124 + -DEIGEN_TEST_SSSE3="$(usex cpu_flags_x86_ssse3)"
125 +# -DEIGEN_TEST_X87="$(usex cpu_flags_x86_x87)"
126 )
127 cmake-utils_src_configure
128 + cmake-utils_src_compile blas
129 cmake-utils_src_compile buildtests
130 cmake-utils_src_test
131 }
132
133 diff --git a/dev-cpp/eigen/files/eigen-3.2.8-adaolc-backport.patch b/dev-cpp/eigen/files/eigen-3.2.8-adaolc-backport.patch
134 new file mode 100644
135 index 0000000..82547e1
136 --- /dev/null
137 +++ b/dev-cpp/eigen/files/eigen-3.2.8-adaolc-backport.patch
138 @@ -0,0 +1,40 @@
139 +# HG changeset patch
140 +# User Gael Guennebaud <g.gael@××××.fr>
141 +# Date 1448895622 -3600
142 +# Node ID e515e2706d00294a5749db7832d10ea366b9389f
143 +# Parent eb4bf011a2ea5fc4ddb0aa5332d6e616198ed886
144 +Update ADOL-C support.
145 +
146 +diff --git a/unsupported/Eigen/AdolcForward b/unsupported/Eigen/AdolcForward
147 +--- a/unsupported/Eigen/AdolcForward
148 ++++ b/unsupported/Eigen/AdolcForward
149 +@@ -25,7 +25,7 @@
150 + #ifndef NUMBER_DIRECTIONS
151 + # define NUMBER_DIRECTIONS 2
152 + #endif
153 +-#include <adolc/adouble.h>
154 ++#include <adolc/adtl.h>
155 +
156 + // adolc defines some very stupid macros:
157 + #if defined(malloc)
158 +diff --git a/unsupported/test/forward_adolc.cpp b/unsupported/test/forward_adolc.cpp
159 +--- a/unsupported/test/forward_adolc.cpp
160 ++++ b/unsupported/test/forward_adolc.cpp
161 +@@ -13,8 +13,6 @@
162 + #define NUMBER_DIRECTIONS 16
163 + #include <unsupported/Eigen/AdolcForward>
164 +
165 +-int adtl::ADOLC_numDir;
166 +-
167 + template<typename Vector>
168 + EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p)
169 + {
170 +@@ -123,7 +121,7 @@
171 +
172 + void test_forward_adolc()
173 + {
174 +- adtl::ADOLC_numDir = NUMBER_DIRECTIONS;
175 ++ adtl::setNumDir(NUMBER_DIRECTIONS);
176 +
177 + for(int i = 0; i < g_repeat; i++) {
178 + CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1<double,2,2>()) ));
179
180 diff --git a/dev-cpp/eigen/files/eigen-3.2.8-pastix-5.2-backport.patch b/dev-cpp/eigen/files/eigen-3.2.8-pastix-5.2-backport.patch
181 new file mode 100644
182 index 0000000..fafaf3a
183 --- /dev/null
184 +++ b/dev-cpp/eigen/files/eigen-3.2.8-pastix-5.2-backport.patch
185 @@ -0,0 +1,42 @@
186 +# HG changeset patch
187 +# User Gael Guennebaud <g.gael@××××.fr>
188 +# Date 1393589499 -3600
189 +# Node ID b88efb384b160880131ad17e39bb690719112bfa
190 +# Parent 576120ad694efe29b70999576964d3816288fb4e
191 +Fix PaStiX support for Pastix 5.2
192 +
193 +diff --git a/Eigen/src/PaStiXSupport/PaStiXSupport.h b/Eigen/src/PaStiXSupport/PaStiXSupport.h
194 +--- a/Eigen/src/PaStiXSupport/PaStiXSupport.h
195 ++++ b/Eigen/src/PaStiXSupport/PaStiXSupport.h
196 +@@ -12,6 +12,14 @@
197 +
198 + namespace Eigen {
199 +
200 ++#if defined(DCOMPLEX)
201 ++ #define PASTIX_COMPLEX COMPLEX
202 ++ #define PASTIX_DCOMPLEX DCOMPLEX
203 ++#else
204 ++ #define PASTIX_COMPLEX std::complex<float>
205 ++ #define PASTIX_DCOMPLEX std::complex<double>
206 ++#endif
207 ++
208 + /** \ingroup PaStiXSupport_Module
209 + * \brief Interface to the PaStix solver
210 + *
211 +@@ -74,14 +82,14 @@
212 + {
213 + if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
214 + if (nbrhs == 0) {x = NULL; nbrhs=1;}
215 +- c_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<COMPLEX*>(vals), perm, invp, reinterpret_cast<COMPLEX*>(x), nbrhs, iparm, dparm);
216 ++ c_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<PASTIX_COMPLEX*>(vals), perm, invp, reinterpret_cast<PASTIX_COMPLEX*>(x), nbrhs, iparm, dparm);
217 + }
218 +
219 + void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, std::complex<double> *vals, int *perm, int * invp, std::complex<double> *x, int nbrhs, int *iparm, double *dparm)
220 + {
221 + if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
222 + if (nbrhs == 0) {x = NULL; nbrhs=1;}
223 +- z_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<DCOMPLEX*>(vals), perm, invp, reinterpret_cast<DCOMPLEX*>(x), nbrhs, iparm, dparm);
224 ++ z_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<PASTIX_DCOMPLEX*>(vals), perm, invp, reinterpret_cast<PASTIX_DCOMPLEX*>(x), nbrhs, iparm, dparm);
225 + }
226 +
227 + // Convert the matrix to Fortran-style Numbering