summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2018-08-16 18:58:25 +0200
committerAvatar Heiko Becker <heirecka@exherbo.org> 2018-08-16 22:05:03 +0200
commit766daa7f6185af70cba2ba6cfbd3bf9cdeb16528 (patch)
treef9c48a42bbb1351ddf0b44371e940a84824ecc57
parent0587a0505fade9c3fdcd8b70d0fd52f4029e4e0d (diff)
downloadscientific-master.tar.gz
scientific-master.tar.xz
eigen: Fix a warning which is fatal with gcc8 by defaultHEADmaster
step fails to to build with gcc8 and without this fix, hence the revbump.
-rw-r--r--packages/sci-libs/eigen/eigen-3.3.5-r1.exheres-0 (renamed from packages/sci-libs/eigen/eigen-3.3.5.exheres-0)4
-rw-r--r--packages/sci-libs/eigen/files/eigen-3.3.5-fix-warnings-for-doc-eigen-prerequisites.patch84
2 files changed, 88 insertions, 0 deletions
diff --git a/packages/sci-libs/eigen/eigen-3.3.5.exheres-0 b/packages/sci-libs/eigen/eigen-3.3.5-r1.exheres-0
index c19436e..37ca0e7 100644
--- a/packages/sci-libs/eigen/eigen-3.3.5.exheres-0
+++ b/packages/sci-libs/eigen/eigen-3.3.5-r1.exheres-0
@@ -10,3 +10,7 @@ PLATFORMS="~amd64 ~x86"
# Some tests fail with 3.3.0 because they define EIGEN_RUNTIME_NO_MALLOC but allocate memory
RESTRICT="test"
+DEFAULT_SRC_PREPARE_PATCHES+=(
+ "${FILES}"/${PNV}-fix-warnings-for-doc-eigen-prerequisites.patch
+)
+
diff --git a/packages/sci-libs/eigen/files/eigen-3.3.5-fix-warnings-for-doc-eigen-prerequisites.patch b/packages/sci-libs/eigen/files/eigen-3.3.5-fix-warnings-for-doc-eigen-prerequisites.patch
new file mode 100644
index 0000000..b0d0ebe
--- /dev/null
+++ b/packages/sci-libs/eigen/files/eigen-3.3.5-fix-warnings-for-doc-eigen-prerequisites.patch
@@ -0,0 +1,84 @@
+Upstream: yes
+Reason: Fix build of consuming projects with gcc8, -Wreturn-type is enabled
+ by default for gcc8
+
+From 35e60f607c83056e787237b469ae96c0fe27bcf7 Mon Sep 17 00:00:00 2001
+From: Christoph Hertzberg <chtz@informatik.uni-bremen.de>
+Date: Tue, 24 Jul 2018 21:59:15 +0200
+Subject: [PATCH] fix warnings for doc-eigen-prerequisites
+
+---
+ doc/snippets/MatrixBase_cwiseEqual.cpp | 2 +-
+ doc/snippets/MatrixBase_cwiseNotEqual.cpp | 2 +-
+ unsupported/Eigen/src/IterativeSolvers/DGMRES.h | 2 +-
+ unsupported/doc/examples/FFT.cpp | 6 +++---
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/doc/snippets/MatrixBase_cwiseEqual.cpp b/doc/snippets/MatrixBase_cwiseEqual.cpp
+index eb3656f4c..469af642c 100644
+--- a/doc/snippets/MatrixBase_cwiseEqual.cpp
++++ b/doc/snippets/MatrixBase_cwiseEqual.cpp
+@@ -3,5 +3,5 @@ m << 1, 0,
+ 1, 1;
+ cout << "Comparing m with identity matrix:" << endl;
+ cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl;
+-int count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
++Index count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
+ cout << "Number of coefficients that are equal: " << count << endl;
+diff --git a/doc/snippets/MatrixBase_cwiseNotEqual.cpp b/doc/snippets/MatrixBase_cwiseNotEqual.cpp
+index 6a2e4fb6c..7f0a105d6 100644
+--- a/doc/snippets/MatrixBase_cwiseNotEqual.cpp
++++ b/doc/snippets/MatrixBase_cwiseNotEqual.cpp
+@@ -3,5 +3,5 @@ m << 1, 0,
+ 1, 1;
+ cout << "Comparing m with identity matrix:" << endl;
+ cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl;
+-int count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
++Index count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
+ cout << "Number of coefficients that are not equal: " << count << endl;
+diff --git a/unsupported/Eigen/src/IterativeSolvers/DGMRES.h b/unsupported/Eigen/src/IterativeSolvers/DGMRES.h
+index eff2dc8ad..eae717aa2 100644
+--- a/unsupported/Eigen/src/IterativeSolvers/DGMRES.h
++++ b/unsupported/Eigen/src/IterativeSolvers/DGMRES.h
+@@ -173,7 +173,7 @@ class DGMRES : public IterativeSolverBase<DGMRES<_MatrixType,_Preconditioner> >
+ /**
+ * Set the restart value (default is 30)
+ */
+- Index set_restart(const Index restart) { m_restart=restart; }
++ void set_restart(const Index restart) { m_restart=restart; }
+
+ /**
+ * Set the number of eigenvalues to deflate at each restart
+diff --git a/unsupported/doc/examples/FFT.cpp b/unsupported/doc/examples/FFT.cpp
+index fcbf81276..85e8a0241 100644
+--- a/unsupported/doc/examples/FFT.cpp
++++ b/unsupported/doc/examples/FFT.cpp
+@@ -61,14 +61,14 @@ template <typename T>
+ void RandomFill(std::vector<T> & vec)
+ {
+ for (size_t k=0;k<vec.size();++k)
+- vec[k] = T( rand() )/T(RAND_MAX) - .5;
++ vec[k] = T( rand() )/T(RAND_MAX) - T(.5);
+ }
+
+ template <typename T>
+ void RandomFill(std::vector<std::complex<T> > & vec)
+ {
+ for (size_t k=0;k<vec.size();++k)
+- vec[k] = std::complex<T> ( T( rand() )/T(RAND_MAX) - .5, T( rand() )/T(RAND_MAX) - .5);
++ vec[k] = std::complex<T> ( T( rand() )/T(RAND_MAX) - T(.5), T( rand() )/T(RAND_MAX) - T(.5));
+ }
+
+ template <typename T_time,typename T_freq>
+@@ -85,7 +85,7 @@ void fwd_inv(size_t nfft)
+ vector<T_time> timebuf2;
+ fft.inv(timebuf2,freqbuf);
+
+- long double rmse = mag2(timebuf - timebuf2) / mag2(timebuf);
++ T_time rmse = mag2(timebuf - timebuf2) / mag2(timebuf);
+ cout << "roundtrip rmse: " << rmse << endl;
+ }
+
+--
+2.18.0
+