browsermt / mts

Marian Translation Service
Apache License 2.0
18 stars 4 forks source link

Compilation broken with gcc7 due to -Werror #5

Open XapaJIaMnu opened 4 years ago

XapaJIaMnu commented 4 years ago

Hey, Compiling with gcc-7 results in the following:

[ 97%] Building CXX object src/service/CMakeFiles/rest-server.dir/rest/rest_server.cpp.o
In file included from /mts/src/service/rest/rest_server.cpp:7:
In file included from /mts/src/./service/api/json_request_handler.h:34:
In file included from /mts/src/./service/api/bergamot/json_request_handler.h:3:
/mts/src/./service/api/bergamot/node_translation.h:13:1: error: class 'OutputOptions' was previously declared as a struct; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
class OutputOptions;
^
/mts/src/./service/api/output_options.h:5:8: note: previous use is here
struct OutputOptions {
       ^
/mts/src/./service/api/bergamot/node_translation.h:13:1: note: did you mean struct here?
class OutputOptions;
^~~~~
struct
In file included from /mts/src/service/rest/rest_server.cpp:6:
In file included from /mts/3rd_party/marian/src/marian.h:5:
In file included from /mts/3rd_party/marian/src/common/config.h:3:
In file included from /mts/3rd_party/marian/src/3rd_party/yaml-cpp/yaml.h:10:
In file included from /mts/3rd_party/marian/src/3rd_party/yaml-cpp/parser.h:11:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/memory:81:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr.h:52:
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:588:8: error: delete called on non-final 'marian::data::QueuedInput' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-abstract-non-virtual-dtor]
              delete __p;
              ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:595:4: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<marian::data::QueuedInput *>' requested here
        : __shared_count(__p)
          ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1079:17: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<marian::data::QueuedInput *>' requested here
        : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type())
                       ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1243:4: note: in instantiation of function template specialization 'std::__shared_ptr<marian::data::QueuedInput, __gnu_cxx::_S_atomic>::__shared_ptr<marian::data::QueuedInput, void>' requested here
          __shared_ptr(__p).swap(*this);
          ^
/mts/src/./service/common/translation_service.h:76:9: note: in instantiation of function template specialization 'std::__shared_ptr<marian::data::QueuedInput, __gnu_cxx::_S_atomic>::reset<marian::data::QueuedInput>' requested here
    jq_.reset(new data::QueuedInput(vocabs_, options_));
        ^
/mts/src/service/rest/rest_server.cpp:180:21: note: in instantiation of function template specialization 'marian::server::TranslationService::start<marian::BeamSearch>' requested here
  service->template start<BeamSearch>();
                    ^
In file included from /mts/src/service/rest/rest_server.cpp:6:
In file included from /mts/3rd_party/marian/src/marian.h:5:
In file included from /mts/3rd_party/marian/src/common/config.h:3:
In file included from /mts/3rd_party/marian/src/3rd_party/yaml-cpp/yaml.h:10:
In file included from /mts/3rd_party/marian/src/3rd_party/yaml-cpp/parser.h:11:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/memory:81:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr.h:52:
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:376:9: error: delete called on non-final 'marian::data::QueuedInput' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-abstract-non-virtual-dtor]
      { delete _M_ptr; }
        ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:371:7: note: in instantiation of member function 'std::_Sp_counted_ptr<marian::data::QueuedInput *, __gnu_cxx::_S_atomic>::_M_dispose' requested here
      _Sp_counted_ptr(_Ptr __p) noexcept
      ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:584:20: note: in instantiation of member function 'std::_Sp_counted_ptr<marian::data::QueuedInput *, __gnu_cxx::_S_atomic>::_Sp_counted_ptr' requested here
              _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
                          ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:595:4: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<marian::data::QueuedInput *>' requested here
        : __shared_count(__p)
          ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1079:17: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<marian::data::QueuedInput *>' requested here
        : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type())
                       ^
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1243:4: note: in instantiation of function template specialization 'std::__shared_ptr<marian::data::QueuedInput, __gnu_cxx::_S_atomic>::__shared_ptr<marian::data::QueuedInput, void>' requested here
          __shared_ptr(__p).swap(*this);
          ^
/mts/src/./service/common/translation_service.h:76:9: note: in instantiation of function template specialization 'std::__shared_ptr<marian::data::QueuedInput, __gnu_cxx::_S_atomic>::reset<marian::data::QueuedInput>' requested here
    jq_.reset(new data::QueuedInput(vocabs_, options_));
        ^
/mts/src/service/rest/rest_server.cpp:180:21: note: in instantiation of function template specialization 'marian::server::TranslationService::start<marian::BeamSearch>' requested here
  service->template start<BeamSearch>();
                    ^
3 errors generated.
src/service/CMakeFiles/rest-server.dir/build.make:62: recipe for target 'src/service/CMakeFiles/rest-server.dir/rest/rest_server.cpp.o' failed
make[2]: *** [src/service/CMakeFiles/rest-server.dir/rest/rest_server.cpp.o] Error 1
CMakeFiles/Makefile2:1379: recipe for target 'src/service/CMakeFiles/rest-server.dir/all' failed
make[1]: *** [src/service/CMakeFiles/rest-server.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....