[linbox] Rebuild for GCC 4.7.
Jerry James
jjames at fedoraproject.org
Mon Jan 9 23:54:44 UTC 2012
commit 33999d230a7ce93d41c656e9b0ca4dfd6e686d8d
Author: Jerry James <loganjerry at gmail.com>
Date: Mon Jan 9 16:54:35 2012 -0700
Rebuild for GCC 4.7.
linbox-gcc47.patch | 359 ++++++++++++++++++++++++++++++++++++++++++++++++++++
linbox.spec | 7 +-
2 files changed, 365 insertions(+), 1 deletions(-)
---
diff --git a/linbox-gcc47.patch b/linbox-gcc47.patch
new file mode 100644
index 0000000..0162739
--- /dev/null
+++ b/linbox-gcc47.patch
@@ -0,0 +1,359 @@
+--- ./interfaces/driver/lb-blackbox-functor.h.orig 2011-10-28 02:48:13.000000000 -0600
++++ ./interfaces/driver/lb-blackbox-functor.h 2012-01-09 16:34:50.101676361 -0700
+@@ -52,7 +52,7 @@ public:
+ * Macro for automatic code generation *
+ ***************************************/
+ #define LB_BLACKBOX_VISIT(B) \
+-void visit(const B &d){apply(d);}
++void visit(const B &d){this->apply(d);}
+
+
+ /**********************************************************************************
+--- ./interfaces/driver/lb-domain-functor.h.orig 2011-10-28 02:48:13.000000000 -0600
++++ ./interfaces/driver/lb-domain-functor.h 2012-01-09 16:34:50.102676447 -0700
+@@ -51,7 +51,7 @@ public:
+ * Macro for automatic code generation *
+ ***************************************/
+ #define LB_DOMAIN_VISIT(D) \
+-void visit(const DomainEnvelope<D> &d){apply(d);}
++void visit(const DomainEnvelope<D> &d){this->apply(d);}
+
+
+ /*******************************************************************************
+--- ./interfaces/driver/lb-vector-functor.h.orig 2011-10-28 02:48:13.000000000 -0600
++++ ./interfaces/driver/lb-vector-functor.h 2012-01-09 16:34:50.104676614 -0700
+@@ -53,7 +53,7 @@ public:
+ * Macro for automatic code generation *
+ ***************************************/
+ #define LB_VECTOR_VISIT(B) \
+- void visit(const B &d){apply(d);}
++ void visit(const B &d){this->apply(d);}
+
+
+ /**********************************************************************************
+--- ./linbox/algorithms/blackbox-container-symmetric.h.orig 2011-10-28 02:48:12.000000000 -0600
++++ ./linbox/algorithms/blackbox-container-symmetric.h 2012-01-09 16:34:50.105676693 -0700
+@@ -43,10 +43,10 @@ namespace LinBox
+ template<class Vector>
+ BlackboxContainerSymmetric (const Blackbox *D, const Field &F, const Vector &u0) :
+ BlackboxContainerBase<Field, _Blackbox> (D, F)
+- { init (u0, u0); }
++ { this->init (u0, u0); }
+ BlackboxContainerSymmetric (const Blackbox *D, const Field &F, RandIter &g) :
+ BlackboxContainerBase<Field, _Blackbox> (D, F)
+- { init (g); }
++ { this->init (g); }
+
+ protected:
+
+--- ./linbox/algorithms/cra-full-multip-fixed.h.orig 2011-10-28 02:48:12.000000000 -0600
++++ ./linbox/algorithms/cra-full-multip-fixed.h 2012-01-09 16:34:50.107676845 -0700
+@@ -236,7 +236,7 @@ namespace LinBox
+ // It is the only shelf of the radix
+ // We normalize the result and output it
+ for( ; t_it != _tab_it->end(); ++t0_it, ++t_it)
+- normalize(*t0_it = *t_it, *t_it,
++ this->normalize(*t0_it = *t_it, *t_it,
+ _mod_it->operator()());
+ this->RadixPrimeProd_.resize(1);
+ return d;
+@@ -483,7 +483,7 @@ namespace LinBox
+ // It is the only shelf of the radix
+ // We normalize the result and output it
+ for( ; t_it != _tab_it->end(); ++t0_it, ++t_it)
+- normalize(*t0_it = *t_it, *t_it,
++ this->normalize(*t0_it = *t_it, *t_it,
+ _mod_it->operator()());
+ this->RadixPrimeProd_.resize(1);
+ return d;
+--- ./linbox/util/formats/matrix-market.h.orig 2011-10-28 02:48:12.000000000 -0600
++++ ./linbox/util/formats/matrix-market.h 2012-01-09 16:34:50.108676918 -0700
+@@ -150,7 +150,7 @@ namespace LinBox
+ --j;
+ if( i >= this->_m || j >= this->_n )
+ return BAD_FORMAT;
+- if( symmetric && (i != j) ) saveTriple(j,i,v);
++ if( symmetric && (i != j) ) this->saveTriple(j,i,v);
+
+ return GOOD;
+ }
+--- ./linbox/matrix/matrix-domain.h.orig 2011-10-28 02:48:12.000000000 -0600
++++ ./linbox/matrix/matrix-domain.h 2012-01-09 16:34:50.109676989 -0700
+@@ -997,7 +997,7 @@ namespace LinBox
+ VectorCategories::DenseVectorTag,
+ VectorCategories::DenseVectorTag) const
+ {
+- return mulColDense (_VD, w, A, v);
++ return this->mulColDense (_VD, w, A, v);
+ }
+ template <class Vector1, class Matrix, class Vector2>
+ Vector1 &mulColSpecialized (Vector1 &w, const Matrix &A, const Vector2 &v,
+--- ./linbox/field/Givaro/givaro-field.h.orig 2011-10-28 02:48:12.000000000 -0600
++++ ./linbox/field/Givaro/givaro-field.h 2012-01-09 16:34:50.110677059 -0700
+@@ -42,8 +42,8 @@ namespace LinBox
+ {
+ this->init(zero,0UL);
+ this->init(one, 1UL);
+- init(mone);
+- neg(mone,one);
++ this->init(mone);
++ this->neg(mone,one);
+ }
+
+ GivaroField(const BaseField& bf) :
+@@ -51,8 +51,8 @@ namespace LinBox
+ {
+ this->init(zero,0UL);
+ this->init(one, 1UL);
+- init(mone);
+- neg(mone,one);
++ this->init(mone);
++ this->neg(mone,one);
+ // neg(init(mone),one);
+ }
+
+@@ -75,7 +75,7 @@ namespace LinBox
+ Rep& axmyin (Rep& r, const Rep a, const Rep x) const
+ {
+ maxpyin(r,a,x);
+- return negin(r);
++ return this->negin(r);
+ }
+
+ // -- maxpyin: r <- r - a * x
+--- ./linbox/blackbox/companion.h.orig 2011-10-28 02:48:12.000000000 -0600
++++ ./linbox/blackbox/companion.h 2012-01-09 16:34:50.112677193 -0700
+@@ -31,12 +31,12 @@ namespace LinBox
+ { size_t n = P.size() - 1;
+ const size_t indexbase = 1;
+ typename Field::Element one; F.init(one, 1);
+- for (size_t i = 1; i < n; ++i) addEntry(one, i+indexbase, i-1+indexbase);
++ for (size_t i = 1; i < n; ++i) this->addEntry(one, i+indexbase, i-1+indexbase);
+ for (size_t i = 0; i < n; ++i)
+ { typename Field::Element x;
+ F.init(x, 0);
+ F.neg(x, P[i]);
+- addEntry(x, i+indexbase, n-1+indexbase);
++ this->addEntry(x, i+indexbase, n-1+indexbase);
+ }
+ }// Companion cstor
+
+--- ./tests/test-field.h.orig 2011-10-28 02:48:13.000000000 -0600
++++ ./tests/test-field.h 2012-01-09 16:37:58.921941742 -0700
+@@ -818,25 +818,6 @@ bool testFreshmansDream (const Field &F,
+
+ /* Tests of field features */
+
+-/** Generic test 7: Consistency of in-place and out-of-place arithmetic
+- *
+- * Generates random elements 'a' and 'b' and performs all basic arithmetic
+- * operations in-place and out-of-place, checking for consistency.
+- *
+- * Div and inv are checked in a separate function.
+- */
+-
+-template <class Field>
+-bool testArithmeticConsistency (const Field &F, const char *name, unsigned int iterations)
+-{
+- bool ret = true ;
+-
+- ret &= testRingArithmeticConsistency(F, name, iterations) ;
+- ret &= testInvDivConsistency(F, name, iterations);
+-
+- return ret;
+-}
+-
+ template <class Field>
+ bool testRingArithmeticConsistency (const Field &F, const char *name, unsigned int iterations)
+ {
+@@ -1041,6 +1022,25 @@ bool testInvDivConsistency (const Field
+ return ret;
+ }
+
++/** Generic test 7: Consistency of in-place and out-of-place arithmetic
++ *
++ * Generates random elements 'a' and 'b' and performs all basic arithmetic
++ * operations in-place and out-of-place, checking for consistency.
++ *
++ * Div and inv are checked in a separate function.
++ */
++
++template <class Field>
++bool testArithmeticConsistency (const Field &F, const char *name, unsigned int iterations)
++{
++ bool ret = true ;
++
++ ret &= testRingArithmeticConsistency(F, name, iterations) ;
++ ret &= testInvDivConsistency(F, name, iterations);
++
++ return ret;
++}
++
+ /** Generic test 8: Consistency of axpy
+ *
+ * Generates random elements 'a', 'x', and 'y' and checks that a * x + y is the
+@@ -1130,31 +1130,6 @@ bool testRanditerBasic(const Field &F, c
+ }
+
+
+-/* Convenience function to run all of the field tests on a given field */
+-
+-template <class Field>
+-bool runFieldTests (const Field &F, const char *desc, unsigned int iterations, size_t n, bool runCharacteristicTest = true)
+- // n is not used.
+-{
+-
+- ostringstream str;
+-
+- str << "\t--Testing " << desc << " field" << ends;
+- char * st = new char[str.str().size()];
+- strcpy (st, str.str().c_str());
+- commentator.start (st, "runFieldTests");
+- bool ret = runBasicRingTests(F, desc, iterations, runCharacteristicTest) ;
+- ret &= testInvDivConsistency(F, desc, iterations) ;
+- ret &= testFieldInversion (F, desc, iterations) ;
+- ret &= testFieldCommutativity (F, desc, iterations) ;
+- ret &= testFreshmansDream(F, desc, iterations);
+- ret &= testRingTrivia(F,desc);
+-
+- commentator.stop (MSG_STATUS (ret));
+- delete[] st;
+- return ret;
+-}
+-
+ template <class Field>
+ bool runBasicRingTests (const Field &F, const char *desc, unsigned int iterations, bool runCharacteristicTest = true)
+ {
+@@ -1199,46 +1174,33 @@ bool runBasicRingTests (const Field &F,
+ return pass;
+ }
+
+-/// @name Generic field tests
+-//@{
+-/** Random number test
+- *
+- * Test that the random iterator over the given field works.
+- *
+- * Test up to five times, accepting any one, to increase probability of
+- * passing statistical tests.
+- */
++/* Convenience function to run all of the field tests on a given field */
++
+ template <class Field>
+-bool testRandomIterator (const Field &F, const char *text,
+- unsigned int num_trials,
+- unsigned int num_categories,
+- unsigned int hist_len)
++bool runFieldTests (const Field &F, const char *desc, unsigned int iterations, size_t n, bool runCharacteristicTest = true)
++ // n is not used.
+ {
+- std::ostringstream str;
+
+- str << "\t--Testing " << text << "::RandIter" << std::ends;
++ ostringstream str;
++
++ str << "\t--Testing " << desc << " field" << ends;
+ char * st = new char[str.str().size()];
+ strcpy (st, str.str().c_str());
++ commentator.start (st, "runFieldTests");
++ bool ret = runBasicRingTests(F, desc, iterations, runCharacteristicTest) ;
++ ret &= testInvDivConsistency(F, desc, iterations) ;
++ ret &= testFieldInversion (F, desc, iterations) ;
++ ret &= testFieldCommutativity (F, desc, iterations) ;
++ ret &= testFreshmansDream(F, desc, iterations);
++ ret &= testRingTrivia(F,desc);
+
+- commentator.start (st, "testRandomIterator");
+-
+- std::ostream &report = commentator.report (LinBox::Commentator::LEVEL_NORMAL, INTERNAL_DESCRIPTION);
+-
+- /* This test either passes or runs a lot of times */
+- for (int i = 1;
+- (! testRandomIteratorStep (F, text, num_trials, num_categories, hist_len)) && (i < 20) ;
+- ++i ){
+- if (0 == i % 10)
+- report << "Warning! Probable failure of uniformity" << std::endl;
+- };
+-
+- commentator.stop (MSG_STATUS (true), (const char *) 0, "testRandomIterator");
+-
++ commentator.stop (MSG_STATUS (ret));
+ delete[] st;
+- return true;
+-
++ return ret;
+ }
+
++/// @name Generic field tests
++//@{
+ /* Random number test
+ *
+ * Test that the random iterator over the given field works
+@@ -1356,5 +1318,43 @@ bool testRandomIteratorStep (const Field
+ //commentator.stop (MSG_STATUS (ret), (const char *) 0, "testRandomIteratorStep");
+ return ret;
+ }
++
++/** Random number test
++ *
++ * Test that the random iterator over the given field works.
++ *
++ * Test up to five times, accepting any one, to increase probability of
++ * passing statistical tests.
++ */
++template <class Field>
++bool testRandomIterator (const Field &F, const char *text,
++ unsigned int num_trials,
++ unsigned int num_categories,
++ unsigned int hist_len)
++{
++ std::ostringstream str;
++
++ str << "\t--Testing " << text << "::RandIter" << std::ends;
++ char * st = new char[str.str().size()];
++ strcpy (st, str.str().c_str());
++
++ commentator.start (st, "testRandomIterator");
++
++ std::ostream &report = commentator.report (LinBox::Commentator::LEVEL_NORMAL, INTERNAL_DESCRIPTION);
++
++ /* This test either passes or runs a lot of times */
++ for (int i = 1;
++ (! testRandomIteratorStep (F, text, num_trials, num_categories, hist_len)) && (i < 20) ;
++ ++i ){
++ if (0 == i % 10)
++ report << "Warning! Probable failure of uniformity" << std::endl;
++ };
++
++ commentator.stop (MSG_STATUS (true), (const char *) 0, "testRandomIterator");
++
++ delete[] st;
++ return true;
++
++}
+ //@}
+ #endif // __LINBOX_test_field_H
+--- ./tests/test-common.h.orig 2012-01-09 16:34:45.565609259 -0700
++++ ./tests/test-common.h 2012-01-09 16:34:50.116677442 -0700
+@@ -34,10 +34,6 @@ using namespace std;
+ #include "fflas-ffpack/utils/args-parser.h"
+
+ template <class Field, class Vector>
+-void printVector (Field &F, ostream &output, const Vector &v)
+-{ printVectorSpecialized(F, output, v, typename LinBox::VectorTraits<Vector>::VectorCategory()); }
+-
+-template <class Field, class Vector>
+ void printVectorSpecialized(
+ Field &F,
+ ostream &output,
+@@ -109,6 +105,10 @@ void printVectorSpecialized(
+ }
+
+ template <class Field, class Vector>
++void printVector (Field &F, ostream &output, const Vector &v)
++{ printVectorSpecialized(F, output, v, typename LinBox::VectorTraits<Vector>::VectorCategory()); }
++
++template <class Field, class Vector>
+ bool areVectorsEqual (Field &F, const Vector &v, const Vector &w)
+ {
+ return areVectorsEqualSpecialized(F, v, w, LinBox::VectorTraits<Vector>::VectorCategory());
diff --git a/linbox.spec b/linbox.spec
index 77c80aa..4ddf2f2 100644
--- a/linbox.spec
+++ b/linbox.spec
@@ -1,6 +1,6 @@
Name: linbox
Version: 1.2.2
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: C++ Library for High-Performance Exact Linear Algebra
Group: Development/Libraries
License: LGPLv2+
@@ -8,6 +8,7 @@ URL: http://www.linalg.org/
Source0: http://www.linalg.org/%{name}-%{version}.tar.gz
# Sent upstream 2 Nov 2011. Fix double frees that crash all tests.
Patch0: linbox-destructor.patch
+Patch1: linbox-gcc47.patch
BuildRequires: atlas-devel
BuildRequires: fflas-ffpack-devel
@@ -53,6 +54,7 @@ Documentation for %{name}.
%prep
%setup -q
%patch0
+%patch1
# Fix up missing and extraneous library linkage
sed -e "s|\$(GMP_LIBS) \$(NTL_LIBS) \$(BLAS_LIBS)|-L%{_libdir}/atlas \$(NTL_LIBS) -lcblas|" \
@@ -117,6 +119,9 @@ LD_LIBRARY_PATH=`pwd`/linbox/.libs make %{?_smp_mflags} check
%changelog
+* Mon Jan 9 2012 Jerry James <loganjerry at gmail.com> - 1.2.2-3
+- Rebuild for GCC 4.7
+
* Wed Nov 9 2011 Jerry James <loganjerry at gmail.com> - 1.2.2-2
- New -destructor patch that doesn't cause memory leaks
More information about the scm-commits
mailing list