Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several errors with clang 19 #320

Open
thierry-FreeBSD opened this issue Jan 6, 2025 · 4 comments
Open

Several errors with clang 19 #320

thierry-FreeBSD opened this issue Jan 6, 2025 · 4 comments

Comments

@thierry-FreeBSD
Copy link

FreeBSD -CURRENT adopted clang 19, and this causes several compilation errors for linbox.
A full log is available at https://pkg-status.freebsd.org/beefy18/data/main-amd64-default/pf72088b8f67d_s3d0a0dda3a7/logs/linbox-1.7.0_5.log .
If it gets removed, here are some examples:

libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -isystem /usr/local/include -O2 -Wall -DNDEBUG -UDEBUG -I/usr/local/include -pthread -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -std=c++14 -MT diophantine-solver.lo -MD -MP -MF .deps/diophantine-solver.Tpo -c diophantine-solver.C  -fPIC -DPIC -o .libs/diophantine-solver.o
In file included from diophantine-solver.C:26:
In file included from ../../linbox/algorithms/diophantine-solver.h:29:
In file included from ../../linbox/algorithms/rational-solver.h:41:
In file included from ../../linbox/solutions/methods.h:26:
In file included from ../../linbox/matrix/dense-matrix.h:85:
In file included from ../../linbox/matrix/densematrix/blas-matrix.h:42:
In file included from ../../linbox/vector/blas-vector.h:47:
../../linbox/vector/blas-subvector.h:121:20: error: no member named 'data' in 'BlasSubvector<_Vector>'
  121 |             _ptr(V.data()+beg), _size(dim), _inc(inc), _field(&V.field()) {}
      |                  ~ ^

Or

In file included from diophantine-solver.C:26:
In file included from ../../linbox/algorithms/diophantine-solver.h:29:
In file included from ../../linbox/algorithms/rational-solver.h:44:
In file included from ../../linbox/blackbox/lambda-sparse.h:29:
In file included from ../../linbox/matrix/sparse-matrix.h:76:
../../linbox/matrix/sparsematrix/sparse-ell-matrix.h:1216:16: error: cannot assign to non-static data member '_ld' with const-qualified type 'const size_t &' (aka 'const unsigned long &')
 1216 |                                 _ld        = iter._ld ;
      |                                 ~~~        ^

Or

In file included from diophantine-solver.C:26:
In file included from ../../linbox/algorithms/diophantine-solver.h:29:
In file included from ../../linbox/algorithms/rational-solver.h:44:
In file included from ../../linbox/blackbox/lambda-sparse.h:29:
In file included from ../../linbox/matrix/sparse-matrix.h:77:
../../linbox/matrix/sparsematrix/sparse-ellr-matrix.h:1108:12: error: no viable overloaded '='
 1108 |                                 _rowid = iter._rowid;
      |                                 ~~~~~~ ^ ~~~~~~~~~~~
/usr/include/c++/v1/vector:546:63: note: candidate function not viable: 'this' argument has type 'const std::vector<size_t>' (aka 'const vector<unsigned long>'), but method is not marked const
  546 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(const vector& __x);
      |                                                               ^
/usr/include/c++/v1/vector:554:63: note: candidate function not viable: 'this' argument has type 'const std::vector<size_t>' (aka 'const vector<unsigned long>'), but method is not marked const
  554 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(initializer_list<value_type> __il) {
      |                                                               ^
/usr/include/c++/v1/vector:569:63: note: candidate function not viable: 'this' argument has type 'const std::vector<size_t>' (aka 'const vector<unsigned long>'), but method is not marked const
  569 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector& operator=(vector&& __x)
      |                                                               ^

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jan 11, 2025
@musicinmybrain
Copy link
Contributor

musicinmybrain commented Jan 17, 2025

I’m also seeing something simlar to the first error in Fedora with GCC 15 (now that I’ve patched givaro with linbox-team/givaro#233).

In file included from /usr/include/c++/15/string:51,
                 from /usr/include/c++/15/bits/locale_classes.h:42,
                 from /usr/include/c++/15/bits/ios_base.h:43,
                 from /usr/include/c++/15/ios:46,
                 from /usr/include/c++/15/ostream:42,
                 from /usr/include/c++/15/iostream:43,
                 from ../../linbox/linbox-config.h:45,
                 from diophantine-solver.C:25:
/usr/include/c++/15/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
In file included from ../../linbox/vector/blas-vector.h:47,
                 from ../../linbox/matrix/densematrix/blas-matrix.h:42,
                 from ../../linbox/matrix/dense-matrix.h:85:
../../linbox/vector/blas-subvector.h: In constructor 'LinBox::BlasSubvector<_Vector>::BlasSubvector(Self_t&, size_t, size_t, size_t)':
../../linbox/vector/blas-subvector.h:121:20: error: 'LinBox::BlasSubvector<_Vector>::Self_t' has no member named 'data'; did you mean 'at'? [-Wtemplate-body]
  121 |             _ptr(V.data()+beg), _size(dim), _inc(inc), _field(&V.field()) {}
      |                    ^~~~
      |                    at

@musicinmybrain
Copy link
Contributor

I’m also seeing something simlar to the first error in Fedora with GCC 15 (now that I’ve patched givaro with linbox-team/givaro#233).

Ah, found it! #319

@thierry-FreeBSD
Copy link
Author

Next errors detected with clang-19: see linbox-team/givaro#233 (comment)

nanorkyo pushed a commit to nanorkyo/freebsd-ports that referenced this issue Jan 18, 2025
nanorkyo pushed a commit to nanorkyo/freebsd-ports that referenced this issue Jan 18, 2025
@thierry-FreeBSD
Copy link
Author

FYI, this problem has been solved by Dimitry Andric [email protected].
His patches are available at https://bugs.freebsd.org/bugzilla/attachment.cgi?id=256800&action=diff .
Remark: this requires also a patch for Givaro, available at https://bugs.freebsd.org/bugzilla/attachment.cgi?id=256810&action=diff .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants