marian-nmt / marian

Fast Neural Machine Translation in C++
https://marian-nmt.github.io
Other
1.22k stars 228 forks source link

Compilation fails. Deprecated boost function? #353

Closed MickHardins closed 3 years ago

MickHardins commented 3 years ago

Compilation fails with -DUSE_SENTENCEPIECE -DCOMPILE_SERVER flags. Below the errors:

Scanning dependencies of target marian_server
[ 98%] Building CXX object src/CMakeFiles/marian_server.dir/command/marian_server.cpp.o
In file included from /home/ubuntu/marian/src/command/marian_server.cpp:7:
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp: In instantiation of ‘SimpleWeb::SocketServerBase<socket_type>::Connection::Connection(std::shared_ptr<SimpleWeb::ScopeRunner>, long int, Args&& ...) [with Args = {boost::asio::io_context&}; socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]’:
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:802:109:   required from here
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:155:153: error: ‘class boost::asio::basic_stream_socket<boost::asio::ip::tcp>’ has no member named ‘get_io_service’
           : handler_runner(std::move(handler_runner)), socket(new socket_type(std::forward<Args>(args)...)), timeout_idle(timeout_idle), strand(socket->get_io_service()), closed(false) {}
                                                                                                                                                 ~~~~~~~~^~~~~~~~~~~~~~
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp: In instantiation of ‘void SimpleWeb::SocketServerBase<socket_type>::Connection::set_timeout(long int) [with socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]’:
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:525:7:   required from ‘void SimpleWeb::SocketServerBase<socket_type>::read_handshake(const std::shared_ptr<SimpleWeb::SocketServerBase<socket_type>::Connection>&) [with socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]’
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:816:36:   required from here
/home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:190:84: error: ‘class boost::asio::basic_stream_socket<boost::asio::ip::tcp>’ has no member named ‘get_io_service’
         timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(socket->get_io_service()));
                                                                            ~~~~~~~~^~~~~~~~~~~~~~
[ 98%] Linking CXX executable ../marian-conv
In file included from /usr/include/boost/asio/steady_timer.hpp:22,
                 from /usr/include/boost/asio/basic_socket_streambuf.hpp:36,
                 from /usr/include/boost/asio/basic_socket_iostream.hpp:24,
                 from /usr/include/boost/asio.hpp:33,
                 from /home/ubuntu/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:50,
                 from /home/ubuntu/marian/src/command/marian_server.cpp:7:
/usr/include/boost/asio/basic_waitable_timer.hpp:698:3: error: ‘typename boost::asio::async_result<typename std::decay<_U1>::type, void(boost::system::error_code)>::return_type boost::asio::basic_waitable_timer<Clock, WaitTraits, Executor>::async_wait(WaitHandler&&) [with WaitHandler = SimpleWeb::SocketServerBase<socket_type>::Connection::set_timeout(long int) [with socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]::<lambda(const error_code&)>; Clock = std::chrono::_V2::steady_clock; WaitTraits = boost::asio::wait_traits<std::chrono::_V2::steady_clock>; Executor = boost::asio::executor; typename boost::asio::async_result<typename std::decay<_U1>::type, void(boost::system::error_code)>::return_type = void]’, declared using local type ‘SimpleWeb::SocketServerBase<socket_type>::Connection::set_timeout(long int) [with socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]::<lambda(const error_code&)>’, is used but never defined [-fpermissive]
   async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   ^~~~~~~~~~
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/marian_server.dir/build.make:63: src/CMakeFiles/marian_server.dir/command/marian_server.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:482: src/CMakeFiles/marian_server.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 98%] Built target marian_conv
[ 98%] Linking CXX executable ../marian-scorer
[ 98%] Built target marian_scorer
[ 99%] Linking CXX executable ../marian-decoder
[ 99%] Built target marian_decoder
make: *** [Makefile:152: all] Error 2

My configuration:

Maybe due to a deprecated boost function?

snukky commented 3 years ago

Which Marian version is it? I think marian-server in 1.9.0 works with Boost 1.68 or lower only. https://github.com/marian-nmt/marian-dev should work with Boost 1.71 too. Related issue: #340

frankseide commented 3 years ago

I thought we removed all Boost dependency?

emjotde commented 3 years ago

Not for the optionally compiled marian-server. It's not using boost anywhere else.

MickHardins commented 3 years ago

Thanks for your responses. I can confirm that marian-dev works fine on boost 1.71. To build marian I followed the instructions provided on the documentation section of the website. Is there a compatibility table to know which version of boost is needed for different versions of the marian server? (like the GCC/CUDA compatibility table)

snukky commented 3 years ago

Unfortunately we don't have that compatibility table yet, but that's a good idea to create one. Thanks! FYI, v1.10 supports now Boost at least up to 1.75. Closing.