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
+7 -1
View File
@@ -23,10 +23,16 @@ target_link_libraries(pvt_adapters
pvt_gr_blocks
PRIVATE
gnss_sdr_flags
Glog::glog
pvt_libs
)
if(ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(pvt_adapters PRIVATE Glog::glog)
target_compile_definitions(pvt_adapters PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
else()
target_link_libraries(pvt_adapters PRIVATE absl::flags absl::log)
endif()
target_include_directories(pvt_adapters
PUBLIC
${GNSSSDR_SOURCE_DIR}/src/core/interfaces
+23 -2
View File
@@ -26,8 +26,12 @@
#include "gps_ephemeris.h" // for Gps_Ephemeris
#include "pvt_conf.h" // for Pvt_Conf
#include "rtklib_rtkpos.h" // for rtkfree, rtkinit
#include <glog/logging.h> // for LOG
#include <iostream> // for std::cout
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
#if USE_STD_COMMON_FACTOR
#include <numeric>
namespace bc = std;
@@ -88,6 +92,7 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
// RINEX version
pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3);
#if USE_GLOG_AND_GFLAGS
if (FLAGS_RINEX_version == "3.01" || FLAGS_RINEX_version == "3.02" || FLAGS_RINEX_version == "3")
{
pvt_output_parameters.rinex_version = 3;
@@ -96,13 +101,29 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration,
{
pvt_output_parameters.rinex_version = 2;
}
#else
if (absl::GetFlag(FLAGS_RINEX_version) == "3.01" || absl::GetFlag(FLAGS_RINEX_version) == "3.02" || absl::GetFlag(FLAGS_RINEX_version) == "3")
{
pvt_output_parameters.rinex_version = 3;
}
else if (absl::GetFlag(FLAGS_RINEX_version) == "2.10" || absl::GetFlag(FLAGS_RINEX_version) == "2.11" || absl::GetFlag(FLAGS_RINEX_version) == "2")
{
pvt_output_parameters.rinex_version = 2;
}
#endif
pvt_output_parameters.rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), pvt_output_parameters.output_rate_ms);
pvt_output_parameters.rinex_name = configuration->property(role + ".rinex_name", std::string("-"));
#if USE_GLOG_AND_GFLAGS
if (FLAGS_RINEX_name != "-")
{
pvt_output_parameters.rinex_name = FLAGS_RINEX_name;
}
#else
if (absl::GetFlag(FLAGS_RINEX_name) != "-")
{
pvt_output_parameters.rinex_name = absl::GetFlag(FLAGS_RINEX_name);
}
#endif
// RTCM Printer settings
pvt_output_parameters.flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
pvt_output_parameters.rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname);
@@ -27,11 +27,16 @@ target_link_libraries(pvt_gr_blocks
PRIVATE
algorithms_libs
pvt_libs
Gflags::gflags
Glog::glog
Boost::serialization
)
if(ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(pvt_gr_blocks PRIVATE Gflags::gflags Glog::glog)
target_compile_definitions(pvt_gr_blocks PRIVATE -DUSE_GLOG_AND_GFLAGS=1)
else()
target_link_libraries(pvt_gr_blocks PRIVATE absl::log)
endif()
if(GNURADIO_USES_STD_POINTERS)
target_compile_definitions(pvt_gr_blocks
PUBLIC -DGNURADIO_USES_STD_POINTERS=1
@@ -64,7 +64,6 @@
#include <boost/exception/exception.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/nvp.hpp> // for nvp, make_nvp
#include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature
#include <pmt/pmt_sugar.h> // for mp
#include <algorithm> // for sort, unique
@@ -82,6 +81,12 @@
#include <typeinfo> // for std::type_info, typeid
#include <utility> // for pair
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
+9 -2
View File
@@ -92,11 +92,18 @@ target_link_libraries(pvt_libs
algorithms_libs_rtklib
PRIVATE
algorithms_libs
Gflags::gflags
Glog::glog
gnss_sdr_flags
Matio::matio
)
if(ENABLE_GLOG_AND_GFLAGS)
target_link_libraries(pvt_libs PUBLIC Glog::glog)
target_compile_definitions(pvt_libs PUBLIC -DUSE_GLOG_AND_GFLAGS=1)
else()
target_link_libraries(pvt_libs PUBLIC absl::log)
endif()
get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY)
# for concurrent_queue.h
+6 -1
View File
@@ -20,7 +20,6 @@
#include "an_packet_printer.h"
#include "rtklib_solver.h" // for Rtklib_Solver
#include <glog/logging.h> // for DLOG
#include <cmath> // for M_PI
#include <cstring> // for memcpy
#include <fcntl.h> // for fcntl
@@ -29,6 +28,12 @@
#include <termios.h> // values for termios
#include <unistd.h> // for write(), read(), close()
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
An_Packet_Printer::An_Packet_Printer(const std::string& an_dump_devname)
: d_start(std::chrono::system_clock::now()),
+1 -1
View File
@@ -135,7 +135,7 @@ std::array<double, 2> Geohash::decode(std::string geohash) const
std::array<double, 4> Geohash::bounds(std::string geohash) const
{
if (geohash.length() == 0)
if (geohash.empty())
{
throw std::runtime_error("Invalid geohash");
}
+6 -1
View File
@@ -20,13 +20,18 @@
#include "gnss_sdr_filesystem.h"
#include "pvt_solution.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <ctime> // for tm
#include <exception> // for exception
#include <iomanip> // for operator<<
#include <iostream> // for cout, cerr
#include <sstream> // for stringstream
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) : geojson_base_path(base_path),
first_pos(true)
+5 -1
View File
@@ -20,13 +20,17 @@
#include "gnss_sdr_filesystem.h"
#include "pvt_solution.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <ctime> // for tm
#include <exception> // for exception
#include <iomanip> // for operator<<
#include <iostream> // for cout, cerr
#include <sstream> // for stringstream
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Gpx_Printer::Gpx_Printer(const std::string& base_path) : indent(" "),
gpx_base_path(base_path),
@@ -21,7 +21,6 @@
#include "galileo_has_data.h"
#include "gnss_sdr_filesystem.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <algorithm> // for std::find, std::count
#include <bitset> // for std::bitset
#include <cstdint> // for uint8_t, ...
@@ -32,6 +31,12 @@
#include <iostream> // for std::cout, std::cerr
#include <sstream> // for std::stringstream
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Has_Simple_Printer::Has_Simple_Printer(const std::string& base_path,
const std::string& filename,
+5 -1
View File
@@ -20,7 +20,6 @@
#include "gnss_sdr_filesystem.h"
#include "pvt_solution.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <cstdlib> // for mkstemp
#include <ctime> // for tm
#include <exception> // for exception
@@ -30,6 +29,11 @@
#include <sys/stat.h> // for S_IXUSR | S_IRWXG | S_IRWXO
#include <sys/types.h> // for mode_t
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Kml_Printer::Kml_Printer(const std::string& base_path) : kml_base_path(base_path),
indent(" "),
+6 -1
View File
@@ -23,7 +23,6 @@
#include "gnss_sdr_filesystem.h"
#include "rtklib_solution.h"
#include "rtklib_solver.h"
#include <glog/logging.h>
#include <array>
#include <cstdint>
#include <exception>
@@ -32,6 +31,12 @@
#include <termios.h>
#include <utility>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Nmea_Printer::Nmea_Printer(const std::string& filename,
bool flag_nmea_output_file,
+5 -1
View File
@@ -16,8 +16,12 @@
*/
#include "pvt_kf.h"
#include <glog/logging.h>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
void Pvt_Kf::init_Kf(const arma::vec& p,
const arma::vec& v,
+5 -1
View File
@@ -17,10 +17,14 @@
#include "pvt_solution.h"
#include "MATH_CONSTANTS.h"
#include <glog/logging.h>
#include <cmath>
#include <cstddef>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection)
{
+5 -1
View File
@@ -42,7 +42,6 @@
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/local_time/local_time.hpp>
#include <boost/date_time/time_zone_base.hpp>
#include <glog/logging.h>
#include <algorithm> // for min and max
#include <array>
#include <cmath> // for floor
@@ -55,6 +54,11 @@
#include <utility>
#include <vector>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Rinex_Printer::Rinex_Printer(int32_t conf_version,
const std::string& base_path,
+6 -1
View File
@@ -29,7 +29,6 @@
#include "gps_ephemeris.h"
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <algorithm> // for std::max, std::min, std::copy_n
#include <array>
#include <bitset>
@@ -47,6 +46,12 @@
#include <utility>
#include <vector>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
/** \addtogroup PVT
* \{ */
/** \addtogroup PVT_libs
+5 -1
View File
@@ -30,7 +30,6 @@
#include "rtcm.h"
#include "rtklib_solver.h"
#include <boost/exception/diagnostic_information.hpp>
#include <glog/logging.h>
#include <ctime> // for tm
#include <exception> // for exception
#include <fcntl.h> // for O_RDWR
@@ -39,6 +38,11 @@
#include <unistd.h> // for close, write
#include <vector> // for std::vector
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Rtcm_Printer::Rtcm_Printer(const std::string& filename,
bool flag_rtcm_file_dump,
+5 -1
View File
@@ -35,7 +35,6 @@
#include "gnss_sdr_filesystem.h"
#include "rtklib_rtkpos.h"
#include "rtklib_solution.h"
#include <glog/logging.h>
#include <matio.h>
#include <algorithm>
#include <cmath>
@@ -43,6 +42,11 @@
#include <utility>
#include <vector>
#if USE_GLOG_AND_GFLAGS
#include <glog/logging.h>
#else
#include <absl/log/log.h>
#endif
Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk,
const Pvt_Conf &conf,