Macaulay2 / mathicgb

Compute (signature) Groebner bases using the fast datastructures from mathic.
2 stars 4 forks source link

Fails to build using gcc 11 #25

Closed d-torrance closed 3 years ago

d-torrance commented 3 years ago

From Debian bug #984231:

In file included from src/mathicgb/SparseMatrix.hpp:6,
                 from src/mathicgb/SparseMatrix.cpp:4:
src/mathicgb/RawVector.hpp: In member function ‘mgb::RawVector<T>::size_type mgb::RawVector<T>::max_size() const’:
src/mathicgb/RawVector.hpp:109:43: error: ‘numeric_limits’ is not a member of ‘std’
  109 |   size_type max_size() const {return std::numeric_limits<size_type>::max();}
      |                                           ^~~~~~~~~~~~~~
src/mathicgb/RawVector.hpp:109:67: error: expected primary-expression before ‘>’ token
  109 |   size_type max_size() const {return std::numeric_limits<size_type>::max();}
      |                                                                   ^
src/mathicgb/RawVector.hpp:109:70: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  109 |   size_type max_size() const {return std::numeric_limits<size_type>::max();}
      |                                                                      ^~~
      |                                                                      std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from src/mathicgb/RawVector.hpp:10,
                 from src/mathicgb/SparseMatrix.hpp:6,
                 from src/mathicgb/SparseMatrix.cpp:4:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
d-torrance commented 3 years ago

I thought maybe this might be related to the bump to C++17 in gcc 11, but compiling with gcc 10 and -std=gnu++17 works just fine.

d-torrance commented 3 years ago

I did reproduce the issue in a Debian experimental chroot. Fortunately, the fix is very simple!

d-torrance commented 3 years ago

This was fixed in cdace24982db137ea7 from #28.