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

Compiling failure on Gentoo Linux + gcc 12/13(with master and v2.1.16 branch) #234

Open
2403772980ygy opened this issue Sep 18, 2023 · 0 comments · May be fixed by #239
Open

Compiling failure on Gentoo Linux + gcc 12/13(with master and v2.1.16 branch) #234

2403772980ygy opened this issue Sep 18, 2023 · 0 comments · May be fixed by #239
Labels
bug Something isn't working

Comments

@2403772980ygy
Copy link

QPanda

基本信息

  • QPanda 版本: v2.1.16
  • 操作系统: Gentoo Linux

Bug是什么?

Can not compile, with both Ninja and make as cmake generator.

复现Bug的步骤?

mkdir -p build
cd build
cmake -DFIND_CUDA=OFF -DUSE_PYQPANDA=OFF -DUSE_CHEMIQ=OFF
make -j12

The above commands yields the following errors.

/home/erina/build/QPanda-2/Core/VirtualQuantumProcessor/SparesQVM/SparseQVM.cpp: In member function ‘void QPanda::SparseSimulator::SWAP(size_t, size_t)’:
/home/erina/build/QPanda-2/Core/VirtualQuantumProcessor/SparesQVM/SparseQVM.cpp:817:14: error: no matching function for call to ‘swap(std::vector<bool>::reference, std::vector<bool>::reference)’
  817 |     std::swap(_queue_Ry[index_1], _queue_Ry[index_2]);
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/new_allocator.h:36,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/allocator.h:46,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/string:41,
                 from /home/erina/build/QPanda-2/include/Core/VirtualQuantumProcessor/SparseQVM/SparseQVM.h:4,
                 from /home/erina/build/QPanda-2/Core/VirtualQuantumProcessor/SparesQVM/SparseQVM.cpp:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/move.h:196:5: note: candidate: ‘std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = _Bit_reference; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]’ (near match)
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/move.h:196:5: note:   conversion of argument 2 would be ill-formed:
/home/erina/build/QPanda-2/Core/VirtualQuantumProcessor/SparesQVM/SparseQVM.cpp:817:52: error: cannot bind non-const lvalue reference of type ‘std::_Bit_reference&’ to an rvalue of type ‘std::vector<bool>::reference’
  817 |     std::swap(_queue_Ry[index_1], _queue_Ry[index_2]);
      |                                   ~~~~~~~~~~~~~~~~~^
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/move.h:220:5: note: candidate: ‘template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])’
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~

(A lot of lines truncated, most of them indicating errors about the swap function)

建议的解决方案

@2403772980ygy 2403772980ygy added the bug Something isn't working label Sep 18, 2023
@DerryAlex DerryAlex linked a pull request May 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant