Closed AndrewJSchoen closed 4 years ago
Hello !
Currently we develop libqi with the boost libraries v1.64, and it's not officially tested on other versions, and it seems you're using a newer version. We have some dependencies management issues that does not enforce this requirement, so this explains why you didn't get an error at CMake configure time.
You can try to apply this patch on libqi and see if it solves your issue.
Thanks for the quick reply. I am going to just try using v1.64 and let you know if I encounter any issues.
For whatever reason, the downgrade down to boost v1.64 did not change anything. The patch you provided seems to have allowed the compilation to proceed further, but encountered another issue around the 18% mark.
make
make[1]: Entering directory '/data/home/nao/libqi/BUILD'
make[2]: Entering directory '/data/home/nao/libqi/BUILD'
Scanning dependencies of target qi
make[2]: Leaving directory '/data/home/nao/libqi/BUILD'
make[2]: Entering directory '/data/home/nao/libqi/BUILD'
[ 1%] Building CXX object CMakeFiles/qi.dir/src/dlfcn.cpp.o
[ 2%] Building CXX object CMakeFiles/qi.dir/src/path.cpp.o
[ 3%] Building CXX object CMakeFiles/qi.dir/src/application.cpp.o
[ 4%] Building CXX object CMakeFiles/qi.dir/src/buffer.cpp.o
[ 5%] Building CXX object CMakeFiles/qi.dir/src/bufferreader.cpp.o
[ 6%] Building CXX object CMakeFiles/qi.dir/src/clock.cpp.o
[ 7%] Building CXX object CMakeFiles/qi.dir/src/future.cpp.o
[ 7%] Building CXX object CMakeFiles/qi.dir/src/log.cpp.o
[ 8%] Building CXX object CMakeFiles/qi.dir/src/consoleloghandler.cpp.o
[ 9%] Building CXX object CMakeFiles/qi.dir/src/fileloghandler.cpp.o
[ 10%] Building CXX object CMakeFiles/qi.dir/src/csvloghandler.cpp.o
[ 11%] Building CXX object CMakeFiles/qi.dir/src/headfileloghandler.cpp.o
[ 12%] Building CXX object CMakeFiles/qi.dir/src/tailfileloghandler.cpp.o
[ 13%] Building CXX object CMakeFiles/qi.dir/src/locale-light.cpp.o
[ 14%] Building CXX object CMakeFiles/qi.dir/src/os.cpp.o
[ 14%] Building CXX object CMakeFiles/qi.dir/src/path_conf.cpp.o
[ 15%] Building CXX object CMakeFiles/qi.dir/src/periodictask.cpp.o
[ 16%] Building CXX object CMakeFiles/qi.dir/src/print.cpp.o
[ 17%] Building CXX object CMakeFiles/qi.dir/src/utils.cpp.o
[ 18%] Building CXX object CMakeFiles/qi.dir/src/eventloop.cpp.o
In file included from /tmp/gentoo/usr/include/boost/asio/basic_waitable_timer.hpp:23,
from /tmp/gentoo/usr/include/boost/asio/steady_timer.hpp:22,
from /home/nao/libqi/src/eventloop.cpp:12:
/tmp/gentoo/usr/include/boost/asio/detail/io_object_impl.hpp: In instantiation of 'boost::asio::detail::io_object_impl<IoObjectService, Executor>::io_object_impl(ExecutionContext&, typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type*) [with ExecutionContext = const boost::reference_wrapper<boost::asio::io_context>; IoObjectService = boost::asio::detail::deadline_timer_service<boost::asio::detail::chrono_time_traits<boost::chrono::steady_clock, boost::asio::wait_traits<boost::chrono::steady_clock> > >; Executor = boost::asio::executor; typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type = void]':
/tmp/gentoo/usr/include/boost/asio/basic_waitable_timer.hpp:198:20: required from 'boost::asio::basic_waitable_timer<Clock, WaitTraits, Executor>::basic_waitable_timer(ExecutionContext&, typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type*) [with ExecutionContext = const boost::reference_wrapper<boost::asio::io_context>; Clock = boost::chrono::steady_clock; WaitTraits = boost::asio::wait_traits<boost::chrono::steady_clock>; Executor = boost::asio::executor; typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type = void]'
/tmp/gentoo/usr/include/boost/smart_ptr/make_shared_object.hpp:256:5: required from 'typename boost::detail::sp_if_not_array<T>::type boost::make_shared(Args&& ...) [with T = boost::asio::basic_waitable_timer<boost::chrono::steady_clock>; Args = {const boost::reference_wrapper<boost::asio::io_context>}; typename boost::detail::sp_if_not_array<T>::type = boost::shared_ptr<boost::asio::basic_waitable_timer<boost::chrono::steady_clock> >]'
/home/nao/libqi/src/eventloop.cpp:725:121: required from here
/tmp/gentoo/usr/include/boost/asio/detail/io_object_impl.hpp:87:40: error: 'const class boost::reference_wrapper<boost::asio::io_context>' has no member named 'get_executor'
87 | implementation_executor_(context.get_executor(),
| ~~~~~~~~^~~~~~~~~~~~
/tmp/gentoo/usr/include/boost/asio/detail/io_object_impl.hpp: In instantiation of 'boost::asio::detail::io_object_impl<IoObjectService, Executor>::io_object_impl(ExecutionContext&, typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type*) [with ExecutionContext = const boost::reference_wrapper<boost::asio::io_context>; IoObjectService = boost::asio::detail::deadline_timer_service<boost::asio::detail::chrono_time_traits<qi::SteadyClock, boost::asio::wait_traits<qi::SteadyClock> > >; Executor = boost::asio::executor; typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type = void]':
/tmp/gentoo/usr/include/boost/asio/basic_waitable_timer.hpp:198:20: required from 'boost::asio::basic_waitable_timer<Clock, WaitTraits, Executor>::basic_waitable_timer(ExecutionContext&, typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type*) [with ExecutionContext = const boost::reference_wrapper<boost::asio::io_context>; Clock = qi::SteadyClock; WaitTraits = boost::asio::wait_traits<qi::SteadyClock>; Executor = boost::asio::executor; typename std::enable_if<std::is_convertible<ExecutionContext&, boost::asio::execution_context&>::value>::type = void]'
/tmp/gentoo/usr/include/boost/smart_ptr/make_shared_object.hpp:256:5: required from 'typename boost::detail::sp_if_not_array<T>::type boost::make_shared(Args&& ...) [with T = boost::asio::basic_waitable_timer<qi::SteadyClock>; Args = {const boost::reference_wrapper<boost::asio::io_context>}; typename boost::detail::sp_if_not_array<T>::type = boost::shared_ptr<boost::asio::basic_waitable_timer<qi::SteadyClock> >]'
/home/nao/libqi/src/eventloop.cpp:768:91: required from here
/tmp/gentoo/usr/include/boost/asio/detail/io_object_impl.hpp:87:40: error: 'const class boost::reference_wrapper<boost::asio::io_context>' has no member named 'get_executor'
make[2]: *** [CMakeFiles/qi.dir/build.make:310: CMakeFiles/qi.dir/src/eventloop.cpp.o] Error 1
make[2]: Leaving directory '/data/home/nao/libqi/BUILD'
make[1]: *** [CMakeFiles/Makefile2:311: CMakeFiles/qi.dir/all] Error 2
make[1]: Leaving directory '/data/home/nao/libqi/BUILD'
make: *** [Makefile:130: all] Error 2
Hello,
Did you try changing the two following lines: https://github.com/aldebaran/libqi/blob/0ee3d241db5210829d6bb2a997fa464e72b35923/src/eventloop.cpp#L725 https://github.com/aldebaran/libqi/blob/0ee3d241db5210829d6bb2a997fa464e72b35923/src/eventloop.cpp#L768
into:
boost::shared_ptr<SteadyTimer> timer = boost::make_shared<SteadyTimer>(_io);
Hopefully this fixes the issue for this file. If you have multiple versions of boost on your system, try to make sure CMake found the right one. I see that in the first snippet you showed, you used cmake
directly instead of using qibuild
, but the CMake seems to have found the qibuild macros anyway. Those macros use some mechanisms to find the dependencies from toolchains created with qitoolchain. We'd be interested to know how you configured CMake to work out of the box, if you're willing to share !
Hello all,
Although my issue wasn't with running on pepper, rather to compile it on Ubuntu 20.04 with Boost 1.71. The above mentioned patches and fixes worked to some extent. The main issue was with Boost v1.71 because the function socket.get_io_service()
in boost::asio
is removed after v1.70 since it was previously deprecated. The suggested fix was to change instances of socket.get_io_service()
to socket.get_executor().context()
which still didn't work for me. However, explicitly casting it to boost::asio::io_context
solved the issue for me.
Specifically, in
src/messaging/transportserverasio_p.cpp changing all instances of _acceptor->get_io_service()
to ((boost::asio::io_context&)_acceptor->get_executor().context())
and changing
into return ((boost::asio::io_context&)socket.get_executor().context());
The overall changes can be seen in this updated patch file which includes the above fixes along with the fixes/patches from the previous comments in to compile it with Boost v1.71.
Hello,
Thanks for the update. We are currently in the process of merging some patches that would fix the build of libqi with boost v1.68. Unfortunately we haven't started porting to boost v1.71 yet. The API that you are mentioning (socket.get_io_service()
) was not deprecated on the version we were supporting until now (v1.64), and we didn't see this issue yet.
We are currently discussing porting to boost v1.72, although we have no estimation of when this will be done yet. Though when we start migrating, your patch will come in handy ! Thank you for the work.
Hello... I am still struggling here to compile with higher boost version. Or is anyway possible to add support of TLSV1.3 for handshake?
Hello @jaskarannagi19,
We have plans to port libqi for more recent versions of boost (most likely v1.76) but we have no estimation yet when this will be done.
As for TLS v1.3, we've added support for TLS v1.2 in this commit https://github.com/aldebaran/libqi/commit/78e8cf7f54a1239047330e13b63b80f872c5ac9e. As soon as we have ported the code for newer versions of boost, we can then update libqi to enable TLS v1.3 on the server side. For the client side, you should be able to use libqi to connect to a SSL socket that uses TLS v1.3 as it should be directly compatible.
@nyibbang So great to hear from you. What is the recommended boost version for above for windows and linux. """- Server components will force the use of TLS 1.2 (TLS 1.3 is not available in Boost.Asio 1.64, which is the currently supported version).""""
I will try with 1.64 boost version and try to connect with TLSV1.3 socket.
Env:: Visual Studio 2015 Boost:: 1.64 Libqi:: Above link
Still getting very very scary errors
Hi all,
I am trying to compile Libqi on the Pepper (I have a gentoo environment), and I am getting the following error when trying to compile.
Any thoughts on what is going on?
I should say, I am only going down this route because for some reason, when I try to install
qi
via python, I get a segmentation fault whenever I import the library. So if either of those two issues finds a solution, it would be fine.