Closed
Description
Issue when compiling with:
$ apk info boost-dev
boost-dev-1.67.0-r2 description:
Free peer-reviewed portable C++ source libraries (development files)
[ 64%] Building CXX object src/acomms/CMakeFiles/goby_acomms.dir/queue/queue_manager.cpp.o
/apk_src/goby/src/goby3-3.0.0_alpha17/src/acomms/queue/queue_manager.cpp: In member function 'goby::acomms::Queue* goby::acomms::QueueManager::find_next_sender(const goby::acomms::protobuf::ModemTransmission&, const string&, bool)':
/apk_src/goby/src/goby3-3.0.0_alpha17/src/acomms/queue/queue_manager.cpp:547:88: error: no matching function for call to 'boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>::subsecond_duration(double)'
cfg_.on_demand_skew_seconds() * 1e6) <
^
In file included from /usr/include/boost/date_time/posix_time/posix_time_config.hpp:16,
from /usr/include/boost/date_time/posix_time/posix_time_system.hpp:13,
from /usr/include/boost/date_time/posix_time/ptime.hpp:12,
from /usr/include/boost/date_time/posix_time/posix_time_types.hpp:12,
from /usr/include/boost/thread/thread_time.hpp:11,
from /usr/include/boost/thread/lock_types.hpp:18,
from /usr/include/boost/thread/pthread/thread_data.hpp:12,
from /usr/include/boost/thread/thread_only.hpp:17,
from /usr/include/boost/thread/thread.hpp:12,
from /usr/include/boost/thread.hpp:13,
from /apk_src/goby/src/goby3-3.0.0_alpha17/build/include/goby/common/logger/flex_ostreambuf.h:33,
from /apk_src/goby/src/goby3-3.0.0_alpha17/build/include/goby/common/logger/flex_ostream.h:35,
from /apk_src/goby/src/goby3-3.0.0_alpha17/build/include/goby/common/logger.h:28,
from /apk_src/goby/src/goby3-3.0.0_alpha17/src/acomms/queue/queue_manager.cpp:25:
/usr/include/boost/date_time/time_duration.hpp:285:14: note: candidate: 'template<class T> boost::date_time::subsecond_duration<base_duration, frac_of_second>::subsecond_duration(const T&, typename boost::enable_if<boost::is_integral<T>, void>::type*)'
explicit subsecond_duration(T const& ss,
^~~~~~~~~~~~~~~~~~
/usr/include/boost/date_time/time_duration.hpp:285:14: note: template argument deduction/substitution failed:
/usr/include/boost/date_time/time_duration.hpp: In substitution of 'template<class T> boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>::subsecond_duration(const T&, typename boost::enable_if<boost::is_integral<T>, void>::type*) [with T = double]':
/apk_src/goby/src/goby3-3.0.0_alpha17/src/acomms/queue/queue_manager.cpp:547:88: required from here
/usr/include/boost/date_time/time_duration.hpp:285:14: error: no type named 'type' in 'struct boost::enable_if<boost::is_integral<double>, void>'
In file included from /usr/include/boost/date_time/posix_time/posix_time_config.hpp:16,
from /usr/include/boost/date_time/posix_time/posix_time_system.hpp:13,
from /usr/include/boost/date_time/posix_time/ptime.hpp:12,
from /usr/include/boost/date_time/posix_time/posix_time_types.hpp:12,
from /usr/include/boost/thread/thread_time.hpp:11,
from /usr/include/boost/thread/lock_types.hpp:18,
from /usr/include/boost/thread/pthread/thread_data.hpp:12,
from /usr/include/boost/thread/thread_only.hpp:17,
from /usr/include/boost/thread/thread.hpp:12,
from /usr/include/boost/thread.hpp:13,
from /apk_src/goby/src/goby3-3.0.0_alpha17/build/include/goby/common/logger/flex_ostreambuf.h:33,
from /apk_src/goby/src/goby3-3.0.0_alpha17/build/include/goby/common/logger/flex_ostream.h:35,
from /apk_src/goby/src/goby3-3.0.0_alpha17/build/include/goby/common/logger.h:28,
from /apk_src/goby/src/goby3-3.0.0_alpha17/src/acomms/queue/queue_manager.cpp:25:
/usr/include/boost/date_time/time_duration.hpp:270:30: note: candidate: 'boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>::subsecond_duration(const boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>&)'
class BOOST_SYMBOL_VISIBLE subsecond_duration : public base_duration
^~~~~~~~~~~~~~~~~~
/usr/include/boost/date_time/time_duration.hpp:270:30: note: no known conversion for argument 1 from 'double' to 'const boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>&'
/usr/include/boost/date_time/time_duration.hpp:270:30: note: candidate: 'boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>::subsecond_duration(boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>&&)'
/usr/include/boost/date_time/time_duration.hpp:270:30: note: no known conversion for argument 1 from 'double' to 'boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>&&'
make[2]: *** [src/acomms/CMakeFiles/goby_acomms.dir/build.make:277: src/acomms/CMakeFiles/goby_acomms.dir/queue/queue_manager.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:377: src/acomms/CMakeFiles/goby_acomms.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
>>> ERROR: goby: build failed
It seems boost no longer permits floating point numbers to initialise posix_time objects. If we cast these to long will there be much precision loss?
Also goby::acomms::MACManager::next_cycle_time()
function seems to have numerous conversions to microseconds through out the function, some using double and some using int64. Perhaps this could be refactored?
Related issue I could find: PointCloudLibrary/pcl#2422
Metadata
Metadata
Assignees
Labels
No labels
Activity
russkel commentedon May 2, 2019
In addition there is also this:
It seems it is now
native_handle
.https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/basic_datagram_socket/native_handle.html
tsaubergine commentedon May 2, 2019
Thanks, oldest boost we're supporting now is 1.58.0 so this should be no problem.
tsaubergine commentedon May 2, 2019
Almost certainly. I'd like to move everything over to the time3.h functions which use a mix of boost::units and posix_time. C++20 should finally bring dates to std::chrono but we're not there yet...
I opened an issue on this: #74
Explicit cast to long for calls to boost::posix_time::*seconds