commaai / opendbc

a Python API for your car
MIT License
1.9k stars 1.11k forks source link

Build fails due to ostream_iterator #643

Closed bulvara closed 2 years ago

bulvara commented 2 years ago

Clang 13 / GCC 12.1

clang++ -o opendbc/can/common.os -c -std=c++1z -DSWAGLOG="\"common/swaglog.h\"" -DDBC_FILE_PATH='"./openpilot/opendbc"' -g -fPIC -O2 -Wunused -Werror -Wshadow -Wno-unknown-warning-option -Wno-deprecated-register -Wno-register -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-reorder-init-list -Wno-error=unused-but-set-variable -DSWAGLOG="\"common/swaglog.h\"" -fPIC -I. -Ithird_party/acados/include -Ithird_party/acados/include/blasfeo/include -Ithird_party/acados/include/hpipm/include -Ithird_party/catch2/include -Ithird_party/libyuv/include -Ithird_party/json11 -Ithird_party/curl/include -Ithird_party/libgralloc/include -Ithird_party/android_frameworks_native/include -Ithird_party/android_hardware_libhardware/include -Ithird_party/android_system_core/include -Ithird_party/linux/include -Ithird_party/snpe/include -Ithird_party/mapbox-gl-native-qt/include -Ithird_party/qrcode -Ithird_party -Icereal -Iopendbc/can opendbc/can/common.cc
clang++ -o opendbc/can/dbc.os -c -std=c++1z -DSWAGLOG="\"common/swaglog.h\"" -DDBC_FILE_PATH='"./openpilot/opendbc"' -g -fPIC -O2 -Wunused -Werror -Wshadow -Wno-unknown-warning-option -Wno-deprecated-register -Wno-register -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-reorder-init-list -Wno-error=unused-but-set-variable -DSWAGLOG="\"common/swaglog.h\"" -fPIC -I. -Ithird_party/acados/include -Ithird_party/acados/include/blasfeo/include -Ithird_party/acados/include/hpipm/include -Ithird_party/catch2/include -Ithird_party/libyuv/include -Ithird_party/json11 -Ithird_party/curl/include -Ithird_party/libgralloc/include -Ithird_party/android_frameworks_native/include -Ithird_party/android_hardware_libhardware/include -Ithird_party/android_system_core/include -Ithird_party/linux/include -Ithird_party/snpe/include -Ithird_party/mapbox-gl-native-qt/include -Ithird_party/qrcode -Ithird_party -Icereal -Iopendbc/can opendbc/can/dbc.cc
opendbc/can/dbc.cc:191:50: error: no template named 'ostream_iterator' in namespace 'std'; did you mean 'ostreambuf_iterator'?
      std::copy(words.begin(), words.end(), std::ostream_iterator<std::string>(s, " "));
                                            ~~~~~^~~~~~~~~~~~~~~~
                                                 ostreambuf_iterator
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/streambuf_iterator.h:248:11: note: 'ostreambuf_iterator' declared here
    class ostreambuf_iterator
          ^
opendbc/can/dbc.cc:191:45: error: no matching constructor for initialization of 'std::ostreambuf_iterator<std::string>' (aka 'ostreambuf_iterator<basic_string<char>>')
      std::copy(words.begin(), words.end(), std::ostream_iterator<std::string>(s, " "));
                                            ^                                  ~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/streambuf_iterator.h:283:7: note: candidate constructor not viable: requires single argument '__s', but 2 arguments were provided
      ostreambuf_iterator(ostream_type& __s) _GLIBCXX_USE_NOEXCEPT
      ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/streambuf_iterator.h:287:7: note: candidate constructor not viable: requires single argument '__s', but 2 arguments were provided
      ostreambuf_iterator(streambuf_type* __s) _GLIBCXX_USE_NOEXCEPT
      ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/streambuf_iterator.h:248:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
    class ostreambuf_iterator
          ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/streambuf_iterator.h:248:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
In file included from opendbc/can/dbc.cc:2:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/filesystem:44:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/fs_fwd.h:35:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/system_error:41:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/stdexcept:39:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/string:40:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/char_traits.h:152:16: error: no matching conversion for static_cast from 'const __gnu_cxx::char_traits<std::basic_string<char>>::char_type' (aka 'const std::basic_string<char>') to '__gnu_cxx::char_traits<std::basic_string<char>>::int_type' (aka 'unsigned long')
      { return static_cast<int_type>(__c); }
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/streambuf:436:27: note: in instantiation of member function '__gnu_cxx::char_traits<std::basic_string<char>>::to_int_type' requested here
            __ret = traits_type::to_int_type(__c);
                                 ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/streambuf_iterator.h:295:36: note: in instantiation of member function 'std::basic_streambuf<std::basic_string<char>>::sputc' requested here
            _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
                                          ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_algobase.h:385:18: note: in instantiation of member function 'std::ostreambuf_iterator<std::basic_string<char>>::operator=' requested here
              *__result = *__first;
                        ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_algobase.h:495:22: note: in instantiation of function template specialization 'std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m<std::basic_string<char> *, std::ostreambuf_iterator<std::basic_string<char>>>' requested here
                              _Category>::__copy_m(__first, __last, __result);
                                          ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_algobase.h:522:19: note: in instantiation of function template specialization 'std::__copy_move_a2<false, std::basic_string<char> *, std::ostreambuf_iterator<std::basic_string<char>>>' requested here
    { return std::__copy_move_a2<_IsMove>(__first, __last, __result); }
                  ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_algobase.h:530:8: note: in instantiation of function template specialization 'std::__copy_move_a1<false, std::basic_string<char> *, std::ostreambuf_iterator<std::basic_string<char>>>' requested here
                std::__copy_move_a1<_IsMove>(std::__niter_base(__first),
                     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_algobase.h:619:19: note: in instantiation of function template specialization 'std::__copy_move_a<false, __gnu_cxx::__normal_iterator<std::basic_string<char> *, std::vector<std::basic_string<char>>>, std::ostreambuf_iterator<std::basic_string<char>>>' requested here
      return std::__copy_move_a<__is_move_iterator<_II>::__value>
                  ^
opendbc/can/dbc.cc:191:12: note: in instantiation of function template specialization 'std::copy<__gnu_cxx::__normal_iterator<std::basic_string<char> *, std::vector<std::basic_string<char>>>, std::ostreambuf_iterator<std::basic_string<char>>>' requested here
      std::copy(words.begin(), words.end(), std::ostream_iterator<std::string>(s, " "));
           ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/basic_string.h:936:7: note: candidate function
      operator __sv_type() const noexcept
      ^
3 errors generated.
scons: *** [opendbc/can/dbc.os] Error 1
adeebshihadeh commented 2 years ago

We target Ubuntu 20.04 as explained here, though we're always happy to merge clean PRs to support other platforms. We may even merge PRs adding CI workflows for other platforms.