1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-10 04:03:02 +00:00

Soft transition from Gflags and Glog to Abseil. Some CI fixes

This commit is contained in:
Carles Fernandez
2024-04-29 08:27:33 +02:00
parent 4910629a5d
commit 95596b8f91
289 changed files with 5930 additions and 952 deletions

View File

@@ -169,10 +169,16 @@ target_link_libraries(signal_source_adapters
algorithms_libs
gnss_sdr_flags
core_system_parameters
Glog::glog
Volk::volk
)
if(ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(signal_source_adapters PRIVATE Glog::glog)
target_compile_definitions(signal_source_adapters PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
else()
target_link_libraries(signal_source_adapters PRIVATE absl::flags absl::log)
endif()
if(GNURADIO_USES_STD_POINTERS)
target_compile_definitions(signal_source_adapters
PUBLIC -DGNURADIO_USES_STD_POINTERS=1

View File

@@ -31,7 +31,6 @@
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <iio.h>
#include <algorithm> // for std::max
#include <chrono> // for std::chrono
@@ -44,6 +43,11 @@
#include <unistd.h> // for write
#include <vector> // fr std::vector
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -21,10 +21,15 @@
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <boost/exception/diagnostic_information.hpp>
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <iostream>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
Ad936xCustomSignalSource::Ad936xCustomSignalSource(const ConfigurationInterface* configuration,

View File

@@ -18,9 +18,13 @@
#include "custom_udp_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <iostream>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -19,10 +19,14 @@
#include "configuration_interface.h"
#include "fifo_reader.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -18,7 +18,12 @@
#include "file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -29,12 +29,16 @@
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <algorithm> // for std::max
#include <cmath> // for ceil, floor
#include <iostream> // for std::cout, std:cerr
#include <utility> // for std::move
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
@@ -93,7 +97,8 @@ FileSourceBase::FileSourceBase(ConfigurationInterface const* configuration, std:
}
}
// override value with commandline flag, if present
// override value with commandline flag, if present
#if USE_GLOG_AND_GFLAGS
if (FLAGS_signal_source != "-")
{
filename_ = FLAGS_signal_source;
@@ -102,6 +107,16 @@ FileSourceBase::FileSourceBase(ConfigurationInterface const* configuration, std:
{
filename_ = FLAGS_s;
}
#else
if (absl::GetFlag(FLAGS_signal_source) != "-")
{
filename_ = absl::GetFlag(FLAGS_signal_source);
}
if (absl::GetFlag(FLAGS_s) != "-")
{
filename_ = absl::GetFlag(FLAGS_s);
}
#endif
if (sampling_frequency_ == 0)
{
std::cerr << "Warning: parameter " << role_ << ".sampling_frequency is not set, this could lead to wrong results.\n"

View File

@@ -18,9 +18,14 @@
#include "file_timestamp_signal_source.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <string>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
FileTimestampSignalSource::FileTimestampSignalSource(const ConfigurationInterface* configuration,
@@ -41,11 +46,18 @@ FileTimestampSignalSource::FileTimestampSignalSource(const ConfigurationInterfac
LOG(ERROR) << "This implementation only supports one output stream";
}
// override value with commandline flag, if present
// override value with commandline flag, if present
#if USE_GLOG_AND_GFLAGS
if (FLAGS_timestamp_source != "-")
{
timestamp_file_ = FLAGS_timestamp_source;
}
#else
if (absl::GetFlag(FLAGS_timestamp_source) != "-")
{
timestamp_file_ = absl::GetFlag(FLAGS_timestamp_source);
}
#endif
}

View File

@@ -19,11 +19,16 @@
#include "flexiband_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <teleorbit/frontend.h>
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -24,12 +24,17 @@
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <algorithm> // for max
#include <exception>
#include <iostream>
#include <vector>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configuration,

View File

@@ -19,7 +19,12 @@
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
@@ -58,11 +63,18 @@ FourBitCpxFileSignalSource::FourBitCpxFileSignalSource(
LOG(ERROR) << "This implementation only supports one output stream";
}
// override value with commandline flag, if present
// override value with commandline flag, if present
#if USE_GLOG_AND_GFLAGS
if (FLAGS_timestamp_source != "-")
{
timestamp_file_ = FLAGS_timestamp_source;
}
#else
if (absl::GetFlag(FLAGS_timestamp_source) != "-")
{
timestamp_file_ = absl::GetFlag(FLAGS_timestamp_source);
}
#endif
}

View File

@@ -18,12 +18,16 @@
#include "gen_signal_source.h"
#include <boost/lexical_cast.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include <gnuradio/message.h>
#include <sstream>
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
// Constructor
GenSignalSource::GenSignalSource(std::shared_ptr<GNSSBlockInterface> signal_generator,

View File

@@ -18,10 +18,15 @@
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "labsat23_source.h"
#include <glog/logging.h>
#include <iostream>
#include <sstream>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configuration,

View File

@@ -20,10 +20,15 @@
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <boost/exception/diagnostic_information.hpp>
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <iostream>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configuration,

View File

@@ -20,13 +20,18 @@
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream> // for std::cerr
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/check.h>
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -18,7 +18,12 @@
#include "nsr_file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -21,10 +21,15 @@
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <boost/exception/diagnostic_information.hpp>
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <iostream>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -20,9 +20,13 @@
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <iostream>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -18,11 +18,15 @@
#include "concurrent_queue.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <pmt/pmt.h>
#include <dbfcttc/raw_array.h>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -22,11 +22,16 @@
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <boost/exception/diagnostic_information.hpp>
#include <glog/logging.h>
#include <cstdint>
#include <iostream>
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configuration,

View File

@@ -17,8 +17,13 @@
#include "spir_file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/check.h>
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -19,13 +19,19 @@
#include "spir_gss6450_file_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/check.h>
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInterface* configuration,

View File

@@ -17,7 +17,12 @@
#include "two_bit_cpx_file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -19,9 +19,14 @@
#include "two_bit_packed_file_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/char_to_float.h>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;
TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(

View File

@@ -21,13 +21,18 @@
#include "gnss_sdr_filesystem.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <uhd/exception.hpp>
#include <uhd/types/device_addr.hpp>
#include <volk/volk.h>
#include <iostream>
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -17,7 +17,12 @@
#include "zmq_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
using namespace std::string_literals;

View File

@@ -75,10 +75,15 @@ target_link_libraries(signal_source_gr_blocks
PRIVATE
algorithms_libs
core_libs
Gflags::gflags
Glog::glog
)
if(ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(signal_source_gr_blocks PRIVATE Gflags::gflags Glog::glog)
target_compile_definitions(signal_source_gr_blocks PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
else()
target_link_libraries(signal_source_gr_blocks PRIVATE absl::flags absl::log)
endif()
target_include_directories(signal_source_gr_blocks
PUBLIC
${GNSSSDR_SOURCE_DIR}/src/core/receiver

View File

@@ -16,7 +16,12 @@
*/
#include "fifo_reader.h"
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
// initial construction; pass to private constructor
FifoReader::sptr FifoReader::make(const std::string &file_name, const std::string &sample_type)

View File

@@ -20,9 +20,13 @@
#include "rtl_tcp_commands.h"
#include <boost/bind/bind.hpp>
#include <boost/thread/thread.hpp>
#include <glog/logging.h>
#include <map>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
namespace ip = boost::asio::ip;

View File

@@ -74,11 +74,16 @@ target_link_libraries(signal_source_libs
Boost::headers
Gnuradio::runtime
PRIVATE
Gflags::gflags
Glog::glog
core_libs
)
if(ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(signal_source_libs PRIVATE Gflags::gflags Glog::glog)
target_compile_definitions(signal_source_libs PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
else()
target_link_libraries(signal_source_libs PRIVATE absl::flags absl::log)
endif()
target_include_directories(signal_source_libs
PUBLIC
${GNSSSDR_SOURCE_DIR}/src/core/receiver

View File

@@ -16,7 +16,6 @@
* -----------------------------------------------------------------------------
*/
#include "ad9361_manager.h"
#include <glog/logging.h>
#include <ad9361.h>
#include <cmath>
#include <fstream> // for ifstream
@@ -25,6 +24,12 @@
#include <utility>
#include <vector>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
/* check return value of attr_write function */
void errchk(int v, const char *what)
{

View File

@@ -15,7 +15,6 @@
#include "ad936x_iio_custom.h"
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <glog/logging.h>
#include <chrono>
#include <cmath>
#include <fstream>
@@ -24,6 +23,12 @@
#include <utility>
#include <vector>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
ad936x_iio_custom::ad936x_iio_custom(int debug_level_, int log_level_)
{
receive_samples = false;

View File

@@ -25,7 +25,6 @@
#include "fpga_buffer_monitor.h"
#include "gnss_sdr_create_directory.h"
#include "gnss_sdr_filesystem.h"
#include <glog/logging.h>
#include <ctime> // for time, localtime
#include <fcntl.h> // for open, O_RDWR, O_SYNC
#include <fstream> // for string, ofstream
@@ -34,6 +33,12 @@
#include <unistd.h> // for close
#include <utility> // for move
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Fpga_buffer_monitor::Fpga_buffer_monitor(const std::string &device_name,
uint32_t num_freq_bands,

View File

@@ -21,12 +21,17 @@
#include "fpga_dynamic_bit_selection.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <fcntl.h> // for open, O_RDWR, O_SYNC
#include <iostream> // for cout
#include <sys/mman.h> // for mmap
#include <unistd.h> // for close
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Fpga_dynamic_bit_selection::Fpga_dynamic_bit_selection(bool enable_rx1_band, bool enable_rx2_band)
: d_map_base_freq_band_1(nullptr),
d_map_base_freq_band_2(nullptr),

View File

@@ -21,12 +21,17 @@
*/
#include "fpga_switch.h"
#include <glog/logging.h>
#include <fcntl.h> // for open, O_RDWR, O_SYNC
#include <iostream> // for cout
#include <sys/mman.h> // for mmap
#include <unistd.h> // for close
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Fpga_Switch::Fpga_Switch(const std::string &device_name)
{
if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1)

View File

@@ -19,11 +19,16 @@
#include "gnss_sdr_valve.h"
#include "command_event.h"
#include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature
#include <algorithm> // for min
#include <cstring> // for memcpy
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
Concurrent_Queue<pmt::pmt_t>* queue,