diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index fa97a6f17..d04629891 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -96,14 +96,25 @@ endif() ######################################################################## MESSAGE(STATUS "") MESSAGE(STATUS "Configuring Boost C++ Libraries...") + +set(Boost_NO_BOOST_CMAKE ON) + +find_package(Boost 1.36 QUIET) + SET(BOOST_REQUIRED_COMPONENTS date_time filesystem - system + # system thread program_options ) +if(Boost_VERSION_STRING AND Boost_VERSION_STRING VERSION_LESS "1.89.0") + MESSAGE(STATUS "Boost C++ Library version is less than 1.89.0, adding system to required components") + list(APPEND BOOST_REQUIRED_COMPONENTS system) +endif() + + IF(UNIX AND EXISTS "/usr/lib64") LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix ENDIF(UNIX AND EXISTS "/usr/lib64") diff --git a/host/cores/super_recv_packet_handler.hpp b/host/cores/super_recv_packet_handler.hpp index 9623a6995..e020fca91 100644 --- a/host/cores/super_recv_packet_handler.hpp +++ b/host/cores/super_recv_packet_handler.hpp @@ -23,6 +23,7 @@ #include #include #include "umtrx_log_adapter.hpp" +#include #include #include #include @@ -778,6 +779,12 @@ class recv_packet_streamer : public recv_packet_handler, public rx_streamer{ return recv_packet_handler::issue_stream_cmd(stream_cmd); } + void post_input_action( + [[maybe_unused]] const std::shared_ptr& action, + [[maybe_unused]] const size_t port + ){ + // no action required + } private: size_t _max_num_samps; }; diff --git a/host/cores/super_send_packet_handler.hpp b/host/cores/super_send_packet_handler.hpp index 075feaac5..897f56933 100644 --- a/host/cores/super_send_packet_handler.hpp +++ b/host/cores/super_send_packet_handler.hpp @@ -23,6 +23,7 @@ #include #include #include "umtrx_log_adapter.hpp" +#include #include #include #include @@ -448,6 +449,13 @@ class send_packet_streamer : public send_packet_handler, public tx_streamer{ return send_packet_handler::recv_async_msg(async_metadata, timeout); } + void post_output_action( + [[maybe_unused]] const std::shared_ptr& action, + [[maybe_unused]] const size_t port + ){ + // no action required + } + private: size_t _max_num_samps; }; diff --git a/host/umtrx_common.hpp b/host/umtrx_common.hpp index bab206b47..860505198 100644 --- a/host/umtrx_common.hpp +++ b/host/umtrx_common.hpp @@ -1,6 +1,7 @@ #ifndef INCLUDED_UMTRX_COMMON_HPP #define INCLUDED_UMTRX_COMMON_HPP +#include #include #if UHD_VERSION >= 4000000 @@ -9,4 +10,12 @@ #define UMTRX_UHD_PTR_NAMESPACE boost #endif +#if BOOST_VERSION >= 106600 + #define PARSE_IP_V4_FROM_STRING(ip_str) boost::asio::ip::make_address_v4(ip_str) + #define BOOST_IO_CONTEXT boost::asio::io_context +#else + #define PARSE_IP_V4_FROM_STRING(ip_str) boost::asio::ip::address_v4::from_string(ip_str) + #define BOOST_IO_CONTEXT boost::asio::io_service +#endif + #endif /* INCLUDED_UMTRX_COMMON_HPP */ diff --git a/host/umtrx_eeprom.cpp b/host/umtrx_eeprom.cpp index ef6a09d8c..098d3d87f 100644 --- a/host/umtrx_eeprom.cpp +++ b/host/umtrx_eeprom.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . // +#include "umtrx_common.hpp" #include #include #include @@ -34,6 +35,7 @@ static const boost::uint8_t N200_EEPROM_ADDR = 0x50; static const size_t SERIAL_LEN = 9; static const size_t NAME_MAX_LEN = 32 - SERIAL_LEN; + //! convert a string to a byte vector to write to eeprom static byte_vector_t string_to_uint16_bytes(const std::string &num_str){ const boost::uint16_t num = boost::lexical_cast(num_str); @@ -232,19 +234,19 @@ void store_umtrx_eeprom(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface) if (mb_eeprom.has_key("ip-addr")){ byte_vector_t ip_addr_bytes(4); - byte_copy(boost::asio::ip::address_v4::from_string(mb_eeprom["ip-addr"]).to_bytes(), ip_addr_bytes); + byte_copy(PARSE_IP_V4_FROM_STRING(mb_eeprom["ip-addr"]).to_bytes(), ip_addr_bytes); iface.write_eeprom(N200_EEPROM_ADDR, offsetof(n200_eeprom_map, ip_addr), ip_addr_bytes); } if (mb_eeprom.has_key("subnet")){ byte_vector_t ip_addr_bytes(4); - byte_copy(boost::asio::ip::address_v4::from_string(mb_eeprom["subnet"]).to_bytes(), ip_addr_bytes); + byte_copy(PARSE_IP_V4_FROM_STRING(mb_eeprom["subnet"]).to_bytes(), ip_addr_bytes); iface.write_eeprom(N200_EEPROM_ADDR, offsetof(n200_eeprom_map, subnet), ip_addr_bytes); } if (mb_eeprom.has_key("gateway")){ byte_vector_t ip_addr_bytes(4); - byte_copy(boost::asio::ip::address_v4::from_string(mb_eeprom["gateway"]).to_bytes(), ip_addr_bytes); + byte_copy(PARSE_IP_V4_FROM_STRING(mb_eeprom["gateway"]).to_bytes(), ip_addr_bytes); iface.write_eeprom(N200_EEPROM_ADDR, offsetof(n200_eeprom_map, gateway), ip_addr_bytes); } diff --git a/host/umtrx_impl.hpp b/host/umtrx_impl.hpp index fea39b1c1..3aaa97b8f 100644 --- a/host/umtrx_impl.hpp +++ b/host/umtrx_impl.hpp @@ -33,6 +33,7 @@ #include "tmp102_ctrl.hpp" #include "power_amp.hpp" #include "umsel2_ctrl.hpp" +#include #include #include #include @@ -231,7 +232,7 @@ class umtrx_impl : public uhd::device { //tcp query server uhd::task::sptr _server_query_task; void server_query_handler(void); - boost::asio::io_service _server_query_io_service; + BOOST_IO_CONTEXT _server_query_io_service; boost::shared_ptr _server_query_tcp_acceptor; void client_query_handle(boost::shared_ptr); void client_query_handle1(const boost::property_tree::ptree &request, boost::property_tree::ptree &response); diff --git a/host/umtrx_monitor.cpp b/host/umtrx_monitor.cpp index 37ae3398c..451483959 100644 --- a/host/umtrx_monitor.cpp +++ b/host/umtrx_monitor.cpp @@ -72,7 +72,7 @@ void umtrx_impl::status_monitor_start(const uhd::device_addr_t &device_addr) { UHD_MSG(status) << "Creating TCP monitor on port " << device_addr.get("status_port") << std::endl; _server_query_tcp_acceptor.reset(new asio::ip::tcp::acceptor( - _server_query_io_service, asio::ip::tcp::endpoint(asio::ip::address::from_string("127.0.0.1"), device_addr.cast("status_port", 0)))); + _server_query_io_service, asio::ip::tcp::endpoint(PARSE_IP_V4_FROM_STRING("127.0.0.1"), device_addr.cast("status_port", 0)))); _server_query_task = task::make(boost::bind(&umtrx_impl::server_query_handler, this)); } _status_monitor_task = task::make(boost::bind(&umtrx_impl::status_monitor_handler, this));