readmapping / essaMEM

essaMEM is an algorithm for calculating maximal exact matches using enhanced sparse suffix arrays
Other
2 stars 4 forks source link

Fails to compile on linux #2

Open ksahlin opened 4 years ago

ksahlin commented 4 years ago
(py36) [ksahlin@rackham essaMEM]$ make
g++ -MM mummer.cpp qsufsort.c sparseSA.cpp fasta.cpp > .depend
g++ -O3 -DNDEBUG -Wall -c mummer.cpp
In file included from mummer.cpp:6:
sparseSA.hpp: In member function ‘long int sparseSA::index_size_in_bytes()’:
sparseSA.hpp:110:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
       for(int i = 0; i < descr.size(); i++){
                      ~~^~~~~~~~~~~~~~
mummer.cpp: In function ‘void* query_thread(void*)’:
mummer.cpp:92:10: error: reference to ‘forward’ is ambiguous
       if(forward){
          ^~~~~~~
In file included from /usr/include/c++/8/bits/nested_exception.h:40,
                 from /usr/include/c++/8/exception:144,
                 from /usr/include/c++/8/ios:39,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iostream:39,
                 from mummer.cpp:1:
/usr/include/c++/8/bits/move.h:85:5: note: candidates are: ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&&)’
     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
     ^~~~~~~
/usr/include/c++/8/bits/move.h:74:5: note:                 ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&)’
     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
     ^~~~~~~
mummer.cpp:29:6: note:                 ‘bool forward’
 bool forward = true;
      ^~~~~~~
mummer.cpp:144:10: error: reference to ‘forward’ is ambiguous
       if(forward){
          ^~~~~~~
In file included from /usr/include/c++/8/bits/nested_exception.h:40,
                 from /usr/include/c++/8/exception:144,
                 from /usr/include/c++/8/ios:39,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iostream:39,
                 from mummer.cpp:1:
/usr/include/c++/8/bits/move.h:85:5: note: candidates are: ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&&)’
     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
     ^~~~~~~
/usr/include/c++/8/bits/move.h:74:5: note:                 ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&)’
     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
     ^~~~~~~
mummer.cpp:29:6: note:                 ‘bool forward’
 bool forward = true;
      ^~~~~~~
mummer.cpp: In function ‘int main(int, char**)’:
mummer.cpp:290:7: error: reference to ‘forward’ is ambiguous
       forward = false;
       ^~~~~~~
In file included from /usr/include/c++/8/bits/nested_exception.h:40,
                 from /usr/include/c++/8/exception:144,
                 from /usr/include/c++/8/ios:39,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iostream:39,
                 from mummer.cpp:1:
/usr/include/c++/8/bits/move.h:85:5: note: candidates are: ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&&)’
     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
     ^~~~~~~
/usr/include/c++/8/bits/move.h:74:5: note:                 ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&)’
     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
     ^~~~~~~
mummer.cpp:29:6: note:                 ‘bool forward’
 bool forward = true;
      ^~~~~~~
make: *** [Makefile:10: mummer.o] Error 1
chenzhiw commented 2 years ago

There is a std::forward in C++ std library, in conflict with forward variable in mummer.cpp which cause this problem. Just replace the variable forward to another name such as Forward or forward_ can slove this problem.

1