Skip to content

Commit 725c4ed

Browse files
author
Release Manager
committed
gh-39985: linbox patches for gcc-15 and Apple clang-17 Linbox needs patches for gcc-15 and Apple clang-17 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> - #39936: givaro update to 4.2.1 URL: #39985 Reported by: Dima Pasechnik Reviewer(s): David Coudert
2 parents 4719fe0 + 90b8952 commit 725c4ed

File tree

3 files changed

+402
-0
lines changed

3 files changed

+402
-0
lines changed

build/pkgs/linbox/patches/41.patch

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
From 4a1e1395804d4630ec556c61ba3f2cb67e140248 Mon Sep 17 00:00:00 2001
2+
From: Jean-Guillaume Dumas <[email protected]>
3+
Date: Thu, 5 Dec 2024 15:38:58 +0100
4+
Subject: [PATCH] solving issue #319
5+
6+
---
7+
linbox/vector/blas-subvector.h | 52 +++++++++++++++++-----------------
8+
tests/test-subvector.C | 6 ++++
9+
2 files changed, 32 insertions(+), 26 deletions(-)
10+
11+
diff --git a/linbox/vector/blas-subvector.h b/linbox/vector/blas-subvector.h
12+
index e1582723c3d4488504ca1473dec7260c33a06a23..8f290dd4362872a6b98a08b4e775ad66b5cde2dd 100644
13+
--- a/linbox/vector/blas-subvector.h
14+
+++ b/linbox/vector/blas-subvector.h
15+
@@ -1,6 +1,6 @@
16+
/* linbox/matrix/blas-vector.h
17+
* Copyright (C) 2013 the LinBox group
18+
- * 2019 Pascal Giorgi
19+
+ * 2019 Pascal Giorgi
20+
*
21+
* Written by :
22+
* Pascal Giorgi [email protected]
23+
@@ -45,7 +45,7 @@ namespace LinBox {
24+
// forward declaration
25+
template <class Field, class Storage>
26+
class BlasVector;
27+
-
28+
+
29+
30+
template <typename _Vector>
31+
class VectorEltPointer {
32+
@@ -61,7 +61,7 @@ namespace LinBox {
33+
typedef typename _Vector::Storage::const_reference reference;
34+
using Element=const typename _Vector::Field::Element;
35+
};
36+
-
37+
+
38+
template<class _Vector>
39+
class BlasSubvector {
40+
41+
@@ -88,7 +88,7 @@ namespace LinBox {
42+
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
43+
44+
protected:
45+
- pointer _ptr;
46+
+ pointer _ptr;
47+
size_t _size;
48+
size_t _inc;
49+
Field const*_field;
50+
@@ -101,7 +101,7 @@ namespace LinBox {
51+
//////////////////
52+
53+
BlasSubvector(){}
54+
-
55+
+
56+
/** Constructor from an existing @ref BlasVector and dimensions.
57+
* \param V Pointer to @ref BlasVector of which to construct subvector
58+
* \param beg Starting idx
59+
@@ -110,7 +110,7 @@ namespace LinBox {
60+
*/
61+
BlasSubvector (vectorType &V, size_t beg, size_t inc, size_t dim) :
62+
_ptr(V.getPointer()+beg), _size(dim), _inc(inc), _field(&V.field()) {}
63+
-
64+
+
65+
/** Constructor from an existing @ref BlasSubvector and dimensions.
66+
* \param V Pointer to @ref DenseSubector of which to construct subvector
67+
* \param beg Starting idx
68+
@@ -118,9 +118,9 @@ namespace LinBox {
69+
* \param inc distance between two element
70+
*/
71+
BlasSubvector (Self_t &V, size_t beg, size_t inc, size_t dim) :
72+
- _ptr(V.data()+beg), _size(dim), _inc(inc), _field(&V.field()) {}
73+
+ _ptr(V.getPointer()+beg), _size(dim), _inc(inc), _field(&V.field()) {}
74+
+
75+
76+
-
77+
/** Constructor from an existing @ref BlasVector
78+
* \param V Pointer to @ref BlasVector of which to construct submatrix
79+
*/
80+
@@ -132,17 +132,17 @@ namespace LinBox {
81+
*/
82+
BlasSubvector (const Field& F, pointer ptr, size_t inc, size_t dim) :
83+
_ptr(ptr), _size(dim), _inc(inc), _field(&F) {}
84+
-
85+
-
86+
+
87+
+
88+
89+
BlasSubvector (const Field& F, std::vector<Element>& v) :
90+
- _ptr(v.data()), _size(v.size()), _inc(1), _field(&F)
91+
+ _ptr(v.data()), _size(v.size()), _inc(1), _field(&F)
92+
{
93+
std::cerr<<"WARNING "<<__LINE__<<" ("<<__FILE__<<") : creating a BlasSubvector from a std::vector -> MUST BE DEPRECATED"<<std::endl;
94+
throw LinBoxError("Deprecated Subvector cstor from std::vector");
95+
}
96+
-
97+
-
98+
+
99+
+
100+
101+
/** Copy operator */
102+
BlasSubvector& operator= (const BlasSubvector& V){
103+
@@ -157,18 +157,18 @@ namespace LinBox {
104+
105+
template<class Vect>
106+
Self_t& copy(const Vect& A){
107+
- assert(_size == A.size());
108+
+ assert(_size == A.size());
109+
auto it=A.begin(); auto jt=begin();
110+
for( ; it!=A.end();++it,++jt)
111+
field().assign(*jt,*it);
112+
return *this;
113+
}
114+
-
115+
+
116+
//! Rebind operator
117+
template<typename _Tp1, typename _Rep2 = typename Rebind<Storage, _Tp1>::other>
118+
struct rebind {
119+
typedef BlasVector<_Tp1, _Rep2> other;
120+
-
121+
+
122+
void operator() (other & Ap, const Self_t& A) {
123+
typedef typename Self_t::const_iterator ConstSelfIterator ;
124+
typedef typename other::iterator OtherIterator ;
125+
@@ -180,14 +180,14 @@ namespace LinBox {
126+
}
127+
};
128+
129+
-
130+
+
131+
132+
/////////////////
133+
// ACCESSORS //
134+
/////////////////
135+
136+
const Field& field() const { return *_field;}
137+
-
138+
+
139+
// dimension of the vector
140+
size_t size() const{ return _size; }
141+
size_t max_size() const{ return _size; }
142+
@@ -203,14 +203,14 @@ namespace LinBox {
143+
* @return the inc value of the subvector
144+
*/
145+
size_t getInc() const {return _inc;}
146+
-
147+
+
148+
149+
void setEntry (size_t i, const Element &a_i){ field().assign(_ptr[i],a_i); }
150+
-
151+
+
152+
reference refEntry (size_t i){ return _ptr[i]; }
153+
154+
const_reference getEntry (size_t i) const { return _ptr[i]; }
155+
-
156+
+
157+
Element& getEntry (Element &x, size_t i) const{ return field().assign(x,_ptr[i]); }
158+
159+
// write
160+
@@ -226,7 +226,7 @@ namespace LinBox {
161+
case (Tag::FileFormat::Maple) :
162+
{
163+
os << '<' ;
164+
- for(size_t i=0; i<_size; i++){
165+
+ for(size_t i=0; i<_size; i++){
166+
field().write(os, *(_ptr+_inc*i));
167+
if (i != _size-1)
168+
os << ',' ;
169+
@@ -237,7 +237,7 @@ namespace LinBox {
170+
return os << "not implemented" ;
171+
}
172+
}
173+
-
174+
+
175+
//read
176+
std::istream &read ( std::istream &is, Tag::FileFormat fmt = Tag::FileFormat::Pretty ) {
177+
return is;
178+
@@ -275,10 +275,10 @@ namespace LinBox {
179+
const_reference front (void) const { return _ptr[0];}
180+
reference back (void) { return _ptr[(_size-1)*_inc];}
181+
const_reference back (void) const { return _ptr[(_size-1)*_inc];}
182+
-
183+
+
184+
bool empty() const {return (_size==0);}
185+
};
186+
-
187+
+
188+
template <class Vector>
189+
std::ostream& operator<< (std::ostream & os, const BlasSubvector<Vector> & V) {
190+
return V.write(os);
191+
@@ -296,7 +296,7 @@ namespace LinBox {
192+
193+
194+
195+
-
196+
+
197+
} // LinBox
198+
#endif
199+
// Local Variables:
200+
diff --git a/tests/test-subvector.C b/tests/test-subvector.C
201+
index be4850e23344c95f762c09d8fdfe2cdbbac896b2..fc1d2c658afdb4cf6a8338443e29d73b583de9f4 100644
202+
--- a/tests/test-subvector.C
203+
+++ b/tests/test-subvector.C
204+
@@ -752,6 +752,12 @@ static bool testSubvector3(Field &F, size_t n)
205+
//vector<int> ww(3, 77);
206+
w = ww;
207+
report << ww << std::endl;
208+
+
209+
+ report << "Constructing subvectors from subvector: ";
210+
+ subVector ww1(w, 0, 0, Length);
211+
+ report << ww1 << std::endl;
212+
+
213+
+
214+
#if 0
215+
report << "Constructing subvector from iterators: ";
216+
Subvect www(w.begin(), w.end());

build/pkgs/linbox/patches/42.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From d1f618fb0ee4a84be3ccddcfc28b257f34e1cbf7 Mon Sep 17 00:00:00 2001
2+
From: "Benjamin A. Beasley" <[email protected]>
3+
Date: Fri, 17 Jan 2025 14:25:19 -0500
4+
Subject: [PATCH] Fix a compiler error on GCC 15
5+
6+
Fixes https://github.com/linbox-team/linbox/issues/321.
7+
---
8+
linbox/matrix/sparsematrix/sparse-tpl-matrix-omp.h | 4 ++--
9+
1 file changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/linbox/matrix/sparsematrix/sparse-tpl-matrix-omp.h b/linbox/matrix/sparsematrix/sparse-tpl-matrix-omp.h
12+
index feca4cf35d41910759c564273cf12f30e150b853..c97b1c8c114f58b3f1be4fdc89cb3dae0f1d8dea 100644
13+
--- a/linbox/matrix/sparsematrix/sparse-tpl-matrix-omp.h
14+
+++ b/linbox/matrix/sparsematrix/sparse-tpl-matrix-omp.h
15+
@@ -318,9 +318,9 @@ class SparseMatrix<Field_, SparseMatrixFormat::TPL_omp> : public BlackboxInterfa
16+
typedef typename selfvec::const_iterator selfiter;
17+
otheriter vp_p; selfiter v_p;
18+
19+
- Ap.data_.resize(A.data.size());
20+
+ Ap.data_.resize(A.data_.size());
21+
for (v_p = A.data_.begin(), vp_p = Ap.data_.begin();
22+
- v_p != A.data.end(); ++ v_p, ++ vp_p)
23+
+ v_p != A.data_.end(); ++ v_p, ++ vp_p)
24+
hom.image (vp_p->elt, v_p->elt);
25+
}
26+
};

0 commit comments

Comments
 (0)