[libstxxl1] 01/02: * Add compilation fix patches from upstream for priority queue FTBFS bug : 759701
D Haley
mycae-guest at moszumanska.debian.org
Fri Sep 19 13:39:01 UTC 2014
This is an automated email from the git hooks/post-receive script.
mycae-guest pushed a commit to branch master
in repository libstxxl1.
commit 3d9d2d157b5b897b9e23afbb18fe4dd6b73402ad
Author: D Haley <mycae at gmx.com>
Date: Sat Aug 30 20:59:05 2014 +0100
* Add compilation fix patches from upstream for priority queue FTBFS
bug : 759701
---
...ger-underflow-in-PQ-config-rewriting-PQ-t.patch | 123 +++++++++++++++++++++
...mpile-of-PQ-with-8-GiB-on-32-bit-systems-.patch | 39 +++++++
debian/patches/disable-large-queue.patch | 24 ++++
debian/patches/series | 2 +
debian/rules | 2 +-
5 files changed, 189 insertions(+), 1 deletion(-)
diff --git a/debian/patches/Fixing-integer-underflow-in-PQ-config-rewriting-PQ-t.patch b/debian/patches/Fixing-integer-underflow-in-PQ-config-rewriting-PQ-t.patch
new file mode 100644
index 0000000..b6d2242
--- /dev/null
+++ b/debian/patches/Fixing-integer-underflow-in-PQ-config-rewriting-PQ-t.patch
@@ -0,0 +1,123 @@
+Desrciption: Upstream patch to fix Priority queue on 32 bit systems
+Author: Timo Bergmann
+Date: Mon, 8 Sep 2014 15:25:38 +0200
+Applied-Upstream: Yes
+diff --git a/include/stxxl/bits/containers/priority_queue.h b/include/stxxl/bits/containers/priority_queue.h
+index 8050d5c..c0a47e9 100644
+--- a/include/stxxl/bits/containers/priority_queue.h
++++ b/include/stxxl/bits/containers/priority_queue.h
+@@ -10,6 +10,7 @@
+ * Copyright (C) 2003, 2004, 2007 Roman Dementiev <dementiev at mpi-sb.mpg.de>
+ * Copyright (C) 2007-2009 Johannes Singler <singler at ira.uka.de>
+ * Copyright (C) 2007-2010 Andreas Beckmann <beckmann at cs.uni-frankfurt.de>
++ * Copyright (C) 2014 Timo Bingmann <tb at panthema.net>
+ *
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+@@ -854,51 +855,80 @@ struct dummy
+ typedef dummy result;
+ };
+
+-template <unsigned_type E_, internal_size_type IntMem_, external_size_type MaxItems, unsigned_type B_, unsigned_type m_, bool stop = false>
++template <internal_size_type ElementSize, internal_size_type IntMem,
++ external_size_type MaxItems, internal_size_type BlockSize,
++ unsigned_type m_, bool stop = false>
+ struct find_B_m
+ {
+- typedef find_B_m<E_, IntMem_, MaxItems, B_, m_, stop> Self;
+-
+- static const unsigned_type k = IntMem_ / B_; // number of blocks that fit into M
+- static const unsigned_type element_size = E_; // element size
+- static const internal_size_type IntMem = IntMem_;
+- static const unsigned_type B = B_; // block size
+- static const external_size_type m = m_; // number of blocks fitting into buffers
+- static const unsigned_type c = k - m_;
++ typedef find_B_m<ElementSize, IntMem,
++ MaxItems, BlockSize, m_, stop> self_type;
++
++ //! element size
++ static const internal_size_type element_size = ElementSize;
++ //! internal memory size of PQ
++ static const internal_size_type intmem = IntMem;
++ //! block size (iterates from 8 MiB downwards)
++ static const internal_size_type B = BlockSize;
++
++ //! number of blocks that fit into internal memory (M)
++ static const internal_size_type k = IntMem / BlockSize;
++ //! number of blocks fitting into buffers of mergers (arity of both
++ //! mergers), increased from 1 to 2048 ?-tb
++ static const internal_size_type m = m_;
++ //! remaining blocks, (freely moving, not necessarily unused) ?-tb
++ static const int_type c = k - m_;
++
+ // memory occupied by block must be at least 10 times larger than size of ext sequence
+- // && satisfy memory req && if we have two ext mergers their degree must be at least 64=m/2
+- static const external_size_type fits = (c > 10) &&
+- (((k - m) * (m) * (m * B / (element_size * 4 * 1024))) >= MaxItems) &&
+- ((MaxItems < ((k - m) * m / (2 * element_size)) * 1024) || m >= 128);
++
++ //! calculated boolean whether the configuration fits into internal memory.
++ static const external_size_type fits =
++ // need some temporary constant-size internal blocks
++ (c > 10) &&
++ // satisfy items requirement
++ (((k - m) * m * (m * B / (ElementSize * 4 * 1024))) >= MaxItems) &&
++ // if we have two ext mergers their degree must be at least 64=m/2
++ ((MaxItems < ((k - m) * m / (2 * ElementSize)) * 1024) || m >= 128);
++
+ static const unsigned_type step = 1;
+
+- typedef typename find_B_m<element_size, IntMem, MaxItems, B, m + step, fits || (m >= k - step)>::result candidate1;
+- typedef typename find_B_m<element_size, IntMem, MaxItems, B / 2, 1, fits || candidate1::fits>::result candidate2;
+- typedef typename IF<fits, Self, typename IF<candidate1::fits, candidate1, candidate2>::result>::result result;
++ //! if not fits, recurse into configuration with +step more internal buffers
++ typedef typename find_B_m<ElementSize, IntMem, MaxItems, B,
++ m + step, fits || (m + step >= k)>::result candidate1;
++ //! if not fits, recurse into configuration with block size halved.
++ typedef typename find_B_m<ElementSize, IntMem, MaxItems, B / 2,
++ 1, fits || candidate1::fits>::result candidate2;
++
++ //! return a fitting configuration.
++ typedef typename IF<fits, self_type, typename IF<candidate1::fits, candidate1, candidate2>::result>::result result;
+ };
+
+ // specialization for the case when no valid parameters are found
+-template <unsigned_type E_, unsigned_type IntMem, unsigned_type MaxItems, bool stop>
+-struct find_B_m<E_, IntMem, MaxItems, 2048, 1, stop>
++template <internal_size_type ElementSize, internal_size_type IntMem,
++ external_size_type MaxItems, bool stop>
++struct find_B_m<ElementSize, IntMem, MaxItems, 2048, 1, stop>
+ {
+ enum { fits = false };
+ typedef Parameters_for_priority_queue_not_found_Increase_IntMem result;
+ };
+
+ // to speedup search
+-template <unsigned_type E_, unsigned_type IntMem, unsigned_type MaxItems, unsigned_type B_, unsigned_type m_>
+-struct find_B_m<E_, IntMem, MaxItems, B_, m_, true>
++template <internal_size_type ElementSize, internal_size_type IntMem,
++ external_size_type MaxItems, unsigned_type BlockSize,
++ unsigned_type m_>
++struct find_B_m<ElementSize, IntMem, MaxItems, BlockSize, m_, true>
+ {
+ enum { fits = false };
+ typedef dummy result;
+ };
+
+-// E_ size of element in bytes
+-template <unsigned_type E_, unsigned_type IntMem, unsigned_type MaxItems>
++// start search
++template <internal_size_type ElementSize, internal_size_type IntMem,
++ external_size_type MaxItems>
+ struct find_settings
+ {
+ // start from block size (8*1024*1024) bytes
+- typedef typename find_B_m<E_, IntMem, MaxItems, (8* 1024* 1024), 1>::result result;
++ typedef typename find_B_m<ElementSize, IntMem,
++ MaxItems, (8* 1024* 1024), 1>::result result;
+ };
+
+ struct Parameters_not_found_Try_to_change_the_Tune_parameter
+--
+1.8.5.5
+
diff --git a/debian/patches/Skipping-compile-of-PQ-with-8-GiB-on-32-bit-systems-.patch b/debian/patches/Skipping-compile-of-PQ-with-8-GiB-on-32-bit-systems-.patch
new file mode 100644
index 0000000..b617c8a
--- /dev/null
+++ b/debian/patches/Skipping-compile-of-PQ-with-8-GiB-on-32-bit-systems-.patch
@@ -0,0 +1,39 @@
+Desrciption: Upstream patch to fix Priority queue on 32 bit systems
+Author: Timo Bergmann
+Date: Mon, 8 Sep 2014 15:25:38 +0200
+Applied-Upstream: Yes
+
+diff --git a/tools/benchmark_pqueue.cpp b/tools/benchmark_pqueue.cpp
+index b5e673f..ffb0383 100644
+--- a/tools/benchmark_pqueue.cpp
++++ b/tools/benchmark_pqueue.cpp
+@@ -265,8 +265,10 @@ int do_benchmark_pqueue_config(unsigned pqconfig, uint64 size, unsigned opseq)
+ return do_benchmark_pqueue<ValueType, 128, 128, 16>(size, opseq);
+ else if (pqconfig == 2)
+ return do_benchmark_pqueue<ValueType, 512, 512, 64>(size, opseq);
++#if __x86_64__ || __LP64__ || (__WORDSIZE == 64)
+ else if (pqconfig == 3)
+ return do_benchmark_pqueue<ValueType, 4096, 4096, 512>(size, opseq);
++#endif
+ else
+ return 0;
+ }
+@@ -304,7 +306,14 @@ int benchmark_pqueue(int argc, char* argv[])
+ cp.add_uint('t', "type", "Value type of tested priority queue:\n 1 = pair of uint32,\n 2 = pair of uint64 (default),\n 3 = 24 byte struct\n 0 = all of the above", type);
+
+ unsigned pqconfig = 2;
+- cp.add_uint('p', "pq", "Priority queue configuration to test:\n 1 = small (256 MiB RAM, 4 GiB elements)\n 2 = medium (1 GiB RAM, 16 GiB elements) (default)\n 3 = big (8 GiB RAM, 64 GiB elements)\n 0 = all of the above", pqconfig);
++ cp.add_uint('p', "pq",
++ "Priority queue configuration to test:\n"
++ "1 = small (256 MiB RAM, 4 GiB elements)\n"
++ "2 = medium (1 GiB RAM, 16 GiB elements) (default)\n"
++#if __x86_64__ || __LP64__ || (__WORDSIZE == 64)
++ "3 = big (8 GiB RAM, 64 GiB elements)\n"
++#endif
++ "0 = all of the above", pqconfig);
+
+ unsigned opseq = 1;
+ cp.add_uint('o', "opseq", "Operation sequence to perform:\n 1 = insert all, delete all (default)\n 2 = insert all, intermixed insert/delete\n 0 = all of the above", opseq);
+--
+1.8.5.5
+
diff --git a/debian/patches/disable-large-queue.patch b/debian/patches/disable-large-queue.patch
new file mode 100644
index 0000000..804af2e
--- /dev/null
+++ b/debian/patches/disable-large-queue.patch
@@ -0,0 +1,24 @@
+diff --git a/tools/benchmark_pqueue.cpp b/tools/benchmark_pqueue.cpp
+index b5e673f..42e12a5 100644
+--- a/tools/benchmark_pqueue.cpp
++++ b/tools/benchmark_pqueue.cpp
+@@ -265,8 +265,8 @@ int do_benchmark_pqueue_config(unsigned pqconfig, uint64 size, unsigned opseq)
+ return do_benchmark_pqueue<ValueType, 128, 128, 16>(size, opseq);
+ else if (pqconfig == 2)
+ return do_benchmark_pqueue<ValueType, 512, 512, 64>(size, opseq);
+- else if (pqconfig == 3)
+- return do_benchmark_pqueue<ValueType, 4096, 4096, 512>(size, opseq);
++# else if (pqconfig == 3)
++# return do_benchmark_pqueue<ValueType, 4096, 4096, 512>(size, opseq);
+ else
+ return 0;
+ }
+@@ -277,7 +277,7 @@ int do_benchmark_pqueue_type(unsigned type, unsigned pqconfig, uint64 size, unsi
+ {
+ do_benchmark_pqueue_type(1, pqconfig, size, opseq);
+ do_benchmark_pqueue_type(2, pqconfig, size, opseq);
+- do_benchmark_pqueue_type(3, pqconfig, size, opseq);
++# do_benchmark_pqueue_type(3, pqconfig, size, opseq);
+ return 1;
+ }
+ else if (type == 1)
diff --git a/debian/patches/series b/debian/patches/series
index af2cb74..963c5a4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
prefersvg.patch
change-cmake-options
+Fixing-integer-underflow-in-PQ-config-rewriting-PQ-t.patch
+Skipping-compile-of-PQ-with-8-GiB-on-32-bit-systems-.patch
diff --git a/debian/rules b/debian/rules
index 2950873..3bcbc3a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
%:
- dh $@ --parallel
+ CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ dh $@ --parallel
override_dh_auto_install:
dh_auto_install
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libstxxl1.git
More information about the debian-science-commits
mailing list