From cd2dfe0bc2a3157b1b5db3eca04e5a784f1830b3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 6 Jun 2020 14:11:19 +0200 Subject: [PATCH 01/54] Fix for Boost 1.73 --- .../signal_source/gnuradio_blocks/CMakeLists.txt | 7 +++++++ .../gnuradio_blocks/rtl_tcp_signal_source_c.cc | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 3a4b47d50..45ab8e9e3 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -103,6 +103,13 @@ if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) ) endif() +if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) + target_compile_definitions(signal_source_gr_blocks + PRIVATE + -DBOOST_173_OR_GREATER=1 + ) +endif() + if(CMAKE_VERSION VERSION_GREATER 3.1) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 9b97034dd..6ad2e2af8 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -133,9 +133,14 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, LOG(INFO) << "Found " << info_.get_type_name() << " tuner."; } - // 6. Start reading +// 6. Start reading +#if BOOST_173_OR_GREATER + boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); +#else boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, _1, _2)); // NOLINT(modernize-avoid-bind) +#endif + boost::thread( #if HAS_GENERIC_LAMBDA From d2e9b0aece56e43d4a03a4b8dc4f5be3f357411e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 6 Jun 2020 20:07:00 +0200 Subject: [PATCH 02/54] Fix for Boost 1.73 --- CMakeLists.txt | 2 +- .../gnuradio_blocks/rtl_tcp_signal_source_c.cc | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9524d4956..7ed45c4c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -746,7 +746,7 @@ if(Boost_VERSION_STRING VERSION_LESS 1.73) endif() # Workaround for https://github.com/boostorg/format/issues/67 -if(Boost_VERSION_STRING VERSION_GREATER 1.71) +if((Boost_VERSION_STRING VERSION_GREATER 1.71) AND (Boost_VERSION_STRING VERSION_LESS 1.73)) set(CMAKE_CXX_STANDARD 17) endif() diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 6ad2e2af8..c94c0195a 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -21,7 +21,7 @@ #include "rtl_tcp_signal_source_c.h" #include "rtl_tcp_commands.h" -#include +#include #include #include #include @@ -135,13 +135,13 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, // 6. Start reading #if BOOST_173_OR_GREATER - boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); + boost::asio::async_read(socket_, boost::asio::buffer(data_), + boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); // NOLINT(modernize-avoid-bind) #else boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, _1, _2)); // NOLINT(modernize-avoid-bind) #endif - boost::thread( #if HAS_GENERIC_LAMBDA [ObjectPtr = &io_context_] { ObjectPtr->run(); }); @@ -318,10 +318,16 @@ void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, } // let woker know that more data is available not_empty_.notify_one(); - // Read some more +// Read some more +#if BOOST_173_OR_GREATER + boost::asio::async_read(socket_, + boost::asio::buffer(data_), + boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); // NOLINT(modernize-avoid-bind) +#else boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, _1, _2)); // NOLINT(modernize-avoid-bind) +#endif } } From 8ba33a357dceeffddf98a17374b564cf92c9af6b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 6 Jun 2020 21:27:25 +0200 Subject: [PATCH 03/54] Find libgfortran in OpenSUSE and Fedora --- cmake/Modules/FindGFORTRAN.cmake | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index 0123e6314..fce8df19d 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -226,6 +226,42 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/gcc/x86_64-linux-gnux32/10 /usr/lib/gcc/x86_64-kfreebsd-gnu/10 /usr/lib/gcc/i686-kfreebsd-gnu/10 + /usr/lib64/gcc/x86_64-suse-linux/7 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/7 + /usr/lib64/gcc/powerpc64le-suse-linux/7 + /usr/lib/gcc/i586-suse-linux/7 + /usr/lib64/gcc/aarch64-suse-linux/7 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/7 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 + /usr/lib64/gcc/riscv64-suse-linux/7 + /usr/lib64/gcc/s390x-suse-linux/7 + /usr/lib64/gcc/x86_64-suse-linux/10 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/10 + /usr/lib64/gcc/powerpc64le-suse-linux/10 + /usr/lib/gcc/i586-suse-linux/10 + /usr/lib64/gcc/aarch64-suse-linux/10 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/10 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/10 + /usr/lib64/gcc/riscv64-suse-linux/10 + /usr/lib64/gcc/s390x-suse-linux/10 + /usr/lib/gcc/x86_64-redhat-linux/8 # Fedora + /usr/lib/gcc/i686-redhat-linux/8 + /usr/lib/gcc/aarch64-redhat-linux/8 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/8 + /usr/lib/gcc/ppc64le-redhat-linux/8 + /usr/lib/gcc/s390x-redhat-linux/8 + /usr/lib/gcc/x86_64-redhat-linux/9 # Fedora + /usr/lib/gcc/i686-redhat-linux/9 + /usr/lib/gcc/aarch64-redhat-linux/9 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/9 + /usr/lib/gcc/ppc64le-redhat-linux/9 + /usr/lib/gcc/s390x-redhat-linux/9 + /usr/lib/gcc/x86_64-redhat-linux/10 # Fedora + /usr/lib/gcc/i686-redhat-linux/10 + /usr/lib/gcc/aarch64-redhat-linux/10 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/10 + /usr/lib/gcc/ppc64le-redhat-linux/10 + /usr/lib/gcc/s390x-redhat-linux/10 /usr/local/lib /usr/local/lib64 /usr/local/lib/i386 From 065706cd32d0305ac76f0a41521321afc3ae6484 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 6 Jun 2020 21:51:26 +0200 Subject: [PATCH 04/54] Find libgfortran in OpenSUSE --- cmake/Modules/FindGFORTRAN.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index fce8df19d..801dab5fb 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -235,6 +235,24 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 /usr/lib64/gcc/riscv64-suse-linux/7 /usr/lib64/gcc/s390x-suse-linux/7 + /usr/lib64/gcc/x86_64-suse-linux/8 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/8 + /usr/lib64/gcc/powerpc64le-suse-linux/8 + /usr/lib/gcc/i586-suse-linux/8 + /usr/lib64/gcc/aarch64-suse-linux/8 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/8 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 + /usr/lib64/gcc/riscv64-suse-linux/8 + /usr/lib64/gcc/s390x-suse-linux/8 + /usr/lib64/gcc/x86_64-suse-linux/9 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/9 + /usr/lib64/gcc/powerpc64le-suse-linux/9 + /usr/lib/gcc/i586-suse-linux/9 + /usr/lib64/gcc/aarch64-suse-linux/9 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/9 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 + /usr/lib64/gcc/riscv64-suse-linux/9 + /usr/lib64/gcc/s390x-suse-linux/9 /usr/lib64/gcc/x86_64-suse-linux/10 # openSUSE /usr/lib64/gcc/powerpc64-suse-linux/10 /usr/lib64/gcc/powerpc64le-suse-linux/10 From e7124657427b531f189619889a85d0033e30764e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 6 Jun 2020 23:35:10 +0200 Subject: [PATCH 05/54] Update changelog --- docs/changelog.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index efe3a9b1d..dfa900dea 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -20,23 +20,24 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades Date: Sat, 6 Jun 2020 23:41:38 +0200 Subject: [PATCH 06/54] Replace by --- src/algorithms/channel/libs/channel_msg_receiver_cc.cc | 2 +- .../observables/gnuradio_blocks/hybrid_observables_gs.cc | 2 +- .../gnuradio_blocks/gr_complex_ip_packet_source.cc | 2 +- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 2 +- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 2 +- .../gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- src/core/libs/channel_status_msg_receiver.cc | 2 +- .../acquisition/acq_performance_test.cc | 2 +- .../acquisition/beidou_b1i_pcps_acquisition_test.cc | 2 +- .../acquisition/beidou_b3i_pcps_acquisition_test.cc | 2 +- .../galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc | 2 +- .../galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc | 2 +- .../galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc | 2 +- .../acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc | 2 +- ...alileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...leo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc | 2 +- .../galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc | 2 +- .../galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc | 2 +- .../acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc | 2 +- .../acquisition/glonass_l1_ca_pcps_acquisition_test.cc | 2 +- .../acquisition/glonass_l2_ca_pcps_acquisition_test.cc | 2 +- .../acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 2 +- .../acquisition/gps_l1_ca_pcps_acquisition_test.cc | 2 +- .../gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc | 2 +- .../gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc | 2 +- .../gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc | 2 +- .../acquisition/gps_l2_m_pcps_acquisition_test.cc | 2 +- .../signal-processing-blocks/libs/acquisition_msg_rx.cc | 2 +- .../observables/hybrid_observables_test.cc | 2 +- .../observables/hybrid_observables_test_fpga.cc | 2 +- .../telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc | 2 +- .../tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc | 2 +- .../tracking/glonass_l1_ca_dll_pll_tracking_test.cc | 2 +- .../tracking/gps_l1_ca_dll_pll_tracking_test.cc | 2 +- .../tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc | 2 +- .../tracking/gps_l1_ca_kf_tracking_test.cc | 2 +- .../tracking/gps_l2_m_dll_pll_tracking_test.cc | 2 +- .../signal-processing-blocks/tracking/tracking_pull-in_test.cc | 2 +- .../tracking/tracking_pull-in_test_fpga.cc | 2 +- src/utils/front-end-cal/main.cc | 2 +- 43 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index a7dcfbeae..4487685f3 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -28,7 +28,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 9eb58fef1..ae3b93b9e 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -37,7 +37,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if HAS_STD_FILESYSTEM diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index b37350d15..5d68f362d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -26,7 +26,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif const int FIFO_SIZE = 1472000; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index b543ae979..ae2a07797 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -61,7 +61,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if HAS_STD_FILESYSTEM diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index cc6cf931d..226749708 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -52,7 +52,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if HAS_STD_FILESYSTEM diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 824cb74ba..b523bef9f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -49,7 +49,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #define CN0_ESTIMATION_SAMPLES 10 diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 752bee325..b51644b77 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -47,7 +47,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 781683187..ada36aeac 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -46,7 +46,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #define CN0_ESTIMATION_SAMPLES 10 diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 58373d6e4..2457fc9d3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -45,7 +45,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #define CN0_ESTIMATION_SAMPLES 10 diff --git a/src/core/libs/channel_status_msg_receiver.cc b/src/core/libs/channel_status_msg_receiver.cc index 5b126adcc..e584b4038 100644 --- a/src/core/libs/channel_status_msg_receiver.cc +++ b/src/core/libs/channel_status_msg_receiver.cc @@ -28,7 +28,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index b5a8b04e4..df47db7d7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -52,7 +52,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if HAS_STD_FILESYSTEM diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index 7528cd185..58bfb3bb9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -44,7 +44,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index 3d2ac0ac9..3729a266f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -44,7 +44,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index 6a712178e..73c8ca05c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -40,7 +40,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index 89ba3476e..a4b423367 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -38,7 +38,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index 774616f0d..c0409da58 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -48,7 +48,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 0d2e1b0ed..b60499982 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -45,7 +45,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index f9c704aca..53f824283 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -41,7 +41,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 88ef538e5..72f4ed117 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -43,7 +43,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 94d48aae7..2ebe7e26a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -42,7 +42,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index b59d37f78..6c46fe2cf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -38,7 +38,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 6d25bc460..0219af232 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -44,7 +44,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 59a81297d..9ded82469 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -39,7 +39,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index 949418857..26fac0879 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -42,7 +42,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index bd817dcff..59920d0ce 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -44,7 +44,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 8db0e87af..bc28603fd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -42,7 +42,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index ae6a5060d..84163dbfb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -40,7 +40,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 68953fe13..d47208480 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -41,7 +41,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index 5b6bb9e38..b1bf66d9f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -42,7 +42,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index c4c2a7951..e8c844f58 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -44,7 +44,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc index 0d143a34a..f527989d9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc @@ -26,7 +26,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif Acquisition_msg_rx_sptr Acquisition_msg_rx_make() diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 931d5c21c..aa9b8db5f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -74,7 +74,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index 60f686a9e..d2add5517 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -74,7 +74,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index 65b2856a9..ff7f88336 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -52,7 +52,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if GNURADIO_USES_STD_POINTERS #include diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index e7d71d6a7..7f6050ef6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -37,7 +37,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index 62e67f10f..c15b1e1ad 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -38,7 +38,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 2ef143e75..1d2041abc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -45,7 +45,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index e3c880966..88496a4f2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -50,7 +50,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index eef1afe19..5b66f09b5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -44,7 +44,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 7ce9ba42a..6582b9f49 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -38,7 +38,7 @@ #include #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 #include diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index 484e2b890..a20a5f8b8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -60,7 +60,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index ef93fd2a3..6f5deee2d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -59,7 +59,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #ifdef GR_GREATER_38 diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 0749eae53..6d7e2e667 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -71,7 +71,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if HAS_STD_FILESYSTEM From 7e0502362a24c951dd537a9f4a0313e11da4faff Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 7 Jun 2020 01:04:02 +0200 Subject: [PATCH 07/54] Update Protocol Buffers to 3.12.3 --- CMakeLists.txt | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ed45c4c2..14ea9c468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,7 +301,7 @@ set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GPSTK_LOCAL_VERSION "3.0.0") set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.17") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.10") -set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.12.2") +set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.12.3") if(CMAKE_VERSION VERSION_LESS "3.0.2") set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") # Fix for CentOS 7 diff --git a/README.md b/README.md index 0bf003ca5..2d129c1f9 100644 --- a/README.md +++ b/README.md @@ -394,9 +394,9 @@ $ sudo apt-get install autoconf automake libtool curl make g++ unzip and then: ``` -$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.2/protobuf-cpp-3.12.2.tar.gz -$ tar xvfz protobuf-cpp-3.12.2.tar.gz -$ cd protobuf-3.12.2 +$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protobuf-cpp-3.12.3.tar.gz +$ tar xvfz protobuf-cpp-3.12.3.tar.gz +$ cd protobuf-3.12.3 $ ./autogen.sh $ ./configure $ make From 2a3d682f1f966cc1df0d42ef742df104cddfead0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 8 Jun 2020 20:04:01 +0200 Subject: [PATCH 08/54] Make use of target_sources(), make use of target propagation to reduce redundancy in dependencies, some fixes for Clang and CMake < 3.11. Use generic lambdas with auto --- CMakeLists.txt | 4 +- src/algorithms/PVT/adapters/CMakeLists.txt | 24 +-- .../PVT/gnuradio_blocks/CMakeLists.txt | 26 ++-- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 4 +- src/algorithms/PVT/libs/CMakeLists.txt | 19 ++- .../acquisition/adapters/CMakeLists.txt | 22 +-- .../gnuradio_blocks/CMakeLists.txt | 15 +- .../acquisition/libs/CMakeLists.txt | 21 ++- .../channel/adapters/CMakeLists.txt | 29 ++-- src/algorithms/channel/libs/CMakeLists.txt | 17 ++- .../channel/libs/channel_msg_receiver_cc.cc | 2 +- .../conditioner/adapters/CMakeLists.txt | 18 ++- .../data_type_adapter/adapters/CMakeLists.txt | 29 ++-- .../gnuradio_blocks/CMakeLists.txt | 21 ++- .../input_filter/adapters/CMakeLists.txt | 30 ++-- .../gnuradio_blocks/CMakeLists.txt | 20 ++- src/algorithms/libs/CMakeLists.txt | 30 +++- src/algorithms/libs/rtklib/CMakeLists.txt | 18 ++- .../observables/adapters/CMakeLists.txt | 25 ++- .../gnuradio_blocks/CMakeLists.txt | 25 +-- .../gnuradio_blocks/hybrid_observables_gs.cc | 2 +- .../observables/libs/CMakeLists.txt | 18 ++- .../resampler/adapters/CMakeLists.txt | 22 ++- .../resampler/gnuradio_blocks/CMakeLists.txt | 21 ++- .../signal_generator/adapters/CMakeLists.txt | 24 +-- .../gnuradio_blocks/CMakeLists.txt | 24 +-- .../signal_source/adapters/CMakeLists.txt | 24 +-- .../gnuradio_blocks/CMakeLists.txt | 24 ++- .../signal_source/libs/CMakeLists.txt | 18 ++- .../telemetry_decoder/adapters/CMakeLists.txt | 22 ++- .../gnuradio_blocks/CMakeLists.txt | 21 ++- .../telemetry_decoder/libs/CMakeLists.txt | 21 ++- .../libs/libswiftcnav/CMakeLists.txt | 21 ++- .../tracking/adapters/CMakeLists.txt | 24 +-- .../tracking/gnuradio_blocks/CMakeLists.txt | 27 ++-- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 2 +- .../dll_pll_veml_tracking_fpga.cc | 2 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- src/algorithms/tracking/libs/CMakeLists.txt | 16 +- src/core/libs/CMakeLists.txt | 17 ++- src/core/libs/channel_status_msg_receiver.cc | 2 +- src/core/libs/supl/CMakeLists.txt | 29 +++- src/core/monitor/CMakeLists.txt | 27 +++- src/core/receiver/CMakeLists.txt | 29 ++-- src/core/system_parameters/CMakeLists.txt | 21 ++- src/main/CMakeLists.txt | 19 ++- src/tests/CMakeLists.txt | 144 +++++++++++------- src/tests/system-tests/libs/CMakeLists.txt | 21 ++- .../acquisition/acq_performance_test.cc | 2 +- .../beidou_b1i_pcps_acquisition_test.cc | 2 +- .../beidou_b3i_pcps_acquisition_test.cc | 2 +- ...8ms_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...cps_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...e1_pcps_ambiguous_acquisition_gsoc_test.cc | 2 +- ...ileo_e1_pcps_ambiguous_acquisition_test.cc | 2 +- ...wsr_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...ync_ambiguous_acquisition_gsoc2014_test.cc | 2 +- ...ong_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...cps_acquisition_gsoc2014_gensource_test.cc | 2 +- ...ss_l1_ca_pcps_acquisition_gsoc2017_test.cc | 2 +- .../glonass_l1_ca_pcps_acquisition_test.cc | 2 +- .../glonass_l2_ca_pcps_acquisition_test.cc | 2 +- ...ps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 2 +- .../gps_l1_ca_pcps_acquisition_test.cc | 2 +- ...a_pcps_opencl_acquisition_gsoc2013_test.cc | 2 +- ...cps_quicksync_acquisition_gsoc2014_test.cc | 2 +- ..._ca_pcps_tong_acquisition_gsoc2013_test.cc | 2 +- .../gps_l2_m_pcps_acquisition_test.cc | 2 +- .../libs/CMakeLists.txt | 23 ++- .../libs/acquisition_msg_rx.cc | 2 +- .../observables/hybrid_observables_test.cc | 4 +- .../hybrid_observables_test_fpga.cc | 2 +- .../gps_l1_ca_telemetry_decoder_test.cc | 4 +- ...onass_l1_ca_dll_pll_c_aid_tracking_test.cc | 2 +- .../glonass_l1_ca_dll_pll_tracking_test.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_test.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 2 +- .../tracking/gps_l1_ca_kf_tracking_test.cc | 2 +- .../gps_l2_m_dll_pll_tracking_test.cc | 2 +- .../tracking/tracking_pull-in_test.cc | 2 +- .../tracking/tracking_pull-in_test_fpga.cc | 2 +- src/utils/front-end-cal/CMakeLists.txt | 37 +++-- src/utils/front-end-cal/main.cc | 2 +- src/utils/rinex-tools/CMakeLists.txt | 22 ++- src/utils/rinex2assist/CMakeLists.txt | 23 ++- 88 files changed, 801 insertions(+), 423 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14ea9c468..84c1abf5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -736,8 +736,8 @@ endif() if(Boost_VERSION_STRING VERSION_LESS 1.73) # Disable concepts to address https://github.com/boostorg/asio/issues/312 - if((CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9) OR - (CMAKE_CXX_COMPILER_ID MATCHES Clang)) + if(((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9) OR + CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (CMAKE_VERSION VERSION_GREATER 3.11)) target_compile_definitions(Boost::headers INTERFACE -DBOOST_ASIO_DISABLE_CONCEPTS diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 75661be5b..2f0cf3f84 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -8,22 +8,22 @@ # -set(PVT_ADAPTER_SOURCES - rtklib_pvt.cc -) - -set(PVT_ADAPTER_HEADERS - rtklib_pvt.h -) - -source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) - -add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(pvt_adapters STATIC) + target_sources(pvt_adapters + PRIVATE + rtklib_pvt.cc + PUBLIC + rtklib_pvt.h + ) +else() + source_group(Headers FILES rtklib_pvt.h) + add_library(pvt_adapters rtklib_pvt.cc rtklib_pvt.h) +endif() target_link_libraries(pvt_adapters PUBLIC pvt_gr_blocks - algorithms_libs_rtklib PRIVATE gnss_sdr_flags Glog::glog diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index 220115e86..c52b217da 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -7,17 +7,18 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -set(PVT_GR_BLOCKS_SOURCES - rtklib_pvt_gs.cc -) - -set(PVT_GR_BLOCKS_HEADERS - rtklib_pvt_gs.h -) - -source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS}) - -add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(pvt_gr_blocks STATIC) + target_sources(pvt_gr_blocks + PRIVATE + rtklib_pvt_gs.cc + PUBLIC + rtklib_pvt_gs.h + ) +else() + source_group(Headers FILES rtklib_pvt_gs.h) + add_library(pvt_gr_blocks rtklib_pvt_gs.cc rtklib_pvt_gs.h) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -32,7 +33,6 @@ endif() target_link_libraries(pvt_gr_blocks PUBLIC algorithms_libs_rtklib - core_system_parameters Boost::date_time Gnuradio::pmt Gnuradio::runtime @@ -49,7 +49,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(pvt_gr_blocks diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index f3f68f251..77f2bef56 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -76,7 +76,7 @@ #if HAS_GENERIC_LAMBDA #else -#include +#include #endif #if HAS_STD_FILESYSTEM @@ -192,7 +192,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, this->message_port_register_in(pmt::mp("telemetry")); this->set_msg_handler(pmt::mp("telemetry"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_telemetry(PH1); }); + [this](auto&& PH1) { msg_handler_telemetry(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, boost::placeholders::_1)); diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index aacfe2da5..e8a2d1188 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -23,7 +23,6 @@ set(PVT_LIB_SOURCES rtklib_solver.cc pvt_conf.cc monitor_pvt_udp_sink.cc - ${PROTO_SRCS} ) set(PVT_LIB_HEADERS @@ -42,15 +41,25 @@ set(PVT_LIB_HEADERS monitor_pvt_udp_sink.h monitor_pvt.h serdes_monitor_pvt.h - ${PROTO_HDRS} ) list(SORT PVT_LIB_HEADERS) list(SORT PVT_LIB_SOURCES) -source_group(Headers FILES ${PVT_LIB_HEADERS}) - -add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(pvt_libs STATIC) + target_sources(pvt_libs + PRIVATE + ${PROTO_SRCS} + ${PROTO_HDRS} + ${PVT_LIB_SOURCES} + PUBLIC + ${PVT_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${PVT_LIB_HEADERS} ${PROTO_HDRS}) + add_library(pvt_libs ${PVT_LIB_SOURCES} ${PROTO_SRCS} ${PVT_LIB_HEADERS} ${PROTO_HDRS}) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM=1) diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 355be8398..b2747381d 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -80,24 +80,27 @@ endif() list(SORT ACQ_ADAPTER_HEADERS) list(SORT ACQ_ADAPTER_SOURCES) -source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) - -add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(acquisition_adapters STATIC) + target_sources(acquisition_adapters + PRIVATE + ${ACQ_ADAPTER_SOURCES} + PUBLIC + ${ACQ_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) + add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) +endif() target_link_libraries(acquisition_adapters PUBLIC - algorithms_libs acquisition_gr_blocks - acquisition_libs - channel_libs - core_system_parameters Gnuradio::blocks PRIVATE gnss_sdr_flags Boost::headers - Gflags::gflags Glog::glog - Gnuradio::fft ) if(GNURADIO_USES_STD_POINTERS) @@ -115,6 +118,7 @@ endif() if(ENABLE_FPGA) target_link_libraries(acquisition_adapters PRIVATE + Gnuradio::fft Volk::volk Volkgnsssdr::volkgnsssdr ) diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 8ff77ec73..6dc51cf5a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -43,9 +43,18 @@ endif() list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) - -add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(acquisition_gr_blocks STATIC) + target_sources(acquisition_gr_blocks + PRIVATE + ${ACQ_GR_BLOCKS_SOURCES} + PUBLIC + ${ACQ_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) + add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index f2ffac081..0d766d601 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -18,12 +18,21 @@ endif() list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_SOURCES) -source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) - -add_library(acquisition_libs - ${ACQUISITION_LIB_SOURCES} - ${ACQUISITION_LIB_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(acquisition_libs STATIC) + target_sources(acquisition_libs + PRIVATE + ${ACQUISITION_LIB_SOURCES} + PUBLIC + ${ACQUISITION_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) + add_library(acquisition_libs + ${ACQUISITION_LIB_SOURCES} + ${ACQUISITION_LIB_HEADERS} + ) +endif() target_link_libraries(acquisition_libs PRIVATE diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index f69e36136..39a7993c7 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -7,25 +7,28 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -set(CHANNEL_ADAPTER_SOURCES channel.cc) -set(CHANNEL_ADAPTER_HEADERS channel.h) - -add_library(channel_adapters - ${CHANNEL_ADAPTER_SOURCES} - ${CHANNEL_ADAPTER_HEADERS} -) - -source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(channel_adapters STATIC) + target_sources(channel_adapters + PRIVATE + channel.cc + PUBLIC + channel.h + ) +else() + source_group(Headers FILES channel.h) + add_library(channel_adapters + channel.cc + channel.h + ) +endif() target_link_libraries(channel_adapters PUBLIC - Gnuradio::runtime channel_libs - core_system_parameters PRIVATE - Gflags::gflags - Glog::glog gnss_sdr_flags + Glog::glog ) target_include_directories(channel_adapters diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 0c81f0f43..5be88b305 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -20,9 +20,18 @@ set(CHANNEL_FSM_HEADERS list(SORT CHANNEL_FSM_HEADERS) list(SORT CHANNEL_FSM_SOURCES) -source_group(Headers FILES ${CHANNEL_FSM_HEADERS}) - -add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(channel_libs STATIC) + target_sources(channel_libs + PRIVATE + ${CHANNEL_FSM_SOURCES} + PUBLIC + ${CHANNEL_FSM_HEADERS} + ) +else() + source_group(Headers FILES ${CHANNEL_FSM_HEADERS}) + add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) +endif() target_link_libraries(channel_libs PUBLIC @@ -47,7 +56,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(channel_libs diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 4487685f3..b168a4575 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -42,7 +42,7 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr cha this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index 839a138b3..80c580960 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -21,9 +21,21 @@ set(COND_ADAPTER_HEADERS list(SORT COND_ADAPTER_HEADERS) list(SORT COND_ADAPTER_SOURCES) -source_group(Headers FILES ${COND_ADAPTER_HEADERS}) - -add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(conditioner_adapters STATIC) + target_sources(conditioner_adapters + PRIVATE + ${COND_ADAPTER_SOURCES} + PUBLIC + ${COND_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${COND_ADAPTER_HEADERS}) + add_library(conditioner_adapters + ${COND_ADAPTER_SOURCES} + ${COND_ADAPTER_HEADERS} + ) +endif() target_link_libraries(conditioner_adapters PUBLIC diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 5a04a1e8c..ebb2a094f 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -29,15 +29,30 @@ set(DATATYPE_ADAPTER_HEADERS list(SORT DATATYPE_ADAPTER_HEADERS) list(SORT DATATYPE_ADAPTER_SOURCES) -source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(data_type_adapters STATIC) + target_sources(data_type_adapters + PRIVATE + ${DATATYPE_ADAPTER_SOURCES} + PUBLIC + ${DATATYPE_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) + add_library(data_type_adapters + ${DATATYPE_ADAPTER_SOURCES} + ${DATATYPE_ADAPTER_HEADERS} + ) +endif() -add_library(data_type_adapters - ${DATATYPE_ADAPTER_SOURCES} - ${DATATYPE_ADAPTER_HEADERS} +target_include_directories(data_type_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces ) target_link_libraries(data_type_adapters PUBLIC + algorithms_libs Gnuradio::blocks data_type_gr_blocks PRIVATE @@ -46,12 +61,6 @@ target_link_libraries(data_type_adapters Volk::volk ) -target_include_directories(data_type_adapters - PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/core/interfaces -) - if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(data_type_adapters diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 20ded2bd4..0297eee3d 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -23,12 +23,21 @@ set(DATA_TYPE_GR_BLOCKS_HEADERS list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) - -add_library(data_type_gr_blocks - ${DATA_TYPE_GR_BLOCKS_SOURCES} - ${DATA_TYPE_GR_BLOCKS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(data_type_gr_blocks STATIC) + target_sources(data_type_gr_blocks + PRIVATE + ${DATA_TYPE_GR_BLOCKS_SOURCES} + PUBLIC + ${DATA_TYPE_GR_BLOCKS_HEADERS} + ) +else() + source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) + add_library(data_type_gr_blocks + ${DATA_TYPE_GR_BLOCKS_SOURCES} + ${DATA_TYPE_GR_BLOCKS_HEADERS} + ) +endif() target_link_libraries(data_type_gr_blocks PUBLIC diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index d64c964cc..f27169b04 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -28,17 +28,25 @@ set(INPUT_FILTER_ADAPTER_HEADERS list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) -source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) - -add_library(input_filter_adapters - ${INPUT_FILTER_ADAPTER_SOURCES} - ${INPUT_FILTER_ADAPTER_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(input_filter_adapters STATIC) + target_sources(input_filter_adapters + PRIVATE + ${INPUT_FILTER_ADAPTER_SOURCES} + PUBLIC + ${INPUT_FILTER_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) + add_library(input_filter_adapters + ${INPUT_FILTER_ADAPTER_SOURCES} + ${INPUT_FILTER_ADAPTER_HEADERS} + ) +endif() target_link_libraries(input_filter_adapters PUBLIC - Gnuradio::blocks - Gnuradio::filter + algorithms_libs input_filter_gr_blocks PRIVATE Gflags::gflags @@ -46,12 +54,6 @@ target_link_libraries(input_filter_adapters Volk::volk ) -target_include_directories(input_filter_adapters - PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/core/interfaces -) - if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1) endif() diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index a8f6d21a9..1105e6e98 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -25,11 +25,21 @@ set(INPUT_FILTER_GR_BLOCKS_HEADERS list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) - -add_library(input_filter_gr_blocks - ${INPUT_FILTER_GR_BLOCKS_SOURCES} - ${INPUT_FILTER_GR_BLOCKS_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(input_filter_gr_blocks STATIC) + target_sources(input_filter_gr_blocks + PRIVATE + ${INPUT_FILTER_GR_BLOCKS_SOURCES} + PUBLIC + ${INPUT_FILTER_GR_BLOCKS_HEADERS} + ) +else() + source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) + add_library(input_filter_gr_blocks + ${INPUT_FILTER_GR_BLOCKS_SOURCES} + ${INPUT_FILTER_GR_BLOCKS_HEADERS} + ) +endif() target_link_libraries(input_filter_gr_blocks PUBLIC diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 05d2da68f..4b57638f6 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -71,9 +71,18 @@ endif() list(SORT GNSS_SPLIBS_HEADERS) list(SORT GNSS_SPLIBS_SOURCES) -source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) - -add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(algorithms_libs STATIC) + target_sources(algorithms_libs + PRIVATE + ${GNSS_SPLIBS_SOURCES} + PUBLIC + ${GNSS_SPLIBS_HEADERS} + ) +else() + source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) + add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -180,9 +189,18 @@ endif() ############################################################################### -source_group(Headers FILES gnss_sdr_flags.h) - -add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(gnss_sdr_flags STATIC) + target_sources(gnss_sdr_flags + PRIVATE + gnss_sdr_flags.cc + PUBLIC + gnss_sdr_flags.h + ) +else() + source_group(Headers FILES gnss_sdr_flags.h) + add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM=1) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index 184335d02..126d7ed67 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -52,9 +52,21 @@ set(RTKLIB_LIB_HEADERS list(SORT RTKLIB_LIB_HEADERS) list(SORT RTKLIB_LIB_SOURCES) -source_group(Headers FILES ${RTKLIB_LIB_HEADERS}) - -add_library(algorithms_libs_rtklib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(algorithms_libs_rtklib STATIC) + target_sources(algorithms_libs_rtklib + PRIVATE + ${RTKLIB_LIB_SOURCES} + PUBLIC + ${RTKLIB_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${RTKLIB_LIB_HEADERS}) + add_library(algorithms_libs_rtklib + ${RTKLIB_LIB_SOURCES} + ${RTKLIB_LIB_HEADERS} + ) +endif() target_link_libraries(algorithms_libs_rtklib PRIVATE diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index 55545df6e..d1dec4961 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -7,17 +7,18 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -set(OBS_ADAPTER_SOURCES - hybrid_observables.cc -) - -set(OBS_ADAPTER_HEADERS - hybrid_observables.h -) - -source_group(Headers FILES ${OBS_ADAPTER_HEADERS}) - -add_library(obs_adapters ${OBS_ADAPTER_SOURCES} ${OBS_ADAPTER_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(obs_adapters STATIC) + target_sources(obs_adapters + PRIVATE + hybrid_observables.cc + PUBLIC + hybrid_observables.h + ) +else() + source_group(Headers FILES hybrid_observables.h) + add_library(obs_adapters hybrid_observables.cc hybrid_observables.h) +endif() target_include_directories(obs_adapters PUBLIC @@ -29,8 +30,6 @@ target_link_libraries(obs_adapters obs_gr_blocks PRIVATE gnss_sdr_flags - observables_libs - Gflags::gflags Glog::glog ) diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 82f6c536a..ca76de937 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -7,17 +7,18 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -set(OBS_GR_BLOCKS_SOURCES - hybrid_observables_gs.cc -) - -set(OBS_GR_BLOCKS_HEADERS - hybrid_observables_gs.h -) - -source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) - -add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(obs_gr_blocks STATIC) + target_sources(obs_gr_blocks + PRIVATE + hybrid_observables_gs.cc + PUBLIC + hybrid_observables_gs.h + ) +else() + source_group(Headers FILES hybrid_observables_gs.h) + add_library(obs_gr_blocks hybrid_observables_gs.cc hybrid_observables_gs.h) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -53,7 +54,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(obs_gr_blocks diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index ae3b93b9e..2d707a533 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -74,7 +74,7 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_) : gr::block( this->message_port_register_in(pmt::mp("pvt_to_observables")); this->set_msg_handler(pmt::mp("pvt_to_observables"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_pvt_to_observables(PH1); }); + [this](auto &&PH1) { msg_handler_pvt_to_observables(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&hybrid_observables_gs::msg_handler_pvt_to_observables, this, boost::placeholders::_1)); diff --git a/src/algorithms/observables/libs/CMakeLists.txt b/src/algorithms/observables/libs/CMakeLists.txt index c666347ae..319620d74 100644 --- a/src/algorithms/observables/libs/CMakeLists.txt +++ b/src/algorithms/observables/libs/CMakeLists.txt @@ -7,12 +7,18 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -source_group(Headers FILES obs_conf.h) - -add_library(observables_libs - obs_conf.cc - obs_conf.h -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(observables_libs STATIC) + target_sources(observables_libs + PRIVATE + obs_conf.cc + PUBLIC + obs_conf.h + ) +else() + source_group(Headers FILES obs_conf.h) + add_library(observables_libs obs_conf.cc obs_conf.h) +endif() target_link_libraries(observables_libs PRIVATE diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 0e35da746..4865dd107 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -21,16 +21,24 @@ set(RESAMPLER_ADAPTER_HEADERS list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) -source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) - -add_library(resampler_adapters - ${RESAMPLER_ADAPTER_SOURCES} - ${RESAMPLER_ADAPTER_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(resampler_adapters STATIC) + target_sources(resampler_adapters + PRIVATE + ${RESAMPLER_ADAPTER_SOURCES} + PUBLIC + ${RESAMPLER_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) + add_library(resampler_adapters + ${RESAMPLER_ADAPTER_SOURCES} + ${RESAMPLER_ADAPTER_HEADERS} + ) +endif() target_link_libraries(resampler_adapters PUBLIC - Gnuradio::runtime resampler_gr_blocks PRIVATE Gflags::gflags diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 711377eb4..9b4e7473c 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -23,12 +23,21 @@ set(RESAMPLER_GR_BLOCKS_HEADERS list(SORT RESAMPLER_GR_BLOCKS_HEADERS) list(SORT RESAMPLER_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) - -add_library(resampler_gr_blocks - ${RESAMPLER_GR_BLOCKS_SOURCES} - ${RESAMPLER_GR_BLOCKS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(resampler_gr_blocks STATIC) + target_sources(resampler_gr_blocks + PRIVATE + ${RESAMPLER_GR_BLOCKS_SOURCES} + PUBLIC + ${RESAMPLER_GR_BLOCKS_HEADERS} + ) +else() + source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) + add_library(resampler_gr_blocks + ${RESAMPLER_GR_BLOCKS_SOURCES} + ${RESAMPLER_GR_BLOCKS_HEADERS} + ) +endif() target_link_libraries(resampler_gr_blocks PUBLIC diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index 159399846..7c07bfe47 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -7,15 +7,21 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -set(SIGNAL_GENERATOR_ADAPTER_SOURCES signal_generator.cc) -set(SIGNAL_GENERATOR_ADAPTER_HEADERS signal_generator.h) - -source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) - -add_library(signal_generator_adapters - ${SIGNAL_GENERATOR_ADAPTER_SOURCES} - ${SIGNAL_GENERATOR_ADAPTER_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(signal_generator_adapters STATIC) + target_sources(signal_generator_adapters + PRIVATE + signal_generator.cc + PUBLIC + signal_generator.h + ) +else() + source_group(Headers FILES signal_generator.h) + add_library(signal_generator_adapters + signal_generator.cc + signal_generator.h + ) +endif() target_link_libraries(signal_generator_adapters PUBLIC diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index f69f6a482..bd81a3d3c 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -7,15 +7,21 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -set(SIGNAL_GENERATOR_BLOCK_SOURCES signal_generator_c.cc) -set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) - -source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) - -add_library(signal_generator_gr_blocks - ${SIGNAL_GENERATOR_BLOCK_SOURCES} - ${SIGNAL_GENERATOR_BLOCK_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(signal_generator_gr_blocks STATIC) + target_sources(signal_generator_gr_blocks + PRIVATE + signal_generator_c.cc + PUBLIC + signal_generator_c.h + ) +else() + source_group(Headers FILES signal_generator_c.h) + add_library(signal_generator_gr_blocks + signal_generator_c.cc + signal_generator_c.h + ) +endif() target_link_libraries(signal_generator_gr_blocks PUBLIC diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 3f6b1e090..c49ae30cf 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -125,12 +125,21 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) -source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS}) - -add_library(signal_source_adapters - ${SIGNAL_SOURCE_ADAPTER_SOURCES} - ${SIGNAL_SOURCE_ADAPTER_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(signal_source_adapters STATIC) + target_sources(signal_source_adapters + PRIVATE + ${SIGNAL_SOURCE_ADAPTER_SOURCES} + PUBLIC + ${SIGNAL_SOURCE_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS}) + add_library(signal_source_adapters + ${SIGNAL_SOURCE_ADAPTER_SOURCES} + ${SIGNAL_SOURCE_ADAPTER_HEADERS} + ) +endif() target_include_directories(signal_source_adapters PUBLIC @@ -140,14 +149,11 @@ target_include_directories(signal_source_adapters target_link_libraries(signal_source_adapters PUBLIC Boost::headers - Gnuradio::runtime Gnuradio::blocks signal_source_gr_blocks - signal_source_libs PRIVATE gnss_sdr_flags core_system_parameters - Gflags::gflags Glog::glog Volk::volk ) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 45ab8e9e3..d1bf439a5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -43,18 +43,26 @@ set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) - -add_library(signal_source_gr_blocks - ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} - ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(signal_source_gr_blocks STATIC) + target_sources(signal_source_gr_blocks + PRIVATE + ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} + PUBLIC + ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} + ) +else() + source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) + add_library(signal_source_gr_blocks + ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} + ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} + ) +endif() target_link_libraries(signal_source_gr_blocks PUBLIC signal_source_libs Boost::thread - Gnuradio::runtime PRIVATE core_libs Gflags::gflags @@ -110,7 +118,7 @@ if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(signal_source_gr_blocks diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 6f3a6858d..c9aa09e94 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -36,9 +36,21 @@ set(SIGNAL_SOURCE_LIB_HEADERS list(SORT SIGNAL_SOURCE_LIB_HEADERS) list(SORT SIGNAL_SOURCE_LIB_SOURCES) -source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) - -add_library(signal_source_libs ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(signal_source_libs STATIC) + target_sources(signal_source_libs + PRIVATE + ${SIGNAL_SOURCE_LIB_SOURCES} + PUBLIC + ${SIGNAL_SOURCE_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) + add_library(signal_source_libs + ${SIGNAL_SOURCE_LIB_SOURCES} + ${SIGNAL_SOURCE_LIB_HEADERS} + ) +endif() target_link_libraries(signal_source_libs PUBLIC diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index c228e09a2..ca74329ed 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -37,17 +37,25 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_SOURCES) -source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) - -add_library(telemetry_decoder_adapters - ${TELEMETRY_DECODER_ADAPTER_SOURCES} - ${TELEMETRY_DECODER_ADAPTER_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(telemetry_decoder_adapters STATIC) + target_sources(telemetry_decoder_adapters + PRIVATE + ${TELEMETRY_DECODER_ADAPTER_SOURCES} + PUBLIC + ${TELEMETRY_DECODER_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) + add_library(telemetry_decoder_adapters + ${TELEMETRY_DECODER_ADAPTER_SOURCES} + ${TELEMETRY_DECODER_ADAPTER_HEADERS} + ) +endif() target_link_libraries(telemetry_decoder_adapters PUBLIC telemetry_decoder_gr_blocks - core_system_parameters PRIVATE Gflags::gflags Glog::glog diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 824b9ed36..7ffbfa98e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -34,12 +34,21 @@ set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) list(SORT TELEMETRY_DECODER_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) - -add_library(telemetry_decoder_gr_blocks - ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} - ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(telemetry_decoder_gr_blocks STATIC) + target_sources(telemetry_decoder_gr_blocks + PRIVATE + ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} + PUBLIC + ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} + ) +else() + source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) + add_library(telemetry_decoder_gr_blocks + ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} + ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} + ) +endif() target_link_libraries(telemetry_decoder_gr_blocks PUBLIC diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 6b45c8761..5e5f3eb37 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -22,12 +22,21 @@ set(TELEMETRY_DECODER_LIB_HEADERS list(SORT TELEMETRY_DECODER_LIB_HEADERS) list(SORT TELEMETRY_DECODER_LIB_SOURCES) -source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) - -add_library(telemetry_decoder_libs - ${TELEMETRY_DECODER_LIB_SOURCES} - ${TELEMETRY_DECODER_LIB_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(telemetry_decoder_libs STATIC) + target_sources(telemetry_decoder_libs + PRIVATE + ${TELEMETRY_DECODER_LIB_SOURCES} + PUBLIC + ${TELEMETRY_DECODER_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) + add_library(telemetry_decoder_libs + ${TELEMETRY_DECODER_LIB_SOURCES} + ${TELEMETRY_DECODER_LIB_HEADERS} + ) +endif() target_link_libraries(telemetry_decoder_libs PUBLIC diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index ef75dea25..41456f235 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -25,12 +25,21 @@ set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES) -source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) - -add_library(telemetry_decoder_libswiftcnav STATIC - ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} - ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(telemetry_decoder_libswiftcnav STATIC) + target_sources(telemetry_decoder_libswiftcnav + PRIVATE + ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} + PUBLIC + ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} + ) +else() + source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) + add_library(telemetry_decoder_libswiftcnav STATIC + ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} + ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} + ) +endif() set_property(TARGET telemetry_decoder_libswiftcnav APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 098428e6a..e8c40d1b4 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -76,22 +76,28 @@ set(TRACKING_ADAPTER_HEADERS list(SORT TRACKING_ADAPTER_HEADERS) list(SORT TRACKING_ADAPTER_SOURCES) -source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) - -add_library(tracking_adapters - ${TRACKING_ADAPTER_SOURCES} - ${TRACKING_ADAPTER_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(tracking_adapters STATIC) + target_sources(tracking_adapters + PRIVATE + ${TRACKING_ADAPTER_SOURCES} + PUBLIC + ${TRACKING_ADAPTER_HEADERS} + ) +else() + source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) + add_library(tracking_adapters + ${TRACKING_ADAPTER_SOURCES} + ${TRACKING_ADAPTER_HEADERS} + ) +endif() target_link_libraries(tracking_adapters PUBLIC tracking_gr_blocks - algorithms_libs - Gnuradio::runtime PRIVATE gnss_sdr_flags Glog::glog - Volkgnsssdr::volkgnsssdr ) target_include_directories(tracking_adapters diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 4db2b3f6a..bf49f2841 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -61,12 +61,21 @@ set(TRACKING_GR_BLOCKS_HEADERS list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) -source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) - -add_library(tracking_gr_blocks - ${TRACKING_GR_BLOCKS_SOURCES} - ${TRACKING_GR_BLOCKS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(tracking_gr_blocks STATIC) + target_sources(tracking_gr_blocks + PRIVATE + ${TRACKING_GR_BLOCKS_SOURCES} + PUBLIC + ${TRACKING_GR_BLOCKS_HEADERS} + ) +else() + source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) + add_library(tracking_gr_blocks + ${TRACKING_GR_BLOCKS_SOURCES} + ${TRACKING_GR_BLOCKS_HEADERS} + ) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -80,11 +89,7 @@ endif() target_link_libraries(tracking_gr_blocks PUBLIC - Boost::headers - Armadillo::armadillo Gnuradio::blocks - Volkgnsssdr::volkgnsssdr - algorithms_libs tracking_libs PRIVATE Matio::matio @@ -115,7 +120,7 @@ if(ENABLE_ARMA_NO_DEBUG) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(tracking_gr_blocks diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index ae2a07797..4e1a00b44 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -99,7 +99,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl this->set_msg_handler( pmt::mp("telemetry_to_trk"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_telemetry_to_trk(PH1); }); + [this](auto &&PH1) { msg_handler_telemetry_to_trk(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&dll_pll_veml_tracking::msg_handler_telemetry_to_trk, this, boost::placeholders::_1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 226749708..bb594b604 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -89,7 +89,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & this->message_port_register_in(pmt::mp("telemetry_to_trk")); this->set_msg_handler(pmt::mp("telemetry_to_trk"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_telemetry_to_trk(PH1); }); + [this](auto &&PH1) { msg_handler_telemetry_to_trk(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk, this, boost::placeholders::_1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index b523bef9f..e93b12164 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -113,7 +113,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc this->set_msg_handler(pmt::mp("preamble_timestamp_s"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_preamble_index(PH1); }); + [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, boost::placeholders::_1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index b51644b77..0548192d5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -110,7 +110,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->set_msg_handler(pmt::mp("preamble_timestamp_s"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_preamble_index(PH1); }); + [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, boost::placeholders::_1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index ada36aeac..8bf9acdb8 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -110,7 +110,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc this->set_msg_handler(pmt::mp("preamble_timestamp_s"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_preamble_index(PH1); }); + [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&glonass_l2_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, boost::placeholders::_1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 2457fc9d3..3bb646ce4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -108,7 +108,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc this->message_port_register_in(pmt::mp("preamble_timestamp_s")); this->set_msg_handler(pmt::mp("preamble_timestamp_s"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_preamble_index(PH1); }); + [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&glonass_l2_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, boost::placeholders::_1)); diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 74f72273c..a92c0f714 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -73,9 +73,18 @@ endif() list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) -source_group(Headers FILES ${TRACKING_LIB_HEADERS}) - -add_library(tracking_libs ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(tracking_libs STATIC) + target_sources(tracking_libs + PRIVATE + ${TRACKING_LIB_SOURCES} + PUBLIC + ${TRACKING_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${TRACKING_LIB_HEADERS}) + add_library(tracking_libs ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) +endif() target_link_libraries(tracking_libs PUBLIC @@ -88,7 +97,6 @@ target_link_libraries(tracking_libs ${OPT_TRACKING_LIBRARIES} PRIVATE gnss_sdr_flags - Gflags::gflags Glog::glog ) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 3df13834a..dd80ee92c 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -47,9 +47,18 @@ endif() list(SORT CORE_LIBS_HEADERS) list(SORT CORE_LIBS_SOURCES) -source_group(Headers FILES ${CORE_LIBS_HEADERS}) - -add_library(core_libs ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(core_libs STATIC) + target_sources(core_libs + PRIVATE + ${CORE_LIBS_SOURCES} + PUBLIC + ${CORE_LIBS_HEADERS} + ) +else() + source_group(Headers FILES ${CORE_LIBS_HEADERS}) + add_library(core_libs ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) +endif() target_link_libraries(core_libs PUBLIC @@ -71,7 +80,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(core_libs diff --git a/src/core/libs/channel_status_msg_receiver.cc b/src/core/libs/channel_status_msg_receiver.cc index e584b4038..ba8e61ba0 100644 --- a/src/core/libs/channel_status_msg_receiver.cc +++ b/src/core/libs/channel_status_msg_receiver.cc @@ -43,7 +43,7 @@ channel_status_msg_receiver::channel_status_msg_receiver() : gr::block("channel_ this->message_port_register_in(pmt::mp("status")); this->set_msg_handler(pmt::mp("status"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&channel_status_msg_receiver::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 013416862..6c60a699f 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -9,12 +9,12 @@ file(GLOB ASN_RRLP_SOURCES "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp/*.c") list(SORT ASN_RRLP_SOURCES) +file(GLOB ASN_RRLP_HEADERS "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp/*.h") +list(SORT ASN_RRLP_HEADERS) file(GLOB ASN_SUPL_SOURCES "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl/*.c") list(SORT ASN_SUPL_SOURCES) - -set(SUPL_SOURCES - supl.c -) +file(GLOB ASN_SUPL_HEADERS "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl/*.h") +list(SORT ASN_SUPL_HEADERS) set(MY_C_FLAGS "") if(CMAKE_C_COMPILER_ID MATCHES "Clang") @@ -25,7 +25,26 @@ endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") -add_library(core_libs_supl STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) +if(CMAKE_VERSION VERSION_GREATER 3.1) + add_library(core_libs_supl STATIC) + target_sources(core_libs_supl + PRIVATE + ${ASN_RRLP_SOURCES} + ${ASN_SUPL_SOURCES} + ${ASN_RRLP_HEADERS} + ${ASN_SUPL_HEADERS} + ${CMAKE_CURRENT_LIST_DIR}/supl.c + PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/supl.h + ) +else() + add_library(core_libs_supl + STATIC + ${ASN_RRLP_SOURCES} + ${ASN_SUPL_SOURCES} + supl.c + ) +endif() if(OPENSSL_FOUND) target_compile_definitions(core_libs_supl PUBLIC -DUSE_OPENSSL_FALLBACK=1) diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index a711b53fc..991815cfe 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -12,25 +12,36 @@ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/docs/protobuf/gn set(CORE_MONITOR_LIBS_SOURCES gnss_synchro_monitor.cc gnss_synchro_udp_sink.cc - ${PROTO_SRCS} ) set(CORE_MONITOR_LIBS_HEADERS gnss_synchro_monitor.h gnss_synchro_udp_sink.h serdes_gnss_synchro.h - ${PROTO_HDRS} ) list(SORT CORE_MONITOR_LIBS_HEADERS) list(SORT CORE_MONITOR_LIBS_SOURCES) -source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) - -add_library(core_monitor - ${CORE_MONITOR_LIBS_SOURCES} - ${CORE_MONITOR_LIBS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(core_monitor STATIC) + target_sources(core_monitor + PRIVATE + ${PROTO_SRCS} + ${PROTO_HDRS} + ${CORE_MONITOR_LIBS_SOURCES} + PUBLIC + ${CORE_MONITOR_LIBS_HEADERS} + ) +else() + source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) + add_library(core_monitor + ${CORE_MONITOR_LIBS_SOURCES} + ${PROTO_SRCS} + ${CORE_MONITOR_LIBS_HEADERS} + ${PROTO_HDRS} + ) +endif() target_link_libraries(core_monitor PUBLIC diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index e9a72c180..108185ac1 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -44,15 +44,26 @@ set(GNSS_RECEIVER_INTERFACE_HEADERS list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) -source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} - ${GNSS_RECEIVER_INTERFACE_HEADERS} -) - -add_library(core_receiver - ${GNSS_RECEIVER_SOURCES} - ${GNSS_RECEIVER_HEADERS} - ${GNSS_RECEIVER_INTERFACE_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(core_receiver STATIC) + target_sources(core_receiver + PRIVATE + ${GNSS_RECEIVER_SOURCES} + PUBLIC + ${GNSS_RECEIVER_HEADERS} + INTERFACE + ${GNSS_RECEIVER_INTERFACE_HEADERS} + ) +else() + source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS} + ) + add_library(core_receiver + ${GNSS_RECEIVER_SOURCES} + ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS} + ) +endif() if(ENABLE_FPGA) target_compile_definitions(core_receiver PUBLIC -DENABLE_FPGA=1) diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index d82b9cbd3..5656a8f5e 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -95,12 +95,21 @@ set(SYSTEM_PARAMETERS_HEADERS list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) -source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) - -add_library(core_system_parameters - ${SYSTEM_PARAMETERS_SOURCES} - ${SYSTEM_PARAMETERS_HEADERS} -) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(core_system_parameters STATIC) + target_sources(core_system_parameters + PRIVATE + ${SYSTEM_PARAMETERS_SOURCES} + PUBLIC + ${SYSTEM_PARAMETERS_HEADERS} + ) +else() + source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) + add_library(core_system_parameters + ${SYSTEM_PARAMETERS_SOURCES} + ${SYSTEM_PARAMETERS_HEADERS} + ) +endif() target_link_libraries(core_system_parameters PUBLIC diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index aa90ca986..ffc653db1 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -7,8 +7,13 @@ # SPDX-License-Identifier: GPL-3.0-or-later # +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(gnss-sdr) + target_sources(gnss-sdr PRIVATE main.cc) +else() + add_executable(gnss-sdr main.cc) +endif() -add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) if(${FILESYSTEM_FOUND}) target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -21,7 +26,7 @@ else() endif() target_link_libraries(gnss-sdr - PUBLIC + PRIVATE core_receiver Boost::headers Boost::thread @@ -34,17 +39,17 @@ target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}") # Disable internal logging if(NOT ENABLE_LOG) - target_compile_definitions(gnss-sdr PUBLIC -DGOOGLE_STRIP_LOG=1) + target_compile_definitions(gnss-sdr PRIVATE -DGOOGLE_STRIP_LOG=1) endif() if(ENABLE_CUDA) if(NOT CMAKE_VERSION VERSION_GREATER 3.11) target_link_libraries(gnss-sdr - PUBLIC + PRIVATE ${CUDA_LIBRARIES} ) target_include_directories(gnss-sdr - PUBLIC + PRIVATE ${CUDA_INCLUDE_DIRS} ) endif() @@ -54,7 +59,7 @@ endif() if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) target_link_libraries(gnss-sdr - PUBLIC + PRIVATE Gperftools::profiler Gperftools::tcmalloc ) @@ -64,7 +69,7 @@ endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_link_libraries(gnss-sdr - PUBLIC + PRIVATE "-lc++" ) endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index ef197ed28..cd55b6b2f 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -449,7 +449,12 @@ include_directories(${LIST_INCLUDE_DIRS}) # Unit testing ################################################################################ if(ENABLE_UNIT_TESTING) - add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(run_tests) + target_sources(run_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) + else() + add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(run_tests PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -461,7 +466,7 @@ if(ENABLE_UNIT_TESTING) endif() target_link_libraries(run_tests - PUBLIC + PRIVATE Boost::thread Armadillo::armadillo Gflags::gflags @@ -476,8 +481,6 @@ if(ENABLE_UNIT_TESTING) Volk::volk Volkgnsssdr::volkgnsssdr signal_source_adapters - signal_source_gr_blocks - signal_source_libs data_type_adapters input_filter_adapters resampler_adapters @@ -495,15 +498,14 @@ if(ENABLE_UNIT_TESTING) signal_processing_testing_lib system_testing_lib core_receiver - core_system_parameters ) if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(run_tests - PUBLIC -DGNURADIO_USES_STD_POINTERS=1 + PRIVATE -DGNURADIO_USES_STD_POINTERS=1 ) endif() if(ENABLE_UNIT_TESTING_EXTRA) - target_link_libraries(run_tests PUBLIC Gpstk::gpstk) + target_link_libraries(run_tests PRIVATE Gpstk::gpstk) endif() if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) @@ -519,7 +521,7 @@ if(ENABLE_UNIT_TESTING) if(ENABLE_GPERFTOOLS) if(GPERFTOOLS_FOUND) target_link_libraries(run_tests - PUBLIC + PRIVATE Gperftools::gperftools ) endif() @@ -534,15 +536,15 @@ if(ENABLE_UNIT_TESTING) endif() if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11) target_link_libraries(run_tests - PUBLIC + PRIVATE ${CUDA_LIBRARIES} ) target_include_directories(run_tests - PUBLIC + PRIVATE ${CUDA_INCLUDE_DIRS} ) endif() - if(CMAKE_VERSION VERSION_GREATER 3.1) + if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(run_tests @@ -565,10 +567,16 @@ if(ENABLE_UNIT_TESTING) endif() if(ENABLE_FPGA) - add_executable(gps_l1_ca_dll_pll_tracking_test_fpga + add_executable(GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(gps_l1_ca_dll_pll_tracking_test_fpga) + target_sources(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE ${GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES}) + else() + add_executable(gps_l1_ca_dll_pll_tracking_test_fpga ${GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -579,7 +587,7 @@ if(ENABLE_FPGA) target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE Boost::filesystem Boost::system) endif() target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga - PUBLIC + PRIVATE Armadillo::armadillo Boost::thread Gflags::gflags @@ -596,7 +604,6 @@ if(ENABLE_FPGA) signal_processing_testing_lib algorithms_libs core_receiver - core_system_parameters ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga RUNTIME DESTINATION bin @@ -622,7 +629,12 @@ function(add_system_test executable) if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES}) endif() - add_executable(${executable} ${SYSTEM_TEST_SOURCES}) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(${executable}) + target_sources(${executable} PRIVATE ${SYSTEM_TEST_SOURCES}) + else() + add_executable(${executable} ${SYSTEM_TEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(${executable} PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -633,11 +645,11 @@ function(add_system_test executable) target_link_libraries(${executable} PRIVATE Boost::filesystem Boost::system) endif() - target_include_directories(${executable} PUBLIC ${OPT_INCLUDES_} ${CMAKE_SOURCE_DIR}/src/algorithms/libs) - target_link_libraries(${executable} PUBLIC ${OPT_LIBS_} algorithms_libs) + target_include_directories(${executable} PRIVATE ${OPT_INCLUDES_} ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + target_link_libraries(${executable} PRIVATE ${OPT_LIBS_} algorithms_libs) if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(${executable} - PUBLIC -DGNURADIO_USES_STD_POINTERS=1 + PRIVATE -DGNURADIO_USES_STD_POINTERS=1 ) endif() @@ -681,7 +693,7 @@ if(ENABLE_SYSTEM_TESTING) Gnuradio::runtime GTest::GTest GTest::Main Gnuradio::blocks Gnuradio::filter Gnuradio::analog algorithms_libs - core_receiver core_system_parameters + core_receiver ) add_system_test(ttff) @@ -725,10 +737,16 @@ set(CMAKE_CTEST_COMMAND ctest -V) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) - add_executable(flowgraph_test + set(FLOWGRAPH_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(flowgraph_test) + target_sources(flowgraph_test PRIVATE ${FLOWGRAPH_TEST_SOURCES}) + else() + add_executable(flowgraph_test ${FLOWGRAPH_TEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(flowgraph_test PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -739,7 +757,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) target_link_libraries(flowgraph_test PRIVATE Boost::filesystem Boost::system) endif() target_link_libraries(flowgraph_test - PUBLIC + PRIVATE Boost::thread Gflags::gflags Glog::glog @@ -748,17 +766,14 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) GTest::Main Volkgnsssdr::volkgnsssdr signal_source_adapters - signal_source_gr_blocks - signal_source_libs input_filter_adapters channel_adapters core_receiver algorithms_libs - core_system_parameters ) target_include_directories(flowgraph_test - PUBLIC + PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs ) @@ -770,7 +785,7 @@ endif() ######################################################### if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) - add_executable(gnss_block_test + set(GNSS_BLOCK_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -781,6 +796,12 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(gnss_block_test) + target_sources(gnss_block_test PRIVATE ${GNSS_BLOCK_TEST_SOURCES}) + else() + add_executable(gnss_block_test ${GNSS_BLOCK_TEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(gnss_block_test PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -791,7 +812,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) target_link_libraries(gnss_block_test PRIVATE Boost::filesystem Boost::system) endif() target_link_libraries(gnss_block_test - PUBLIC + PRIVATE Boost::thread Gflags::gflags Glog::glog @@ -803,20 +824,17 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) GTest::Main Volkgnsssdr::volkgnsssdr signal_source_adapters - signal_source_gr_blocks - signal_source_libs data_type_adapters input_filter_adapters channel_adapters core_receiver algorithms_libs - core_system_parameters ) - target_include_directories(gnss_block_test PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + target_include_directories(gnss_block_test PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs) if(ENABLE_FPGA) - target_compile_definitions(gnss_block_test PUBLIC -DENABLE_FPGA=1) + target_compile_definitions(gnss_block_test PRIVATE -DENABLE_FPGA=1) endif() add_test(gnss_block_test gnss_block_test) @@ -827,10 +845,16 @@ endif() ######################################################### if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) - add_executable(gnuradio_block_test + set(GNURADIO_BLOCK_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(gnuradio_block_test) + target_sources(gnuradio_block_test PRIVATE ${GNURADIO_BLOCK_TEST_SOURCES}) + else() + add_executable(gnuradio_block_test ${GNURADIO_BLOCK_TEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(gnuradio_block_test PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -841,7 +865,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) target_link_libraries(gnuradio_block_test PRIVATE Boost::filesystem Boost::system) endif() target_link_libraries(gnuradio_block_test - PUBLIC + PRIVATE Boost::thread Gflags::gflags Glog::glog @@ -856,7 +880,6 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) signal_source_libs core_receiver algorithms_libs - core_system_parameters ) add_test(gnuradio_block_test gnuradio_block_test) @@ -866,10 +889,16 @@ endif() ######################################################### -add_executable(matio_test +set(MATIO_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc ) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(matio_test) + target_sources(matio_test PRIVATE ${MATIO_TEST_SOURCES}) +else() + add_executable(matio_test ${MATIO_TEST_SOURCES}) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(matio_test PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -882,14 +911,13 @@ else() endif() target_link_libraries(matio_test - PUBLIC + PRIVATE Gflags::gflags Glog::glog GTest::GTest GTest::Main Matio::matio core_receiver - core_system_parameters ) add_test(matio_test matio_test) @@ -899,10 +927,16 @@ set_property(TEST matio_test PROPERTY TIMEOUT 30) ######################################################### if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) - add_executable(acq_test + set(ACQ_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(acq_test) + target_sources(acq_test PRIVATE ${ACQ_TEST_SOURCES}) + else() + add_executable(acq_test ${ACQ_TEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(acq_test PRIVATE -DHAS_STD_FILESYSTEM=1) target_link_libraries(acq_test PRIVATE std::filesystem) @@ -910,7 +944,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) target_link_libraries(acq_test PRIVATE Boost::filesystem Boost::system) endif() target_link_libraries(acq_test - PUBLIC + PRIVATE Boost::thread Gflags::gflags Glog::glog @@ -925,16 +959,14 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) signal_source_gr_blocks signal_source_libs acquisition_adapters - acquisition_gr_blocks algorithms_libs signal_processing_testing_lib core_receiver - core_system_parameters ) add_test(acq_test acq_test) - if(CMAKE_VERSION VERSION_GREATER 3.1) + if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(acq_test @@ -967,7 +999,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) # ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/unscented_filter_test.cc ) endif() - add_executable(trk_test + set(TRKTEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc @@ -975,6 +1007,12 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc ${NONLINEAR_SOURCES} ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(trk_test) + target_sources(trk_test PRIVATE ${TRKTEST_SOURCES}) + else() + add_executable(trk_test ${TRKTEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(trk_test PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -986,7 +1024,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) endif() target_link_libraries(trk_test - PUBLIC + PRIVATE Boost::thread Gflags::gflags Glog::glog @@ -1003,9 +1041,8 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) tracking_adapters signal_generator_gr_blocks core_receiver - core_system_parameters ) - if(CMAKE_VERSION VERSION_GREATER 3.1) + if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(trk_test @@ -1034,10 +1071,16 @@ endif() ######################################################### if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) - add_executable(control_thread_test + set(CONTROL_THREAD_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(control_thread_test) + target_sources(control_thread_test PRIVATE ${CONTROL_THREAD_TEST_SOURCES}) + else() + add_executable(control_thread_test ${CONTROL_THREAD_TEST_SOURCES}) + endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(control_thread_test PRIVATE -DHAS_STD_FILESYSTEM=1) if(${find_experimental}) @@ -1049,18 +1092,15 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) endif() target_link_libraries(control_thread_test - PUBLIC + PRIVATE Boost::thread Gflags::gflags Glog::glog GTest::GTest GTest::Main signal_source_adapters - signal_source_gr_blocks - signal_source_libs algorithms_libs core_receiver - core_system_parameters ) add_test(control_thread_test control_thread_test) diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index c7720d4bf..3db9dca38 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -16,12 +16,21 @@ set(SYSTEM_TESTING_LIB_SOURCES file(GLOB SYSTEM_TESTING_LIB_HEADERS "*.h") list(SORT SYSTEM_TESTING_LIB_HEADERS) -add_library(system_testing_lib - ${SYSTEM_TESTING_LIB_SOURCES} - ${SYSTEM_TESTING_LIB_HEADERS} -) - -source_group(Headers FILES ${SYSTEM_TESTING_LIB_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(system_testing_lib STATIC) + target_sources(system_testing_lib + PRIVATE + ${SYSTEM_TESTING_LIB_SOURCES} + PUBLIC + ${SYSTEM_TESTING_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${SYSTEM_TESTING_LIB_HEADERS}) + add_library(system_testing_lib + ${SYSTEM_TESTING_LIB_SOURCES} + ${SYSTEM_TESTING_LIB_HEADERS} + ) +endif() target_link_libraries(system_testing_lib PUBLIC diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index df47db7d7..75c8760b9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -159,7 +159,7 @@ AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(Concurrent_Queue& queue) : gr::block this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&AcqPerfTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index 58bfb3bb9..fd20afc78 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -112,7 +112,7 @@ BeidouB1iPcpsAcquisitionTest_msg_rx::BeidouB1iPcpsAcquisitionTest_msg_rx() : gr: this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_events(PH1); }); + [this](auto &&PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index 3729a266f..f14dfdddd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -112,7 +112,7 @@ BeidouB3iPcpsAcquisitionTest_msg_rx::BeidouB3iPcpsAcquisitionTest_msg_rx() : gr: this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_events(PH1); }); + [this](auto &&PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index 73c8ca05c..884509345 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -105,7 +105,7 @@ GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguo this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index a4b423367..d86af8e3c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -103,7 +103,7 @@ GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcqu this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index c0409da58..cefa11014 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -112,7 +112,7 @@ GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisit this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index b60499982..50bc63946 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -124,7 +124,7 @@ GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionT this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index 53f824283..8a39cfa36 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -106,7 +106,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguous this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 72f4ed117..06ae77566 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -108,7 +108,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuic this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 2ebe7e26a..2601bb252 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -103,7 +103,7 @@ GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbig this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index 6c46fe2cf..e1b742f36 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -99,7 +99,7 @@ GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisition this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 0219af232..5c9ef5251 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -105,7 +105,7 @@ GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC201 this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 9ded82469..811faca5e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -98,7 +98,7 @@ GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() : this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index 26fac0879..e3a474876 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -103,7 +103,7 @@ GlonassL2CaPcpsAcquisitionTest_msg_rx::GlonassL2CaPcpsAcquisitionTest_msg_rx(con this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GlonassL2CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index 59920d0ce..9b52e0d5e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -106,7 +106,7 @@ GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_ms this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index bc28603fd..59ea1fdbb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -122,7 +122,7 @@ GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : gr::blo this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_events(PH1); }); + [this](auto &&PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index 84163dbfb..4cb39a048 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -101,7 +101,7 @@ GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsOpenClAcquisitionGSo this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index d47208480..39db80cbe 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -106,7 +106,7 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisit this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index b1bf66d9f..73bec7a58 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -103,7 +103,7 @@ GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC201 this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index e8c844f58..f3d4b6e8a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -114,7 +114,7 @@ GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : gr::block this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_events(PH1); }); + [this](auto &&PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index ecac00f2b..1e11782be 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -21,12 +21,21 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES file(GLOB SIGNAL_PROCESSING_TESTING_LIB_HEADERS "*.h") list(SORT SIGNAL_PROCESSING_TESTING_LIB_HEADERS) -add_library(signal_processing_testing_lib - ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} - ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS} -) - -source_group(Headers FILES ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(signal_processing_testing_lib STATIC) + target_sources(signal_processing_testing_lib + PRIVATE + ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} + PUBLIC + ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS} + ) +else() + source_group(Headers FILES ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) + add_library(signal_processing_testing_lib + ${SIGNAL_PROCESSING_TESTING_LIB_SOURCES} + ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS} + ) +endif() target_link_libraries(signal_processing_testing_lib PUBLIC @@ -39,7 +48,7 @@ target_link_libraries(signal_processing_testing_lib Glog::glog ) -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(signal_processing_testing_lib diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc index f527989d9..253441b1a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc @@ -56,7 +56,7 @@ Acquisition_msg_rx::Acquisition_msg_rx() : gr::block("Acquisition_msg_rx", gr::i this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&Acquisition_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index aa9b8db5f..8fa9bc5e6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -140,7 +140,7 @@ HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : gr::block("Hybrid this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&HybridObservablesTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); @@ -206,7 +206,7 @@ HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : gr::block this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&HybridObservablesTest_tlm_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index d2add5517..bef53b841 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -136,7 +136,7 @@ HybridObservablesTest_msg_rx_Fpga::HybridObservablesTest_msg_rx_Fpga() : gr::blo this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&HybridObservablesTest_msg_rx_Fpga::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index ff7f88336..da25899f5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -108,7 +108,7 @@ GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_ this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); @@ -168,7 +168,7 @@ GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::GpsL1CADllPllTelemetryDecoderTest_ this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else boost::bind(&GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #endif diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 7f6050ef6..1d3eddfd2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -87,7 +87,7 @@ GlonassL1CaDllPllCAidTrackingTest_msg_rx::GlonassL1CaDllPllCAidTrackingTest_msg_ this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index c15b1e1ad..ed2b08811 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -94,7 +94,7 @@ GlonassL1CaDllPllTrackingTest_msg_rx::GlonassL1CaDllPllTrackingTest_msg_rx() : g this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 1d2041abc..fa957667a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -124,7 +124,7 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : gr::block this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 88496a4f2..91a864112 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -211,7 +211,7 @@ GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : g this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t &&PH1) { msg_handler_events(PH1); }); + [this](auto &&PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 5b66f09b5..0e255c2c0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -125,7 +125,7 @@ GpsL1CAKfTrackingTest_msg_rx::GpsL1CAKfTrackingTest_msg_rx() : gr::block("GpsL1C this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL1CAKfTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 6582b9f49..1d1607db2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -101,7 +101,7 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : gr::block(" this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index a20a5f8b8..31d2c241e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -140,7 +140,7 @@ TrackingPullInTest_msg_rx::TrackingPullInTest_msg_rx() : gr::block("TrackingPull this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&TrackingPullInTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index 6f5deee2d..ab55d8d37 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -138,7 +138,7 @@ TrackingPullInTest_msg_rx_Fpga::TrackingPullInTest_msg_rx_Fpga() : gr::block("Tr this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&TrackingPullInTest_msg_rx_Fpga::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 70c817959..b0a96147b 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -8,11 +8,18 @@ # -set(FRONT_END_CAL_SOURCES front_end_cal.cc) -set(FRONT_END_CAL_HEADERS front_end_cal.h) - -add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS}) -source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_library(front_end_cal_lib STATIC) + target_sources(front_end_cal_lib + PRIVATE + front_end_cal.cc + PUBLIC + front_end_cal.h + ) +else() + source_group(Headers FILES front_end_cal.h) + add_library(front_end_cal_lib front_end_cal.cc front_end_cal.h) +endif() target_link_libraries(front_end_cal_lib PUBLIC @@ -41,7 +48,12 @@ if(ENABLE_CLANG_TIDY) endif() endif() -add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) +if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(front-end-cal) + target_sources(front-end-cal PRIVATE main.cc) +else() + add_executable(front-end-cal main.cc) +endif() if(${FILESYSTEM_FOUND}) target_compile_definitions(front-end-cal PRIVATE -DHAS_STD_FILESYSTEM=1) @@ -54,29 +66,26 @@ else() endif() target_link_libraries(front-end-cal - PUBLIC - core_libs + PRIVATE core_receiver front_end_cal_lib gnss_sdr_flags Boost::headers - PRIVATE - Gflags::gflags Glog::glog ) if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(front-end-cal - PUBLIC -DGNURADIO_USES_STD_POINTERS=1 + PRIVATE -DGNURADIO_USES_STD_POINTERS=1 ) endif() target_compile_definitions(front-end-cal - PUBLIC -DGNSS_SDR_VERSION="${VERSION}" - PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" + PRIVATE -DGNSS_SDR_VERSION="${VERSION}" + PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(front-end-cal diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 6d7e2e667..736cb64d5 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -148,7 +148,7 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), #if HAS_GENERIC_LAMBDA - [this](pmt::pmt_t&& PH1) { msg_handler_events(PH1); }); + [this](auto&& PH1) { msg_handler_events(PH1); }); #else #if BOOST_173_OR_GREATER boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, boost::placeholders::_1)); diff --git a/src/utils/rinex-tools/CMakeLists.txt b/src/utils/rinex-tools/CMakeLists.txt index 513323b08..a81bd945d 100644 --- a/src/utils/rinex-tools/CMakeLists.txt +++ b/src/utils/rinex-tools/CMakeLists.txt @@ -16,22 +16,30 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() - set(obsdiff_HEADERS obsdiff_flags.h) - source_group(Headers FILES ${obsdiff_HEADERS}) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(obsdiff) + target_sources(obsdiff + PRIVATE + obsdiff.cc + obsdiff_flags.h + ) + else() + source_group(Headers FILES obsdiff_flags.h) + add_executable(obsdiff ${CMAKE_CURRENT_SOURCE_DIR}/obsdiff.cc obsdiff_flags.h) + endif() - add_executable(obsdiff ${CMAKE_CURRENT_SOURCE_DIR}/obsdiff.cc ${obsdiff_HEADERS}) target_include_directories(obsdiff PUBLIC ${CMAKE_SOURCE_DIR}/src/tests/common-files) set_property(TARGET obsdiff PROPERTY CXX_STANDARD 14) # Required by GPSTk v3.0.0 # Do not show warnings raised by GPSTk v3.0.0 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(obsdiff - PUBLIC + PRIVATE -Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-reorder -Wno-deprecated-copy -Wno-extra -Wno-unused-but-set-variable -Wno-unknown-pragmas ) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_compile_options(obsdiff - PUBLIC + PRIVATE -Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-reorder ) endif() @@ -50,7 +58,7 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND endif() target_link_libraries(obsdiff - PUBLIC + PRIVATE Armadillo::armadillo Threads::Threads Gflags::gflags @@ -59,7 +67,7 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND ) target_include_directories(obsdiff - PUBLIC + PRIVATE ${GPSTK_INCLUDE_DIR}/gpstk ${GPSTK_INCLUDE_DIR} ) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index d6a9ca6f0..100308049 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -46,24 +46,33 @@ find_program(UNCOMPRESS_EXECUTABLE uncompress if(Boost_FOUND) message(STATUS "The rinex2assist utility tool will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'") - add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) + if(CMAKE_VERSION VERSION_GREATER 3.13) + add_executable(rinex2assist) + target_sources(rinex2assist + PRIVATE + main.cc + ) + else() + add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) + endif() + set_property(TARGET rinex2assist PROPERTY CXX_STANDARD 14) # Required by GPSTk # Do not show warnings raised by GPSTk v3.0.0 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(rinex2assist - PUBLIC + PRIVATE -Wno-deprecated -Wno-unused-parameter -Wno-sign-compare -Wno-type-limits -Wno-unused-but-set-variable -Wno-deprecated-copy -Wno-extra ) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_compile_options(rinex2assist - PUBLIC + PRIVATE -Wno-deprecated -Wno-unused-parameter -Wno-sign-compare ) endif() target_link_libraries(rinex2assist - PUBLIC + PRIVATE Boost::iostreams Boost::serialization ${GPSTK_LIBRARY} @@ -73,15 +82,15 @@ if(Boost_FOUND) ) target_include_directories(rinex2assist - PUBLIC + PRIVATE ${GPSTK_INCLUDE_DIR}/gpstk ${GPSTK_INCLUDE_DIR} ) if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) - target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") + target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") else() - target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="") + target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="") endif() if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) From 904bef433f42b08382e154603b254cfe95e8a348 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 8 Jun 2020 22:02:28 +0200 Subject: [PATCH 09/54] Fix cmakelint job --- .../data_type_adapter/gnuradio_blocks/CMakeLists.txt | 2 +- src/algorithms/libs/rtklib/CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 0297eee3d..9b9aa50df 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -44,7 +44,7 @@ target_link_libraries(data_type_gr_blocks Gnuradio::runtime Boost::headers PRIVATE - Volk::volk + Volk::volk ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index 126d7ed67..d9e9491f8 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -63,9 +63,9 @@ if(CMAKE_VERSION VERSION_GREATER 3.13) else() source_group(Headers FILES ${RTKLIB_LIB_HEADERS}) add_library(algorithms_libs_rtklib - ${RTKLIB_LIB_SOURCES} - ${RTKLIB_LIB_HEADERS} - ) + ${RTKLIB_LIB_SOURCES} + ${RTKLIB_LIB_HEADERS} + ) endif() target_link_libraries(algorithms_libs_rtklib From 72c820f9eef77d86f5cb0d7e1195d4f7bb921bb2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 9 Jun 2020 01:17:48 +0200 Subject: [PATCH 10/54] Fix cmakelint job --- src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 9b9aa50df..0297eee3d 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -44,7 +44,7 @@ target_link_libraries(data_type_gr_blocks Gnuradio::runtime Boost::headers PRIVATE - Volk::volk + Volk::volk ) if(GNURADIO_USES_STD_POINTERS) From 950006ddee0fd598ba66011a69b079c5553760b1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 9 Jun 2020 14:11:18 +0200 Subject: [PATCH 11/54] Fix warning in gcc 10: avoid undefined behavior in move assignment operator --- src/core/system_parameters/gnss_synchro.h | 86 +++++++---------------- 1 file changed, 26 insertions(+), 60 deletions(-) diff --git a/src/core/system_parameters/gnss_synchro.h b/src/core/system_parameters/gnss_synchro.h index 8b8b9a345..09bd27ad3 100644 --- a/src/core/system_parameters/gnss_synchro.h +++ b/src/core/system_parameters/gnss_synchro.h @@ -34,75 +34,41 @@ class Gnss_Synchro { public: // Satellite and signal info - char System; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) - char Signal[3]; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) - uint32_t PRN; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) - int32_t Channel_ID; //!< Set by Channel constructor + char System{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) + char Signal[3]{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) + uint32_t PRN{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) + int32_t Channel_ID{}; //!< Set by Channel constructor // Acquisition - double Acq_delay_samples; //!< Set by Acquisition processing block - double Acq_doppler_hz; //!< Set by Acquisition processing block - uint64_t Acq_samplestamp_samples; //!< Set by Acquisition processing block - uint32_t Acq_doppler_step; //!< Set by Acquisition processing block - bool Flag_valid_acquisition; //!< Set by Acquisition processing block + double Acq_delay_samples{}; //!< Set by Acquisition processing block + double Acq_doppler_hz{}; //!< Set by Acquisition processing block + uint64_t Acq_samplestamp_samples{}; //!< Set by Acquisition processing block + uint32_t Acq_doppler_step{}; //!< Set by Acquisition processing block + bool Flag_valid_acquisition{}; //!< Set by Acquisition processing block // Tracking - int64_t fs; //!< Set by Tracking processing block - double Prompt_I; //!< Set by Tracking processing block - double Prompt_Q; //!< Set by Tracking processing block - double CN0_dB_hz; //!< Set by Tracking processing block - double Carrier_Doppler_hz; //!< Set by Tracking processing block - double Carrier_phase_rads; //!< Set by Tracking processing block - double Code_phase_samples; //!< Set by Tracking processing block - uint64_t Tracking_sample_counter; //!< Set by Tracking processing block - bool Flag_valid_symbol_output; //!< Set by Tracking processing block - int32_t correlation_length_ms; //!< Set by Tracking processing block + int64_t fs{}; //!< Set by Tracking processing block + double Prompt_I{}; //!< Set by Tracking processing block + double Prompt_Q{}; //!< Set by Tracking processing block + double CN0_dB_hz{}; //!< Set by Tracking processing block + double Carrier_Doppler_hz{}; //!< Set by Tracking processing block + double Carrier_phase_rads{}; //!< Set by Tracking processing block + double Code_phase_samples{}; //!< Set by Tracking processing block + uint64_t Tracking_sample_counter{}; //!< Set by Tracking processing block + bool Flag_valid_symbol_output{}; //!< Set by Tracking processing block + int32_t correlation_length_ms{}; //!< Set by Tracking processing block // Telemetry Decoder - bool Flag_valid_word; //!< Set by Telemetry Decoder processing block - uint32_t TOW_at_current_symbol_ms; //!< Set by Telemetry Decoder processing block + bool Flag_valid_word{}; //!< Set by Telemetry Decoder processing block + uint32_t TOW_at_current_symbol_ms{}; //!< Set by Telemetry Decoder processing block // Observables - double Pseudorange_m; //!< Set by Observables processing block - double RX_time; //!< Set by Observables processing block - bool Flag_valid_pseudorange; //!< Set by Observables processing block - double interp_TOW_ms; //!< Set by Observables processing block + double Pseudorange_m{}; //!< Set by Observables processing block + double RX_time{}; //!< Set by Observables processing block + bool Flag_valid_pseudorange{}; //!< Set by Observables processing block + double interp_TOW_ms{}; //!< Set by Observables processing block - /// Constructor - Gnss_Synchro() - { - System = 0; - Signal[0] = 0; - Signal[1] = 0; - Signal[2] = '\0'; - PRN = 0U; - Channel_ID = 0; - - Acq_delay_samples = 0.0; - Acq_doppler_hz = 0.0; - Acq_samplestamp_samples = 0UL; - Acq_doppler_step = 0U; - Flag_valid_acquisition = false; - - fs = 0L; - Prompt_I = 0.0; - Prompt_Q = 0.0; - CN0_dB_hz = 0.0; - Carrier_Doppler_hz = 0.0; - Carrier_phase_rads = 0.0; - Code_phase_samples = 0.0; - Tracking_sample_counter = 0UL; - Flag_valid_symbol_output = false; - correlation_length_ms = 0; - - Flag_valid_word = false; - TOW_at_current_symbol_ms = 0U; - - Pseudorange_m = 0.0; - RX_time = 0.0; - Flag_valid_pseudorange = false; - interp_TOW_ms = 0.0; - }; + Gnss_Synchro() = default; //!< Default constructor ~Gnss_Synchro() = default; //!< Default destructor From 3f4ecbcc889de716281f350fa77719ab0d5d1f24 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 9 Jun 2020 17:03:15 +0200 Subject: [PATCH 12/54] Make CMake module more scalable --- cmake/Modules/FindGFORTRAN.cmake | 285 ++++++------------------------- 1 file changed, 50 insertions(+), 235 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index 801dab5fb..d732182f8 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -17,136 +17,65 @@ else() endif() if(DEFINED ENV{GFORTRAN_ROOT}) set(GFORTRAN_ROOT_USER_DEFINED - ${GFORTRAN_ROOT_USER_DEFINED} $ENV{GFORTRAN_ROOT} + ${GFORTRAN_ROOT_USER_DEFINED} ) endif() +set(GCC_MAJOR_SERIES 10 9 8 7 6 5) +set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) +set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) + find_library(GFORTRAN NAMES gfortran PATHS ${GFORTRAN_ROOT_USER_DEFINED} /usr/lib64 + /usr/lib/gcc/x86_64-linux-gnu/${GCC_SERIES} # Debian + /usr/lib/gcc/i486-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i586-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/arm-linux-gnueabihf/${GCC_SERIES} + /usr/lib/gcc/aarch64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/arm-linux-gnueabi/${GCC_SERIES} + /usr/lib/gcc/alpha-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/riscv64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/hppa-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/m68k-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-gnu/${GCC_SERIES} + /usr/lib/gcc/x86_64-kfreebsd-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-kfreebsd-gnu/${GCC_SERIES} + /usr/lib/gcc/mips-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/mips64el-linux-gnuabi64/${GCC_SERIES} + /usr/lib/gcc/mipsel-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/powerpc-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/powerpc-linux-gnuspe/${GCC_SERIES} + /usr/lib/gcc/powerpc64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/powerpc64le-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/s390x-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/sparc64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/x86_64-linux-gnux32/${GCC_SERIES} + /usr/lib/gcc/sh4-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-redhat-linux/${GCC_SERIES} # Fedora + /usr/lib64/gcc/x86_64-redhat-linux/${GCC_SERIES} + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/${GCC_SERIES} + /usr/lib/gcc/aarch64-redhat-linux/${GCC_SERIES} + /usr/lib/gcc/ppc64le-redhat-linux/${GCC_SERIES} + /usr/lib/gcc/s390x-redhat-linux/${GCC_SERIES} + /usr/lib64/gcc/x86_64-suse-linux/${GCC_SERIES} # openSUSE + /usr/lib/gcc/i586-suse-linux/${GCC_SERIES} + /usr/lib/gcc/x86_64-suse-linux/${GCC_SERIES} + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/${GCC_SERIES} + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/${GCC_SERIES} + /usr/lib64/gcc/aarch64-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/powerpc64-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/powerpc64le-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/riscv64-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/s390x-suse-linux/${GCC_SERIES} /usr/lib/gcc/x86_64-linux-gnu /usr/lib/gcc/i686-linux-gnu /usr/lib/gcc/i386-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 - /usr/lib/gcc/i686-linux-gnu/4.6 - /usr/lib/gcc/x86_64-linux-gnu/4.7 - /usr/lib/gcc/i686-linux-gnu/4.7 - /usr/lib/gcc/x86_64-linux-gnu/4.8 - /usr/lib/gcc/i686-linux-gnu/4.8 - /usr/lib/gcc/x86_64-linux-gnu/4.9 - /usr/lib/gcc/i686-linux-gnu/4.9 - /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 - /usr/lib/gcc/i686-redhat-linux/4.7.2 - /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 - /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 - /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 - /usr/lib/gcc/i686-redhat-linux/4.8.1 - /usr/lib/gcc/i686-redhat-linux/4.8.3 - /usr/lib/gcc/i686-redhat-linux/4.9.1 - /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 - /usr/lib/gcc/i686-redhat-linux/4.4.4 - /usr/lib/gcc/x86_64-redhat-linux/4.8.2 - /usr/lib/gcc/i686-redhat-linux/4.8.2 - /usr/lib/gcc/x86_64-redhat-linux/7 - /usr/lib/gcc/i686-redhat-linux/7 - /usr/lib/gcc/x86_64-redhat-linux/8 - /usr/lib/gcc/i686-redhat-linux/8 - /usr/lib/gcc/x86_64-redhat-linux/9 - /usr/lib/gcc/i686-redhat-linux/9 - /usr/lib64/gcc/x86_64-redhat-linux/7 - /usr/lib64/gcc/x86_64-redhat-linux/8 - /usr/lib64/gcc/x86_64-redhat-linux/9 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 - /usr/lib/gcc/aarch64-redhat-linux/7 - /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 - /usr/lib/gcc/i586-suse-linux/4.9 - /usr/lib/gcc/i586-suse-linux/7 - /usr/lib/gcc/i586-suse-linux/8 - /usr/lib/gcc/i586-suse-linux/9 - /usr/lib/gcc/x86_64-suse-linux/4.8 - /usr/lib/gcc/x86_64-suse-linux/4.9 - /usr/lib64/gcc/x86_64-suse-linux/7 - /usr/lib64/gcc/x86_64-suse-linux/8 - /usr/lib64/gcc/x86_64-suse-linux/9 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 - /usr/lib64/gcc/aarch64-suse-linux/7 - /usr/lib64/gcc/aarch64-suse-linux/8 - /usr/lib64/gcc/aarch64-suse-linux/9 - /usr/lib64/gcc/powerpc64-suse-linux/7 - /usr/lib64/gcc/powerpc64-suse-linux/8 - /usr/lib64/gcc/powerpc64-suse-linux/9 - /usr/lib64/gcc/powerpc64le-suse-linux/7 - /usr/lib64/gcc/powerpc64le-suse-linux/8 - /usr/lib64/gcc/powerpc64le-suse-linux/9 - /usr/lib/gcc/i486-linux-gnu # Debian 7 - /usr/lib/gcc/i486-linux-gnu/4.4 - /usr/lib/gcc/i486-linux-gnu/4.6 - /usr/lib/gcc/i486-linux-gnu/4.7 - /usr/lib/gcc/i486-linux-gnu/4.8 - /usr/lib/gcc/i486-linux-gnu/4.9 - /usr/lib/gcc/i586-linux-gnu/4.9 - /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf - /usr/lib/gcc/arm-linux-gnueabihf/4.5 - /usr/lib/gcc/arm-linux-gnueabihf/4.6 - /usr/lib/gcc/arm-linux-gnueabihf/4.7 - /usr/lib/gcc/arm-linux-gnueabihf/4.8 - /usr/lib/gcc/arm-linux-gnueabihf/4.9 - /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 - /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel - /usr/lib/gcc/arm-linux-gnueabi/4.9 - /usr/lib/gcc/x86_64-linux-gnu/5 - /usr/lib/gcc/i686-linux-gnu/5 - /usr/lib/gcc/arm-linux-gnueabi/5 - /usr/lib/gcc/arm-linux-gnueabihf/5 - /usr/lib/gcc/aarch64-linux-gnu/5 - /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 - /usr/lib/gcc/alpha-linux-gnu/6 - /usr/lib/gcc/aarch64-linux-gnu/6 - /usr/lib/gcc/arm-linux-gnueabi/6 - /usr/lib/gcc/arm-linux-gnueabihf/6 - /usr/lib/gcc/hppa-linux-gnu/6 - /usr/lib/gcc/i686-gnu/6 - /usr/lib/gcc/i686-linux-gnu/6 - /usr/lib/gcc/x86_64-kfreebsd-gnu/6 - /usr/lib/gcc/i686-kfreebsd-gnu/6 - /usr/lib/gcc/m68k-linux-gnu/6 - /usr/lib/gcc/mips-linux-gnu/6 - /usr/lib/gcc/mips64el-linux-gnuabi64/6 - /usr/lib/gcc/mipsel-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnuspe/6 - /usr/lib/gcc/powerpc64-linux-gnu/6 - /usr/lib/gcc/powerpc64le-linux-gnu/6 - /usr/lib/gcc/s390x-linux-gnu/6 - /usr/lib/gcc/sparc64-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnux32/6 - /usr/lib/gcc/sh4-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster - /usr/lib/gcc/alpha-linux-gnu/7 - /usr/lib/gcc/aarch64-linux-gnu/7 - /usr/lib/gcc/arm-linux-gnueabi/7 - /usr/lib/gcc/arm-linux-gnueabihf/7 - /usr/lib/gcc/hppa-linux-gnu/7 - /usr/lib/gcc/i686-gnu/7 - /usr/lib/gcc/i686-linux-gnu/7 - /usr/lib/gcc/x86_64-kfreebsd-gnu/7 - /usr/lib/gcc/i686-kfreebsd-gnu/7 - /usr/lib/gcc/m68k-linux-gnu/7 - /usr/lib/gcc/mips-linux-gnu/7 - /usr/lib/gcc/mips64el-linux-gnuabi64/7 - /usr/lib/gcc/mipsel-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnuspe/7 - /usr/lib/gcc/powerpc64-linux-gnu/7 - /usr/lib/gcc/powerpc64le-linux-gnu/7 - /usr/lib/gcc/s390x-linux-gnu/7 - /usr/lib/gcc/sparc64-linux-gnu/7 - /usr/lib/gcc/x86_64-linux-gnux32/7 - /usr/lib/gcc/sh4-linux-gnu/7 - /usr/lib/x86_64-linux-gnu # libgfortran4 + /usr/lib/gcc/i486-linux-gnu + /usr/lib/gcc/riscv64-linux-gnu + /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabi /usr/lib/arm-linux-gnueabihf @@ -165,121 +94,7 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran-8 - /usr/lib/gcc/aarch64-linux-gnu/8 - /usr/lib/gcc/arm-linux-gnueabi/8 - /usr/lib/gcc/arm-linux-gnueabihf/8 - /usr/lib/gcc/hppa-linux-gnu/8 - /usr/lib/gcc/m68k-linux-gnu/8 - /usr/lib/gcc/mips-linux-gnu/8 - /usr/lib/gcc/mips64el-linux-gnuabi64/8 - /usr/lib/gcc/mipsel-linux-gnu/8 - /usr/lib/gcc/i686-linux-gnu/8 - /usr/lib/gcc/powerpc-linux-gnuspe/8 - /usr/lib/gcc/powerpc64-linux-gnu/8 - /usr/lib/gcc/powerpc64le-linux-gnu/8 - /usr/lib/gcc/s390x-linux-gnu/8 - /usr/lib/gcc/alpha-linux-gnu/8 - /usr/lib/gcc/riscv64-linux-gnu/8 - /usr/lib/gcc/sh4-linux-gnu/8 - /usr/lib/gcc/sparc64-linux-gnu/8 - /usr/lib/gcc/x86_64-linux-gnux32/8 - /usr/lib/gcc/x86_64-kfreebsd-gnu/8 - /usr/lib/gcc/i686-kfreebsd-gnu/8 - /usr/lib/gcc/alpha-linux-gnu/9 # libgfortran-9 - /usr/lib/gcc/x86_64-linux-gnu/9 - /usr/lib/gcc/aarch64-linux-gnu/9 - /usr/lib/gcc/arm-linux-gnueabi/9 - /usr/lib/gcc/arm-linux-gnueabihf/9 - /usr/lib/gcc/i686-linux-gnu/9 - /usr/lib/gcc/powerpc64le-linux-gnu/9 - /usr/lib/gcc/powerpc64-linux-gnu/9 - /usr/lib/gcc/s390x-linux-gnu/9 - /usr/lib/gcc/hppa-linux-gnu/9 - /usr/lib/gcc/m68k-linux-gnu/9 - /usr/lib/gcc/mips-linux-gnu/9 - /usr/lib/gcc/mips64el-linux-gnuabi64/9 - /usr/lib/gcc/mipsel-linux-gnu/9 - /usr/lib/gcc/riscv64-linux-gnu/9 - /usr/lib/gcc/sh4-linux-gnu/9 - /usr/lib/gcc/sparc64-linux-gnu/9 - /usr/lib/gcc/x86_64-linux-gnux32/9 - /usr/lib/gcc/x86_64-kfreebsd-gnu/9 - /usr/lib/gcc/i686-kfreebsd-gnu/9 - /usr/lib/gcc/alpha-linux-gnu/10 # libgfortran-10 - /usr/lib/gcc/x86_64-linux-gnu/10 - /usr/lib/gcc/aarch64-linux-gnu/10 - /usr/lib/gcc/arm-linux-gnueabi/10 - /usr/lib/gcc/arm-linux-gnueabihf/10 - /usr/lib/gcc/i686-linux-gnu/10 - /usr/lib/gcc/powerpc64le-linux-gnu/10 - /usr/lib/gcc/powerpc64-linux-gnu/10 - /usr/lib/gcc/s390x-linux-gnu/10 - /usr/lib/gcc/hppa-linux-gnu/10 - /usr/lib/gcc/m68k-linux-gnu/10 - /usr/lib/gcc/mips-linux-gnu/10 - /usr/lib/gcc/mips64el-linux-gnuabi64/10 - /usr/lib/gcc/mipsel-linux-gnu/10 - /usr/lib/gcc/riscv64-linux-gnu/10 - /usr/lib/gcc/sh4-linux-gnu/10 - /usr/lib/gcc/sparc64-linux-gnu/10 - /usr/lib/gcc/x86_64-linux-gnux32/10 - /usr/lib/gcc/x86_64-kfreebsd-gnu/10 - /usr/lib/gcc/i686-kfreebsd-gnu/10 - /usr/lib64/gcc/x86_64-suse-linux/7 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/7 - /usr/lib64/gcc/powerpc64le-suse-linux/7 - /usr/lib/gcc/i586-suse-linux/7 - /usr/lib64/gcc/aarch64-suse-linux/7 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/7 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 - /usr/lib64/gcc/riscv64-suse-linux/7 - /usr/lib64/gcc/s390x-suse-linux/7 - /usr/lib64/gcc/x86_64-suse-linux/8 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/8 - /usr/lib64/gcc/powerpc64le-suse-linux/8 - /usr/lib/gcc/i586-suse-linux/8 - /usr/lib64/gcc/aarch64-suse-linux/8 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/8 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 - /usr/lib64/gcc/riscv64-suse-linux/8 - /usr/lib64/gcc/s390x-suse-linux/8 - /usr/lib64/gcc/x86_64-suse-linux/9 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/9 - /usr/lib64/gcc/powerpc64le-suse-linux/9 - /usr/lib/gcc/i586-suse-linux/9 - /usr/lib64/gcc/aarch64-suse-linux/9 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/9 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 - /usr/lib64/gcc/riscv64-suse-linux/9 - /usr/lib64/gcc/s390x-suse-linux/9 - /usr/lib64/gcc/x86_64-suse-linux/10 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/10 - /usr/lib64/gcc/powerpc64le-suse-linux/10 - /usr/lib/gcc/i586-suse-linux/10 - /usr/lib64/gcc/aarch64-suse-linux/10 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/10 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/10 - /usr/lib64/gcc/riscv64-suse-linux/10 - /usr/lib64/gcc/s390x-suse-linux/10 - /usr/lib/gcc/x86_64-redhat-linux/8 # Fedora - /usr/lib/gcc/i686-redhat-linux/8 - /usr/lib/gcc/aarch64-redhat-linux/8 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/8 - /usr/lib/gcc/ppc64le-redhat-linux/8 - /usr/lib/gcc/s390x-redhat-linux/8 - /usr/lib/gcc/x86_64-redhat-linux/9 # Fedora - /usr/lib/gcc/i686-redhat-linux/9 - /usr/lib/gcc/aarch64-redhat-linux/9 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/9 - /usr/lib/gcc/ppc64le-redhat-linux/9 - /usr/lib/gcc/s390x-redhat-linux/9 - /usr/lib/gcc/x86_64-redhat-linux/10 # Fedora - /usr/lib/gcc/i686-redhat-linux/10 - /usr/lib/gcc/aarch64-redhat-linux/10 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/10 - /usr/lib/gcc/ppc64le-redhat-linux/10 - /usr/lib/gcc/s390x-redhat-linux/10 + /usr/lib/riscv64-linux-gnu /usr/local/lib /usr/local/lib64 /usr/local/lib/i386 From eba5010baa505502841e60720269858d924619b3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 00:42:33 +0200 Subject: [PATCH 13/54] Make CMake module more scalable --- cmake/Modules/FindGFORTRAN.cmake | 90 ++++++++++++++++---------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index d732182f8..b1cd5c7d5 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -22,59 +22,55 @@ if(DEFINED ENV{GFORTRAN_ROOT}) ) endif() -set(GCC_MAJOR_SERIES 10 9 8 7 6 5) -set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) -set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) +set(GCC_MAJOR_SERIES "10 9 8 7 6 5") +set(GCC4_SERIES "4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4") +set(GCC_SERIES "${GCC_MAJOR_SERIES} ${GCC4_SERIES}") find_library(GFORTRAN NAMES gfortran PATHS ${GFORTRAN_ROOT_USER_DEFINED} /usr/lib64 - /usr/lib/gcc/x86_64-linux-gnu/${GCC_SERIES} # Debian - /usr/lib/gcc/i486-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i586-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/arm-linux-gnueabihf/${GCC_SERIES} - /usr/lib/gcc/aarch64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/arm-linux-gnueabi/${GCC_SERIES} - /usr/lib/gcc/alpha-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/riscv64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/hppa-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/m68k-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-gnu/${GCC_SERIES} - /usr/lib/gcc/x86_64-kfreebsd-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-kfreebsd-gnu/${GCC_SERIES} - /usr/lib/gcc/mips-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/mips64el-linux-gnuabi64/${GCC_SERIES} - /usr/lib/gcc/mipsel-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/powerpc-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/powerpc-linux-gnuspe/${GCC_SERIES} - /usr/lib/gcc/powerpc64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/powerpc64le-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/s390x-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/sparc64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/x86_64-linux-gnux32/${GCC_SERIES} - /usr/lib/gcc/sh4-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-redhat-linux/${GCC_SERIES} # Fedora - /usr/lib64/gcc/x86_64-redhat-linux/${GCC_SERIES} - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/${GCC_SERIES} - /usr/lib/gcc/aarch64-redhat-linux/${GCC_SERIES} - /usr/lib/gcc/ppc64le-redhat-linux/${GCC_SERIES} - /usr/lib/gcc/s390x-redhat-linux/${GCC_SERIES} - /usr/lib64/gcc/x86_64-suse-linux/${GCC_SERIES} # openSUSE - /usr/lib/gcc/i586-suse-linux/${GCC_SERIES} - /usr/lib/gcc/x86_64-suse-linux/${GCC_SERIES} - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/${GCC_SERIES} - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/${GCC_SERIES} - /usr/lib64/gcc/aarch64-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/powerpc64-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/powerpc64le-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/riscv64-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/s390x-suse-linux/${GCC_SERIES} - /usr/lib/gcc/x86_64-linux-gnu - /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu # Debian /usr/lib/gcc/i386-linux-gnu /usr/lib/gcc/i486-linux-gnu + /usr/lib/gcc/i586-linux-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/arm-linux-gnueabihf + /usr/lib/gcc/aarch64-linux-gnu + /usr/lib/gcc/arm-linux-gnueabi + /usr/lib/gcc/alpha-linux-gnu /usr/lib/gcc/riscv64-linux-gnu + /usr/lib/gcc/hppa-linux-gnu + /usr/lib/gcc/m68k-linux-gnu + /usr/lib/gcc/i686-gnu + /usr/lib/gcc/x86_64-kfreebsd-gnu + /usr/lib/gcc/i686-kfreebsd-gnu + /usr/lib/gcc/mips-linux-gnu + /usr/lib/gcc/mips64el-linux-gnuabi64 + /usr/lib/gcc/mipsel-linux-gnu + /usr/lib/gcc/powerpc-linux-gnu + /usr/lib/gcc/powerpc-linux-gnuspe + /usr/lib/gcc/powerpc64-linux-gnu + /usr/lib/gcc/powerpc64le-linux-gnu + /usr/lib/gcc/s390x-linux-gnu + /usr/lib/gcc/sparc64-linux-gnu + /usr/lib/gcc/x86_64-linux-gnux32 + /usr/lib/gcc/sh4-linux-gnu + /usr/lib/gcc/i686-redhat-linux # Fedora + /usr/lib64/gcc/x86_64-redhat-linux + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi + /usr/lib/gcc/aarch64-redhat-linux + /usr/lib/gcc/ppc64le-redhat-linux + /usr/lib/gcc/s390x-redhat-linux + /usr/lib64/gcc/x86_64-suse-linux # openSUSE + /usr/lib/gcc/i586-suse-linux + /usr/lib/gcc/x86_64-suse-linux + /usr/lib/gcc/armv6hl-suse-linux-gnueabi + /usr/lib/gcc/armv7hl-suse-linux-gnueabi + /usr/lib64/gcc/aarch64-suse-linux + /usr/lib64/gcc/powerpc64-suse-linux + /usr/lib64/gcc/powerpc64le-suse-linux + /usr/lib64/gcc/riscv64-suse-linux + /usr/lib64/gcc/s390x-suse-linux /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabi @@ -98,6 +94,8 @@ find_library(GFORTRAN NAMES gfortran /usr/local/lib /usr/local/lib64 /usr/local/lib/i386 + PATH_SUFFIXES + ${GCC_SERIES} ) set_package_properties(GFORTRAN PROPERTIES From 8aae3af4bb3d286ade38a90a004533deaf073b64 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 01:30:50 +0200 Subject: [PATCH 14/54] Revert "Make CMake module more scalable" This reverts commit eba5010baa505502841e60720269858d924619b3. --- cmake/Modules/FindGFORTRAN.cmake | 90 ++++++++++++++++---------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index b1cd5c7d5..d732182f8 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -22,55 +22,59 @@ if(DEFINED ENV{GFORTRAN_ROOT}) ) endif() -set(GCC_MAJOR_SERIES "10 9 8 7 6 5") -set(GCC4_SERIES "4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4") -set(GCC_SERIES "${GCC_MAJOR_SERIES} ${GCC4_SERIES}") +set(GCC_MAJOR_SERIES 10 9 8 7 6 5) +set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) +set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) find_library(GFORTRAN NAMES gfortran PATHS ${GFORTRAN_ROOT_USER_DEFINED} /usr/lib64 - /usr/lib/gcc/x86_64-linux-gnu # Debian + /usr/lib/gcc/x86_64-linux-gnu/${GCC_SERIES} # Debian + /usr/lib/gcc/i486-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i586-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/arm-linux-gnueabihf/${GCC_SERIES} + /usr/lib/gcc/aarch64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/arm-linux-gnueabi/${GCC_SERIES} + /usr/lib/gcc/alpha-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/riscv64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/hppa-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/m68k-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-gnu/${GCC_SERIES} + /usr/lib/gcc/x86_64-kfreebsd-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-kfreebsd-gnu/${GCC_SERIES} + /usr/lib/gcc/mips-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/mips64el-linux-gnuabi64/${GCC_SERIES} + /usr/lib/gcc/mipsel-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/powerpc-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/powerpc-linux-gnuspe/${GCC_SERIES} + /usr/lib/gcc/powerpc64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/powerpc64le-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/s390x-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/sparc64-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/x86_64-linux-gnux32/${GCC_SERIES} + /usr/lib/gcc/sh4-linux-gnu/${GCC_SERIES} + /usr/lib/gcc/i686-redhat-linux/${GCC_SERIES} # Fedora + /usr/lib64/gcc/x86_64-redhat-linux/${GCC_SERIES} + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/${GCC_SERIES} + /usr/lib/gcc/aarch64-redhat-linux/${GCC_SERIES} + /usr/lib/gcc/ppc64le-redhat-linux/${GCC_SERIES} + /usr/lib/gcc/s390x-redhat-linux/${GCC_SERIES} + /usr/lib64/gcc/x86_64-suse-linux/${GCC_SERIES} # openSUSE + /usr/lib/gcc/i586-suse-linux/${GCC_SERIES} + /usr/lib/gcc/x86_64-suse-linux/${GCC_SERIES} + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/${GCC_SERIES} + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/${GCC_SERIES} + /usr/lib64/gcc/aarch64-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/powerpc64-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/powerpc64le-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/riscv64-suse-linux/${GCC_SERIES} + /usr/lib64/gcc/s390x-suse-linux/${GCC_SERIES} + /usr/lib/gcc/x86_64-linux-gnu + /usr/lib/gcc/i686-linux-gnu /usr/lib/gcc/i386-linux-gnu /usr/lib/gcc/i486-linux-gnu - /usr/lib/gcc/i586-linux-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/arm-linux-gnueabihf - /usr/lib/gcc/aarch64-linux-gnu - /usr/lib/gcc/arm-linux-gnueabi - /usr/lib/gcc/alpha-linux-gnu /usr/lib/gcc/riscv64-linux-gnu - /usr/lib/gcc/hppa-linux-gnu - /usr/lib/gcc/m68k-linux-gnu - /usr/lib/gcc/i686-gnu - /usr/lib/gcc/x86_64-kfreebsd-gnu - /usr/lib/gcc/i686-kfreebsd-gnu - /usr/lib/gcc/mips-linux-gnu - /usr/lib/gcc/mips64el-linux-gnuabi64 - /usr/lib/gcc/mipsel-linux-gnu - /usr/lib/gcc/powerpc-linux-gnu - /usr/lib/gcc/powerpc-linux-gnuspe - /usr/lib/gcc/powerpc64-linux-gnu - /usr/lib/gcc/powerpc64le-linux-gnu - /usr/lib/gcc/s390x-linux-gnu - /usr/lib/gcc/sparc64-linux-gnu - /usr/lib/gcc/x86_64-linux-gnux32 - /usr/lib/gcc/sh4-linux-gnu - /usr/lib/gcc/i686-redhat-linux # Fedora - /usr/lib64/gcc/x86_64-redhat-linux - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi - /usr/lib/gcc/aarch64-redhat-linux - /usr/lib/gcc/ppc64le-redhat-linux - /usr/lib/gcc/s390x-redhat-linux - /usr/lib64/gcc/x86_64-suse-linux # openSUSE - /usr/lib/gcc/i586-suse-linux - /usr/lib/gcc/x86_64-suse-linux - /usr/lib/gcc/armv6hl-suse-linux-gnueabi - /usr/lib/gcc/armv7hl-suse-linux-gnueabi - /usr/lib64/gcc/aarch64-suse-linux - /usr/lib64/gcc/powerpc64-suse-linux - /usr/lib64/gcc/powerpc64le-suse-linux - /usr/lib64/gcc/riscv64-suse-linux - /usr/lib64/gcc/s390x-suse-linux /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabi @@ -94,8 +98,6 @@ find_library(GFORTRAN NAMES gfortran /usr/local/lib /usr/local/lib64 /usr/local/lib/i386 - PATH_SUFFIXES - ${GCC_SERIES} ) set_package_properties(GFORTRAN PROPERTIES From a994367f610b81df02804934d9ca4e16ffbf750a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 01:31:06 +0200 Subject: [PATCH 15/54] Revert "Make CMake module more scalable" This reverts commit 3f4ecbcc889de716281f350fa77719ab0d5d1f24. --- cmake/Modules/FindGFORTRAN.cmake | 285 +++++++++++++++++++++++++------ 1 file changed, 235 insertions(+), 50 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index d732182f8..801dab5fb 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -17,65 +17,136 @@ else() endif() if(DEFINED ENV{GFORTRAN_ROOT}) set(GFORTRAN_ROOT_USER_DEFINED - $ENV{GFORTRAN_ROOT} ${GFORTRAN_ROOT_USER_DEFINED} + $ENV{GFORTRAN_ROOT} ) endif() -set(GCC_MAJOR_SERIES 10 9 8 7 6 5) -set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) -set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) - find_library(GFORTRAN NAMES gfortran PATHS ${GFORTRAN_ROOT_USER_DEFINED} /usr/lib64 - /usr/lib/gcc/x86_64-linux-gnu/${GCC_SERIES} # Debian - /usr/lib/gcc/i486-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i586-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/arm-linux-gnueabihf/${GCC_SERIES} - /usr/lib/gcc/aarch64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/arm-linux-gnueabi/${GCC_SERIES} - /usr/lib/gcc/alpha-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/riscv64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/hppa-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/m68k-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-gnu/${GCC_SERIES} - /usr/lib/gcc/x86_64-kfreebsd-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-kfreebsd-gnu/${GCC_SERIES} - /usr/lib/gcc/mips-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/mips64el-linux-gnuabi64/${GCC_SERIES} - /usr/lib/gcc/mipsel-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/powerpc-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/powerpc-linux-gnuspe/${GCC_SERIES} - /usr/lib/gcc/powerpc64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/powerpc64le-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/s390x-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/sparc64-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/x86_64-linux-gnux32/${GCC_SERIES} - /usr/lib/gcc/sh4-linux-gnu/${GCC_SERIES} - /usr/lib/gcc/i686-redhat-linux/${GCC_SERIES} # Fedora - /usr/lib64/gcc/x86_64-redhat-linux/${GCC_SERIES} - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/${GCC_SERIES} - /usr/lib/gcc/aarch64-redhat-linux/${GCC_SERIES} - /usr/lib/gcc/ppc64le-redhat-linux/${GCC_SERIES} - /usr/lib/gcc/s390x-redhat-linux/${GCC_SERIES} - /usr/lib64/gcc/x86_64-suse-linux/${GCC_SERIES} # openSUSE - /usr/lib/gcc/i586-suse-linux/${GCC_SERIES} - /usr/lib/gcc/x86_64-suse-linux/${GCC_SERIES} - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/${GCC_SERIES} - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/${GCC_SERIES} - /usr/lib64/gcc/aarch64-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/powerpc64-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/powerpc64le-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/riscv64-suse-linux/${GCC_SERIES} - /usr/lib64/gcc/s390x-suse-linux/${GCC_SERIES} /usr/lib/gcc/x86_64-linux-gnu /usr/lib/gcc/i686-linux-gnu /usr/lib/gcc/i386-linux-gnu - /usr/lib/gcc/i486-linux-gnu - /usr/lib/gcc/riscv64-linux-gnu - /usr/lib/x86_64-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 + /usr/lib/gcc/i686-linux-gnu/4.6 + /usr/lib/gcc/x86_64-linux-gnu/4.7 + /usr/lib/gcc/i686-linux-gnu/4.7 + /usr/lib/gcc/x86_64-linux-gnu/4.8 + /usr/lib/gcc/i686-linux-gnu/4.8 + /usr/lib/gcc/x86_64-linux-gnu/4.9 + /usr/lib/gcc/i686-linux-gnu/4.9 + /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 + /usr/lib/gcc/i686-redhat-linux/4.7.2 + /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 + /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 + /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 + /usr/lib/gcc/i686-redhat-linux/4.8.1 + /usr/lib/gcc/i686-redhat-linux/4.8.3 + /usr/lib/gcc/i686-redhat-linux/4.9.1 + /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 + /usr/lib/gcc/i686-redhat-linux/4.4.4 + /usr/lib/gcc/x86_64-redhat-linux/4.8.2 + /usr/lib/gcc/i686-redhat-linux/4.8.2 + /usr/lib/gcc/x86_64-redhat-linux/7 + /usr/lib/gcc/i686-redhat-linux/7 + /usr/lib/gcc/x86_64-redhat-linux/8 + /usr/lib/gcc/i686-redhat-linux/8 + /usr/lib/gcc/x86_64-redhat-linux/9 + /usr/lib/gcc/i686-redhat-linux/9 + /usr/lib64/gcc/x86_64-redhat-linux/7 + /usr/lib64/gcc/x86_64-redhat-linux/8 + /usr/lib64/gcc/x86_64-redhat-linux/9 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 + /usr/lib/gcc/aarch64-redhat-linux/7 + /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 + /usr/lib/gcc/i586-suse-linux/4.9 + /usr/lib/gcc/i586-suse-linux/7 + /usr/lib/gcc/i586-suse-linux/8 + /usr/lib/gcc/i586-suse-linux/9 + /usr/lib/gcc/x86_64-suse-linux/4.8 + /usr/lib/gcc/x86_64-suse-linux/4.9 + /usr/lib64/gcc/x86_64-suse-linux/7 + /usr/lib64/gcc/x86_64-suse-linux/8 + /usr/lib64/gcc/x86_64-suse-linux/9 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 + /usr/lib64/gcc/aarch64-suse-linux/7 + /usr/lib64/gcc/aarch64-suse-linux/8 + /usr/lib64/gcc/aarch64-suse-linux/9 + /usr/lib64/gcc/powerpc64-suse-linux/7 + /usr/lib64/gcc/powerpc64-suse-linux/8 + /usr/lib64/gcc/powerpc64-suse-linux/9 + /usr/lib64/gcc/powerpc64le-suse-linux/7 + /usr/lib64/gcc/powerpc64le-suse-linux/8 + /usr/lib64/gcc/powerpc64le-suse-linux/9 + /usr/lib/gcc/i486-linux-gnu # Debian 7 + /usr/lib/gcc/i486-linux-gnu/4.4 + /usr/lib/gcc/i486-linux-gnu/4.6 + /usr/lib/gcc/i486-linux-gnu/4.7 + /usr/lib/gcc/i486-linux-gnu/4.8 + /usr/lib/gcc/i486-linux-gnu/4.9 + /usr/lib/gcc/i586-linux-gnu/4.9 + /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf + /usr/lib/gcc/arm-linux-gnueabihf/4.5 + /usr/lib/gcc/arm-linux-gnueabihf/4.6 + /usr/lib/gcc/arm-linux-gnueabihf/4.7 + /usr/lib/gcc/arm-linux-gnueabihf/4.8 + /usr/lib/gcc/arm-linux-gnueabihf/4.9 + /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 + /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel + /usr/lib/gcc/arm-linux-gnueabi/4.9 + /usr/lib/gcc/x86_64-linux-gnu/5 + /usr/lib/gcc/i686-linux-gnu/5 + /usr/lib/gcc/arm-linux-gnueabi/5 + /usr/lib/gcc/arm-linux-gnueabihf/5 + /usr/lib/gcc/aarch64-linux-gnu/5 + /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 + /usr/lib/gcc/alpha-linux-gnu/6 + /usr/lib/gcc/aarch64-linux-gnu/6 + /usr/lib/gcc/arm-linux-gnueabi/6 + /usr/lib/gcc/arm-linux-gnueabihf/6 + /usr/lib/gcc/hppa-linux-gnu/6 + /usr/lib/gcc/i686-gnu/6 + /usr/lib/gcc/i686-linux-gnu/6 + /usr/lib/gcc/x86_64-kfreebsd-gnu/6 + /usr/lib/gcc/i686-kfreebsd-gnu/6 + /usr/lib/gcc/m68k-linux-gnu/6 + /usr/lib/gcc/mips-linux-gnu/6 + /usr/lib/gcc/mips64el-linux-gnuabi64/6 + /usr/lib/gcc/mipsel-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnuspe/6 + /usr/lib/gcc/powerpc64-linux-gnu/6 + /usr/lib/gcc/powerpc64le-linux-gnu/6 + /usr/lib/gcc/s390x-linux-gnu/6 + /usr/lib/gcc/sparc64-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnux32/6 + /usr/lib/gcc/sh4-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster + /usr/lib/gcc/alpha-linux-gnu/7 + /usr/lib/gcc/aarch64-linux-gnu/7 + /usr/lib/gcc/arm-linux-gnueabi/7 + /usr/lib/gcc/arm-linux-gnueabihf/7 + /usr/lib/gcc/hppa-linux-gnu/7 + /usr/lib/gcc/i686-gnu/7 + /usr/lib/gcc/i686-linux-gnu/7 + /usr/lib/gcc/x86_64-kfreebsd-gnu/7 + /usr/lib/gcc/i686-kfreebsd-gnu/7 + /usr/lib/gcc/m68k-linux-gnu/7 + /usr/lib/gcc/mips-linux-gnu/7 + /usr/lib/gcc/mips64el-linux-gnuabi64/7 + /usr/lib/gcc/mipsel-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnuspe/7 + /usr/lib/gcc/powerpc64-linux-gnu/7 + /usr/lib/gcc/powerpc64le-linux-gnu/7 + /usr/lib/gcc/s390x-linux-gnu/7 + /usr/lib/gcc/sparc64-linux-gnu/7 + /usr/lib/gcc/x86_64-linux-gnux32/7 + /usr/lib/gcc/sh4-linux-gnu/7 + /usr/lib/x86_64-linux-gnu # libgfortran4 /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabi /usr/lib/arm-linux-gnueabihf @@ -94,7 +165,121 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu - /usr/lib/riscv64-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran-8 + /usr/lib/gcc/aarch64-linux-gnu/8 + /usr/lib/gcc/arm-linux-gnueabi/8 + /usr/lib/gcc/arm-linux-gnueabihf/8 + /usr/lib/gcc/hppa-linux-gnu/8 + /usr/lib/gcc/m68k-linux-gnu/8 + /usr/lib/gcc/mips-linux-gnu/8 + /usr/lib/gcc/mips64el-linux-gnuabi64/8 + /usr/lib/gcc/mipsel-linux-gnu/8 + /usr/lib/gcc/i686-linux-gnu/8 + /usr/lib/gcc/powerpc-linux-gnuspe/8 + /usr/lib/gcc/powerpc64-linux-gnu/8 + /usr/lib/gcc/powerpc64le-linux-gnu/8 + /usr/lib/gcc/s390x-linux-gnu/8 + /usr/lib/gcc/alpha-linux-gnu/8 + /usr/lib/gcc/riscv64-linux-gnu/8 + /usr/lib/gcc/sh4-linux-gnu/8 + /usr/lib/gcc/sparc64-linux-gnu/8 + /usr/lib/gcc/x86_64-linux-gnux32/8 + /usr/lib/gcc/x86_64-kfreebsd-gnu/8 + /usr/lib/gcc/i686-kfreebsd-gnu/8 + /usr/lib/gcc/alpha-linux-gnu/9 # libgfortran-9 + /usr/lib/gcc/x86_64-linux-gnu/9 + /usr/lib/gcc/aarch64-linux-gnu/9 + /usr/lib/gcc/arm-linux-gnueabi/9 + /usr/lib/gcc/arm-linux-gnueabihf/9 + /usr/lib/gcc/i686-linux-gnu/9 + /usr/lib/gcc/powerpc64le-linux-gnu/9 + /usr/lib/gcc/powerpc64-linux-gnu/9 + /usr/lib/gcc/s390x-linux-gnu/9 + /usr/lib/gcc/hppa-linux-gnu/9 + /usr/lib/gcc/m68k-linux-gnu/9 + /usr/lib/gcc/mips-linux-gnu/9 + /usr/lib/gcc/mips64el-linux-gnuabi64/9 + /usr/lib/gcc/mipsel-linux-gnu/9 + /usr/lib/gcc/riscv64-linux-gnu/9 + /usr/lib/gcc/sh4-linux-gnu/9 + /usr/lib/gcc/sparc64-linux-gnu/9 + /usr/lib/gcc/x86_64-linux-gnux32/9 + /usr/lib/gcc/x86_64-kfreebsd-gnu/9 + /usr/lib/gcc/i686-kfreebsd-gnu/9 + /usr/lib/gcc/alpha-linux-gnu/10 # libgfortran-10 + /usr/lib/gcc/x86_64-linux-gnu/10 + /usr/lib/gcc/aarch64-linux-gnu/10 + /usr/lib/gcc/arm-linux-gnueabi/10 + /usr/lib/gcc/arm-linux-gnueabihf/10 + /usr/lib/gcc/i686-linux-gnu/10 + /usr/lib/gcc/powerpc64le-linux-gnu/10 + /usr/lib/gcc/powerpc64-linux-gnu/10 + /usr/lib/gcc/s390x-linux-gnu/10 + /usr/lib/gcc/hppa-linux-gnu/10 + /usr/lib/gcc/m68k-linux-gnu/10 + /usr/lib/gcc/mips-linux-gnu/10 + /usr/lib/gcc/mips64el-linux-gnuabi64/10 + /usr/lib/gcc/mipsel-linux-gnu/10 + /usr/lib/gcc/riscv64-linux-gnu/10 + /usr/lib/gcc/sh4-linux-gnu/10 + /usr/lib/gcc/sparc64-linux-gnu/10 + /usr/lib/gcc/x86_64-linux-gnux32/10 + /usr/lib/gcc/x86_64-kfreebsd-gnu/10 + /usr/lib/gcc/i686-kfreebsd-gnu/10 + /usr/lib64/gcc/x86_64-suse-linux/7 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/7 + /usr/lib64/gcc/powerpc64le-suse-linux/7 + /usr/lib/gcc/i586-suse-linux/7 + /usr/lib64/gcc/aarch64-suse-linux/7 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/7 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 + /usr/lib64/gcc/riscv64-suse-linux/7 + /usr/lib64/gcc/s390x-suse-linux/7 + /usr/lib64/gcc/x86_64-suse-linux/8 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/8 + /usr/lib64/gcc/powerpc64le-suse-linux/8 + /usr/lib/gcc/i586-suse-linux/8 + /usr/lib64/gcc/aarch64-suse-linux/8 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/8 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 + /usr/lib64/gcc/riscv64-suse-linux/8 + /usr/lib64/gcc/s390x-suse-linux/8 + /usr/lib64/gcc/x86_64-suse-linux/9 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/9 + /usr/lib64/gcc/powerpc64le-suse-linux/9 + /usr/lib/gcc/i586-suse-linux/9 + /usr/lib64/gcc/aarch64-suse-linux/9 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/9 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 + /usr/lib64/gcc/riscv64-suse-linux/9 + /usr/lib64/gcc/s390x-suse-linux/9 + /usr/lib64/gcc/x86_64-suse-linux/10 # openSUSE + /usr/lib64/gcc/powerpc64-suse-linux/10 + /usr/lib64/gcc/powerpc64le-suse-linux/10 + /usr/lib/gcc/i586-suse-linux/10 + /usr/lib64/gcc/aarch64-suse-linux/10 + /usr/lib/gcc/armv6hl-suse-linux-gnueabi/10 + /usr/lib/gcc/armv7hl-suse-linux-gnueabi/10 + /usr/lib64/gcc/riscv64-suse-linux/10 + /usr/lib64/gcc/s390x-suse-linux/10 + /usr/lib/gcc/x86_64-redhat-linux/8 # Fedora + /usr/lib/gcc/i686-redhat-linux/8 + /usr/lib/gcc/aarch64-redhat-linux/8 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/8 + /usr/lib/gcc/ppc64le-redhat-linux/8 + /usr/lib/gcc/s390x-redhat-linux/8 + /usr/lib/gcc/x86_64-redhat-linux/9 # Fedora + /usr/lib/gcc/i686-redhat-linux/9 + /usr/lib/gcc/aarch64-redhat-linux/9 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/9 + /usr/lib/gcc/ppc64le-redhat-linux/9 + /usr/lib/gcc/s390x-redhat-linux/9 + /usr/lib/gcc/x86_64-redhat-linux/10 # Fedora + /usr/lib/gcc/i686-redhat-linux/10 + /usr/lib/gcc/aarch64-redhat-linux/10 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/10 + /usr/lib/gcc/ppc64le-redhat-linux/10 + /usr/lib/gcc/s390x-redhat-linux/10 /usr/local/lib /usr/local/lib64 /usr/local/lib/i386 From ffcd5b55da6db10c19a4b3d4207790d5949b32db Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 01:50:29 +0200 Subject: [PATCH 16/54] Make CMake GFORTRAN module more scalable --- cmake/Modules/FindGFORTRAN.cmake | 287 ++++++------------------------- 1 file changed, 50 insertions(+), 237 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index 801dab5fb..b7e5d0a75 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -17,136 +17,61 @@ else() endif() if(DEFINED ENV{GFORTRAN_ROOT}) set(GFORTRAN_ROOT_USER_DEFINED - ${GFORTRAN_ROOT_USER_DEFINED} $ENV{GFORTRAN_ROOT} + ${GFORTRAN_ROOT_USER_DEFINED} ) endif() +set(GCC_MAJOR_SERIES 10 9 8 7 6 5) +set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) +set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) + find_library(GFORTRAN NAMES gfortran PATHS ${GFORTRAN_ROOT_USER_DEFINED} /usr/lib64 - /usr/lib/gcc/x86_64-linux-gnu - /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu # Debian /usr/lib/gcc/i386-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 - /usr/lib/gcc/i686-linux-gnu/4.6 - /usr/lib/gcc/x86_64-linux-gnu/4.7 - /usr/lib/gcc/i686-linux-gnu/4.7 - /usr/lib/gcc/x86_64-linux-gnu/4.8 - /usr/lib/gcc/i686-linux-gnu/4.8 - /usr/lib/gcc/x86_64-linux-gnu/4.9 - /usr/lib/gcc/i686-linux-gnu/4.9 - /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 - /usr/lib/gcc/i686-redhat-linux/4.7.2 - /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 - /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 - /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 - /usr/lib/gcc/i686-redhat-linux/4.8.1 - /usr/lib/gcc/i686-redhat-linux/4.8.3 - /usr/lib/gcc/i686-redhat-linux/4.9.1 - /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 - /usr/lib/gcc/i686-redhat-linux/4.4.4 - /usr/lib/gcc/x86_64-redhat-linux/4.8.2 - /usr/lib/gcc/i686-redhat-linux/4.8.2 - /usr/lib/gcc/x86_64-redhat-linux/7 - /usr/lib/gcc/i686-redhat-linux/7 - /usr/lib/gcc/x86_64-redhat-linux/8 - /usr/lib/gcc/i686-redhat-linux/8 - /usr/lib/gcc/x86_64-redhat-linux/9 - /usr/lib/gcc/i686-redhat-linux/9 - /usr/lib64/gcc/x86_64-redhat-linux/7 - /usr/lib64/gcc/x86_64-redhat-linux/8 - /usr/lib64/gcc/x86_64-redhat-linux/9 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 - /usr/lib/gcc/aarch64-redhat-linux/7 - /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 - /usr/lib/gcc/i586-suse-linux/4.9 - /usr/lib/gcc/i586-suse-linux/7 - /usr/lib/gcc/i586-suse-linux/8 - /usr/lib/gcc/i586-suse-linux/9 - /usr/lib/gcc/x86_64-suse-linux/4.8 - /usr/lib/gcc/x86_64-suse-linux/4.9 - /usr/lib64/gcc/x86_64-suse-linux/7 - /usr/lib64/gcc/x86_64-suse-linux/8 - /usr/lib64/gcc/x86_64-suse-linux/9 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 - /usr/lib64/gcc/aarch64-suse-linux/7 - /usr/lib64/gcc/aarch64-suse-linux/8 - /usr/lib64/gcc/aarch64-suse-linux/9 - /usr/lib64/gcc/powerpc64-suse-linux/7 - /usr/lib64/gcc/powerpc64-suse-linux/8 - /usr/lib64/gcc/powerpc64-suse-linux/9 - /usr/lib64/gcc/powerpc64le-suse-linux/7 - /usr/lib64/gcc/powerpc64le-suse-linux/8 - /usr/lib64/gcc/powerpc64le-suse-linux/9 - /usr/lib/gcc/i486-linux-gnu # Debian 7 - /usr/lib/gcc/i486-linux-gnu/4.4 - /usr/lib/gcc/i486-linux-gnu/4.6 - /usr/lib/gcc/i486-linux-gnu/4.7 - /usr/lib/gcc/i486-linux-gnu/4.8 - /usr/lib/gcc/i486-linux-gnu/4.9 - /usr/lib/gcc/i586-linux-gnu/4.9 - /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf - /usr/lib/gcc/arm-linux-gnueabihf/4.5 - /usr/lib/gcc/arm-linux-gnueabihf/4.6 - /usr/lib/gcc/arm-linux-gnueabihf/4.7 - /usr/lib/gcc/arm-linux-gnueabihf/4.8 - /usr/lib/gcc/arm-linux-gnueabihf/4.9 - /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 - /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel - /usr/lib/gcc/arm-linux-gnueabi/4.9 - /usr/lib/gcc/x86_64-linux-gnu/5 - /usr/lib/gcc/i686-linux-gnu/5 - /usr/lib/gcc/arm-linux-gnueabi/5 - /usr/lib/gcc/arm-linux-gnueabihf/5 - /usr/lib/gcc/aarch64-linux-gnu/5 - /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 - /usr/lib/gcc/alpha-linux-gnu/6 - /usr/lib/gcc/aarch64-linux-gnu/6 - /usr/lib/gcc/arm-linux-gnueabi/6 - /usr/lib/gcc/arm-linux-gnueabihf/6 - /usr/lib/gcc/hppa-linux-gnu/6 - /usr/lib/gcc/i686-gnu/6 - /usr/lib/gcc/i686-linux-gnu/6 - /usr/lib/gcc/x86_64-kfreebsd-gnu/6 - /usr/lib/gcc/i686-kfreebsd-gnu/6 - /usr/lib/gcc/m68k-linux-gnu/6 - /usr/lib/gcc/mips-linux-gnu/6 - /usr/lib/gcc/mips64el-linux-gnuabi64/6 - /usr/lib/gcc/mipsel-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnuspe/6 - /usr/lib/gcc/powerpc64-linux-gnu/6 - /usr/lib/gcc/powerpc64le-linux-gnu/6 - /usr/lib/gcc/s390x-linux-gnu/6 - /usr/lib/gcc/sparc64-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnux32/6 - /usr/lib/gcc/sh4-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster - /usr/lib/gcc/alpha-linux-gnu/7 - /usr/lib/gcc/aarch64-linux-gnu/7 - /usr/lib/gcc/arm-linux-gnueabi/7 - /usr/lib/gcc/arm-linux-gnueabihf/7 - /usr/lib/gcc/hppa-linux-gnu/7 - /usr/lib/gcc/i686-gnu/7 - /usr/lib/gcc/i686-linux-gnu/7 - /usr/lib/gcc/x86_64-kfreebsd-gnu/7 - /usr/lib/gcc/i686-kfreebsd-gnu/7 - /usr/lib/gcc/m68k-linux-gnu/7 - /usr/lib/gcc/mips-linux-gnu/7 - /usr/lib/gcc/mips64el-linux-gnuabi64/7 - /usr/lib/gcc/mipsel-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnuspe/7 - /usr/lib/gcc/powerpc64-linux-gnu/7 - /usr/lib/gcc/powerpc64le-linux-gnu/7 - /usr/lib/gcc/s390x-linux-gnu/7 - /usr/lib/gcc/sparc64-linux-gnu/7 - /usr/lib/gcc/x86_64-linux-gnux32/7 - /usr/lib/gcc/sh4-linux-gnu/7 - /usr/lib/x86_64-linux-gnu # libgfortran4 + /usr/lib/gcc/i486-linux-gnu + /usr/lib/gcc/i586-linux-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/arm-linux-gnueabihf + /usr/lib/gcc/aarch64-linux-gnu + /usr/lib/gcc/arm-linux-gnueabi + /usr/lib/gcc/alpha-linux-gnu + /usr/lib/gcc/riscv64-linux-gnu + /usr/lib/gcc/hppa-linux-gnu + /usr/lib/gcc/m68k-linux-gnu + /usr/lib/gcc/i686-gnu + /usr/lib/gcc/x86_64-kfreebsd-gnu + /usr/lib/gcc/i686-kfreebsd-gnu + /usr/lib/gcc/mips-linux-gnu + /usr/lib/gcc/mips64el-linux-gnuabi64 + /usr/lib/gcc/mipsel-linux-gnu + /usr/lib/gcc/powerpc-linux-gnu + /usr/lib/gcc/powerpc-linux-gnuspe + /usr/lib/gcc/powerpc64-linux-gnu + /usr/lib/gcc/powerpc64le-linux-gnu + /usr/lib/gcc/s390x-linux-gnu + /usr/lib/gcc/sparc64-linux-gnu + /usr/lib/gcc/x86_64-linux-gnux32 + /usr/lib/gcc/sh4-linux-gnu + /usr/lib/gcc/i686-redhat-linux # Fedora + /usr/lib64/gcc/x86_64-redhat-linux + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi + /usr/lib/gcc/aarch64-redhat-linux + /usr/lib/gcc/ppc64le-redhat-linux + /usr/lib/gcc/s390x-redhat-linux + /usr/lib64/gcc/x86_64-suse-linux # openSUSE + /usr/lib/gcc/i586-suse-linux + /usr/lib/gcc/x86_64-suse-linux + /usr/lib/gcc/armv6hl-suse-linux-gnueabi + /usr/lib/gcc/armv7hl-suse-linux-gnueabi + /usr/lib64/gcc/aarch64-suse-linux + /usr/lib64/gcc/powerpc64-suse-linux + /usr/lib64/gcc/powerpc64le-suse-linux + /usr/lib64/gcc/riscv64-suse-linux + /usr/lib64/gcc/s390x-suse-linux + /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu /usr/lib/arm-linux-gnueabi /usr/lib/arm-linux-gnueabihf @@ -165,124 +90,12 @@ find_library(GFORTRAN NAMES gfortran /usr/lib/sparc64-linux-gnu /usr/lib/x86_64-linux-gnux32 /usr/lib/alpha-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran-8 - /usr/lib/gcc/aarch64-linux-gnu/8 - /usr/lib/gcc/arm-linux-gnueabi/8 - /usr/lib/gcc/arm-linux-gnueabihf/8 - /usr/lib/gcc/hppa-linux-gnu/8 - /usr/lib/gcc/m68k-linux-gnu/8 - /usr/lib/gcc/mips-linux-gnu/8 - /usr/lib/gcc/mips64el-linux-gnuabi64/8 - /usr/lib/gcc/mipsel-linux-gnu/8 - /usr/lib/gcc/i686-linux-gnu/8 - /usr/lib/gcc/powerpc-linux-gnuspe/8 - /usr/lib/gcc/powerpc64-linux-gnu/8 - /usr/lib/gcc/powerpc64le-linux-gnu/8 - /usr/lib/gcc/s390x-linux-gnu/8 - /usr/lib/gcc/alpha-linux-gnu/8 - /usr/lib/gcc/riscv64-linux-gnu/8 - /usr/lib/gcc/sh4-linux-gnu/8 - /usr/lib/gcc/sparc64-linux-gnu/8 - /usr/lib/gcc/x86_64-linux-gnux32/8 - /usr/lib/gcc/x86_64-kfreebsd-gnu/8 - /usr/lib/gcc/i686-kfreebsd-gnu/8 - /usr/lib/gcc/alpha-linux-gnu/9 # libgfortran-9 - /usr/lib/gcc/x86_64-linux-gnu/9 - /usr/lib/gcc/aarch64-linux-gnu/9 - /usr/lib/gcc/arm-linux-gnueabi/9 - /usr/lib/gcc/arm-linux-gnueabihf/9 - /usr/lib/gcc/i686-linux-gnu/9 - /usr/lib/gcc/powerpc64le-linux-gnu/9 - /usr/lib/gcc/powerpc64-linux-gnu/9 - /usr/lib/gcc/s390x-linux-gnu/9 - /usr/lib/gcc/hppa-linux-gnu/9 - /usr/lib/gcc/m68k-linux-gnu/9 - /usr/lib/gcc/mips-linux-gnu/9 - /usr/lib/gcc/mips64el-linux-gnuabi64/9 - /usr/lib/gcc/mipsel-linux-gnu/9 - /usr/lib/gcc/riscv64-linux-gnu/9 - /usr/lib/gcc/sh4-linux-gnu/9 - /usr/lib/gcc/sparc64-linux-gnu/9 - /usr/lib/gcc/x86_64-linux-gnux32/9 - /usr/lib/gcc/x86_64-kfreebsd-gnu/9 - /usr/lib/gcc/i686-kfreebsd-gnu/9 - /usr/lib/gcc/alpha-linux-gnu/10 # libgfortran-10 - /usr/lib/gcc/x86_64-linux-gnu/10 - /usr/lib/gcc/aarch64-linux-gnu/10 - /usr/lib/gcc/arm-linux-gnueabi/10 - /usr/lib/gcc/arm-linux-gnueabihf/10 - /usr/lib/gcc/i686-linux-gnu/10 - /usr/lib/gcc/powerpc64le-linux-gnu/10 - /usr/lib/gcc/powerpc64-linux-gnu/10 - /usr/lib/gcc/s390x-linux-gnu/10 - /usr/lib/gcc/hppa-linux-gnu/10 - /usr/lib/gcc/m68k-linux-gnu/10 - /usr/lib/gcc/mips-linux-gnu/10 - /usr/lib/gcc/mips64el-linux-gnuabi64/10 - /usr/lib/gcc/mipsel-linux-gnu/10 - /usr/lib/gcc/riscv64-linux-gnu/10 - /usr/lib/gcc/sh4-linux-gnu/10 - /usr/lib/gcc/sparc64-linux-gnu/10 - /usr/lib/gcc/x86_64-linux-gnux32/10 - /usr/lib/gcc/x86_64-kfreebsd-gnu/10 - /usr/lib/gcc/i686-kfreebsd-gnu/10 - /usr/lib64/gcc/x86_64-suse-linux/7 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/7 - /usr/lib64/gcc/powerpc64le-suse-linux/7 - /usr/lib/gcc/i586-suse-linux/7 - /usr/lib64/gcc/aarch64-suse-linux/7 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/7 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/7 - /usr/lib64/gcc/riscv64-suse-linux/7 - /usr/lib64/gcc/s390x-suse-linux/7 - /usr/lib64/gcc/x86_64-suse-linux/8 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/8 - /usr/lib64/gcc/powerpc64le-suse-linux/8 - /usr/lib/gcc/i586-suse-linux/8 - /usr/lib64/gcc/aarch64-suse-linux/8 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/8 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/8 - /usr/lib64/gcc/riscv64-suse-linux/8 - /usr/lib64/gcc/s390x-suse-linux/8 - /usr/lib64/gcc/x86_64-suse-linux/9 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/9 - /usr/lib64/gcc/powerpc64le-suse-linux/9 - /usr/lib/gcc/i586-suse-linux/9 - /usr/lib64/gcc/aarch64-suse-linux/9 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/9 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/9 - /usr/lib64/gcc/riscv64-suse-linux/9 - /usr/lib64/gcc/s390x-suse-linux/9 - /usr/lib64/gcc/x86_64-suse-linux/10 # openSUSE - /usr/lib64/gcc/powerpc64-suse-linux/10 - /usr/lib64/gcc/powerpc64le-suse-linux/10 - /usr/lib/gcc/i586-suse-linux/10 - /usr/lib64/gcc/aarch64-suse-linux/10 - /usr/lib/gcc/armv6hl-suse-linux-gnueabi/10 - /usr/lib/gcc/armv7hl-suse-linux-gnueabi/10 - /usr/lib64/gcc/riscv64-suse-linux/10 - /usr/lib64/gcc/s390x-suse-linux/10 - /usr/lib/gcc/x86_64-redhat-linux/8 # Fedora - /usr/lib/gcc/i686-redhat-linux/8 - /usr/lib/gcc/aarch64-redhat-linux/8 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/8 - /usr/lib/gcc/ppc64le-redhat-linux/8 - /usr/lib/gcc/s390x-redhat-linux/8 - /usr/lib/gcc/x86_64-redhat-linux/9 # Fedora - /usr/lib/gcc/i686-redhat-linux/9 - /usr/lib/gcc/aarch64-redhat-linux/9 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/9 - /usr/lib/gcc/ppc64le-redhat-linux/9 - /usr/lib/gcc/s390x-redhat-linux/9 - /usr/lib/gcc/x86_64-redhat-linux/10 # Fedora - /usr/lib/gcc/i686-redhat-linux/10 - /usr/lib/gcc/aarch64-redhat-linux/10 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/10 - /usr/lib/gcc/ppc64le-redhat-linux/10 - /usr/lib/gcc/s390x-redhat-linux/10 + /usr/lib/riscv64-linux-gnu /usr/local/lib /usr/local/lib64 /usr/local/lib/i386 + PATH_SUFFIXES + ${GCC_SERIES} ) set_package_properties(GFORTRAN PROPERTIES From 5755e6ae8b734ae8e8c9e8ba87126b5ae0a88d2b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 05:30:23 +0200 Subject: [PATCH 17/54] Fix FPGA test --- src/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index cd55b6b2f..bd4d6ee2e 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -567,7 +567,7 @@ if(ENABLE_UNIT_TESTING) endif() if(ENABLE_FPGA) - add_executable(GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES + set(GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc ) From 34a250246ad854d8279d5b0c7a8399429572775a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 10:15:59 +0200 Subject: [PATCH 18/54] Simplify initializations in system_parameters library --- .../gps_l1_ca_telemetry_decoder_gs.cc | 2 +- .../gps_l5_telemetry_decoder_gs.cc | 4 +- src/core/system_parameters/CMakeLists.txt | 12 - .../system_parameters/agnss_ref_location.cc | 29 -- .../system_parameters/agnss_ref_location.h | 11 +- src/core/system_parameters/agnss_ref_time.cc | 30 -- src/core/system_parameters/agnss_ref_time.h | 13 +- .../system_parameters/beidou_dnav_almanac.cc | 38 --- .../system_parameters/beidou_dnav_almanac.h | 28 +- .../beidou_dnav_ephemeris.cc | 53 +--- .../system_parameters/beidou_dnav_ephemeris.h | 92 +++--- .../system_parameters/beidou_dnav_iono.cc | 33 --- src/core/system_parameters/beidou_dnav_iono.h | 22 +- .../beidou_dnav_navigation_message.cc | 185 +----------- .../beidou_dnav_navigation_message.h | 264 +++++++++-------- .../beidou_dnav_utc_model.cc | 40 --- .../system_parameters/beidou_dnav_utc_model.h | 30 +- src/core/system_parameters/galileo_almanac.cc | 41 --- src/core/system_parameters/galileo_almanac.h | 34 +-- .../galileo_almanac_helper.cc | 58 ---- .../galileo_almanac_helper.h | 97 +++--- .../system_parameters/galileo_ephemeris.cc | 61 ---- .../system_parameters/galileo_ephemeris.h | 94 +++--- .../system_parameters/galileo_fnav_message.cc | 137 --------- .../system_parameters/galileo_fnav_message.h | 231 ++++++++------- src/core/system_parameters/galileo_iono.cc | 39 --- src/core/system_parameters/galileo_iono.h | 34 +-- .../galileo_navigation_message.cc | 188 ------------ .../galileo_navigation_message.h | 276 +++++++++--------- .../system_parameters/galileo_utc_model.cc | 19 -- .../system_parameters/galileo_utc_model.h | 42 +-- .../system_parameters/glonass_gnav_almanac.cc | 44 --- .../system_parameters/glonass_gnav_almanac.h | 44 +-- .../glonass_gnav_ephemeris.cc | 46 --- .../glonass_gnav_ephemeris.h | 80 ++--- .../glonass_gnav_navigation_message.cc | 61 +--- .../glonass_gnav_navigation_message.h | 79 +++-- .../glonass_gnav_utc_model.cc | 12 - .../glonass_gnav_utc_model.h | 16 +- src/core/system_parameters/gnss_satellite.cc | 6 - src/core/system_parameters/gnss_satellite.h | 2 +- src/core/system_parameters/gnss_signal.cc | 5 - src/core/system_parameters/gnss_signal.h | 2 +- src/core/system_parameters/gps_acq_assist.cc | 37 --- src/core/system_parameters/gps_acq_assist.h | 26 +- src/core/system_parameters/gps_almanac.cc | 40 --- src/core/system_parameters/gps_almanac.h | 32 +- .../system_parameters/gps_cnav_ephemeris.cc | 63 ---- .../system_parameters/gps_cnav_ephemeris.h | 100 +++---- src/core/system_parameters/gps_cnav_iono.cc | 35 --- src/core/system_parameters/gps_cnav_iono.h | 22 +- .../gps_cnav_navigation_message.cc | 26 -- .../gps_cnav_navigation_message.h | 33 +-- .../system_parameters/gps_cnav_utc_model.cc | 14 - .../system_parameters/gps_cnav_utc_model.h | 26 +- src/core/system_parameters/gps_ephemeris.cc | 53 +--- src/core/system_parameters/gps_ephemeris.h | 92 +++--- src/core/system_parameters/gps_iono.cc | 35 --- src/core/system_parameters/gps_iono.h | 20 +- .../gps_navigation_message.cc | 112 +------ .../gps_navigation_message.h | 155 +++++----- src/core/system_parameters/gps_utc_model.cc | 15 - src/core/system_parameters/gps_utc_model.h | 26 +- src/core/system_parameters/sbas_ephemeris.h | 23 +- .../glonass_gnav_nav_message_test.cc | 6 +- 65 files changed, 1045 insertions(+), 2580 deletions(-) delete mode 100644 src/core/system_parameters/agnss_ref_location.cc delete mode 100644 src/core/system_parameters/agnss_ref_time.cc delete mode 100644 src/core/system_parameters/beidou_dnav_almanac.cc delete mode 100644 src/core/system_parameters/beidou_dnav_iono.cc delete mode 100644 src/core/system_parameters/beidou_dnav_utc_model.cc delete mode 100644 src/core/system_parameters/galileo_almanac.cc delete mode 100644 src/core/system_parameters/galileo_iono.cc delete mode 100644 src/core/system_parameters/glonass_gnav_almanac.cc delete mode 100644 src/core/system_parameters/gps_acq_assist.cc delete mode 100644 src/core/system_parameters/gps_almanac.cc delete mode 100644 src/core/system_parameters/gps_cnav_iono.cc delete mode 100644 src/core/system_parameters/gps_iono.cc diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index a3df06b25..60769242f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -159,7 +159,7 @@ bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword) void gps_l1_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { - d_nav.reset(); + d_nav = Gps_Navigation_Message(); d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; d_nav.i_satellite_PRN = d_satellite.get_PRN(); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index cbf0483dd..6ff60cfb6 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -93,14 +93,14 @@ void gps_l5_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; - d_CNAV_Message.reset(); + d_CNAV_Message = Gps_CNAV_Navigation_Message(); } void gps_l5_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; - d_CNAV_Message.reset(); + d_CNAV_Message = Gps_CNAV_Navigation_Message(); DLOG(INFO) << "GPS L5 CNAV channel set to " << channel; // ############# ENABLE DATA FILE LOG ################# if (d_dump == true) diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 5656a8f5e..e4e8e586a 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -13,31 +13,19 @@ set(SYSTEM_PARAMETERS_SOURCES gnss_signal.cc gps_navigation_message.cc gps_ephemeris.cc - gps_iono.cc - gps_almanac.cc gps_utc_model.cc - gps_acq_assist.cc - agnss_ref_time.cc - agnss_ref_location.cc galileo_utc_model.cc galileo_ephemeris.cc - galileo_almanac.cc galileo_almanac_helper.cc - galileo_iono.cc galileo_navigation_message.cc beidou_dnav_navigation_message.cc beidou_dnav_ephemeris.cc - beidou_dnav_iono.cc - beidou_dnav_almanac.cc - beidou_dnav_utc_model.cc sbas_ephemeris.cc galileo_fnav_message.cc gps_cnav_ephemeris.cc gps_cnav_navigation_message.cc - gps_cnav_iono.cc gps_cnav_utc_model.cc glonass_gnav_ephemeris.cc - glonass_gnav_almanac.cc glonass_gnav_utc_model.cc glonass_gnav_navigation_message.cc ) diff --git a/src/core/system_parameters/agnss_ref_location.cc b/src/core/system_parameters/agnss_ref_location.cc deleted file mode 100644 index 77c7eef01..000000000 --- a/src/core/system_parameters/agnss_ref_location.cc +++ /dev/null @@ -1,29 +0,0 @@ -/*! - * \file agnss_ref_location.cc - * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage - * - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "agnss_ref_location.h" - -Agnss_Ref_Location::Agnss_Ref_Location() -{ - valid = false; - lat = 0.0; - lon = 0.0; - uncertainty = 0.0; -} diff --git a/src/core/system_parameters/agnss_ref_location.h b/src/core/system_parameters/agnss_ref_location.h index ec20e1289..433f13682 100644 --- a/src/core/system_parameters/agnss_ref_location.h +++ b/src/core/system_parameters/agnss_ref_location.h @@ -31,14 +31,15 @@ class Agnss_Ref_Location { public: - bool valid; - double lat; - double lon; - double uncertainty; /*! * Default constructor */ - Agnss_Ref_Location(); + Agnss_Ref_Location() = default; + + bool valid{}; + double lat{}; + double lon{}; + double uncertainty{}; template diff --git a/src/core/system_parameters/agnss_ref_time.cc b/src/core/system_parameters/agnss_ref_time.cc deleted file mode 100644 index 0a69784b7..000000000 --- a/src/core/system_parameters/agnss_ref_time.cc +++ /dev/null @@ -1,30 +0,0 @@ -/*! - * \file agnss_ref_time.cc - * \brief Interface of an Assisted GNSS REFERENCE TIME storage - * - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "agnss_ref_time.h" - -Agnss_Ref_Time::Agnss_Ref_Time() -{ - valid = false; - d_TOW = 0.0; - d_Week = 0.0; - d_tv_sec = 0.0; - d_tv_usec = 0.0; -} diff --git a/src/core/system_parameters/agnss_ref_time.h b/src/core/system_parameters/agnss_ref_time.h index 0e764d910..439118ffd 100644 --- a/src/core/system_parameters/agnss_ref_time.h +++ b/src/core/system_parameters/agnss_ref_time.h @@ -31,15 +31,16 @@ class Agnss_Ref_Time { public: - bool valid; - double d_TOW; - double d_Week; - double d_tv_sec; - double d_tv_usec; /*! * Default constructor */ - Agnss_Ref_Time(); + Agnss_Ref_Time() = default; + + bool valid{}; + double d_TOW{}; + double d_Week{}; + double d_tv_sec{}; + double d_tv_usec{}; template diff --git a/src/core/system_parameters/beidou_dnav_almanac.cc b/src/core/system_parameters/beidou_dnav_almanac.cc deleted file mode 100644 index 22827e2ac..000000000 --- a/src/core/system_parameters/beidou_dnav_almanac.cc +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * \file beidou_dnav_almanac.cc - * \brief Interface of a Beidou DNAV Almanac storage - * - * See http://en.beidou.gov.cn/SYSTEMS/Officialdocument/201902/P020190227601370045731.pdf - * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "beidou_dnav_almanac.h" - -Beidou_Dnav_Almanac::Beidou_Dnav_Almanac() -{ - i_satellite_PRN = 0; - d_Delta_i = 0.0; - d_Toa = 0.0; - d_M_0 = 0.0; - d_e_eccentricity = 0.0; - d_sqrt_A = 0.0; - d_OMEGA0 = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - i_SV_health = 0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; -} diff --git a/src/core/system_parameters/beidou_dnav_almanac.h b/src/core/system_parameters/beidou_dnav_almanac.h index dd58afbf2..bc7b24622 100644 --- a/src/core/system_parameters/beidou_dnav_almanac.h +++ b/src/core/system_parameters/beidou_dnav_almanac.h @@ -31,23 +31,23 @@ class Beidou_Dnav_Almanac { public: - unsigned int i_satellite_PRN; //!< SV PRN NUMBER - double d_Delta_i; - double d_Toa; //!< Almanac data reference time of week [s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - int i_SV_health; // SV Health - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - /*! * Default constructor */ - Beidou_Dnav_Almanac(); + Beidou_Dnav_Almanac() = default; + + unsigned int i_satellite_PRN{}; //!< SV PRN NUMBER + double d_Delta_i{}; + double d_Toa{}; //!< Almanac data reference time of week [s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + int i_SV_health{}; //!< SV Health + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] template diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.cc b/src/core/system_parameters/beidou_dnav_ephemeris.cc index 423316a0b..3a3d5d3bb 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.cc +++ b/src/core/system_parameters/beidou_dnav_ephemeris.cc @@ -22,66 +22,15 @@ #include "gnss_satellite.h" #include + Beidou_Dnav_Ephemeris::Beidou_Dnav_Ephemeris() { - i_satellite_PRN = 0; - d_TOW = 0; - d_Crs = 0; - d_Delta_n = 0; - d_M_0 = 0; - d_Cuc = 0; - d_eccentricity = 0; - d_Cus = 0; - d_sqrt_A = 0; - d_Toe = 0; - d_Toc = 0; - d_Cic = 0; - d_OMEGA0 = 0; - d_Cis = 0; - d_i_0 = 0; - d_Crc = 0; - d_OMEGA = 0; - d_OMEGA_DOT = 0; - d_IDOT = 0; - i_BEIDOU_week = 0; - i_SV_accuracy = 0; - i_SV_health = 0; - d_AODE = 0; - d_TGD1 = 0; - d_TGD2 = 0; - d_AODC = 0; // Issue of Data, Clock - i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - d_AODC = 0; - b_fit_interval_flag = false; - d_spare1 = 0.0; - d_spare2 = 0.0; - - i_sig_type = 0; - i_nav_type = 0; - - d_A_f0 = 0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0; // Coefficient 2 of code phase offset model [s/s^2] - - b_integrity_status_flag = false; - b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV - auto gnss_sat = Gnss_Satellite(); std::string _system("Beidou"); for (unsigned int i = 1; i < 36; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } - - d_satClkDrift = 0.0; - d_dtr = 0.0; - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; } diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.h b/src/core/system_parameters/beidou_dnav_ephemeris.h index 9ba9ad4e0..744826add 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.h +++ b/src/core/system_parameters/beidou_dnav_ephemeris.h @@ -41,44 +41,44 @@ public: */ Beidou_Dnav_Ephemeris(); - unsigned int i_satellite_PRN; //!< SV PRN NUMBER - double d_TOW; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int i_BEIDOU_week; //!< BEIDOU week number, aka WN [week] - int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) - int i_SV_health; - double d_TGD1; //!< Estimated Group Delay Differential on B1I [s] - double d_TGD2; //!< Estimated Group Delay Differential on B2I [s] - double d_AODC; //!< Age of Data, Clock - double d_AODE; //!< Age of Data, Ephemeris - int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + unsigned int i_satellite_PRN{}; //!< SV PRN NUMBER + double d_TOW{}; //!< Time of BEIDOU Week of the ephemeris set (taken from subframes TOW) [s] + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + double d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int i_BEIDOU_week{}; //!< BEIDOU week number, aka WN [week] + int i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int i_SV_health{}; + double d_TGD1{}; //!< Estimated Group Delay Differential on B1I [s] + double d_TGD2{}; //!< Estimated Group Delay Differential on B2I [s] + double d_AODC{}; //!< Age of Data, Clock + double d_AODE{}; //!< Age of Data, Ephemeris + int i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - int i_sig_type; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */ - int i_nav_type; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */ + int i_sig_type{}; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) */ + int i_nav_type{}; //!< BDS: nav type (0:unknown,1:IGSO/MEO,2:GEO) */ - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] /*! \brief If true, enhanced level of integrity assurance. * @@ -90,23 +90,23 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift{}; //!< GPS clock error + double d_dtr{}; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] std::map satelliteBlock; //!< Map that stores to which block the PRN belongs diff --git a/src/core/system_parameters/beidou_dnav_iono.cc b/src/core/system_parameters/beidou_dnav_iono.cc deleted file mode 100644 index e24050cff..000000000 --- a/src/core/system_parameters/beidou_dnav_iono.cc +++ /dev/null @@ -1,33 +0,0 @@ -/*! - * \file beidou_dnav_iono.cc - * \brief Interface of a BEIDOU IONOSPHERIC MODEL storage - * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "beidou_dnav_iono.h" - -Beidou_Dnav_Iono::Beidou_Dnav_Iono() -{ - valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; -} diff --git a/src/core/system_parameters/beidou_dnav_iono.h b/src/core/system_parameters/beidou_dnav_iono.h index 531de8ec8..8a16a5922 100644 --- a/src/core/system_parameters/beidou_dnav_iono.h +++ b/src/core/system_parameters/beidou_dnav_iono.h @@ -31,18 +31,18 @@ class Beidou_Dnav_Iono { public: - bool valid; //!< Valid flag - // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + Beidou_Dnav_Iono() = default; //!< Default constructor - Beidou_Dnav_Iono(); //!< Default constructor + bool valid{}; //!< Valid flag + // Ionospheric parameters + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] template diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index d7604fe89..e57604c59 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -26,187 +26,18 @@ #include // for std::numeric_limits -void Beidou_Dnav_Navigation_Message::reset() +Beidou_Dnav_Navigation_Message::Beidou_Dnav_Navigation_Message() { - // Control variable for message decoding - flag_eph_valid = false; - flag_iono_valid = false; - flag_utc_model_valid = false; - flag_crc_test = false; - - flag_d1_sf1 = false; - flag_d1_sf2 = false; - flag_d1_sf3 = false; - flag_d1_sf4 = false; - flag_d1_sf5 = false; - flag_d1_sf5_p7 = false; - flag_d1_sf5_p8 = false; - flag_d1_sf5_p9 = false; - flag_d1_sf5_p10 = false; - flag_new_SOW_available = false; - d_previous_aode = 0.0; - - flag_sf1_p1 = false; - flag_sf1_p2 = false; - flag_sf1_p3 = false; - flag_sf1_p4 = false; - flag_sf1_p5 = false; - flag_sf1_p6 = false; - flag_sf1_p7 = false; - flag_sf1_p8 = false; - flag_sf1_p9 = false; - flag_sf1_p10 = false; - - // D2 NAV Decoding UNique Attributes - d_A_f1_msb_bits = 0; - d_A_f1_lsb_bits = 0; - d_Cuc_msb_bits = 0; - d_Cuc_lsb_bits = 0; - d_eccentricity_msb_bits = 0; - d_eccentricity_lsb_bits = 0; - d_Cic_msb_bits = 0; - d_Cic_lsb_bits = 0; - d_i_0_msb_bits = 0; - d_i_0_lsb_bits = 0; - d_OMEGA_msb_bits = 0; - d_OMEGA_lsb_bits = 0; - d_OMEGA_DOT_msb_bits = 0; - d_OMEGA_DOT_lsb_bits = 0; - - // D2 NAV Decoding UNique Attributes - d_eccentricity_msb = 0; - d_eccentricity_lsb = 0; - - d_SOW = 0.0; - d_SOW_SF1 = 0.0; - d_SOW_SF2 = 0.0; - d_SOW_SF3 = 0.0; - d_SOW_SF4 = 0.0; - d_SOW_SF5 = 0.0; - d_AODE = 0.0; - d_Crs = 0.0; - d_Delta_n = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_eccentricity = 0.0; - d_Cus = 0.0; - d_sqrt_A = 0.0; - d_Toe_sf2 = 0.0; - d_Toe_sf3 = 0.0; - d_Toe = 0.0; - d_Toc = 0.0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_IDOT = 0.0; - i_BEIDOU_week = 0; - i_SV_accuracy = 0; - i_SV_health = 0; - d_TGD1 = 0.0; - d_TGD2 = 0.0; - d_AODC = -1.0; - // i_AODO = 0; - - b_fit_interval_flag = false; - d_spare1 = 0.0; - d_spare2 = 0.0; - - d_A_f0 = 0.0; - d_A_f1 = 0.0; - d_A_f2 = 0.0; - - // clock terms - // d_master_clock=0; - d_dtr = 0.0; - d_satClkCorr = 0.0; - d_satClkDrift = 0.0; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // info - i_channel_ID = 0; - i_satellite_PRN = 0; - i_signal_type = 0; - - // time synchro - d_subframe_timestamp_ms = 0.0; - - // flags - b_alert_flag = false; - b_integrity_status_flag = false; - b_antispoofing_flag = false; - - // Ionosphere and UTC - flag_iono_valid = false; - flag_utc_model_valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; - d_A1UTC = 0.0; - d_A0UTC = 0.0; - d_DeltaT_LS = 0.0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0.0; - - // Almanac - d_Toa = 0.0; - i_WN_A = 0; - for (int32_t i = 1; i < 36; i++) - { - almanacHealth[i] = 0; - } - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - d_A1GPS = 0.0; - d_A0GPS = 0.0; - d_A1GAL = 0.0; - d_A0GAL = 0.0; - d_A1GLO = 0.0; - d_A0GLO = 0.0; - d_SQRT_A_ALMANAC = 0.0; - d_A1_ALMANAC = 0.0; - d_A0_ALMANAC = 0.0; - d_OMEGA0_ALMANAC = 0.0; - d_E_ALMANAC = 0.0; - d_DELTA_I = 0.0; - d_TOA = 0.0; - d_OMEGA_DOT_ALMANAC = 0.0; - d_OMEGA_ALMANAC = 0.0; - d_M0_ALMANAC = 0.0; - almanac_WN = 0; - d_toa2 = 0.0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; - d_A_f2 = 0.0; - auto gnss_sat = Gnss_Satellite(); std::string _system("Beidou"); for (uint32_t i = 1; i < 36; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } -} - - -Beidou_Dnav_Navigation_Message::Beidou_Dnav_Navigation_Message() -{ - reset(); + for (uint32_t i = 1; i < 36; i++) + { + almanacHealth[i] = 0; + } } @@ -1060,6 +891,7 @@ Beidou_Dnav_Iono Beidou_Dnav_Navigation_Message::get_iono() return iono; } + Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() { Beidou_Dnav_Utc_Model utc_model; @@ -1084,6 +916,7 @@ Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() return utc_model; } + bool Beidou_Dnav_Navigation_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class { if (i_satellite_PRN > 0 and i_satellite_PRN < 6) @@ -1139,6 +972,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_ephemeris() // Check if we have a return false; } + bool Beidou_Dnav_Navigation_Message::have_new_iono() { // the condition on flag_utc_model is added to have a time stamp for iono @@ -1150,6 +984,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_iono() return false; } + bool Beidou_Dnav_Navigation_Message::have_new_utc_model() { if (flag_d1_sf5_p9 == true and flag_d1_sf5_p10 == true) @@ -1164,6 +999,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_utc_model() return false; } + bool Beidou_Dnav_Navigation_Message::have_new_almanac() { if ((flag_d1_sf4 == true) and (flag_d1_sf5 == true)) @@ -1178,6 +1014,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_almanac() return false; } + bool Beidou_Dnav_Navigation_Message::satellite_validation() { bool flag_data_valid = false; diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index 68cb7d5ed..166f8e238 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -50,112 +50,111 @@ public: Beidou_Dnav_Navigation_Message(); // System flags for data processing - bool flag_eph_valid; - bool flag_utc_model_valid; - bool flag_iono_valid; - bool flag_d1_sf1; - bool flag_d1_sf2; - bool flag_d1_sf3; - bool flag_d1_sf4; - bool flag_d1_sf5; - bool flag_new_SOW_available; - bool flag_crc_test; - double d_previous_aode; + bool flag_eph_valid{}; + bool flag_utc_model_valid{}; + bool flag_iono_valid{}; + bool flag_d1_sf1{}; + bool flag_d1_sf2{}; + bool flag_d1_sf3{}; + bool flag_d1_sf4{}; + bool flag_d1_sf5{}; + bool flag_new_SOW_available{}; + bool flag_crc_test{}; + double d_previous_aode{}; - bool flag_d1_sf5_p7; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator - bool flag_d1_sf5_p8; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator - bool flag_d1_sf5_p9; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator - bool flag_d1_sf5_p10; //!< D1 NAV Message, Subframe 5, Page 10 decoded indicator + bool flag_d1_sf5_p7{}; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator + bool flag_d1_sf5_p8{}; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator + bool flag_d1_sf5_p9{}; //!< D1 NAV Message, Subframe 5, Page 09 decoded indicator + bool flag_d1_sf5_p10{}; //!< D1 NAV Message, Subframe 5, Page 10 decoded indicator - - bool flag_sf1_p1; //!< D2 NAV Message, Subframe 1, Page 1 decoded indicator - bool flag_sf1_p2; //!< D2 NAV Message, Subframe 1, Page 2 decoded indicator - bool flag_sf1_p3; //!< D2 NAV Message, Subframe 1, Page 3 decoded indicator - bool flag_sf1_p4; //!< D2 NAV Message, Subframe 1, Page 4 decoded indicator - bool flag_sf1_p5; //!< D2 NAV Message, Subframe 1, Page 5 decoded indicator - bool flag_sf1_p6; //!< D2 NAV Message, Subframe 1, Page 6 decoded indicator - bool flag_sf1_p7; //!< D2 NAV Message, Subframe 1, Page 7 decoded indicator - bool flag_sf1_p8; //!< D2 NAV Message, Subframe 1, Page 8 decoded indicator - bool flag_sf1_p9; //!< D2 NAV Message, Subframe 1, Page 9 decoded indicator - bool flag_sf1_p10; //!< D2 NAV Message, Subframe 1, Page 10 decoded indicator + bool flag_sf1_p1{}; //!< D2 NAV Message, Subframe 1, Page 1 decoded indicator + bool flag_sf1_p2{}; //!< D2 NAV Message, Subframe 1, Page 2 decoded indicator + bool flag_sf1_p3{}; //!< D2 NAV Message, Subframe 1, Page 3 decoded indicator + bool flag_sf1_p4{}; //!< D2 NAV Message, Subframe 1, Page 4 decoded indicator + bool flag_sf1_p5{}; //!< D2 NAV Message, Subframe 1, Page 5 decoded indicator + bool flag_sf1_p6{}; //!< D2 NAV Message, Subframe 1, Page 6 decoded indicator + bool flag_sf1_p7{}; //!< D2 NAV Message, Subframe 1, Page 7 decoded indicator + bool flag_sf1_p8{}; //!< D2 NAV Message, Subframe 1, Page 8 decoded indicator + bool flag_sf1_p9{}; //!< D2 NAV Message, Subframe 1, Page 9 decoded indicator + bool flag_sf1_p10{}; //!< D2 NAV Message, Subframe 1, Page 10 decoded indicator // broadcast orbit 1 - double d_SOW; //!< Time of BeiDou Week of the ephemeris set (taken from subframes SOW) [s] - double d_SOW_SF1; //!< Time of BeiDou Week from HOW word of Subframe 1 [s] - double d_SOW_SF2; //!< Time of BeiDou Week from HOW word of Subframe 2 [s] - double d_SOW_SF3; //!< Time of BeiDou Week from HOW word of Subframe 3 [s] - double d_SOW_SF4; //!< Time of BeiDou Week from HOW word of Subframe 4 [s] - double d_SOW_SF5; //!< Time of BeiDou Week from HOW word of Subframe 5 [s] + double d_SOW{}; //!< Time of BeiDou Week of the ephemeris set (taken from subframes SOW) [s] + double d_SOW_SF1{}; //!< Time of BeiDou Week from HOW word of Subframe 1 [s] + double d_SOW_SF2{}; //!< Time of BeiDou Week from HOW word of Subframe 2 [s] + double d_SOW_SF3{}; //!< Time of BeiDou Week from HOW word of Subframe 3 [s] + double d_SOW_SF4{}; //!< Time of BeiDou Week from HOW word of Subframe 4 [s] + double d_SOW_SF5{}; //!< Time of BeiDou Week from HOW word of Subframe 5 [s] - double d_AODE; - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + double d_AODE{}; + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] // broadcast orbit 2 - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] // broadcast orbit 3 - double d_Toe_sf2; //!< Ephemeris data reference time of week in subframe 2, D1 Message - double d_Toe_sf3; //!< Ephemeris data reference time of week in subframe 3, D1 Message - double d_Toe; //!< Ephemeris data reference time of week in subframe 1, D2 Message - double d_Toc; //!< clock data reference time [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Toe_sf2{}; //!< Ephemeris data reference time of week in subframe 2, D1 Message + double d_Toe_sf3{}; //!< Ephemeris data reference time of week in subframe 3, D1 Message + double d_Toe{}; //!< Ephemeris data reference time of week in subframe 1, D2 Message + double d_Toc{}; //!< clock data reference time [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] // broadcast orbit 4 - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] // broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int32_t i_BEIDOU_week; //!< BeiDou week number, aka WN [week] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_BEIDOU_week{}; //!< BeiDou week number, aka WN [week] // broadcast orbit 6 - int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV - int32_t i_SV_health; - double d_TGD1; //!< Estimated Group Delay Differential in B1 [s] - double d_TGD2; //!< Estimated Group Delay Differential in B2 [s] - double d_AODC; //!< Age of Data, Clock + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV + int32_t i_SV_health{}; + double d_TGD1{}; //!< Estimated Group Delay Differential in B1 [s] + double d_TGD2{}; //!< Estimated Group Delay Differential in B2 [s] + double d_AODC{}; //!< Age of Data, Clock // broadcast orbit 7 - // int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + // int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; - double d_A_f0; //!< Clock correction parameters. Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Clock correction parameters. Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Clock correction parameters. Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0{}; //!< Clock correction parameters. Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Clock correction parameters. Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Clock correction parameters. Coefficient 2 of code phase offset model [s/s^2] // D2 NAV Message Decoding - uint64_t d_A_f1_msb_bits; //!< Clock correction parameters, D2 NAV MSB - uint64_t d_A_f1_lsb_bits; //!< Clock correction parameters, D2 NAV LSB - uint64_t d_Cuc_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_Cuc_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_eccentricity_msb; //!< Eccentricity [dimensionless] - uint64_t d_eccentricity_lsb; //!< Eccentricity [dimensionless] - uint64_t d_Cic_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_Cic_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - uint64_t d_eccentricity_msb_bits; //!< Eccentricity [dimensionless] - uint64_t d_eccentricity_lsb_bits; - uint64_t d_i_0_msb_bits; //!< Inclination Angle at Reference Time [semi-circles] - uint64_t d_i_0_lsb_bits; //!< Inclination Angle at Reference Time [semi-circles] - uint64_t d_OMEGA_msb_bits; //!< Argument of Perigee [semi-cicles] - uint64_t d_OMEGA_lsb_bits; //!< Argument of Perigee [semi-cicles] - uint64_t d_OMEGA_DOT_msb_bits; //!< Rate of Right Ascension [semi-circles/s] - uint64_t d_OMEGA_DOT_lsb_bits; //!< Rate of Right Ascension [semi-circles/s] + uint64_t d_A_f1_msb_bits{}; //!< Clock correction parameters, D2 NAV MSB + uint64_t d_A_f1_lsb_bits{}; //!< Clock correction parameters, D2 NAV LSB + uint64_t d_Cuc_msb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_Cuc_lsb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_eccentricity_msb{}; //!< Eccentricity [dimensionless] + uint64_t d_eccentricity_lsb{}; //!< Eccentricity [dimensionless] + uint64_t d_Cic_msb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_Cic_lsb_bits{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_eccentricity_msb_bits{}; //!< Eccentricity [dimensionless] + uint64_t d_eccentricity_lsb_bits{}; + uint64_t d_i_0_msb_bits{}; //!< Inclination Angle at Reference Time [semi-circles] + uint64_t d_i_0_lsb_bits{}; //!< Inclination Angle at Reference Time [semi-circles] + uint64_t d_OMEGA_msb_bits{}; //!< Argument of Perigee [semi-cicles] + uint64_t d_OMEGA_lsb_bits{}; //!< Argument of Perigee [semi-cicles] + uint64_t d_OMEGA_DOT_msb_bits{}; //!< Rate of Right Ascension [semi-circles/s] + uint64_t d_OMEGA_DOT_lsb_bits{}; //!< Rate of Right Ascension [semi-circles/s] // Almanac - double d_Toa; //!< Almanac reference time [s] - int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced + double d_Toa{}; //!< Almanac reference time [s] + int32_t i_WN_A{}; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac std::map satelliteBlock; //!< Map that stores to which block the PRN belongs @@ -172,73 +171,72 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms - // double d_master_clock; // GPS transmission time - double d_satClkCorr; // GPS clock error - double d_dtr; // relativistic clock correction term - double d_satClkDrift; + // double d_master_clock{}; // GPS transmission time + double d_satClkCorr{}; // GPS clock error + double d_dtr{}; // relativistic clock correction term + double d_satClkDrift{}; // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int32_t i_channel_ID; - int32_t i_signal_type; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + int32_t i_signal_type{}; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) + uint32_t i_satellite_PRN{}; // time synchro - double d_subframe_timestamp_ms; // [ms] + double d_subframe_timestamp_ms{}; // [ms] // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - double d_A1UTC; //!< 1st order term of a model that relates GPS and UTC time [s/s] - double d_A0UTC; //!< Constant of a model that relates GPS and UTC time [s] - double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] - double d_A1GPS; - double d_A0GPS; - double d_A1GAL; - double d_A0GAL; - double d_A1GLO; - double d_A0GLO; + double d_A1UTC{}; //!< 1st order term of a model that relates GPS and UTC time [s/s] + double d_A0UTC{}; //!< Constant of a model that relates GPS and UTC time [s] + double d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + double d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] + double d_A1GPS{}; + double d_A0GPS{}; + double d_A1GAL{}; + double d_A0GAL{}; + double d_A1GLO{}; + double d_A0GLO{}; - double d_SQRT_A_ALMANAC; - double d_A1_ALMANAC; - double d_A0_ALMANAC; - double d_OMEGA0_ALMANAC; - double d_E_ALMANAC; - double d_DELTA_I; - double d_TOA; - double d_OMEGA_DOT_ALMANAC; - double d_OMEGA_ALMANAC; - double d_M0_ALMANAC; - int32_t almanac_WN; - double d_toa2; + double d_SQRT_A_ALMANAC{}; + double d_A1_ALMANAC{}; + double d_A0_ALMANAC{}; + double d_OMEGA0_ALMANAC{}; + double d_E_ALMANAC{}; + double d_DELTA_I{}; + double d_TOA{}; + double d_OMEGA_DOT_ALMANAC{}; + double d_OMEGA_ALMANAC{}; + double d_M0_ALMANAC{}; + int32_t almanac_WN{}; + double d_toa2{}; // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions - void reset(); /*! * \brief Obtain a BDS SV Ephemeris class filled with current SV data diff --git a/src/core/system_parameters/beidou_dnav_utc_model.cc b/src/core/system_parameters/beidou_dnav_utc_model.cc deleted file mode 100644 index ae02c5335..000000000 --- a/src/core/system_parameters/beidou_dnav_utc_model.cc +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * \file beidou_dnav_utc_model.cc - * \brief Interface of a BeiDou UTC Model storage - * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com - * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "beidou_dnav_utc_model.h" - - -Beidou_Dnav_Utc_Model::Beidou_Dnav_Utc_Model() -{ - valid = false; - d_A1_UTC = 0; - d_A0_UTC = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; - - d_A0_GPS = 0; - d_A1_GPS = 0; - d_A0_GAL = 0; - d_A1_GAL = 0; - d_A0_GLO = 0; - d_A1_GLO = 0; -} diff --git a/src/core/system_parameters/beidou_dnav_utc_model.h b/src/core/system_parameters/beidou_dnav_utc_model.h index 72c4f32c7..b88f10a0b 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.h +++ b/src/core/system_parameters/beidou_dnav_utc_model.h @@ -33,29 +33,29 @@ class Beidou_Dnav_Utc_Model { public: - bool valid; + Beidou_Dnav_Utc_Model() = default; + + bool valid{}; // BeiDou UTC parameters - double d_A0_UTC; //!< BDT clock bias relative to UTC [s] - double d_A1_UTC; //!< BDT clock rate relative to UTC [s/s] - double d_DeltaT_LS; //!< Delta time due to leap seconds before the new leap second effective - int i_WN_LSF; //!< Week number of the new leap second - int i_DN; //!< Day number of week of the new leap second - double d_DeltaT_LSF; //!< Delta time due to leap seconds after the new leap second effective [s] + double d_A0_UTC{}; //!< BDT clock bias relative to UTC [s] + double d_A1_UTC{}; //!< BDT clock rate relative to UTC [s/s] + double d_DeltaT_LS{}; //!< Delta time due to leap seconds before the new leap second effective + int i_WN_LSF{}; //!< Week number of the new leap second + int i_DN{}; //!< Day number of week of the new leap second + double d_DeltaT_LSF{}; //!< Delta time due to leap seconds after the new leap second effective [s] // BeiDou to GPS time corrections - double d_A0_GPS; //!< BDT clock bias relative to GPS time [s] - double d_A1_GPS; //!< BDT clock rate relative to GPS time [s/s] + double d_A0_GPS{}; //!< BDT clock bias relative to GPS time [s] + double d_A1_GPS{}; //!< BDT clock rate relative to GPS time [s/s] // BeiDou to Galileo time corrections - double d_A0_GAL; //!< BDT clock bias relative to GAL time [s] - double d_A1_GAL; //!< BDT clock rate relative to GAL time [s/s] + double d_A0_GAL{}; //!< BDT clock bias relative to GAL time [s] + double d_A1_GAL{}; //!< BDT clock rate relative to GAL time [s/s] // BeiDou to GLONASS time corrections - double d_A0_GLO; //!< BDT clock bias relative to GLO time [s] - double d_A1_GLO; //!< BDT clock rate relative to GLO time [s/s] - - Beidou_Dnav_Utc_Model(); + double d_A0_GLO{}; //!< BDT clock bias relative to GLO time [s] + double d_A1_GLO{}; //!< BDT clock rate relative to GLO time [s/s] template /* diff --git a/src/core/system_parameters/galileo_almanac.cc b/src/core/system_parameters/galileo_almanac.cc deleted file mode 100644 index b331628b0..000000000 --- a/src/core/system_parameters/galileo_almanac.cc +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * \file galileo_almanac.cc - * \brief Interface of a Galileo ALMANAC storage - * \author Carles Fernandez, 2018. cfernandez(at)cttc.cat - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "galileo_almanac.h" - - -Galileo_Almanac::Galileo_Almanac() -{ - i_satellite_PRN = 0U; - i_Toa = 0; - i_WNa = 0; - i_IODa = 0; - d_Delta_i = 0.0; - d_M_0 = 0.0; - d_e_eccentricity = 0.0; - d_Delta_sqrt_A = 0.0; - d_OMEGA0 = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; - E5b_HS = 0; - E1B_HS = 0; - E5a_HS = 0; -} diff --git a/src/core/system_parameters/galileo_almanac.h b/src/core/system_parameters/galileo_almanac.h index c09fe5ed5..1bad99c85 100644 --- a/src/core/system_parameters/galileo_almanac.h +++ b/src/core/system_parameters/galileo_almanac.h @@ -30,27 +30,27 @@ class Galileo_Almanac { public: - uint32_t i_satellite_PRN; //!< SV PRN NUMBER - int32_t i_Toa; - int32_t i_WNa; - int32_t i_IODa; - double d_Delta_i; //!< Inclination at reference time relative to i0 = 56º [semi-circles] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Delta_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - int32_t E5b_HS; - int32_t E1B_HS; - int32_t E5a_HS; + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER + int32_t i_Toa{}; + int32_t i_WNa{}; + int32_t i_IODa{}; + double d_Delta_i{}; //!< Inclination at reference time relative to i0 = 56º [semi-circles] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Delta_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + int32_t E5b_HS{}; + int32_t E1B_HS{}; + int32_t E5a_HS{}; /*! * Default constructor */ - Galileo_Almanac(); + Galileo_Almanac() = default; template diff --git a/src/core/system_parameters/galileo_almanac_helper.cc b/src/core/system_parameters/galileo_almanac_helper.cc index 260f06baa..97f35bb67 100644 --- a/src/core/system_parameters/galileo_almanac_helper.cc +++ b/src/core/system_parameters/galileo_almanac_helper.cc @@ -19,64 +19,6 @@ #include "galileo_almanac_helper.h" -Galileo_Almanac_Helper::Galileo_Almanac_Helper() -{ - // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - IOD_a_7 = 0; - WN_a_7 = 0; - t0a_7 = 0; - SVID1_7 = 0; - DELTA_A_7 = 0.0; - e_7 = 0.0; - omega_7 = 0.0; - delta_i_7 = 0.0; - Omega0_7 = 0.0; - Omega_dot_7 = 0.0; - M0_7 = 0.0; - - // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - IOD_a_8 = 0; - af0_8 = 0.0; - af1_8 = 0.0; - E5b_HS_8 = 0; - E1B_HS_8 = 0; - E5a_HS_8 = 0; - SVID2_8 = 0; - DELTA_A_8 = 0.0; - e_8 = 0.0; - omega_8 = 0.0; - delta_i_8 = 0.0; - Omega0_8 = 0.0; - Omega_dot_8 = 0.0; - - // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - IOD_a_9 = 0; - WN_a_9 = 0; - t0a_9 = 0; - M0_9 = 0.0; - af0_9 = 0.0; - af1_9 = 0.0; - E5b_HS_9 = 0; - E1B_HS_9 = 0; - E5a_HS_9 = 0; - SVID3_9 = 0; - DELTA_A_9 = 0.0; - e_9 = 0.0; - omega_9 = 0.0; - delta_i_9 = 0.0; - - // Word type 10: Almanac for SVID3 (2/2) - IOD_a_10 = 0; - Omega0_10 = 0.0; - Omega_dot_10 = 0.0; - M0_10 = 0.0; - af0_10 = 0.0; - af1_10 = 0.0; - E5b_HS_10 = 0; - E1B_HS_10 = 0; - E5a_HS_10 = 0; -} - Galileo_Almanac Galileo_Almanac_Helper::get_almanac(int i) { Galileo_Almanac galileo_almanac; diff --git a/src/core/system_parameters/galileo_almanac_helper.h b/src/core/system_parameters/galileo_almanac_helper.h index 34b457d4a..15fea7a09 100644 --- a/src/core/system_parameters/galileo_almanac_helper.h +++ b/src/core/system_parameters/galileo_almanac_helper.h @@ -31,62 +31,63 @@ class Galileo_Almanac_Helper { public: + Galileo_Almanac_Helper() = default; //!< Default constructor + // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - int32_t IOD_a_7; - int32_t WN_a_7; - int32_t t0a_7; - int32_t SVID1_7; - double DELTA_A_7; - double e_7; - double omega_7; - double delta_i_7; - double Omega0_7; - double Omega_dot_7; - double M0_7; + int32_t IOD_a_7{}; + int32_t WN_a_7{}; + int32_t t0a_7{}; + int32_t SVID1_7{}; + double DELTA_A_7{}; + double e_7{}; + double omega_7{}; + double delta_i_7{}; + double Omega0_7{}; + double Omega_dot_7{}; + double M0_7{}; // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - int32_t IOD_a_8; - double af0_8; - double af1_8; - int32_t E5b_HS_8; - int32_t E1B_HS_8; - int32_t E5a_HS_8; - int32_t SVID2_8; - double DELTA_A_8; - double e_8; - double omega_8; - double delta_i_8; - double Omega0_8; - double Omega_dot_8; + int32_t IOD_a_8{}; + double af0_8{}; + double af1_8{}; + int32_t E5b_HS_8{}; + int32_t E1B_HS_8{}; + int32_t E5a_HS_8{}; + int32_t SVID2_8{}; + double DELTA_A_8{}; + double e_8{}; + double omega_8{}; + double delta_i_8{}; + double Omega0_8{}; + double Omega_dot_8{}; // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - int32_t IOD_a_9; - int32_t WN_a_9; - int32_t t0a_9; - double M0_9; - double af0_9; - double af1_9; - int32_t E5b_HS_9; - int32_t E1B_HS_9; - int32_t E5a_HS_9; - int32_t SVID3_9; - double DELTA_A_9; - double e_9; - double omega_9; - double delta_i_9; + int32_t IOD_a_9{}; + int32_t WN_a_9{}; + int32_t t0a_9{}; + double M0_9{}; + double af0_9{}; + double af1_9{}; + int32_t E5b_HS_9{}; + int32_t E1B_HS_9{}; + int32_t E5a_HS_9{}; + int32_t SVID3_9{}; + double DELTA_A_9{}; + double e_9{}; + double omega_9{}; + double delta_i_9{}; // Word type 10: Almanac for SVID3 (2/2) - int32_t IOD_a_10; - double Omega0_10; - double Omega_dot_10; - double M0_10; - double af0_10; - double af1_10; - int32_t E5b_HS_10; - int32_t E1B_HS_10; - int32_t E5a_HS_10; + int32_t IOD_a_10{}; + double Omega0_10{}; + double Omega_dot_10{}; + double M0_10{}; + double af0_10{}; + double af1_10{}; + int32_t E5b_HS_10{}; + int32_t E1B_HS_10{}; + int32_t E5a_HS_10{}; - Galileo_Almanac_Helper(); //!< Default constructor Galileo_Almanac get_almanac(int i); }; diff --git a/src/core/system_parameters/galileo_ephemeris.cc b/src/core/system_parameters/galileo_ephemeris.cc index 071eb0237..36d1f8c24 100644 --- a/src/core/system_parameters/galileo_ephemeris.cc +++ b/src/core/system_parameters/galileo_ephemeris.cc @@ -22,67 +22,6 @@ #include -Galileo_Ephemeris::Galileo_Ephemeris() -{ - flag_all_ephemeris = false; - IOD_ephemeris = 0; - IOD_nav_1 = 0; - SV_ID_PRN_4 = 0; - M0_1 = 0.0; // Mean anomaly at reference time [semi-circles] - delta_n_3 = 0.0; // Mean motion difference from computed value [semi-circles/sec] - e_1 = 0.0; // Eccentricity - A_1 = 0.0; // Square root of the semi-major axis [meters^1/2] - OMEGA_0_2 = 0.0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - i_0_2 = 0.0; // Inclination angle at reference time [semi-circles] - omega_2 = 0.0; // Argument of perigee [semi-circles] - OMEGA_dot_3 = 0.0; // Rate of right ascension [semi-circles/sec] - iDot_2 = 0.0; // Rate of inclination angle [semi-circles/sec] - C_uc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] - C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] - C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] - t0e_1 = 0; // Ephemeris reference time [s] - - // Clock correction parameters - t0c_4 = 0; // Clock correction data reference Time of Week [sec] - af0_4 = 0.0; // SV clock bias correction coefficient [s] - af1_4 = 0.0; // SV clock drift correction coefficient [s/s] - af2_4 = 0.0; // SV clock drift rate correction coefficient [s/s^2] - - // GST - WN_5 = 0; - TOW_5 = 0; - - // SV status - SISA_3 = 0; - E5a_HS = 0; - E5b_HS_5 = 0; - E1B_HS_5 = 0; - E5a_DVS = false; - E5b_DVS_5 = false; - E1B_DVS_5 = false; - BGD_E1E5a_5 = 0.0; // E1-E5a Broadcast Group Delay [s] - BGD_E1E5b_5 = 0.0; // E1-E5b Broadcast Group Delay [s] - - Galileo_satClkDrift = 0.0; - Galileo_dtr = 0.0; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - - i_satellite_PRN = 0U; -} - - double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW) { /* GALIELO SYSTEM TIME, ICD 5.1.2 diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index d4763d55c..bdbeb4d18 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -34,71 +34,71 @@ class Galileo_Ephemeris { public: + Galileo_Ephemeris() = default; /* Galileo ephemeris are 16 parameters and here are reported following the ICD order, paragraph 5.1.1. The number in the name after underscore (_1, _2, _3 and so on) refers to the page were we can find that parameter */ - bool flag_all_ephemeris; - int32_t IOD_ephemeris; - int32_t IOD_nav_1; - int32_t SV_ID_PRN_4; - double M0_1; //!< Mean anomaly at reference time [semi-circles] - double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] - double e_1; //!< Eccentricity - double A_1; //!< Square root of the semi-major axis [meters^1/2] - double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0_2; //!< Inclination angle at reference time [semi-circles] - double omega_2; //!< Argument of perigee [semi-circles] - double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] - double iDot_2; //!< Rate of inclination angle [semi-circles/sec] - double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] - double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] - double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] - int32_t t0e_1; //!< Ephemeris reference time [s] + bool flag_all_ephemeris{}; + int32_t IOD_ephemeris{}; + int32_t IOD_nav_1{}; + int32_t SV_ID_PRN_4{}; + double M0_1{}; //!< Mean anomaly at reference time [semi-circles] + double delta_n_3{}; //!< Mean motion difference from computed value [semi-circles/sec] + double e_1{}; //!< Eccentricity + double A_1{}; //!< Square root of the semi-major axis [meters^1/2] + double OMEGA_0_2{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + double i_0_2{}; //!< Inclination angle at reference time [semi-circles] + double omega_2{}; //!< Argument of perigee [semi-circles] + double OMEGA_dot_3{}; //!< Rate of right ascension [semi-circles/sec] + double iDot_2{}; //!< Rate of inclination angle [semi-circles/sec] + double C_uc_3{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + double C_us_3{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double C_rc_3{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] + double C_rs_3{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] + double C_ic_4{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + double C_is_4{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] + int32_t t0e_1{}; //!< Ephemeris reference time [s] - /*Clock correction parameters*/ - int32_t t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< SV clock drift rate correction coefficient [s/s^2] + /* Clock correction parameters */ + int32_t t0c_4{}; //!< Clock correction data reference Time of Week [sec] + double af0_4{}; //!< SV clock bias correction coefficient [s] + double af1_4{}; //!< SV clock drift correction coefficient [s/s] + double af2_4{}; //!< SV clock drift rate correction coefficient [s/s^2] - /*GST*/ + /* GST */ // Not belong to ephemeris set (page 1 to 4) - int32_t WN_5; //!< Week number - int32_t TOW_5; //!< Time of Week - double Galileo_satClkDrift; - double Galileo_dtr; //!< relativistic clock correction term + int32_t WN_5{}; //!< Week number + int32_t TOW_5{}; //!< Time of Week + double Galileo_satClkDrift{}; + double Galileo_dtr{}; //!< relativistic clock correction term // SV status - int32_t SISA_3; - int32_t E5a_HS; //!< E5a Signal Health Status - int32_t E5b_HS_5; //!< E5b Signal Health Status - int32_t E1B_HS_5; //!< E1B Signal Health Status - bool E5a_DVS; //!< E5a Data Validity Status - bool E5b_DVS_5; //!< E5b Data Validity Status - bool E1B_DVS_5; //!< E1B Data Validity Status + int32_t SISA_3{}; + int32_t E5a_HS{}; //!< E5a Signal Health Status + int32_t E5b_HS_5{}; //!< E5b Signal Health Status + int32_t E1B_HS_5{}; //!< E1B Signal Health Status + bool E5a_DVS{}; //!< E5a Data Validity Status + bool E5b_DVS_5{}; //!< E5b Data Validity Status + bool E1B_DVS_5{}; //!< E1B Data Validity Status - double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] - double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] + double BGD_E1E5a_5{}; //!< E1-E5a Broadcast Group Delay [s] + double BGD_E1E5b_5{}; //!< E1-E5b Broadcast Group Delay [s] // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] - uint32_t i_satellite_PRN; //!< SV PRN NUMBER + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER void satellitePosition(double transmitTime); //!< Computes the ECEF SV coordinates and ECEF velocity double Galileo_System_Time(double WN, double TOW); //!< Galileo System Time (GST), ICD paragraph 5.1.2 double sv_clock_drift(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 double sv_clock_relativistic_term(double transmitTime); //!< Satellite Time Correction Algorithm, ICD 5.1.4 - Galileo_Ephemeris(); template diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 5428d195a..ba050ec8d 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -33,143 +33,6 @@ using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>; -void Galileo_Fnav_Message::reset() -{ - flag_CRC_test = false; - flag_all_ephemeris = false; //!< Flag indicating that all words containing ephemeris have been received - flag_ephemeris_1 = false; //!< Flag indicating that ephemeris 1/3 (word 2) have been received - flag_ephemeris_2 = false; //!< Flag indicating that ephemeris 2/3 (word 3) have been received - flag_ephemeris_3 = false; //!< Flag indicating that ephemeris 3/3 (word 4) have been received - - flag_iono_and_GST = false; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received - flag_TOW_1 = false; - flag_TOW_2 = false; - flag_TOW_3 = false; - flag_TOW_4 = false; - flag_TOW_set = false; //!< it is true when page 1,2,3 or 4 arrives - flag_utc_model = false; //!< Flag indicating that utc model parameters (word 4) have been received - - flag_all_almanac = false; //!< Flag indicating that all almanac have been received - flag_almanac_1 = false; //!< Flag indicating that almanac 1/2 (word 5) have been received - flag_almanac_2 = false; //!< Flag indicating that almanac 2/2 (word 6) have been received - - IOD_ephemeris = 0; - - page_type = 0; - // WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal - // health and Data validity status - FNAV_SV_ID_PRN_1 = 0; - FNAV_IODnav_1 = -1; - FNAV_t0c_1 = 0; - FNAV_af0_1 = 0.0; - FNAV_af1_1 = 0.0; - FNAV_af2_1 = 0.0; - FNAV_SISA_1 = 0; - FNAV_ai0_1 = 0.0; - FNAV_ai1_1 = 0.0; - FNAV_ai2_1 = 0.0; - FNAV_region1_1 = false; - FNAV_region2_1 = false; - FNAV_region3_1 = false; - FNAV_region4_1 = false; - FNAV_region5_1 = false; - FNAV_BGD_1 = 0.0; - FNAV_E5ahs_1 = 0; - FNAV_WN_1 = 0; - FNAV_TOW_1 = 0; - FNAV_E5advs_1 = false; - - // WORD 2 Ephemeris (1/3) and GST - FNAV_IODnav_2 = -2; - FNAV_M0_2 = 0.0; - FNAV_omegadot_2 = 0.0; - FNAV_e_2 = 0.0; - FNAV_a12_2 = 0.0; - FNAV_omega0_2 = 0.0; - FNAV_idot_2 = 0.0; - FNAV_WN_2 = 0; - FNAV_TOW_2 = 0; - - // WORD 3 Ephemeris (2/3) and GST - FNAV_IODnav_3 = -3; - FNAV_i0_3 = 0.0; - FNAV_w_3 = 0.0; - FNAV_deltan_3 = 0.0; - FNAV_Cuc_3 = 0.0; - FNAV_Cus_3 = 0.0; - FNAV_Crc_3 = 0.0; - FNAV_Crs_3 = 0.0; - FNAV_t0e_3 = 0; - FNAV_WN_3 = 0; - FNAV_TOW_3 = 0; - - // WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW. - // Note that the clock is repeated in this page type - FNAV_IODnav_4 = -4; - FNAV_Cic_4 = 0.0; - FNAV_Cis_4 = 0.0; - FNAV_A0_4 = 0.0; - FNAV_A1_4 = 0.0; - FNAV_deltatls_4 = 0; - FNAV_t0t_4 = 0; - FNAV_WNot_4 = 0; - FNAV_WNlsf_4 = 0; - FNAV_DN_4 = 0; - FNAV_deltatlsf_4 = 0; - FNAV_t0g_4 = 0; - FNAV_A0g_4 = 0.0; - FNAV_A1g_4 = 0.0; - FNAV_WN0g_4 = 0; - FNAV_TOW_4 = 0; - - // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time - FNAV_IODa_5 = 0; - FNAV_WNa_5 = 0; - FNAV_t0a_5 = 0; - FNAV_SVID1_5 = 0; - FNAV_Deltaa12_1_5 = 0.0; - FNAV_e_1_5 = 0.0; - FNAV_w_1_5 = 0.0; - FNAV_deltai_1_5 = 0.0; - FNAV_Omega0_1_5 = 0.0; - FNAV_Omegadot_1_5 = 0.0; - FNAV_M0_1_5 = 0.0; - FNAV_af0_1_5 = 0.0; - FNAV_af1_1_5 = 0.0; - FNAV_E5ahs_1_5 = 0U; - FNAV_SVID2_5 = 0; - FNAV_Deltaa12_2_5 = 0; - FNAV_e_2_5 = 0.0; - FNAV_w_2_5 = 0.0; - FNAV_deltai_2_5 = 0.0; - - // WORD 6 Almanac (SVID2(2/2) and SVID3) - FNAV_IODa_6 = 0; - FNAV_Omega0_2_6 = 0.0; - FNAV_Omegadot_2_6 = 0.0; - FNAV_M0_2_6 = 0.0; - FNAV_af0_2_6 = 0.0; - FNAV_af1_2_6 = 0.0; - FNAV_E5ahs_2_6 = 0; - FNAV_SVID3_6 = 0; - FNAV_Deltaa12_3_6 = 0.0; - FNAV_e_3_6 = 0.0; - FNAV_w_3_6 = 0.0; - FNAV_deltai_3_6 = 0.0; - FNAV_Omega0_3_6 = 0.0; - FNAV_Omegadot_3_6 = 0.0; - FNAV_M0_3_6 = 0.0; - FNAV_af0_3_6 = 0.0; - FNAV_af1_3_6 = 0.0; - FNAV_E5ahs_3_6 = 0; -} - - -Galileo_Fnav_Message::Galileo_Fnav_Message() -{ - reset(); -} - void Galileo_Fnav_Message::split_page(const std::string& page_string) { diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index 8a2daedc9..d26d127fe 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -46,8 +46,9 @@ class Galileo_Fnav_Message { public: + Galileo_Fnav_Message() = default; + void split_page(const std::string& page_string); - void reset(); bool have_new_ephemeris(); bool have_new_iono_and_GST(); bool have_new_utc_model(); @@ -57,135 +58,133 @@ public: Galileo_Utc_Model get_utc_model(); Galileo_Almanac_Helper get_almanac(); - Galileo_Fnav_Message(); + bool flag_CRC_test{}; + bool flag_all_ephemeris{}; //!< Flag indicating that all words containing ephemeris have been received + bool flag_ephemeris_1{}; //!< Flag indicating that ephemeris 1/3 (word 2) have been received + bool flag_ephemeris_2{}; //!< Flag indicating that ephemeris 2/3 (word 3) have been received + bool flag_ephemeris_3{}; //!< Flag indicating that ephemeris 3/3 (word 4) have been received - bool flag_CRC_test; - bool flag_all_ephemeris; //!< Flag indicating that all words containing ephemeris have been received - bool flag_ephemeris_1; //!< Flag indicating that ephemeris 1/3 (word 2) have been received - bool flag_ephemeris_2; //!< Flag indicating that ephemeris 2/3 (word 3) have been received - bool flag_ephemeris_3; //!< Flag indicating that ephemeris 3/3 (word 4) have been received + bool flag_iono_and_GST{}; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received + bool flag_TOW_1{}; + bool flag_TOW_2{}; + bool flag_TOW_3{}; + bool flag_TOW_4{}; + bool flag_TOW_set{}; //!< it is true when page 1,2,3 or 4 arrives + bool flag_utc_model{}; //!< Flag indicating that utc model parameters (word 4) have been received - bool flag_iono_and_GST; //!< Flag indicating that ionospheric and GST parameters (word 1) have been received - bool flag_TOW_1; - bool flag_TOW_2; - bool flag_TOW_3; - bool flag_TOW_4; - bool flag_TOW_set; //!< it is true when page 1,2,3 or 4 arrives - bool flag_utc_model; //!< Flag indicating that utc model parameters (word 4) have been received + bool flag_all_almanac{}; //!< Flag indicating that all almanac have been received + bool flag_almanac_1{}; //!< Flag indicating that almanac 1/2 (word 5) have been received + bool flag_almanac_2{}; //!< Flag indicating that almanac 2/2 (word 6) have been received - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_1; //!< Flag indicating that almanac 1/2 (word 5) have been received - bool flag_almanac_2; //!< Flag indicating that almanac 2/2 (word 6) have been received + int32_t IOD_ephemeris{}; - int32_t IOD_ephemeris; - - int32_t page_type; + int32_t page_type{}; // WORD 1 SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal // health and Data validity status - int32_t FNAV_SV_ID_PRN_1; - int32_t FNAV_IODnav_1; - int32_t FNAV_t0c_1; - double FNAV_af0_1; - double FNAV_af1_1; - double FNAV_af2_1; - int32_t FNAV_SISA_1; - double FNAV_ai0_1; - double FNAV_ai1_1; - double FNAV_ai2_1; - bool FNAV_region1_1; - bool FNAV_region2_1; - bool FNAV_region3_1; - bool FNAV_region4_1; - bool FNAV_region5_1; - double FNAV_BGD_1; - int32_t FNAV_E5ahs_1; - int32_t FNAV_WN_1; - int32_t FNAV_TOW_1; - bool FNAV_E5advs_1; + int32_t FNAV_SV_ID_PRN_1{}; + int32_t FNAV_IODnav_1{}; + int32_t FNAV_t0c_1{}; + double FNAV_af0_1{}; + double FNAV_af1_1{}; + double FNAV_af2_1{}; + int32_t FNAV_SISA_1{}; + double FNAV_ai0_1{}; + double FNAV_ai1_1{}; + double FNAV_ai2_1{}; + bool FNAV_region1_1{}; + bool FNAV_region2_1{}; + bool FNAV_region3_1{}; + bool FNAV_region4_1{}; + bool FNAV_region5_1{}; + double FNAV_BGD_1{}; + int32_t FNAV_E5ahs_1{}; + int32_t FNAV_WN_1{}; + int32_t FNAV_TOW_1{}; + bool FNAV_E5advs_1{}; // WORD 2 Ephemeris (1/3) and GST - int32_t FNAV_IODnav_2; - double FNAV_M0_2; - double FNAV_omegadot_2; - double FNAV_e_2; - double FNAV_a12_2; - double FNAV_omega0_2; - double FNAV_idot_2; - int32_t FNAV_WN_2; - int32_t FNAV_TOW_2; + int32_t FNAV_IODnav_2{}; + double FNAV_M0_2{}; + double FNAV_omegadot_2{}; + double FNAV_e_2{}; + double FNAV_a12_2{}; + double FNAV_omega0_2{}; + double FNAV_idot_2{}; + int32_t FNAV_WN_2{}; + int32_t FNAV_TOW_2{}; // WORD 3 Ephemeris (2/3) and GST - int32_t FNAV_IODnav_3; - double FNAV_i0_3; - double FNAV_w_3; - double FNAV_deltan_3; - double FNAV_Cuc_3; - double FNAV_Cus_3; - double FNAV_Crc_3; - double FNAV_Crs_3; - int32_t FNAV_t0e_3; - int32_t FNAV_WN_3; - int32_t FNAV_TOW_3; + int32_t FNAV_IODnav_3{}; + double FNAV_i0_3{}; + double FNAV_w_3{}; + double FNAV_deltan_3{}; + double FNAV_Cuc_3{}; + double FNAV_Cus_3{}; + double FNAV_Crc_3{}; + double FNAV_Crs_3{}; + int32_t FNAV_t0e_3{}; + int32_t FNAV_WN_3{}; + int32_t FNAV_TOW_3{}; // WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW. // Note that the clock is repeated in this page type - int32_t FNAV_IODnav_4; - double FNAV_Cic_4; - double FNAV_Cis_4; - double FNAV_A0_4; - double FNAV_A1_4; - int32_t FNAV_deltatls_4; - int32_t FNAV_t0t_4; - int32_t FNAV_WNot_4; - int32_t FNAV_WNlsf_4; - int32_t FNAV_DN_4; - int32_t FNAV_deltatlsf_4; - int32_t FNAV_t0g_4; - double FNAV_A0g_4; - double FNAV_A1g_4; - int32_t FNAV_WN0g_4; - int32_t FNAV_TOW_4; + int32_t FNAV_IODnav_4{}; + double FNAV_Cic_4{}; + double FNAV_Cis_4{}; + double FNAV_A0_4{}; + double FNAV_A1_4{}; + int32_t FNAV_deltatls_4{}; + int32_t FNAV_t0t_4{}; + int32_t FNAV_WNot_4{}; + int32_t FNAV_WNlsf_4{}; + int32_t FNAV_DN_4{}; + int32_t FNAV_deltatlsf_4{}; + int32_t FNAV_t0g_4{}; + double FNAV_A0g_4{}; + double FNAV_A1g_4{}; + int32_t FNAV_WN0g_4{}; + int32_t FNAV_TOW_4{}; // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time - int32_t FNAV_IODa_5; - int32_t FNAV_WNa_5; - int32_t FNAV_t0a_5; - int32_t FNAV_SVID1_5; - double FNAV_Deltaa12_1_5; - double FNAV_e_1_5; - double FNAV_w_1_5; - double FNAV_deltai_1_5; - double FNAV_Omega0_1_5; - double FNAV_Omegadot_1_5; - double FNAV_M0_1_5; - double FNAV_af0_1_5; - double FNAV_af1_1_5; - uint32_t FNAV_E5ahs_1_5; - int32_t FNAV_SVID2_5; - double FNAV_Deltaa12_2_5; - double FNAV_e_2_5; - double FNAV_w_2_5; - double FNAV_deltai_2_5; + int32_t FNAV_IODa_5{}; + int32_t FNAV_WNa_5{}; + int32_t FNAV_t0a_5{}; + int32_t FNAV_SVID1_5{}; + double FNAV_Deltaa12_1_5{}; + double FNAV_e_1_5{}; + double FNAV_w_1_5{}; + double FNAV_deltai_1_5{}; + double FNAV_Omega0_1_5{}; + double FNAV_Omegadot_1_5{}; + double FNAV_M0_1_5{}; + double FNAV_af0_1_5{}; + double FNAV_af1_1_5{}; + uint32_t FNAV_E5ahs_1_5{}; + int32_t FNAV_SVID2_5{}; + double FNAV_Deltaa12_2_5{}; + double FNAV_e_2_5{}; + double FNAV_w_2_5{}; + double FNAV_deltai_2_5{}; // WORD 6 Almanac (SVID2(2/2) and SVID3) - int32_t FNAV_IODa_6; - double FNAV_Omega0_2_6; - double FNAV_Omegadot_2_6; - double FNAV_M0_2_6; - double FNAV_af0_2_6; - double FNAV_af1_2_6; - int32_t FNAV_E5ahs_2_6; - int32_t FNAV_SVID3_6; - double FNAV_Deltaa12_3_6; - double FNAV_e_3_6; - double FNAV_w_3_6; - double FNAV_deltai_3_6; - double FNAV_Omega0_3_6; - double FNAV_Omegadot_3_6; - double FNAV_M0_3_6; - double FNAV_af0_3_6; - double FNAV_af1_3_6; - int32_t FNAV_E5ahs_3_6; + int32_t FNAV_IODa_6{}; + double FNAV_Omega0_2_6{}; + double FNAV_Omegadot_2_6{}; + double FNAV_M0_2_6{}; + double FNAV_af0_2_6{}; + double FNAV_af1_2_6{}; + int32_t FNAV_E5ahs_2_6{}; + int32_t FNAV_SVID3_6{}; + double FNAV_Deltaa12_3_6{}; + double FNAV_e_3_6{}; + double FNAV_w_3_6{}; + double FNAV_deltai_3_6{}; + double FNAV_Omega0_3_6{}; + double FNAV_Omegadot_3_6{}; + double FNAV_M0_3_6{}; + double FNAV_af0_3_6{}; + double FNAV_af1_3_6{}; + int32_t FNAV_E5ahs_3_6{}; private: bool _CRC_test(std::bitset bits, uint32_t checksum); @@ -193,9 +192,9 @@ private: uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); - std::string omega0_1; - // std::string omega0_2; - // bool omega_flag; + std::string omega0_1{}; + // std::string omega0_2{}; + // bool omega_flag{}; }; #endif // GNSS_SDR_GALILEO_FNAV_MESSAGE_H diff --git a/src/core/system_parameters/galileo_iono.cc b/src/core/system_parameters/galileo_iono.cc deleted file mode 100644 index 450ef0d34..000000000 --- a/src/core/system_parameters/galileo_iono.cc +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * \file galileo_iono.cc - * \brief Interface of a GPS IONOSPHERIC MODEL storage - * - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "galileo_iono.h" - -Galileo_Iono::Galileo_Iono() -{ - // Ionospheric correction - ai0_5 = 0.0; // Effective Ionisation Level 1st order parameter [sfu] - ai1_5 = 0.0; // Effective Ionisation Level 2st order parameter [sfu/degree] - ai2_5 = 0.0; // Effective Ionisation Level 3st order parameter [sfu/degree] - - // Ionospheric disturbance flag - Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1 - Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2 - Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3 - Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 - Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 - - TOW_5 = 0; - WN_5 = 0; -} diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index cf882eebe..b8e149586 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -32,26 +32,26 @@ class Galileo_Iono { public: - // Ionospheric correction - double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu] - double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree] - double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree] - - // Ionospheric disturbance flag - bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1 - bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2 - bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3 - bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4 - bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 - - // from page 5 (UTC) to have a timestamp - int32_t TOW_5; //!< UTC data reference Time of Week [s] - int32_t WN_5; //!< UTC data reference Week number [week] - /*! * Default constructor */ - Galileo_Iono(); + Galileo_Iono() = default; + + // Ionospheric correction + double ai0_5{}; //!< Effective Ionisation Level 1st order parameter [sfu] + double ai1_5{}; //!< Effective Ionisation Level 2st order parameter [sfu/degree] + double ai2_5{}; //!< Effective Ionisation Level 3st order parameter [sfu/degree] + + // Ionospheric disturbance flag + bool Region1_flag_5{}; //!< Ionospheric Disturbance Flag for region 1 + bool Region2_flag_5{}; //!< Ionospheric Disturbance Flag for region 2 + bool Region3_flag_5{}; //!< Ionospheric Disturbance Flag for region 3 + bool Region4_flag_5{}; //!< Ionospheric Disturbance Flag for region 4 + bool Region5_flag_5{}; //!< Ionospheric Disturbance Flag for region 5 + + // from page 5 (UTC) to have a timestamp + int32_t TOW_5{}; //!< UTC data reference Time of Week [s] + int32_t WN_5{}; //!< UTC data reference Week number [week] template diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 8df2dee5e..045183688 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -31,194 +31,6 @@ using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>; -void Galileo_Navigation_Message::reset() -{ - Page_type_time_stamp = 0; - - flag_CRC_test = false; - flag_all_ephemeris = false; // flag indicating that all words containing ephemeris have been received - flag_ephemeris_1 = false; // flag indicating that ephemeris 1/4 (word 1) have been received - flag_ephemeris_2 = false; // flag indicating that ephemeris 2/4 (word 2) have been received - flag_ephemeris_3 = false; // flag indicating that ephemeris 3/4 (word 3) have been received - flag_ephemeris_4 = false; // flag indicating that ephemeris 4/4 (word 4) have been received - - flag_iono_and_GST = false; // flag indicating that ionospheric parameters (word 5) have been received - flag_utc_model = false; // flag indicating that utc model parameters (word 6) have been received - - flag_all_almanac = false; // flag indicating that all almanac have been received - flag_almanac_1 = false; // flag indicating that almanac 1/4 (word 7) have been received - flag_almanac_2 = false; // flag indicating that almanac 2/4 (word 8) have been received - flag_almanac_3 = false; // flag indicating that almanac 3/4 (word 9) have been received - flag_almanac_4 = false; // flag indicating that almanac 4/4 (word 10) have been received - - flag_TOW_5 = false; - flag_TOW_set = false; - - flag_GGTO = false; - flag_GGTO_1 = false; - flag_GGTO_2 = false; - flag_GGTO_3 = false; - flag_GGTO_4 = false; - - IOD_ephemeris = 0; - - // Word type 1: Ephemeris (1/4) - IOD_nav_1 = 0; - t0e_1 = 0; - M0_1 = 0.0; - e_1 = 0.0; - A_1 = 0.0; - - // Word type 2: Ephemeris (2/4) - IOD_nav_2 = 0; // IOD_nav page 2 - OMEGA_0_2 = 0.0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - i_0_2 = 0.0; // Inclination angle at reference time [semi-circles] - omega_2 = 0.0; // Argument of perigee [semi-circles] - iDot_2 = 0.0; // Rate of inclination angle [semi-circles/sec] - - // Word type 3: Ephemeris (3/4) and SISA - IOD_nav_3 = 0; - OMEGA_dot_3 = 0.0; // Rate of right ascension [semi-circles/sec] - delta_n_3 = 0.0; // Mean motion difference from computed value [semi-circles/sec] - C_uc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] - C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] - C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - SISA_3 = 0; // - - // Word type 4: Ephemeris (4/4) and Clock correction parameter/ - IOD_nav_4 = 0; - SV_ID_PRN_4 = 0; - C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] - - // Clock correction parameters - t0c_4 = 0; - af0_4 = 0.0; - af1_4 = 0.0; - af2_4 = 0.0; - spare_4 = 0.0; - - // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST - // Ionospheric correction - ai0_5 = 0.0; - ai1_5 = 0.0; - ai2_5 = 0.0; - - // Ionospheric disturbance flag - Region1_flag_5 = false; // Region1_flag_5; - Region2_flag_5 = false; - Region3_flag_5 = false; - Region4_flag_5 = false; - Region5_flag_5 = false; - BGD_E1E5a_5 = 0.0; - BGD_E1E5b_5 = 0.0; - E5b_HS_5 = 0; - E1B_HS_5 = 0; - E5b_DVS_5 = false; - E1B_DVS_5 = false; - - // GST - WN_5 = 0; - TOW_5 = 0; - spare_5 = 0.0; - - // Word type 6: GST-UTC conversion parameters - A0_6 = 0.0; - A1_6 = 0.0; - Delta_tLS_6 = 0; - t0t_6 = 0; - WNot_6 = 0; - WN_LSF_6 = 0; - DN_6 = 0; - Delta_tLSF_6 = 0; - TOW_6 = 0; - - // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - IOD_a_7 = 0; - WN_a_7 = 0; - t0a_7 = 0; - SVID1_7 = 0; - DELTA_A_7 = 0.0; - e_7 = 0.0; - omega_7 = 0.0; - delta_i_7 = 0.0; - Omega0_7 = 0.0; - Omega_dot_7 = 0.0; - M0_7 = 0.0; - - // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - IOD_a_8 = 0; - af0_8 = 0.0; - af1_8 = 0.0; - E5b_HS_8 = 0; - E1B_HS_8 = 0; - SVID2_8 = 0; - DELTA_A_8 = 0.0; - e_8 = 0.0; - omega_8 = 0.0; - delta_i_8 = 0.0; - Omega0_8 = 0.0; - Omega_dot_8 = 0.0; - - // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - IOD_a_9 = 0; - WN_a_9 = 0; - t0a_9 = 0; - M0_9 = 0.0; - af0_9 = 0.0; - af1_9 = 0.0; - E5b_HS_9 = 0; - E1B_HS_9 = 0; - SVID3_9 = 0; - DELTA_A_9 = 0.0; - e_9 = 0.0; - omega_9 = 0.0; - delta_i_9 = 0.0; - - // Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters - IOD_a_10 = 0; - Omega0_10 = 0.0; - Omega_dot_10 = 0.0; - M0_10 = 0.0; - af0_10 = 0.0; - af1_10 = 0.0; - E5b_HS_10 = 0; - E1B_HS_10 = 0; - - // GST-GPS - A_0G_10 = 0.0; - A_1G_10 = 0.0; - t_0G_10 = 0; - WN_0G_10 = 0; - - // Word type 0: I/NAV Spare Word - Time_0 = 0; - WN_0 = 0; - TOW_0 = 0; - - flag_TOW_6 = false; - - Galileo_satClkDrift = 0.0; - Galileo_dtr = 0.0; - - // satellite positions - galileo_satpos_X = 0.0; - galileo_satpos_Y = 0.0; - galileo_satpos_Z = 0.0; - // Satellite velocity - galileo_satvel_X = 0.0; - galileo_satvel_Y = 0.0; - galileo_satvel_Z = 0.0; -} - - -Galileo_Navigation_Message::Galileo_Navigation_Message() -{ - reset(); -} - - bool Galileo_Navigation_Message::CRC_test(std::bitset bits, uint32_t checksum) { CRC_Galileo_INAV_type CRC_Galileo; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index 1e6a36194..44665e52c 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -42,185 +42,185 @@ class Galileo_Navigation_Message { public: - Galileo_Navigation_Message(); + Galileo_Navigation_Message() = default; - int32_t Page_type_time_stamp; - std::string page_Even; - bool flag_CRC_test; - bool flag_all_ephemeris; //!< Flag indicating that all words containing ephemeris have been received - bool flag_ephemeris_1; //!< Flag indicating that ephemeris 1/4 (word 1) have been received - bool flag_ephemeris_2; //!< Flag indicating that ephemeris 2/4 (word 2) have been received - bool flag_ephemeris_3; //!< Flag indicating that ephemeris 3/4 (word 3) have been received - bool flag_ephemeris_4; //!< Flag indicating that ephemeris 4/4 (word 4) have been received + int32_t Page_type_time_stamp{}; + std::string page_Even{}; + bool flag_CRC_test{}; + bool flag_all_ephemeris{}; //!< Flag indicating that all words containing ephemeris have been received + bool flag_ephemeris_1{}; //!< Flag indicating that ephemeris 1/4 (word 1) have been received + bool flag_ephemeris_2{}; //!< Flag indicating that ephemeris 2/4 (word 2) have been received + bool flag_ephemeris_3{}; //!< Flag indicating that ephemeris 3/4 (word 3) have been received + bool flag_ephemeris_4{}; //!< Flag indicating that ephemeris 4/4 (word 4) have been received - bool flag_iono_and_GST; //!< Flag indicating that ionospheric and GST parameters (word 5) have been received - bool flag_TOW_5; - bool flag_TOW_6; - bool flag_TOW_set; //!< it is true when page 5 or page 6 arrives - bool flag_utc_model; //!< Flag indicating that utc model parameters (word 6) have been received + bool flag_iono_and_GST{}; //!< Flag indicating that ionospheric and GST parameters (word 5) have been received + bool flag_TOW_5{}; + bool flag_TOW_6{}; + bool flag_TOW_set{}; //!< it is true when page 5 or page 6 arrives + bool flag_utc_model{}; //!< Flag indicating that utc model parameters (word 6) have been received - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_1; //!< Flag indicating that almanac 1/4 (word 7) have been received - bool flag_almanac_2; //!< Flag indicating that almanac 2/4 (word 8) have been received - bool flag_almanac_3; //!< Flag indicating that almanac 3/4 (word 9) have been received - bool flag_almanac_4; //!< Flag indicating that almanac 4/4 (word 10) have been received + bool flag_all_almanac{}; //!< Flag indicating that all almanac have been received + bool flag_almanac_1{}; //!< Flag indicating that almanac 1/4 (word 7) have been received + bool flag_almanac_2{}; //!< Flag indicating that almanac 2/4 (word 8) have been received + bool flag_almanac_3{}; //!< Flag indicating that almanac 3/4 (word 9) have been received + bool flag_almanac_4{}; //!< Flag indicating that almanac 4/4 (word 10) have been received - int32_t IOD_ephemeris; + int32_t IOD_ephemeris{}; - bool flag_GGTO; - bool flag_GGTO_1; - bool flag_GGTO_2; - bool flag_GGTO_3; - bool flag_GGTO_4; + bool flag_GGTO{}; + bool flag_GGTO_1{}; + bool flag_GGTO_2{}; + bool flag_GGTO_3{}; + bool flag_GGTO_4{}; // Word type 1: Ephemeris (1/4) - int32_t IOD_nav_1; //!< IOD_nav page 1 - int32_t t0e_1; //!< Ephemeris reference time [s] - double M0_1; //!< Mean anomaly at reference time [semi-circles] - double e_1; //!< Eccentricity - double A_1; //!< Square root of the semi-major axis [meters^1/2] + int32_t IOD_nav_1{}; //!< IOD_nav page 1 + int32_t t0e_1{}; //!< Ephemeris reference time [s] + double M0_1{}; //!< Mean anomaly at reference time [semi-circles] + double e_1{}; //!< Eccentricity + double A_1{}; //!< Square root of the semi-major axis [meters^1/2] // Word type 2: Ephemeris (2/4) - int32_t IOD_nav_2; //!< IOD_nav page 2 - double OMEGA_0_2; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] - double i_0_2; //!< Inclination angle at reference time [semi-circles] - double omega_2; //!< Argument of perigee [semi-circles] - double iDot_2; //!< Rate of inclination angle [semi-circles/sec] + int32_t IOD_nav_2{}; //!< IOD_nav page 2 + double OMEGA_0_2{}; //!< Longitude of ascending node of orbital plane at weekly epoch [semi-circles] + double i_0_2{}; //!< Inclination angle at reference time [semi-circles] + double omega_2{}; //!< Argument of perigee [semi-circles] + double iDot_2{}; //!< Rate of inclination angle [semi-circles/sec] // Word type 3: Ephemeris (3/4) and SISA - int32_t IOD_nav_3; // - double OMEGA_dot_3; //!< Rate of right ascension [semi-circles/sec] - double delta_n_3; //!< Mean motion difference from computed value [semi-circles/sec] - double C_uc_3; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] - double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] - double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] - double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - int32_t SISA_3; + int32_t IOD_nav_3{}; // + double OMEGA_dot_3{}; //!< Rate of right ascension [semi-circles/sec] + double delta_n_3{}; //!< Mean motion difference from computed value [semi-circles/sec] + double C_uc_3{}; //!< Amplitude of the cosine harmonic correction term to the argument of latitude [radians] + double C_us_3{}; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] + double C_rc_3{}; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] + double C_rs_3{}; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] + int32_t SISA_3{}; // Word type 4: Ephemeris (4/4) and Clock correction parameters*/ - int32_t IOD_nav_4; // - int32_t SV_ID_PRN_4; // - double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] - double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] + int32_t IOD_nav_4{}; // + int32_t SV_ID_PRN_4{}; // + double C_ic_4{}; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] + double C_is_4{}; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] // Clock correction parameters - int32_t t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< clock drift rate correction coefficient [s/s^2] - double spare_4; + int32_t t0c_4{}; //!< Clock correction data reference Time of Week [sec] + double af0_4{}; //!< SV clock bias correction coefficient [s] + double af1_4{}; //!< SV clock drift correction coefficient [s/s] + double af2_4{}; //!< clock drift rate correction coefficient [s/s^2] + double spare_4{}; // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ // Ionospheric correction - double ai0_5; //!< Effective Ionisation Level 1st order parameter [sfu] - double ai1_5; //!< Effective Ionisation Level 2st order parameter [sfu/degree] - double ai2_5; //!< Effective Ionisation Level 3st order parameter [sfu/degree] + double ai0_5{}; //!< Effective Ionisation Level 1st order parameter [sfu] + double ai1_5{}; //!< Effective Ionisation Level 2st order parameter [sfu/degree] + double ai2_5{}; //!< Effective Ionisation Level 3st order parameter [sfu/degree] // Ionospheric disturbance flag - bool Region1_flag_5; //!< Ionospheric Disturbance Flag for region 1 - bool Region2_flag_5; //!< Ionospheric Disturbance Flag for region 2 - bool Region3_flag_5; //!< Ionospheric Disturbance Flag for region 3 - bool Region4_flag_5; //!< Ionospheric Disturbance Flag for region 4 - bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 - double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] - double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] + bool Region1_flag_5{}; //!< Ionospheric Disturbance Flag for region 1 + bool Region2_flag_5{}; //!< Ionospheric Disturbance Flag for region 2 + bool Region3_flag_5{}; //!< Ionospheric Disturbance Flag for region 3 + bool Region4_flag_5{}; //!< Ionospheric Disturbance Flag for region 4 + bool Region5_flag_5{}; //!< Ionospheric Disturbance Flag for region 5 + double BGD_E1E5a_5{}; //!< E1-E5a Broadcast Group Delay [s] + double BGD_E1E5b_5{}; //!< E1-E5b Broadcast Group Delay [s] - int32_t E5b_HS_5; //!< E5b Signal Health Status - int32_t E1B_HS_5; //!< E1B Signal Health Status - bool E5b_DVS_5; //!< E5b Data Validity Status - bool E1B_DVS_5; //!< E1B Data Validity Status + int32_t E5b_HS_5{}; //!< E5b Signal Health Status + int32_t E1B_HS_5{}; //!< E1B Signal Health Status + bool E5b_DVS_5{}; //!< E5b Data Validity Status + bool E1B_DVS_5{}; //!< E1B Data Validity Status // GST - int32_t WN_5; - int32_t TOW_5; - double spare_5; + int32_t WN_5{}; + int32_t TOW_5{}; + double spare_5{}; // Word type 6: GST-UTC conversion parameters - double A0_6; - double A1_6; - int32_t Delta_tLS_6; - int32_t t0t_6; - int32_t WNot_6; - int32_t WN_LSF_6; - int32_t DN_6; - int32_t Delta_tLSF_6; - int32_t TOW_6; + double A0_6{}; + double A1_6{}; + int32_t Delta_tLS_6{}; + int32_t t0t_6{}; + int32_t WNot_6{}; + int32_t WN_LSF_6{}; + int32_t DN_6{}; + int32_t Delta_tLSF_6{}; + int32_t TOW_6{}; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - int32_t IOD_a_7; - int32_t WN_a_7; - int32_t t0a_7; - int32_t SVID1_7; - double DELTA_A_7; - double e_7; - double omega_7; - double delta_i_7; - double Omega0_7; - double Omega_dot_7; - double M0_7; + int32_t IOD_a_7{}; + int32_t WN_a_7{}; + int32_t t0a_7{}; + int32_t SVID1_7{}; + double DELTA_A_7{}; + double e_7{}; + double omega_7{}; + double delta_i_7{}; + double Omega0_7{}; + double Omega_dot_7{}; + double M0_7{}; // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2) - int32_t IOD_a_8; - double af0_8; - double af1_8; - int32_t E5b_HS_8; - int32_t E1B_HS_8; - int32_t SVID2_8; - double DELTA_A_8; - double e_8; - double omega_8; - double delta_i_8; - double Omega0_8; - double Omega_dot_8; + int32_t IOD_a_8{}; + double af0_8{}; + double af1_8{}; + int32_t E5b_HS_8{}; + int32_t E1B_HS_8{}; + int32_t SVID2_8{}; + double DELTA_A_8{}; + double e_8{}; + double omega_8{}; + double delta_i_8{}; + double Omega0_8{}; + double Omega_dot_8{}; // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - int32_t IOD_a_9; - int32_t WN_a_9; - int32_t t0a_9; - double M0_9; - double af0_9; - double af1_9; - int32_t E5b_HS_9; - int32_t E1B_HS_9; - int32_t SVID3_9; - double DELTA_A_9; - double e_9; - double omega_9; - double delta_i_9; + int32_t IOD_a_9{}; + int32_t WN_a_9{}; + int32_t t0a_9{}; + double M0_9{}; + double af0_9{}; + double af1_9{}; + int32_t E5b_HS_9{}; + int32_t E1B_HS_9{}; + int32_t SVID3_9{}; + double DELTA_A_9{}; + double e_9{}; + double omega_9{}; + double delta_i_9{}; // Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters - int32_t IOD_a_10; - double Omega0_10; - double Omega_dot_10; - double M0_10; - double af0_10; - double af1_10; - int32_t E5b_HS_10; - int32_t E1B_HS_10; + int32_t IOD_a_10{}; + double Omega0_10{}; + double Omega_dot_10{}; + double M0_10{}; + double af0_10{}; + double af1_10{}; + int32_t E5b_HS_10{}; + int32_t E1B_HS_10{}; // GST-GPS conversion - double A_0G_10; //!< Constant term of the offset Delta t systems - double A_1G_10; //!< Rate of change of the offset Delta t systems - int32_t t_0G_10; //!< Reference time for Galileo/GPS Time Offset (GGTO) data - int32_t WN_0G_10; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference + double A_0G_10{}; //!< Constant term of the offset Delta t systems + double A_1G_10{}; //!< Rate of change of the offset Delta t systems + int32_t t_0G_10{}; //!< Reference time for Galileo/GPS Time Offset (GGTO) data + int32_t WN_0G_10{}; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference // Word type 0: I/NAV Spare Word - int32_t Time_0; - int32_t WN_0; - int32_t TOW_0; + int32_t Time_0{}; + int32_t WN_0{}; + int32_t TOW_0{}; - double Galileo_satClkDrift; - double Galileo_dtr; //!< Relativistic clock correction term + double Galileo_satClkDrift{}; + double Galileo_dtr{}; //!< Relativistic clock correction term // satellite positions - double galileo_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double galileo_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double galileo_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double galileo_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double galileo_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double galileo_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double galileo_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double galileo_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double galileo_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double galileo_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double galileo_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double galileo_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] /* * \brief Takes in input a page (Odd or Even) of 120 bit, split it according ICD 4.3.2.3 and join Data_k with Data_j @@ -234,8 +234,6 @@ public: */ int32_t page_jk_decoder(const char* data_jk); - void reset(); - /* * \brief Returns true if new Ephemeris has arrived. The flag is set to false when the function is executed */ diff --git a/src/core/system_parameters/galileo_utc_model.cc b/src/core/system_parameters/galileo_utc_model.cc index 54f22d851..f0d40b7dc 100644 --- a/src/core/system_parameters/galileo_utc_model.cc +++ b/src/core/system_parameters/galileo_utc_model.cc @@ -20,25 +20,6 @@ #include "galileo_utc_model.h" #include -Galileo_Utc_Model::Galileo_Utc_Model() -{ - // Word type 6: GST-UTC conversion parameters - A0_6 = 0.0; - A1_6 = 0.0; - Delta_tLS_6 = 0; - t0t_6 = 0; - WNot_6 = 0; - WN_LSF_6 = 0; - DN_6 = 0; - Delta_tLSF_6 = 0; - flag_utc_model = false; - // GPS to Galileo GST conversion parameters - A_0G_10 = 0.0; - A_1G_10 = 0.0; - t_0G_10 = 0; - WN_0G_10 = 0; -} - double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) { diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index 96971d74a..b4d6946ca 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -33,30 +33,30 @@ class Galileo_Utc_Model { public: - // Word type 6: GST-UTC conversion parameters - double A0_6; - double A1_6; - int32_t Delta_tLS_6; - int32_t t0t_6; //!< UTC data reference Time of Week [s] - int32_t WNot_6; //!< UTC data reference Week number [week] - int32_t WN_LSF_6; - int32_t DN_6; - int32_t Delta_tLSF_6; - bool flag_utc_model; - - // GPS to Galileo GST conversion parameters - double A_0G_10; - double A_1G_10; - int32_t t_0G_10; - int32_t WN_0G_10; - - // double TOW_6; - double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters - /*! * Default constructor */ - Galileo_Utc_Model(); + Galileo_Utc_Model() = default; + + // Word type 6: GST-UTC conversion parameters + double A0_6{}; + double A1_6{}; + int32_t Delta_tLS_6{}; + int32_t t0t_6{}; //!< UTC data reference Time of Week [s] + int32_t WNot_6{}; //!< UTC data reference Week number [week] + int32_t WN_LSF_6{}; + int32_t DN_6{}; + int32_t Delta_tLSF_6{}; + bool flag_utc_model{}; + + // GPS to Galileo GST conversion parameters + double A_0G_10{}; + double A_1G_10{}; + int32_t t_0G_10{}; + int32_t WN_0G_10{}; + + // double TOW_6; + double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters template diff --git a/src/core/system_parameters/glonass_gnav_almanac.cc b/src/core/system_parameters/glonass_gnav_almanac.cc deleted file mode 100644 index 47ffe0784..000000000 --- a/src/core/system_parameters/glonass_gnav_almanac.cc +++ /dev/null @@ -1,44 +0,0 @@ -/*! - * \file glonass_gnav_almanac.cc - * \brief Interface of a GLONASS GNAV ALMANAC storage as described in GLONASS ICD (Edition 5.1) - * \note Code added as part of GSoC 2017 program - * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com - * \see GLONASS ICD - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "glonass_gnav_almanac.h" - -Glonass_Gnav_Almanac::Glonass_Gnav_Almanac() -{ - i_satellite_freq_channel = 0; - i_satellite_PRN = 0U; - i_satellite_slot_number = 0U; - - d_n_A = 0.0; - d_H_n_A = 0.0; - d_lambda_n_A = 0.0; - d_t_lambda_n_A = 0.0; - d_Delta_i_n_A = 0.0; - d_Delta_T_n_A = 0.0; - d_Delta_T_n_A_dot = 0.0; - d_epsilon_n_A = 0.0; - d_omega_n_A = 0.0; - d_M_n_A = 0.0; - d_KP = 0.0; - d_tau_n_A = 0.0; - d_C_n = false; - d_l_n = false; -} diff --git a/src/core/system_parameters/glonass_gnav_almanac.h b/src/core/system_parameters/glonass_gnav_almanac.h index 1a3c769ca..9fc4557da 100644 --- a/src/core/system_parameters/glonass_gnav_almanac.h +++ b/src/core/system_parameters/glonass_gnav_almanac.h @@ -34,25 +34,30 @@ class Glonass_Gnav_Almanac { public: - double d_n_A; //!< Conventional number of satellite within GLONASS space segment [dimensionless] - double d_H_n_A; //!< Carrier frequency number of navigation RF signal transmitted by d_nA satellite as table 4.10 (0-31) [dimensionless] - double d_lambda_n_A; //!< Longitude of the first (within the d_NA day) ascending node of d_nA [radians] - double d_t_lambda_n_A; //!< Time of first ascending node passage [s] - double d_Delta_i_n_A; //!< Correction of the mean value of inclination of d_n_A satellite at instant t_lambda_n_A [radians] - double d_Delta_T_n_A; //!< Correction to the mean value of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period] - double d_Delta_T_n_A_dot; //!< Rate of change of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period^2] - double d_epsilon_n_A; //!< Eccentricity of d_n_A satellite at instant t_lambda_n_A [dimensionless] - double d_omega_n_A; //!< Argument of perigee of d_n_A satellite at instant t_lambdan_A [radians] - double d_M_n_A; //!< Type of satellite n_A [dimensionless] - double d_KP; //!< Notification on forthcoming leap second correction of UTC [dimensionless] - double d_tau_n_A; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s] - bool d_C_n; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless] - bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + /*! + * Default constructor + */ + Glonass_Gnav_Almanac() = default; + + double d_n_A{}; //!< Conventional number of satellite within GLONASS space segment [dimensionless] + double d_H_n_A{}; //!< Carrier frequency number of navigation RF signal transmitted by d_nA satellite as table 4.10 (0-31) [dimensionless] + double d_lambda_n_A{}; //!< Longitude of the first (within the d_NA day) ascending node of d_nA [radians] + double d_t_lambda_n_A{}; //!< Time of first ascending node passage [s] + double d_Delta_i_n_A{}; //!< Correction of the mean value of inclination of d_n_A satellite at instant t_lambda_n_A [radians] + double d_Delta_T_n_A{}; //!< Correction to the mean value of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period] + double d_Delta_T_n_A_dot{}; //!< Rate of change of Draconian period of d_n_A satellite at instant t_lambda_n_A [s / orbital period^2] + double d_epsilon_n_A{}; //!< Eccentricity of d_n_A satellite at instant t_lambda_n_A [dimensionless] + double d_omega_n_A{}; //!< Argument of perigee of d_n_A satellite at instant t_lambdan_A [radians] + double d_M_n_A{}; //!< Type of satellite n_A [dimensionless] + double d_KP{}; //!< Notification on forthcoming leap second correction of UTC [dimensionless] + double d_tau_n_A{}; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s] + bool d_C_n{}; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless] + bool d_l_n{}; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Satellite Identification Information - int32_t i_satellite_freq_channel; //!< SV Frequency Channel Number - uint32_t i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - uint32_t i_satellite_slot_number; //!< SV Slot Number + int32_t i_satellite_freq_channel{}; //!< SV Frequency Channel Number + uint32_t i_satellite_PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS + uint32_t i_satellite_slot_number{}; //!< SV Slot Number template /*! @@ -83,11 +88,6 @@ public: archive& make_nvp("d_C_n", d_C_n); archive& make_nvp("d_l_n", d_l_n); } - - /*! - * Default constructor - */ - Glonass_Gnav_Almanac(); }; #endif diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index 11cfe6a33..d69601f39 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -27,52 +27,6 @@ #include -Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris() -{ - d_m = 0.0; //!< String number within frame [dimensionless] - d_t_k = 0.0; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] - d_t_b = 0.0; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] - d_M = 0.0; //!< Type of satellite transmitting navigation signal [dimensionless] - d_gamma_n = 0.0; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - d_tau_n = 0.0; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), - d_Xn = 0.0; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - d_Yn = 0.0; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - d_Zn = 0.0; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - d_VXn = 0.0; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - d_VYn = 0.0; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - d_VZn = 0.0; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - d_AXn = 0.0; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - d_AYn = 0.0; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - d_AZn = 0.0; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - d_B_n = 0.0; //!< Health flag [dimensionless] - d_P = 0.0; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - d_N_T = 0.0; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - d_F_T = 0.0; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - d_n = 0.0; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - d_Delta_tau_n = 0.0; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - d_E_n = 0.0; //!< Characterises "age" of a current information [days] - d_P_1 = 0.0; //!< Flag of the immediate data updating [minutes] - d_P_2 = false; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - d_P_3 = false; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - d_P_4 = false; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - d_l3rd_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - d_l5th_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - - // Satellite Identification Information - i_satellite_freq_channel = 0; //!< SV Frequency Channel Number - i_satellite_PRN = 0U; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - i_satellite_slot_number = 0U; //!< SV Slot Number - d_yr = 1972; //!< Current year, defaults to 1972 (UTC Epoch with leap seconds) - d_satClkDrift = 0.0; //!< GLONASS clock error - d_dtr = 0.0; //!< relativistic clock correction term - d_iode = 0.0; //!< Issue of data, ephemeris (Bit 0-6 of tb) - d_tau_c = 0.0; - d_TOW = 0.0; // tow of the start of frame - d_WN = 0.0; // week number of the start of frame - d_tod = 0.0; -} - - boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const double offset_time) const { boost::posix_time::time_duration t(0, 0, offset_time + d_tau_c + d_tau_n); diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index b0a474509..ebb03022a 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -39,50 +39,50 @@ public: /*! * Default constructor */ - Glonass_Gnav_Ephemeris(); + Glonass_Gnav_Ephemeris() = default; - double d_m; //!< String number within frame [dimensionless] - double d_t_k; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] - double d_t_b; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] - double d_M; //!< Type of satellite transmitting navigation signal [dimensionless] - double d_gamma_n; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] - double d_tau_n; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), - double d_Xn; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. - double d_Yn; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] - double d_Zn; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] - double d_VXn; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] - double d_VYn; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] - double d_VZn; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] - double d_AXn; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_AYn; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_AZn; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] - double d_B_n; //!< Health flag [dimensionless] - double d_P; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] - double d_N_T; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] - double d_F_T; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] - double d_n; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation - double d_Delta_tau_n; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] - double d_E_n; //!< Characterises "age" of a current information [days] - double d_P_1; //!< Flag of the immediate data updating [minutes] - bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] - bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] - bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] - bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] - bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + double d_m{}; //!< String number within frame [dimensionless] + double d_t_k{}; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s] + double d_t_b{}; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s] + double d_M{}; //!< Type of satellite transmitting navigation signal [dimensionless] + double d_gamma_n{}; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless] + double d_tau_n{}; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te), + double d_Xn{}; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km]. + double d_Yn{}; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km] + double d_Zn{}; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km] + double d_VXn{}; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s] + double d_VYn{}; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s] + double d_VZn{}; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s] + double d_AXn{}; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_AYn{}; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_AZn{}; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2] + double d_B_n{}; //!< Health flag [dimensionless] + double d_P{}; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless] + double d_N_T{}; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days] + double d_F_T{}; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless] + double d_n{}; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation + double d_Delta_tau_n{}; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless] + double d_E_n{}; //!< Characterises "age" of a current information [days] + double d_P_1{}; //!< Flag of the immediate data updating [minutes] + bool d_P_2{}; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless] + bool d_P_3{}; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless] + bool d_P_4{}; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless] + bool d_l3rd_n{}; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] + bool d_l5th_n{}; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless] // Immediate deliverables of ephemeris information // Satellite Identification Information - int32_t i_satellite_freq_channel; //!< SV Frequency Channel Number - uint32_t i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS - uint32_t i_satellite_slot_number; //!< SV Slot Number - double d_yr; //!< Current year - double d_satClkDrift; //!< GLONASS clock error - double d_dtr; //!< relativistic clock correction term - double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb) - double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated - double d_TOW; //!< GLONASST IN GPST seconds of week - double d_WN; //!< GLONASST IN GPST week number of the start of frame - double d_tod; //!< Time of Day since ephemeris where decoded + int32_t i_satellite_freq_channel{}; //!< SV Frequency Channel Number + uint32_t i_satellite_PRN{}; //!< SV PRN Number, equivalent to slot number for compatibility with GPS + uint32_t i_satellite_slot_number{}; //!< SV Slot Number + double d_yr = 1972.0; //!< Current year + double d_satClkDrift{}; //!< GLONASS clock error + double d_dtr{}; //!< relativistic clock correction term + double d_iode{}; //!< Issue of data, ephemeris (Bit 0-6 of tb) + double d_tau_c{}; //!< GLONASST 2 UTC correction (todo) may be eliminated + double d_TOW{}; //!< GLONASST IN GPST seconds of week + double d_WN{}; //!< GLONASST IN GPST week number of the start of frame + double d_tod{}; //!< Time of Day since ephemeris where decoded /*! * \brief Sets (\a d_satClkDrift)and returns the clock drift in seconds according to the User Algorithm for SV Clock Correction diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index 91209110c..0a9fa075e 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -28,61 +28,8 @@ #include // for operator<< -void Glonass_Gnav_Navigation_Message::reset() +Glonass_Gnav_Navigation_Message::Glonass_Gnav_Navigation_Message() { - // Satellite Identification - i_satellite_PRN = 0U; - i_alm_satellite_slot_number = 0; // SV Orbit Slot Number - flag_update_slot_number = false; - - // Ephmeris Flags - flag_all_ephemeris = false; - flag_ephemeris_str_1 = false; - flag_ephemeris_str_2 = false; - flag_ephemeris_str_3 = false; - flag_ephemeris_str_4 = false; - - // Almanac Flags - flag_all_almanac = false; - flag_almanac_str_6 = false; - flag_almanac_str_7 = false; - flag_almanac_str_8 = false; - flag_almanac_str_9 = false; - flag_almanac_str_10 = false; - flag_almanac_str_11 = false; - flag_almanac_str_12 = false; - flag_almanac_str_13 = false; - flag_almanac_str_14 = false; - flag_almanac_str_15 = false; - - // UTC and System Clocks Flags - flag_utc_model_valid = false; // If set, it indicates that the UTC model parameters are filled - flag_utc_model_str_5 = false; // Clock info send in string 5 of navigation data - flag_utc_model_str_15 = false; // Clock info send in string 15 of frame 5 of navigation data - - // broadcast orbit 1 - flag_TOW_set = false; - flag_TOW_new = false; - - flag_CRC_test = false; - d_frame_ID = 0U; - d_string_ID = 0U; - i_channel_ID = 0; - - // Clock terms - d_satClkCorr = 0.0; - d_dtr = 0.0; - d_satClkDrift = 0.0; - - // Data update information - d_previous_tb = 0.0; - for (double& i : d_previous_Na) - { - i = 0.0; - } - - std::map satelliteBlock; // Map that stores to which block the PRN belongs - auto gnss_sat = Gnss_Satellite(); std::string _system("GLONASS"); // TODO SHould number of channels be hardcoded? @@ -93,12 +40,6 @@ void Glonass_Gnav_Navigation_Message::reset() } -Glonass_Gnav_Navigation_Message::Glonass_Gnav_Navigation_Message() -{ - reset(); -} - - bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset bits) { uint32_t sum_bits = 0; diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.h b/src/core/system_parameters/glonass_gnav_navigation_message.h index 510bddf62..f8cab5685 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.h +++ b/src/core/system_parameters/glonass_gnav_navigation_message.h @@ -48,53 +48,55 @@ public: */ Glonass_Gnav_Navigation_Message(); - bool flag_CRC_test; - uint32_t d_frame_ID; - uint32_t d_string_ID; - bool flag_update_slot_number; + bool flag_CRC_test{}; + uint32_t d_frame_ID{}; + uint32_t d_string_ID{}; + bool flag_update_slot_number{}; - int32_t i_channel_ID; - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + uint32_t i_satellite_PRN{}; - Glonass_Gnav_Ephemeris gnav_ephemeris; //!< Ephemeris information decoded - Glonass_Gnav_Utc_Model gnav_utc_model; //!< UTC model information - Glonass_Gnav_Almanac gnav_almanac[GLONASS_CA_NBR_SATS]; //!< Almanac information for all 24 satellites + Glonass_Gnav_Ephemeris gnav_ephemeris{}; //!< Ephemeris information decoded + Glonass_Gnav_Utc_Model gnav_utc_model{}; //!< UTC model information + Glonass_Gnav_Almanac gnav_almanac[GLONASS_CA_NBR_SATS]{}; //!< Almanac information for all 24 satellites // Ephemeris Flags and control variables - bool flag_all_ephemeris; //!< Flag indicating that all strings containing ephemeris have been received - bool flag_ephemeris_str_1; //!< Flag indicating that ephemeris 1/4 (string 1) have been received - bool flag_ephemeris_str_2; //!< Flag indicating that ephemeris 2/4 (string 2) have been received - bool flag_ephemeris_str_3; //!< Flag indicating that ephemeris 3/4 (string 3) have been received - bool flag_ephemeris_str_4; //!< Flag indicating that ephemeris 4/4 (string 4) have been received + bool flag_all_ephemeris{}; //!< Flag indicating that all strings containing ephemeris have been received + bool flag_ephemeris_str_1{}; //!< Flag indicating that ephemeris 1/4 (string 1) have been received + bool flag_ephemeris_str_2{}; //!< Flag indicating that ephemeris 2/4 (string 2) have been received + bool flag_ephemeris_str_3{}; //!< Flag indicating that ephemeris 3/4 (string 3) have been received + bool flag_ephemeris_str_4{}; //!< Flag indicating that ephemeris 4/4 (string 4) have been received // Almanac Flags - bool flag_all_almanac; //!< Flag indicating that all almanac have been received - bool flag_almanac_str_6; //!< Flag indicating that almanac of string 6 have been received - bool flag_almanac_str_7; //!< Flag indicating that almanac of string 7 have been received - bool flag_almanac_str_8; //!< Flag indicating that almanac of string 8 have been received - bool flag_almanac_str_9; //!< Flag indicating that almanac of string 9 have been received - bool flag_almanac_str_10; //!< Flag indicating that almanac of string 10 have been received - bool flag_almanac_str_11; //!< Flag indicating that almanac of string 11 have been received - bool flag_almanac_str_12; //!< Flag indicating that almanac of string 12 have been received - bool flag_almanac_str_13; //!< Flag indicating that almanac of string 13 have been received - bool flag_almanac_str_14; //!< Flag indicating that almanac of string 14 have been received - bool flag_almanac_str_15; //!< Flag indicating that almanac of string 15 have been received - uint32_t i_alm_satellite_slot_number; //!< SV Orbit Slot Number + bool flag_all_almanac{}; //!< Flag indicating that all almanac have been received + bool flag_almanac_str_6{}; //!< Flag indicating that almanac of string 6 have been received + bool flag_almanac_str_7{}; //!< Flag indicating that almanac of string 7 have been received + bool flag_almanac_str_8{}; //!< Flag indicating that almanac of string 8 have been received + bool flag_almanac_str_9{}; //!< Flag indicating that almanac of string 9 have been received + bool flag_almanac_str_10{}; //!< Flag indicating that almanac of string 10 have been received + bool flag_almanac_str_11{}; //!< Flag indicating that almanac of string 11 have been received + bool flag_almanac_str_12{}; //!< Flag indicating that almanac of string 12 have been received + bool flag_almanac_str_13{}; //!< Flag indicating that almanac of string 13 have been received + bool flag_almanac_str_14{}; //!< Flag indicating that almanac of string 14 have been received + bool flag_almanac_str_15{}; //!< Flag indicating that almanac of string 15 have been received + uint32_t i_alm_satellite_slot_number{}; //!< SV Orbit Slot Number // UTC and System Clocks Flags - bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled - bool flag_utc_model_str_5; //!< Clock info send in string 5 of navigation data - bool flag_utc_model_str_15; //!< Clock info send in string 15 of frame 5 of navigation data + bool flag_utc_model_valid{}; //!< If set, it indicates that the UTC model parameters are filled + bool flag_utc_model_str_5{}; //!< Clock info send in string 5 of navigation data + bool flag_utc_model_str_15{}; //!< Clock info send in string 15 of frame 5 of navigation data - bool flag_TOW_set; //!< Flag indicating when the TOW has been set - bool flag_TOW_new; //!< Flag indicating when a new TOW has been computed + bool flag_TOW_set{}; //!< Flag indicating when the TOW has been set + bool flag_TOW_new{}; //!< Flag indicating when a new TOW has been computed - double d_satClkCorr; //!< Satellite clock error - double d_dtr; //!< Relativistic clock correction term - double d_satClkDrift; //!< Satellite clock drift + double d_satClkCorr{}; //!< Satellite clock error + double d_dtr{}; //!< Relativistic clock correction term + double d_satClkDrift{}; //!< Satellite clock drift - double d_previous_tb; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives - double d_previous_Na[GLONASS_CA_NBR_SATS]; //!< Previous time for almanac of the Glonass_Gnav_Almanac object + double d_previous_tb{}; //!< Previous iode for the Glonass_Gnav_Ephemeris object. Used to determine when new data arrives + double d_previous_Na[GLONASS_CA_NBR_SATS]{}; //!< Previous time for almanac of the Glonass_Gnav_Almanac object + + std::map satelliteBlock; // Map that stores to which block the PRN belongs /*! * \brief Compute CRC for GLONASS GNAV strings @@ -109,11 +111,6 @@ public: */ uint32_t get_frame_number(uint32_t satellite_slot_number); - /*! - * \brief Reset GLONASS GNAV Navigation Information - */ - void reset(); - /*! * \brief Obtain a GLONASS GNAV SV Ephemeris class filled with current SV data */ diff --git a/src/core/system_parameters/glonass_gnav_utc_model.cc b/src/core/system_parameters/glonass_gnav_utc_model.cc index 352d20671..3d2b3eddb 100644 --- a/src/core/system_parameters/glonass_gnav_utc_model.cc +++ b/src/core/system_parameters/glonass_gnav_utc_model.cc @@ -21,18 +21,6 @@ #include "glonass_gnav_utc_model.h" -Glonass_Gnav_Utc_Model::Glonass_Gnav_Utc_Model() -{ - valid = false; - d_tau_c = 0.0; - d_tau_gps = 0.0; - d_N_4 = 0.0; - d_N_A = 0.0; - d_B1 = 0.0; - d_B2 = 0.0; -} - - double Glonass_Gnav_Utc_Model::utc_time(double glonass_time_corrected) { double t_utc; diff --git a/src/core/system_parameters/glonass_gnav_utc_model.h b/src/core/system_parameters/glonass_gnav_utc_model.h index 26e82bae8..1bec0ce65 100644 --- a/src/core/system_parameters/glonass_gnav_utc_model.h +++ b/src/core/system_parameters/glonass_gnav_utc_model.h @@ -37,16 +37,16 @@ public: /*! * Default constructor */ - Glonass_Gnav_Utc_Model(); + Glonass_Gnav_Utc_Model() = default; - bool valid; + bool valid{}; // Clock Parameters - double d_tau_c; //!< GLONASS time scale correction to UTC(SU) time. [s] - double d_tau_gps; //!< Correction to GPS time to GLONASS time [day] - double d_N_4; //!< Four year interval number starting from 1996 [4 year interval] - double d_N_A; //!< Calendar day number within the four-year period beginning since the leap year for Almanac data [days] - double d_B1; //!< Coefficient to determine DeltaUT1 [s] - double d_B2; //!< Coefficient to determine DeltaUT1 [s/msd] + double d_tau_c{}; //!< GLONASS time scale correction to UTC(SU) time. [s] + double d_tau_gps{}; //!< Correction to GPS time to GLONASS time [day] + double d_N_4{}; //!< Four year interval number starting from 1996 [4 year interval] + double d_N_A{}; //!< Calendar day number within the four-year period beginning since the leap year for Almanac data [days] + double d_B1{}; //!< Coefficient to determine DeltaUT1 [s] + double d_B2{}; //!< Coefficient to determine DeltaUT1 [s/msd] /*! * \brief Computes the Coordinated Universal Time (UTC) and diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index b7f455368..074e422a5 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -22,12 +22,6 @@ #include -Gnss_Satellite::Gnss_Satellite() -{ - Gnss_Satellite::reset(); -} - - Gnss_Satellite::Gnss_Satellite(const std::string& system_, uint32_t PRN_) { Gnss_Satellite::reset(); diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index fd57eb146..ee59ec49a 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -37,7 +37,7 @@ class Gnss_Satellite { public: - Gnss_Satellite(); //!< Default Constructor. + Gnss_Satellite() = default; //!< Default Constructor. Gnss_Satellite(const std::string& system_, uint32_t PRN_); //!< Concrete GNSS satellite Constructor. ~Gnss_Satellite() = default; //!< Default Destructor. void update_PRN(uint32_t PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages diff --git a/src/core/system_parameters/gnss_signal.cc b/src/core/system_parameters/gnss_signal.cc index 5e1f1ee6a..c44cb7ae3 100644 --- a/src/core/system_parameters/gnss_signal.cc +++ b/src/core/system_parameters/gnss_signal.cc @@ -20,11 +20,6 @@ #include "gnss_signal.h" -Gnss_Signal::Gnss_Signal() -{ - this->signal = ""; -} - Gnss_Signal::Gnss_Signal(const std::string& signal_) { diff --git a/src/core/system_parameters/gnss_signal.h b/src/core/system_parameters/gnss_signal.h index 575e40cf0..03d3e3779 100644 --- a/src/core/system_parameters/gnss_signal.h +++ b/src/core/system_parameters/gnss_signal.h @@ -33,7 +33,7 @@ class Gnss_Signal { public: - Gnss_Signal(); + Gnss_Signal() = default; explicit Gnss_Signal(const std::string& signal_); Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_); ~Gnss_Signal() = default; diff --git a/src/core/system_parameters/gps_acq_assist.cc b/src/core/system_parameters/gps_acq_assist.cc deleted file mode 100644 index da4e0df1b..000000000 --- a/src/core/system_parameters/gps_acq_assist.cc +++ /dev/null @@ -1,37 +0,0 @@ -/*! - * \file gps_acq_assist.cc - * \brief Interface of a GPS RRLL ACQUISITION ASSISTACE storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_acq_assist.h" - -Gps_Acq_Assist::Gps_Acq_Assist() -{ - i_satellite_PRN = 0U; - d_TOW = 0.0; - d_Doppler0 = 0.0; - d_Doppler1 = 0.0; - dopplerUncertainty = 0.0; - Code_Phase = 0.0; - Code_Phase_int = 0.0; - GPS_Bit_Number = 0.0; - Code_Phase_window = 0.0; - Azimuth = 0.0; - Elevation = 0.0; -} diff --git a/src/core/system_parameters/gps_acq_assist.h b/src/core/system_parameters/gps_acq_assist.h index 8b8d714a7..a851b2d52 100644 --- a/src/core/system_parameters/gps_acq_assist.h +++ b/src/core/system_parameters/gps_acq_assist.h @@ -34,22 +34,22 @@ class Gps_Acq_Assist { public: - uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_TOW; //!< Time Of Week assigned to the acquisition data - double d_Doppler0; //!< Doppler (0 order term) [Hz] - double d_Doppler1; //!< Doppler (1 order term) [Hz] - double dopplerUncertainty; //!< Doppler Uncertainty [Hz] - double Code_Phase; //!< Code phase [chips] - double Code_Phase_int; //!< Integer Code Phase [1 C/A code period] - double GPS_Bit_Number; //!< GPS Bit Number - double Code_Phase_window; //!< Code Phase search window [chips] - double Azimuth; //!< Satellite Azimuth [deg] - double Elevation; //!< Satellite Elevation [deg] - /*! * Default constructor */ - Gps_Acq_Assist(); + Gps_Acq_Assist() = default; + + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER + double d_TOW{}; //!< Time Of Week assigned to the acquisition data + double d_Doppler0{}; //!< Doppler (0 order term) [Hz] + double d_Doppler1{}; //!< Doppler (1 order term) [Hz] + double dopplerUncertainty{}; //!< Doppler Uncertainty [Hz] + double Code_Phase{}; //!< Code phase [chips] + double Code_Phase_int{}; //!< Integer Code Phase [1 C/A code period] + double GPS_Bit_Number{}; //!< GPS Bit Number + double Code_Phase_window{}; //!< Code Phase search window [chips] + double Azimuth{}; //!< Satellite Azimuth [deg] + double Elevation{}; //!< Satellite Elevation [deg] }; #endif diff --git a/src/core/system_parameters/gps_almanac.cc b/src/core/system_parameters/gps_almanac.cc deleted file mode 100644 index 77f68eb83..000000000 --- a/src/core/system_parameters/gps_almanac.cc +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * \file gps_almanac.cc - * \brief Interface of a GPS ALMANAC storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_almanac.h" - -Gps_Almanac::Gps_Almanac() -{ - i_satellite_PRN = 0U; - d_Delta_i = 0.0; - i_Toa = 0; - i_WNa = 0; - d_M_0 = 0.0; - d_e_eccentricity = 0.0; - d_sqrt_A = 0.0; - d_OMEGA0 = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - i_SV_health = 0; - i_AS_status = 0; - d_A_f0 = 0.0; - d_A_f1 = 0.0; -} diff --git a/src/core/system_parameters/gps_almanac.h b/src/core/system_parameters/gps_almanac.h index c06af1465..bdc38a375 100644 --- a/src/core/system_parameters/gps_almanac.h +++ b/src/core/system_parameters/gps_almanac.h @@ -32,25 +32,25 @@ class Gps_Almanac { public: - uint32_t i_satellite_PRN; //!< SV PRN NUMBER - double d_Delta_i; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) - int32_t i_Toa; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t i_WNa; //!< Almanac week number - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - int32_t i_SV_health; //!< SV Health - int32_t i_AS_status; //!< Anti-Spoofing Flags and SV Configuration - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - /*! * Default constructor */ - Gps_Almanac(); + Gps_Almanac() = default; + + uint32_t i_satellite_PRN{}; //!< SV PRN NUMBER + double d_Delta_i{}; //!< Inclination Angle at Reference Time (relative to i_0 = 0.30 semi-circles) + int32_t i_Toa{}; //!< Almanac data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t i_WNa{}; //!< Almanac week number + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + int32_t i_SV_health{}; //!< SV Health + int32_t i_AS_status{}; //!< Anti-Spoofing Flags and SV Configuration + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] template diff --git a/src/core/system_parameters/gps_cnav_ephemeris.cc b/src/core/system_parameters/gps_cnav_ephemeris.cc index 7faacd23d..7886db9be 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.cc +++ b/src/core/system_parameters/gps_cnav_ephemeris.cc @@ -24,69 +24,6 @@ #include -Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() -{ - i_satellite_PRN = 0U; - - d_Toe1 = -1; - d_Toe2 = -1; - - d_TOW = 0; - d_Crs = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_e_eccentricity = 0.0; - d_Cus = 0.0; - - d_Toc = 0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_IDOT = 0.0; - - i_GPS_week = 0; - - d_TGD = 0.0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - - d_A_f0 = 0.0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0.0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0.0; // Coefficient 2 of code phase offset model [s/s^2] - - b_integrity_status_flag = false; - b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV - - d_satClkDrift = 0.0; - d_dtr = 0.0; - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - - i_URA = 0; - i_signal_health = 0; - d_Top = 0; - d_DELTA_A = 0.0; - d_A_DOT = 0.0; - d_Delta_n = 0.0; - d_DELTA_DOT_N = 0.0; - d_DELTA_OMEGA_DOT = 0.0; - d_URA0 = 0.0; - d_URA1 = 0.0; - d_URA2 = 0.0; - d_ISCL1 = 0.0; - d_ISCL2 = 0.0; - d_ISCL5I = 0.0; - d_ISCL5Q = 0.0; - b_l2c_phasing_flag = false; -} - - double Gps_CNAV_Ephemeris::check_t(double time) { double corrTime; diff --git a/src/core/system_parameters/gps_cnav_ephemeris.h b/src/core/system_parameters/gps_cnav_ephemeris.h index d36be3ae7..a68968175 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.h +++ b/src/core/system_parameters/gps_cnav_ephemeris.h @@ -36,53 +36,53 @@ public: /*! * Default constructor */ - Gps_CNAV_Ephemeris(); + Gps_CNAV_Ephemeris() = default; - uint32_t i_satellite_PRN; // SV PRN NUMBER + uint32_t i_satellite_PRN{}; // SV PRN NUMBER // Message Types 10 and 11 Parameters (1 of 2) - int32_t i_GPS_week; //!< GPS week number, aka WN [week] - int32_t i_URA; //!< ED Accuracy Index - int32_t i_signal_health; //!< Signal health (L1/L2/L5) - int32_t d_Top; //!< Data predict time of week - double d_DELTA_A; //!< Semi-major axis difference at reference time - double d_A_DOT; //!< Change rate in semi-major axis - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_DELTA_DOT_N; //!< Rate of mean motion difference from computed value - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_e_eccentricity; //!< Eccentricity - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] - int32_t d_Toe1; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toe2; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - double d_DELTA_OMEGA_DOT; //!< Rate of Right Ascension difference [semi-circles/s] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] + int32_t i_URA{}; //!< ED Accuracy Index + int32_t i_signal_health{}; //!< Signal health (L1/L2/L5) + int32_t d_Top{}; //!< Data predict time of week + double d_DELTA_A{}; //!< Semi-major axis difference at reference time + double d_A_DOT{}; //!< Change rate in semi-major axis + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_DELTA_DOT_N{}; //!< Rate of mean motion difference from computed value + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_e_eccentricity{}; //!< Eccentricity + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-cicles] + int32_t d_Toe1{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toe2{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + double d_DELTA_OMEGA_DOT{}; //!< Rate of Right Ascension difference [semi-circles/s] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] // Clock Correction and Accuracy Parameters - int32_t d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] - double d_URA0; //!< NED Accuracy Index - double d_URA1; //!< NED Accuracy Change Index - double d_URA2; //!< NED Accuracy Change Rate Index + double d_URA0{}; //!< NED Accuracy Index + double d_URA1{}; //!< NED Accuracy Change Index + double d_URA2{}; //!< NED Accuracy Change Rate Index // Group Delay Differential Parameters - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - double d_ISCL1; - double d_ISCL2; - double d_ISCL5I; - double d_ISCL5Q; + double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + double d_ISCL1{}; + double d_ISCL2{}; + double d_ISCL5I{}; + double d_ISCL5Q{}; - int32_t d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] /*! \brief If true, enhanced level of integrity assurance. * @@ -94,24 +94,24 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_l2c_phasing_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_l2c_phasing_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift{}; //!< GPS clock error + double d_dtr{}; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] /*! * \brief Compute the ECEF SV coordinates and ECEF velocity diff --git a/src/core/system_parameters/gps_cnav_iono.cc b/src/core/system_parameters/gps_cnav_iono.cc deleted file mode 100644 index 3f90fb93c..000000000 --- a/src/core/system_parameters/gps_cnav_iono.cc +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * \file gps_cnav_iono.cc - * \brief Interface of a GPS CNAV IONOSPHERIC MODEL storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix III - * \author Javier Arribas, 2015. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_cnav_iono.h" - -Gps_CNAV_Iono::Gps_CNAV_Iono() -{ - valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; -} diff --git a/src/core/system_parameters/gps_cnav_iono.h b/src/core/system_parameters/gps_cnav_iono.h index 12d240d83..6300c7b74 100644 --- a/src/core/system_parameters/gps_cnav_iono.h +++ b/src/core/system_parameters/gps_cnav_iono.h @@ -33,18 +33,18 @@ class Gps_CNAV_Iono { public: - bool valid; //!< Valid flag - // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + Gps_CNAV_Iono() = default; //!< Default constructor - Gps_CNAV_Iono(); //!< Default constructor + bool valid{}; //!< Valid flag + // Ionospheric parameters + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] template diff --git a/src/core/system_parameters/gps_cnav_navigation_message.cc b/src/core/system_parameters/gps_cnav_navigation_message.cc index 26ae184cb..d2db7d9f0 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.cc +++ b/src/core/system_parameters/gps_cnav_navigation_message.cc @@ -24,34 +24,8 @@ #include // for std::numeric_limits -void Gps_CNAV_Navigation_Message::reset() -{ - b_flag_ephemeris_1 = false; - b_flag_ephemeris_2 = false; - b_flag_iono_valid = false; - b_flag_utc_valid = false; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // info - i_channel_ID = 0; - i_satellite_PRN = 0U; - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - - d_TOW = 0; -} - - Gps_CNAV_Navigation_Message::Gps_CNAV_Navigation_Message() { - reset(); Gnss_Satellite gnss_satellite_ = Gnss_Satellite(); for (uint32_t prn_ = 1; prn_ < 33; prn_++) { diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index bec82bb48..cb1a2b118 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -47,30 +47,29 @@ public: */ Gps_CNAV_Navigation_Message(); - int32_t d_TOW; - bool b_flag_ephemeris_1; - bool b_flag_ephemeris_2; - bool b_flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono - bool b_flag_utc_valid; //!< If set, it indicates that the utc parameters are filled and are not yet read by the get_utc_model + int32_t d_TOW{}; + bool b_flag_ephemeris_1{}; + bool b_flag_ephemeris_2{}; + bool b_flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono + bool b_flag_utc_valid{}; //!< If set, it indicates that the utc parameters are filled and are not yet read by the get_utc_model std::map satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int32_t i_channel_ID; - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + uint32_t i_satellite_PRN{}; // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions - void reset(); void decode_page(std::bitset data_bits); @@ -109,9 +108,9 @@ private: int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); - Gps_CNAV_Ephemeris ephemeris_record; - Gps_CNAV_Iono iono_record; - Gps_CNAV_Utc_Model utc_model_record; + Gps_CNAV_Ephemeris ephemeris_record{}; + Gps_CNAV_Iono iono_record{}; + Gps_CNAV_Utc_Model utc_model_record{}; }; #endif diff --git a/src/core/system_parameters/gps_cnav_utc_model.cc b/src/core/system_parameters/gps_cnav_utc_model.cc index d473d371c..9df57c3b2 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.cc +++ b/src/core/system_parameters/gps_cnav_utc_model.cc @@ -20,20 +20,6 @@ #include "gps_cnav_utc_model.h" #include -Gps_CNAV_Utc_Model::Gps_CNAV_Utc_Model() -{ - valid = false; - d_A2 = 0.0; - d_A1 = 0.0; - d_A0 = 0.0; - d_t_OT = 0; - i_WN_T = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; -} - double Gps_CNAV_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week) { diff --git a/src/core/system_parameters/gps_cnav_utc_model.h b/src/core/system_parameters/gps_cnav_utc_model.h index 8ec9daca1..6bae09dc6 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.h +++ b/src/core/system_parameters/gps_cnav_utc_model.h @@ -32,22 +32,22 @@ class Gps_CNAV_Utc_Model { public: - bool valid; - // UTC parameters - double d_A2; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t i_WN_T; //!< UTC reference week number [weeks] - int32_t d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - int32_t d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] - /*! * Default constructor */ - Gps_CNAV_Utc_Model(); + Gps_CNAV_Utc_Model() = default; + + bool valid{}; + // UTC parameters + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t i_WN_T{}; //!< UTC reference week number [weeks] + int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] /*! * \brief Computes the Coordinated Universal Time (UTC) and diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index c891559fe..df3ce3463 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -24,65 +24,15 @@ #include "gnss_satellite.h" #include + Gps_Ephemeris::Gps_Ephemeris() { - i_satellite_PRN = 0U; - d_TOW = 0; - d_Crs = 0.0; - d_Delta_n = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_e_eccentricity = 0.0; - d_Cus = 0.0; - d_sqrt_A = 0.0; - d_Toe = 0; - d_Toc = 0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_IDOT = 0.0; - i_code_on_L2 = 0; - i_GPS_week = 0; - b_L2_P_data_flag = false; - i_SV_accuracy = 0; - i_SV_health = 0; - d_IODE_SF2 = 0; - d_IODE_SF3 = 0; - d_TGD = 0.0; // Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - d_IODC = 0; // Issue of Data, Clock - i_AODO = 0; // Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - - b_fit_interval_flag = false; // indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - d_spare1 = 0.0; - d_spare2 = 0.0; - - d_A_f0 = 0.0; // Coefficient 0 of code phase offset model [s] - d_A_f1 = 0.0; // Coefficient 1 of code phase offset model [s/s] - d_A_f2 = 0.0; // Coefficient 2 of code phase offset model [s/s^2] - - b_integrity_status_flag = false; - b_alert_flag = false; // If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - b_antispoofing_flag = false; // If true, the AntiSpoofing mode is ON in that SV - auto gnss_sat = Gnss_Satellite(); std::string _system("GPS"); for (uint32_t i = 1; i < 33; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } - - d_satClkDrift = 0.0; - d_dtr = 0.0; - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; } @@ -115,7 +65,6 @@ double Gps_Ephemeris::sv_clock_drift(double transmitTime) // } // d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt); - double dt; dt = check_t(transmitTime - d_Toc); d_satClkDrift = d_A_f0 + d_A_f1 * dt + d_A_f2 * (dt * dt) + sv_clock_relativistic_term(transmitTime); diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h index 84a158385..3beec4780 100644 --- a/src/core/system_parameters/gps_ephemeris.h +++ b/src/core/system_parameters/gps_ephemeris.h @@ -41,43 +41,43 @@ public: */ Gps_Ephemeris(); - uint32_t i_satellite_PRN; // SV PRN NUMBER - int32_t d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] - int32_t d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int32_t i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - int32_t i_GPS_week; //!< GPS week number, aka WN [week] - bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel - int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) - int32_t i_SV_health; - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - int32_t d_IODC; //!< Issue of Data, Clock - int32_t d_IODE_SF2; //!< Issue of Data, Ephemeris (IODE), subframe 2 - int32_t d_IODE_SF3; //!< Issue of Data, Ephemeris(IODE), subframe 3 - int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + uint32_t i_satellite_PRN{}; // SV PRN NUMBER + int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] + int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] + bool b_L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int32_t i_SV_health{}; + double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + int32_t d_IODC{}; //!< Issue of Data, Clock + int32_t d_IODE_SF2{}; //!< Issue of Data, Ephemeris (IODE), subframe 2 + int32_t d_IODE_SF3{}; //!< Issue of Data, Ephemeris(IODE), subframe 3 + int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] // Flags @@ -91,23 +91,23 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms derived from ephemeris data - double d_satClkDrift; //!< GPS clock error - double d_dtr; //!< relativistic clock correction term + double d_satClkDrift{}; //!< GPS clock error + double d_dtr{}; //!< relativistic clock correction term // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] std::map satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus diff --git a/src/core/system_parameters/gps_iono.cc b/src/core/system_parameters/gps_iono.cc deleted file mode 100644 index fbd5dda1e..000000000 --- a/src/core/system_parameters/gps_iono.cc +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * \file gps_iono.cc - * \brief Interface of a GPS IONOSPHERIC MODEL storage - * - * See https://www.gps.gov/technical/icwg/IS-GPS-200K.pdf Appendix II - * \author Javier Arribas, 2013. jarribas(at)cttc.es - * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ------------------------------------------------------------------------- - */ - -#include "gps_iono.h" - -Gps_Iono::Gps_Iono() -{ - valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; -} diff --git a/src/core/system_parameters/gps_iono.h b/src/core/system_parameters/gps_iono.h index 7d68df41f..11a7e539c 100644 --- a/src/core/system_parameters/gps_iono.h +++ b/src/core/system_parameters/gps_iono.h @@ -33,18 +33,18 @@ class Gps_Iono { public: - bool valid; //!< Valid flag + bool valid{}; //!< Valid flag // Ionospheric parameters - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] - Gps_Iono(); //!< Default constructor + Gps_Iono() = default; //!< Default constructor template diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index 37915f883..f1f208792 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -27,120 +27,18 @@ m * \file gps_navigation_message.cc #include // for std::numeric_limits -void Gps_Navigation_Message::reset() +Gps_Navigation_Message::Gps_Navigation_Message() { - b_valid_ephemeris_set_flag = false; - d_TOW = 0; - d_TOW_SF1 = 0; - d_TOW_SF2 = 0; - d_TOW_SF3 = 0; - d_TOW_SF4 = 0; - d_TOW_SF5 = 0; - d_IODE_SF2 = 0; - d_IODE_SF3 = 0; - d_Crs = 0.0; - d_Delta_n = 0.0; - d_M_0 = 0.0; - d_Cuc = 0.0; - d_e_eccentricity = 0.0; - d_Cus = 0.0; - d_sqrt_A = 0.0; - d_Toe = 0; - d_Toc = 0; - d_Cic = 0.0; - d_OMEGA0 = 0.0; - d_Cis = 0.0; - d_i_0 = 0.0; - d_Crc = 0.0; - d_OMEGA = 0.0; - d_OMEGA_DOT = 0.0; - d_IDOT = 0.0; - i_code_on_L2 = 0; - i_GPS_week = 0; - b_L2_P_data_flag = false; - i_SV_accuracy = 0; - i_SV_health = 0; - d_TGD = 0.0; - d_IODC = -1; - i_AODO = 0; - - b_fit_interval_flag = false; - d_spare1 = 0.0; - d_spare2 = 0.0; - - d_A_f0 = 0.0; - d_A_f1 = 0.0; - d_A_f2 = 0.0; - - // clock terms - // d_master_clock=0; - d_dtr = 0.0; - d_satClkCorr = 0.0; - d_satClkDrift = 0.0; - - // satellite positions - d_satpos_X = 0.0; - d_satpos_Y = 0.0; - d_satpos_Z = 0.0; - - // info - i_channel_ID = 0; - i_satellite_PRN = 0U; - - // time synchro - d_subframe_timestamp_ms = 0.0; - - // flags - b_alert_flag = false; - b_integrity_status_flag = false; - b_antispoofing_flag = false; - - // Ionosphere and UTC - flag_iono_valid = false; - flag_utc_model_valid = false; - d_alpha0 = 0.0; - d_alpha1 = 0.0; - d_alpha2 = 0.0; - d_alpha3 = 0.0; - d_beta0 = 0.0; - d_beta1 = 0.0; - d_beta2 = 0.0; - d_beta3 = 0.0; - d_A2 = 0.0; - d_A1 = 0.0; - d_A0 = 0.0; - d_t_OT = 0; - i_WN_T = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; - - // Almanac - i_Toa = 0; - i_WN_A = 0; - for (int32_t i = 1; i < 32; i++) - { - almanacHealth[i] = 0; - } - - // Satellite velocity - d_satvel_X = 0.0; - d_satvel_Y = 0.0; - d_satvel_Z = 0.0; - auto gnss_sat = Gnss_Satellite(); std::string _system("GPS"); for (uint32_t i = 1; i < 33; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } -} - - -Gps_Navigation_Message::Gps_Navigation_Message() -{ - reset(); + for (int32_t i = 1; i < 33; i++) + { + almanacHealth[i] = 0; + } } diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 1ba9aa7cc..0f279f059 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -47,57 +47,57 @@ public: */ Gps_Navigation_Message(); - bool b_valid_ephemeris_set_flag; // flag indicating that this ephemeris set have passed the validation check + bool b_valid_ephemeris_set_flag{}; // flag indicating that this ephemeris set have passed the validation check // broadcast orbit 1 - int32_t d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] - int32_t d_TOW_SF1; //!< Time of GPS Week from HOW word of Subframe 1 [s] - int32_t d_TOW_SF2; //!< Time of GPS Week from HOW word of Subframe 2 [s] - int32_t d_TOW_SF3; //!< Time of GPS Week from HOW word of Subframe 3 [s] - int32_t d_TOW_SF4; //!< Time of GPS Week from HOW word of Subframe 4 [s] - int32_t d_TOW_SF5; //!< Time of GPS Week from HOW word of Subframe 5 [s] - int32_t d_IODE_SF2; - int32_t d_IODE_SF3; - double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] - double d_Delta_n; //!< Mean Motion Difference From Computed Value [semi-circles/s] - double d_M_0; //!< Mean Anomaly at Reference Time [semi-circles] + int32_t d_TOW{}; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] + int32_t d_TOW_SF1{}; //!< Time of GPS Week from HOW word of Subframe 1 [s] + int32_t d_TOW_SF2{}; //!< Time of GPS Week from HOW word of Subframe 2 [s] + int32_t d_TOW_SF3{}; //!< Time of GPS Week from HOW word of Subframe 3 [s] + int32_t d_TOW_SF4{}; //!< Time of GPS Week from HOW word of Subframe 4 [s] + int32_t d_TOW_SF5{}; //!< Time of GPS Week from HOW word of Subframe 5 [s] + int32_t d_IODE_SF2{}; + int32_t d_IODE_SF3{}; + double d_Crs{}; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] + double d_Delta_n{}; //!< Mean Motion Difference From Computed Value [semi-circles/s] + double d_M_0{}; //!< Mean Anomaly at Reference Time [semi-circles] // broadcast orbit 2 - double d_Cuc; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - double d_e_eccentricity; //!< Eccentricity [dimensionless] - double d_Cus; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] - double d_sqrt_A; //!< Square Root of the Semi-Major Axis [sqrt(m)] + double d_Cuc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + double d_e_eccentricity{}; //!< Eccentricity [dimensionless] + double d_Cus{}; //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] + double d_sqrt_A{}; //!< Square Root of the Semi-Major Axis [sqrt(m)] // broadcast orbit 3 - int32_t d_Toe; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] - int32_t d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] - double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] - double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] - double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] + int32_t d_Toe{}; //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200K) [s] + int32_t d_Toc{}; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200K) [s] + double d_Cic{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] + double d_OMEGA0{}; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] + double d_Cis{}; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] // broadcast orbit 4 - double d_i_0; //!< Inclination Angle at Reference Time [semi-circles] - double d_Crc; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] - double d_OMEGA; //!< Argument of Perigee [semi-cicles] - double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] + double d_i_0{}; //!< Inclination Angle at Reference Time [semi-circles] + double d_Crc{}; //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] + double d_OMEGA{}; //!< Argument of Perigee [semi-cicles] + double d_OMEGA_DOT{}; //!< Rate of Right Ascension [semi-circles/s] // broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int32_t i_code_on_L2; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; - int32_t i_GPS_week; //!< GPS week number, aka WN [week] - bool b_L2_P_data_flag; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel + double d_IDOT{}; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2; + int32_t i_GPS_week{}; //!< GPS week number, aka WN [week] + bool b_L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel // broadcast orbit 6 - int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) - int32_t i_SV_health; - double d_TGD; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] - int32_t d_IODC; //!< Issue of Data, Clock + int32_t i_SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200K) + int32_t i_SV_health{}; + double d_TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] + int32_t d_IODC{}; //!< Issue of Data, Clock // broadcast orbit 7 - int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] - bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. - double d_spare1; - double d_spare2; - double d_A_f0; //!< Coefficient 0 of code phase offset model [s] - double d_A_f1; //!< Coefficient 1 of code phase offset model [s/s] - double d_A_f2; //!< Coefficient 2 of code phase offset model [s/s^2] + int32_t i_AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + bool b_fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. + double d_spare1{}; + double d_spare2{}; + double d_A_f0{}; //!< Coefficient 0 of code phase offset model [s] + double d_A_f1{}; //!< Coefficient 1 of code phase offset model [s/s] + double d_A_f2{}; //!< Coefficient 2 of code phase offset model [s/s^2] // Almanac - int32_t i_Toa; //!< Almanac reference time [s] - int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (i_Toa) is referenced + int32_t i_Toa{}; //!< Almanac reference time [s] + int32_t i_WN_A{}; //!< Modulo 256 of the GPS week number to which the almanac reference time (i_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac std::map satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus @@ -114,58 +114,57 @@ public: * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an * accompanying alert, is less than 1E-8 per hour. */ - bool b_integrity_status_flag; - bool b_alert_flag; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. - bool b_antispoofing_flag; //!< If true, the AntiSpoofing mode is ON in that SV + bool b_integrity_status_flag{}; + bool b_alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. + bool b_antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV // clock terms - // double d_master_clock; // GPS transmission time - double d_satClkCorr; // GPS clock error - double d_dtr; // relativistic clock correction term - double d_satClkDrift; + // double d_master_clock{}; // GPS transmission time + double d_satClkCorr{}; // GPS clock error + double d_dtr{}; // relativistic clock correction term + double d_satClkDrift{}; // satellite positions - double d_satpos_X; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. - double d_satpos_Y; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. - double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). + double d_satpos_X{}; //!< Earth-fixed coordinate x of the satellite [m]. Intersection of the IERS Reference Meridian (IRM) and the plane passing through the origin and normal to the Z-axis. + double d_satpos_Y{}; //!< Earth-fixed coordinate y of the satellite [m]. Completes a right-handed, Earth-Centered, Earth-Fixed orthogonal coordinate system. + double d_satpos_Z{}; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int32_t i_channel_ID; - uint32_t i_satellite_PRN; + int32_t i_channel_ID{}; + uint32_t i_satellite_PRN{}; // time synchro - double d_subframe_timestamp_ms; // [ms] + double d_subframe_timestamp_ms{}; // [ms] // Ionospheric parameters - bool flag_iono_valid; //!< If set, it indicates that the ionospheric parameters are filled (page 18 has arrived and decoded) - double d_alpha0; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] - double d_alpha1; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] - double d_alpha2; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] - double d_alpha3; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] - double d_beta0; //!< Coefficient 0 of a cubic equation representing the period of the model [s] - double d_beta1; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] - double d_beta2; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] - double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] + bool flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled (page 18 has arrived and decoded) + double d_alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s] + double d_alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] + double d_alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2] + double d_alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3] + double d_beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s] + double d_beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle] + double d_beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2] + double d_beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - bool flag_utc_model_valid; //!< If set, it indicates that the UTC model parameters are filled - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A2; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - int32_t d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t i_WN_T; //!< UTC reference week number [weeks] - int32_t d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - int32_t d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] + bool flag_utc_model_valid{}; //!< If set, it indicates that the UTC model parameters are filled + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t i_WN_T{}; //!< UTC reference week number [weeks] + int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] // Satellite velocity - double d_satvel_X; //!< Earth-fixed velocity coordinate x of the satellite [m] - double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] - double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] + double d_satvel_X{}; //!< Earth-fixed velocity coordinate x of the satellite [m] + double d_satvel_Y{}; //!< Earth-fixed velocity coordinate y of the satellite [m] + double d_satvel_Z{}; //!< Earth-fixed velocity coordinate z of the satellite [m] // public functions - void reset(); /*! * \brief Obtain a GPS SV Ephemeris class filled with current SV data diff --git a/src/core/system_parameters/gps_utc_model.cc b/src/core/system_parameters/gps_utc_model.cc index a88b330ad..06545d5cf 100644 --- a/src/core/system_parameters/gps_utc_model.cc +++ b/src/core/system_parameters/gps_utc_model.cc @@ -21,21 +21,6 @@ #include -Gps_Utc_Model::Gps_Utc_Model() -{ - valid = false; - d_A0 = 0.0; - d_A1 = 0.0; - d_A2 = 0.0; - d_t_OT = 0; - i_WN_T = 0; - d_DeltaT_LS = 0; - i_WN_LSF = 0; - i_DN = 0; - d_DeltaT_LSF = 0; -} - - double Gps_Utc_Model::utc_time(double gpstime_corrected, int32_t i_GPS_week) { double t_utc; diff --git a/src/core/system_parameters/gps_utc_model.h b/src/core/system_parameters/gps_utc_model.h index 1bc3aacbe..788c88755 100644 --- a/src/core/system_parameters/gps_utc_model.h +++ b/src/core/system_parameters/gps_utc_model.h @@ -32,22 +32,22 @@ class Gps_Utc_Model { public: - bool valid; - // UTC parameters - double d_A0; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] - double d_A1; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - double d_A2; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] - int32_t d_t_OT; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] - int32_t i_WN_T; //!< UTC reference week number [weeks] - int32_t d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] - int32_t d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] - /*! * Default constructor */ - Gps_Utc_Model(); + Gps_Utc_Model() = default; + + bool valid{}; + // UTC parameters + double d_A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s] + double d_A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + double d_A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200K) [s/s] + int32_t d_t_OT{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200K) [s] + int32_t i_WN_T{}; //!< UTC reference week number [weeks] + int32_t d_DeltaT_LS{}; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t d_DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] template /* diff --git a/src/core/system_parameters/sbas_ephemeris.h b/src/core/system_parameters/sbas_ephemeris.h index 69644c9b4..c397a994b 100644 --- a/src/core/system_parameters/sbas_ephemeris.h +++ b/src/core/system_parameters/sbas_ephemeris.h @@ -30,17 +30,20 @@ class Sbas_Ephemeris { public: + Sbas_Ephemeris() = default; + + int i_prn{}; //!< PRN number + int i_t0{}; //!< Reference epoch time (GPST) + double d_tof{}; //!< Time of message frame (GPST) + int i_sv_ura{}; //!< SV accuracy (URA index), not standardized + bool b_sv_do_not_use{}; //!< Health status (false:do not use / true:usable) + double d_pos[3]{}; //!< Satellite position (m) (ECEF) + double d_vel[3]{}; //!< Satellite velocity (m/s) (ECEF) + double d_acc[3]{}; //!< Satellite acceleration (m/s^2) (ECEF) + double d_af0{}; //!< Satellite clock-offset (s) + double d_af1{}; //!< Satellite drift (s/s) + void print(std::ostream &out); - int i_prn; //!< PRN number - int i_t0; //!< Reference epoch time (GPST) - double d_tof; //!< Time of message frame (GPST) - int i_sv_ura; //!< SV accuracy (URA index), not standardized - bool b_sv_do_not_use; //!< Health status (false:do not use / true:usable) - double d_pos[3]; //!< Satellite position (m) (ECEF) - double d_vel[3]; //!< Satellite velocity (m/s) (ECEF) - double d_acc[3]; //!< Satellite acceleration (m/s^2) (ECEF) - double d_af0; //!< Satellite clock-offset (s) - double d_af1; //!< Satellite drift (s/s) }; diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc index a7bf37c6e..e2eb02b65 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc @@ -33,8 +33,7 @@ TEST(GlonassGnavNavigationMessageTest, CRCTestSuccess) // Variables declarations in code bool test_result; std::bitset string_bits(std::string("0010100100001100000000000000000000000000110011110001100000000000000001100100011000000")); - Glonass_Gnav_Navigation_Message gnav_nav_message; - gnav_nav_message.reset(); + auto gnav_nav_message = Glonass_Gnav_Navigation_Message(); // Call function to test test_result = gnav_nav_message.CRC_test(string_bits); @@ -55,8 +54,7 @@ TEST(GlonassGnavNavigationMessageTest, CRCTestFailure) bool test_result; // Constructor of string to bitset will flip the order of the bits. Needed for CRC computation std::bitset string_bits(std::string("0111100100001100000000000000000000000000110011110001100000000000000001100100011000000")); - Glonass_Gnav_Navigation_Message gnav_nav_message; - gnav_nav_message.reset(); + auto gnav_nav_message = Glonass_Gnav_Navigation_Message(); // Call function to test test_result = gnav_nav_message.CRC_test(string_bits); From 85286f8a7e4bf31e86612a3e0f410a86f9354683 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 11:54:23 +0200 Subject: [PATCH 19/54] Initialize members to a valid state --- .../libs/acquisition_dump_reader.h | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h index cbcc4a36c..39af6b231 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h @@ -52,23 +52,23 @@ public: std::vector doppler; std::vector samples; std::vector > mag; - float acq_doppler_hz; - float acq_delay_samples; - float test_statistic; - float input_power; - float threshold; - int positive_acq; - unsigned int PRN; - unsigned int num_dwells; - uint64_t sample_counter; + float acq_doppler_hz{}; + float acq_delay_samples{}; + float test_statistic{}; + float input_power{}; + float threshold{}; + int positive_acq{}; + unsigned int PRN{}; + unsigned int num_dwells{}; + uint64_t sample_counter{}; private: std::string d_basename; - unsigned int d_sat; - unsigned int d_doppler_max; - unsigned int d_doppler_step; - unsigned int d_samples_per_code; - unsigned int d_num_doppler_bins; + unsigned int d_sat{}; + unsigned int d_doppler_max{}; + unsigned int d_doppler_step{}; + unsigned int d_samples_per_code{}; + unsigned int d_num_doppler_bins{}; std::string d_dump_filename; }; From 029651cbe3f0161f269e51d8676cb4a8be537327 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 13:17:03 +0200 Subject: [PATCH 20/54] Do not strip volk_gnsssdr binaries if cross-compiling --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84c1abf5d..702df78d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -888,7 +888,11 @@ if(NOT VOLKGNSSSDR_FOUND) set(STRIP_VOLK_GNSSSDR_PROFILE "") if(ENABLE_PACKAGING) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") + if(CMAKE_CROSSCOMPILING) + set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=OFF -DCMAKE_VERBOSE_MAKEFILE=ON") + else() + set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") + endif() endif() endif() From 836e074f9825404a35b3103b7538e1fcaebafebd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 17:22:03 +0200 Subject: [PATCH 21/54] Add building option ENABLE_STRIP to enable the generation of stripped binaries (without debgging information). Set to OFF by default --- CMakeLists.txt | 22 +++++++++++++------ docs/changelog.md | 4 ++++ .../volk_gnsssdr/CMakeLists.txt | 2 +- src/main/CMakeLists.txt | 9 ++++---- src/tests/CMakeLists.txt | 7 ++++++ src/utils/front-end-cal/CMakeLists.txt | 4 ++++ src/utils/rinex-tools/CMakeLists.txt | 4 ++++ src/utils/rinex2assist/CMakeLists.txt | 4 ++++ 8 files changed, 44 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 702df78d1..abbcfa71b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,10 +75,17 @@ option(ENABLE_LOG "Enable logging" ON) option(ENABLE_ARMA_NO_DEBUG OFF) +option(ENABLE_STRIP "Create stripped binaries without debugging symbols, potentially smaller in size (GCC-only, Release build mode)" OFF) + +if((NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) OR WIN32) + set(ENABLE_STRIP OFF) +endif() + if(ENABLE_PACKAGING) set(ENABLE_GENERIC_ARCH ON) set(ENABLE_ARMA_NO_DEBUG ON) set(CMAKE_VERBOSE_MAKEFILE ON) + set(ENABLE_STRIP OFF) endif() # Testing @@ -221,6 +228,9 @@ else() endif() gnsssdr_check_build_type(${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") +if(NOT (${CMAKE_BUILD_TYPE} STREQUAL "Release")) + set(ENABLE_STRIP OFF) +endif() # Enable optimization options in GCC for Release and RelWithDebInfo build types if((${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) @@ -886,13 +896,10 @@ if(NOT VOLKGNSSSDR_FOUND) endif() set(STRIP_VOLK_GNSSSDR_PROFILE "") - if(ENABLE_PACKAGING) - if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - if(CMAKE_CROSSCOMPILING) - set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=OFF -DCMAKE_VERBOSE_MAKEFILE=ON") - else() - set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON") - endif() + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=${ENABLE_STRIP}") + if(ENABLE_PACKAGING) + set(STRIP_VOLK_GNSSSDR_PROFILE "${STRIP_VOLK_GNSSSDR_PROFILE} -DCMAKE_VERBOSE_MAKEFILE=ON") endif() endif() @@ -2917,6 +2924,7 @@ add_feature_info(ENABLE_PACKAGING ENABLE_PACKAGING "Enables software packaging." add_feature_info(ENABLE_OWN_GLOG ENABLE_OWN_GLOG "Forces the downloading and building of Google glog.") add_feature_info(ENABLE_OWN_ARMADILLO ENABLE_OWN_ARMADILLO "Forces the downloading and building of Armadillo.") add_feature_info(ENABLE_LOG ENABLE_LOG "Enables runtime internal logging with Google glog.") +add_feature_info(ENABLE_STRIP ENABLE_STRIP "Enables the generation of stripped binaries (without debugging symbols).") add_feature_info(ENABLE_UNIT_TESTING ENABLE_UNIT_TESTING "Enables building of Unit Tests.") add_feature_info(ENABLE_UNIT_TESTING_MINIMAL ENABLE_UNIT_TESTING_MINIMAL "Enables building a minimal set of Unit Tests.") add_feature_info(ENABLE_UNIT_TESTING_EXTRA ENABLE_UNIT_TESTING_EXTRA "Enables building of Extra Unit Tests and downloading of external data files.") diff --git a/docs/changelog.md b/docs/changelog.md index dfa900dea..16017e0fc 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -15,6 +15,10 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades ${CMAKE_SOURCE_DIR}/install/$ diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 100308049..1995e4ef5 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -97,6 +97,10 @@ if(Boost_FOUND) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) endif() + if(ENABLE_STRIP) + set_target_properties(rinex2assist PROPERTIES LINK_FLAGS "-s") + endif() + add_custom_command(TARGET rinex2assist POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ From 90086f21c5fbfa1a29233ab45b202110fbd4344b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 10 Jun 2020 23:01:26 +0200 Subject: [PATCH 22/54] Allow stripping also with Clang --- CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abbcfa71b..6c89c1189 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,11 +75,7 @@ option(ENABLE_LOG "Enable logging" ON) option(ENABLE_ARMA_NO_DEBUG OFF) -option(ENABLE_STRIP "Create stripped binaries without debugging symbols, potentially smaller in size (GCC-only, Release build mode)" OFF) - -if((NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) OR WIN32) - set(ENABLE_STRIP OFF) -endif() +option(ENABLE_STRIP "Create stripped binaries without debugging symbols (in Release build mode only)" OFF) if(ENABLE_PACKAGING) set(ENABLE_GENERIC_ARCH ON) From d847d3fdcf3fafd7e2c69ea1dc4dd6c20e42a823 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 11 Jun 2020 12:09:55 +0200 Subject: [PATCH 23/54] Add test about preamble correlation implementations --- src/tests/test_main.cc | 1 + .../arithmetic/preamble_correlator_test.cc | 107 ++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 src/tests/unit-tests/arithmetic/preamble_correlator_test.cc diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 3d54ce6bd..00639b3db 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -49,6 +49,7 @@ DECLARE_string(log_dir); #include "unit-tests/arithmetic/fft_speed_test.cc" #include "unit-tests/arithmetic/magnitude_squared_test.cc" #include "unit-tests/arithmetic/multiply_test.cc" +#include "unit-tests/arithmetic/preamble_correlator_test.cc" #include "unit-tests/control-plane/control_thread_test.cc" #include "unit-tests/control-plane/file_configuration_test.cc" #include "unit-tests/control-plane/gnss_block_factory_test.cc" diff --git a/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc b/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc new file mode 100644 index 000000000..76ca3d681 --- /dev/null +++ b/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc @@ -0,0 +1,107 @@ +/*! + * \file preamble_correlator_test.cc + * \brief This file implements tests for preamble detection. + * \author Carles Fernandez-Prades, 2020. cfernandez(at)cttc.es + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ------------------------------------------------------------------------- + */ + +#include "GPS_L1_CA.h" +#include +#include +#include +#include +#include +#include + +TEST(PreambleCorrelationTest, TestMethods) +{ + int64_t n_iter = 100000; + int32_t corr_value = 0; + int32_t corr_value2 = 0; + + int32_t sum_corr1 = 0; + int32_t sum_corr2 = 0; + + std::vector d_symbol_history(GPS_CA_PREAMBLE_LENGTH_SYMBOLS, 0.0); + std::array d_preamble_samples{}; + + std::chrono::time_point start, end, start2, end2; + + // fill the inputs + std::random_device rd; + std::default_random_engine e2(rd()); + std::uniform_real_distribution<> dist(-1.0, 1.0); + for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) + { + d_symbol_history[i] = dist(e2); + } + + int32_t n = 0; + for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) + { + if (GPS_CA_PREAMBLE[i] == '1') + { + d_preamble_samples[n] = 1; + n++; + } + else + { + d_preamble_samples[n] = -1; + n++; + } + } + + // Compute correlation, method 1 + start = std::chrono::system_clock::now(); + for (int64_t kk = 0; kk < n_iter; kk++) + { + corr_value = 0; + for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) + { + if (d_symbol_history[i] < 0.0) + { + corr_value -= d_preamble_samples[i]; + } + else + { + corr_value += d_preamble_samples[i]; + } + } + sum_corr1 += corr_value; + } + end = std::chrono::system_clock::now(); + + // Compute correlation, method 2 + start2 = std::chrono::system_clock::now(); + for (int64_t kk = 0; kk < n_iter; kk++) + { + int32_t ii = -1; + corr_value2 = std::accumulate(d_symbol_history.begin(), + d_symbol_history.begin() + GPS_CA_PREAMBLE_LENGTH_BITS, + 0, + [&ii, &d_preamble_samples](float a, float b) { return (b > 0.0 ? a + d_preamble_samples[++ii] : a - d_preamble_samples[++ii]); }); + sum_corr2 += corr_value2; + } + end2 = std::chrono::system_clock::now(); + + EXPECT_EQ(corr_value, corr_value2); + EXPECT_EQ(sum_corr1, sum_corr2); + + std::chrono::duration elapsed_seconds = end - start; + std::chrono::duration elapsed_seconds2 = end2 - start2; + std::cout << "Correlation computed with 'C for': done in " << elapsed_seconds.count() * 1.0e9 / n_iter << " nanoseconds" << std::endl; + std::cout << "Correlation computed with lambda: done in " << elapsed_seconds2.count() * 1.0e9 / n_iter << " nanoseconds" << std::endl; +} From 44eba473a458629b9e3f84e5063873a0f0c307ba Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 11 Jun 2020 13:32:18 +0200 Subject: [PATCH 24/54] Replace a macro by a lambda --- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 60769242f..272359030 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -34,7 +34,7 @@ #ifndef _rotl -#define _rotl(X, N) (((X) << (N)) ^ ((X) >> (32 - (N)))) // Used in the parity check algorithm +auto _rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; // Used in the parity check algorithm #endif From 65a25a47c5c5adab3193b02ec99ca1c03afc4c07 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 11 Jun 2020 13:39:38 +0200 Subject: [PATCH 25/54] Speed optimization by reserving memory for a std::vector --- .../observables/gnuradio_blocks/hybrid_observables_gs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 2d707a533..cbd9569ca 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -653,7 +653,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) if (d_Rx_clock_buffer.size() == d_Rx_clock_buffer.capacity()) { - std::vector epoch_data; + std::vector epoch_data(d_nchannels_out); int32_t n_valid = 0; for (uint32_t n = 0; n < d_nchannels_out; n++) { @@ -672,7 +672,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) { n_valid++; } - epoch_data.push_back(interpolated_gnss_synchro); + epoch_data[n] = interpolated_gnss_synchro; } if (T_rx_TOW_set) From e8f8097b047ce716f45f717628fa0346ff33ad4b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 11 Jun 2020 14:24:12 +0200 Subject: [PATCH 26/54] Avoid using different C++ standard depending on building options --- CMakeLists.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c89c1189..baa0fe63c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -540,15 +540,13 @@ set(FILESYSTEM_FOUND FALSE) if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND LOG4CPP_READY_FOR_CXX17) # Check if we have std::filesystem if(NOT (CMAKE_VERSION VERSION_LESS 3.8)) - if(NOT (ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)) # Fix for GPTSk - find_package(FILESYSTEM COMPONENTS Final Experimental) - set_package_properties(FILESYSTEM PROPERTIES - URL "https://en.cppreference.com/w/cpp/filesystem" - DESCRIPTION "Provides facilities for performing operations on file systems and their components" - PURPOSE "Work with paths, regular files, and directories." - TYPE OPTIONAL - ) - endif() + find_package(FILESYSTEM COMPONENTS Final Experimental) + set_package_properties(FILESYSTEM PROPERTIES + URL "https://en.cppreference.com/w/cpp/filesystem" + DESCRIPTION "Provides facilities for performing operations on file systems and their components" + PURPOSE "Work with paths, regular files, and directories." + TYPE OPTIONAL + ) if(${FILESYSTEM_FOUND}) if(CMAKE_VERSION VERSION_LESS 3.13) set(CMAKE_CXX_STANDARD 17) From 034d25c8d3d9bda7c4a8905595476e4efb715ef6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 11 Jun 2020 15:16:40 +0200 Subject: [PATCH 27/54] Do not emit warnings due to Protocol Buffers generated code --- src/algorithms/PVT/libs/CMakeLists.txt | 2 +- src/core/monitor/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index e8a2d1188..fdaf03804 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -90,7 +90,7 @@ get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) target_include_directories(pvt_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/receiver - ${PROTO_INCLUDE_HEADERS} + SYSTEM ${PROTO_INCLUDE_HEADERS} ) target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 991815cfe..650ca63fb 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -59,7 +59,7 @@ get_filename_component(PROTO_INCLUDE_HEADERS ${PROTO_HDRS} DIRECTORY) target_include_directories(core_monitor PUBLIC - ${PROTO_INCLUDE_HEADERS} + SYSTEM ${PROTO_INCLUDE_HEADERS} ) if(GNURADIO_USES_STD_POINTERS) From d15a8d49d2d29316eb532df6fdefd4ae44a1c965 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 11 Jun 2020 15:32:11 +0200 Subject: [PATCH 28/54] GCC 11 already exists (see https://gcc.gnu.org/gcc-11/changes.html) --- cmake/Modules/FindGFORTRAN.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index b7e5d0a75..9a7eb1141 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -22,7 +22,7 @@ if(DEFINED ENV{GFORTRAN_ROOT}) ) endif() -set(GCC_MAJOR_SERIES 10 9 8 7 6 5) +set(GCC_MAJOR_SERIES 11 10 9 8 7 6 5) set(GCC4_SERIES 4.9.1 4.9 4.8.3 4.8.1 4.7.2 4.7 4.8.2 4.8 4.7 4.6 4.5 4.4.4 4.4) set(GCC_SERIES ${GCC_MAJOR_SERIES} ${GCC4_SERIES}) From d14e69ef5a2af8cfb1293edf4d26550e03d19f86 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 12 Jun 2020 20:51:26 +0200 Subject: [PATCH 29/54] Do not pollute the source directory if the software is built from an out-of-source-tree directory External sources and data are now always stored in a ./thirdparty folder under the building directory. A copy of the generated binaries will be stored under gnss-sdr/install, if the building directory is inside the source tree, or in an ./install folder under the building directory if it is outside the source tree. Fix a bug that broke compilation if the user configured the building without extra testing in a first instance, and then switched the testing buiding options to ON in a later build. Fix extra test building if GPSTk was already installed and Boost >= 1.71 --- CMakeLists.txt | 118 +++++++++++------- README.md | 23 ++-- docs/changelog.md | 8 ++ .../PVT/gnuradio_blocks/CMakeLists.txt | 8 -- src/main/CMakeLists.txt | 2 +- src/tests/CMakeLists.txt | 100 +++++++-------- src/utils/front-end-cal/CMakeLists.txt | 2 +- src/utils/rinex-tools/CMakeLists.txt | 6 +- src/utils/rinex2assist/CMakeLists.txt | 6 +- 9 files changed, 154 insertions(+), 119 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baa0fe63c..b912897de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,6 +257,13 @@ if(UNIX) add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES) endif() +# If this is an out-of-tree build, do not pollute the original source directory +if(${CMAKE_BINARY_DIR} MATCHES ${CMAKE_SOURCE_DIR}) + set(LOCAL_INSTALL_BASE_DIR ${CMAKE_SOURCE_DIR}) +else() + set(LOCAL_INSTALL_BASE_DIR ${CMAKE_BINARY_DIR}) +endif() + # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") @@ -540,13 +547,15 @@ set(FILESYSTEM_FOUND FALSE) if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND LOG4CPP_READY_FOR_CXX17) # Check if we have std::filesystem if(NOT (CMAKE_VERSION VERSION_LESS 3.8)) - find_package(FILESYSTEM COMPONENTS Final Experimental) - set_package_properties(FILESYSTEM PROPERTIES - URL "https://en.cppreference.com/w/cpp/filesystem" - DESCRIPTION "Provides facilities for performing operations on file systems and their components" - PURPOSE "Work with paths, regular files, and directories." - TYPE OPTIONAL - ) + if(NOT (ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)) # Fix for GPTSk + find_package(FILESYSTEM COMPONENTS Final Experimental) + set_package_properties(FILESYSTEM PROPERTIES + URL "https://en.cppreference.com/w/cpp/filesystem" + DESCRIPTION "Provides facilities for performing operations on file systems and their components" + PURPOSE "Work with paths, regular files, and directories." + TYPE OPTIONAL + ) + endif() if(${FILESYSTEM_FOUND}) if(CMAKE_VERSION VERSION_LESS 3.13) set(CMAKE_CXX_STANDARD 17) @@ -751,12 +760,15 @@ endif() # Workaround for https://github.com/boostorg/format/issues/67 if((Boost_VERSION_STRING VERSION_GREATER 1.71) AND (Boost_VERSION_STRING VERSION_LESS 1.73)) - set(CMAKE_CXX_STANDARD 17) + if(CMAKE_CXX_STANDARD VERSION_GREATER 17) + set(CMAKE_CXX_STANDARD 17) + endif() endif() # Fix for Boost Asio < 1.70 when using Clang in macOS if(Boost_VERSION_STRING VERSION_LESS 1.70.0) # Check if we have std::string_view + unset(has_string_view CACHE) include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #include  @@ -771,6 +783,7 @@ endif() ################################################################################ # Detect availability of std::span ################################################################################ +unset(has_span CACHE) include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #include @@ -781,6 +794,19 @@ check_cxx_source_compiles(" +################################################################################ +# Detect availability of std::put_time (Workaround for gcc < 5.0) +################################################################################ +include(CheckCXXSourceCompiles) +check_cxx_source_compiles(" + #include + int main() + { std::put_time(nullptr, \"\"); }" + has_put_time +) + + + ################################################################################ # VOLK - Vector-Optimized Library of Kernels ################################################################################ @@ -1007,19 +1033,19 @@ if(NOT VOLKGNSSSDR_FOUND) if(CMAKE_VERSION VERSION_LESS 3.2) add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile + ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile ) else() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile - BYPRODUCTS ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr_profile + ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile + BYPRODUCTS ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile ) endif() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info - ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info + ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr-config-info ) set_package_properties(VOLKGNSSSDR PROPERTIES @@ -1058,7 +1084,7 @@ if(NOT GFLAGS_FOUND) PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} GIT_REPOSITORY git://github.com/gflags/gflags.git GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON @@ -1085,7 +1111,7 @@ if(NOT GFLAGS_FOUND) PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} GIT_REPOSITORY git://github.com/gflags/gflags.git GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON @@ -1222,12 +1248,12 @@ export LIBS=\"${GFLAGS_LIBRARIES_TO_LINK}\" ${GLOG_EXPORT_CXX_LIBRARIES} ${GLOG_EXPORT_C_COMPILER} ${GLOG_EXPORT_CXX_COMPILER} -cd ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/ +cd ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/ aclocal automake --add-missing autoreconf -vfi cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} -${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure --enable-shared=no" +${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure --enable-shared=no" ) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags @@ -1291,7 +1317,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= BUILD_COMMAND "${GLOG_MAKE_PROGRAM}" @@ -1303,7 +1329,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) set(GLOG_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src ) else() # CMake > 3.0 but < 3.2 @@ -1312,7 +1338,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} @@ -1325,7 +1351,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c INSTALL_COMMAND "" ) set(GLOG_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${GFlags_INCLUDE_DIRS} ) @@ -1348,7 +1374,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} @@ -1362,7 +1388,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c INSTALL_COMMAND "" ) set(GLOG_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${GFlags_INCLUDE_DIRS} ) @@ -1372,7 +1398,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c # Create Glog::glog target if(NOT TARGET Glog::glog) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}) add_library(Glog::glog STATIC IMPORTED) add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION}) @@ -1578,7 +1604,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF @@ -1598,7 +1624,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF @@ -1621,7 +1647,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) set(ARMADILLO_STATIC_LIBRARY ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LOCAL_ARMADILLO TRUE CACHE STRING "Armadillo downloaded and built automatically" FORCE) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) add_library(Armadillo::armadillo STATIC IMPORTED) add_dependencies(Armadillo::armadillo armadillo-${armadillo_RELEASE}) set_target_properties(Armadillo::armadillo PROPERTIES @@ -1637,7 +1663,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) IMPORTED_LOCATION_RELEASE ${ARMADILLO_STATIC_LIBRARY} IMPORTED_LOCATION_RELWITHDEBINFO ${ARMADILLO_STATIC_LIBRARY} IMPORTED_LOCATION_MINSIZEREL ${ARMADILLO_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include INTERFACE_LINK_LIBRARIES ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GFORTRAN} ${ARMADILLO_STATIC_LIBRARY} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -1885,9 +1911,9 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio GIT_REPOSITORY https://github.com/tbeu/matio GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= BUILD_COMMAND ${MATIO_MAKE_PROGRAM} ) else() @@ -1895,9 +1921,9 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio GIT_REPOSITORY https://github.com/tbeu/matio GIT_TAG 596cb3ce71038958812bd6cf9b141f12ce155ac6 # Workaround until Matio 1.5.18 v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= BUILD_COMMAND ${MATIO_MAKE_PROGRAM} BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX} ) @@ -1971,7 +1997,7 @@ if(NOT PUGIXML_FOUND) PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} CMAKE_ARGS ${PUGIXML_COMPILER} ${PUGIXML_CMAKE_FLAGS} @@ -1989,7 +2015,7 @@ if(NOT PUGIXML_FOUND) PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} CMAKE_ARGS ${PUGIXML_COMPILER} ${PUGIXML_CMAKE_FLAGS} @@ -2005,7 +2031,7 @@ if(NOT PUGIXML_FOUND) set(PUGIXML_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) if(NOT TARGET Pugixml::pugixml) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) add_library(Pugixml::pugixml STATIC IMPORTED) add_dependencies(Pugixml::pugixml pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) set_target_properties(Pugixml::pugixml PROPERTIES @@ -2021,7 +2047,7 @@ if(NOT PUGIXML_FOUND) IMPORTED_LOCATION_RELEASE ${PUGIXML_LIBRARIES} IMPORTED_LOCATION_RELWITHDEBINFO ${PUGIXML_LIBRARIES} IMPORTED_LOCATION_MINSIZEREL ${PUGIXML_LIBRARIES} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src INTERFACE_LINK_LIBRARIES ${PUGIXML_LIBRARIES} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -2139,10 +2165,10 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} --host=$ENV{OECORE_TARGET_ARCH} --with-protoc=${PROTOC_EXECUTABLE}" + UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND "${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} --host=$ENV{OECORE_TARGET_ARCH} --with-protoc=${PROTOC_EXECUTABLE}" BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} @@ -2226,10 +2252,10 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} install ) @@ -2238,10 +2264,10 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} install BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} diff --git a/README.md b/README.md index 2d129c1f9..12ef6a8a7 100644 --- a/README.md +++ b/README.md @@ -519,20 +519,29 @@ the function to execute. It mimics GNU Radio's [VOLK](https://www.libvolk.org/) library, so if you still have not run `volk_profile`, this is a good moment to do so. -If you are using Eclipse as your development environment, CMake can create the -project for you. Type: +If you are using [Eclipse](https://www.eclipse.org/ide/) as your development +environment, CMake can create the project for you. However, if the build +directory is a subdirectory of the source directory (as is the case of the +`gnss-sdr/build` folder), this is not supported well by Eclipse. It is strongly +recommended to use a build directory which is a sibling of the source directory. +Hence, type from the `gnss-sdr` root folder: ``` -$ cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_ECLIPSE_VERSION=4.5 . +$ cd .. +$ mkdir eclipse && cd eclipse +$ cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_ECLIPSE_VERSION=4.5 ../gnss-sdr ``` -and then import the created project file into Eclipse: +and then import the created project into Eclipse: 1. Import project using Menu File -> Import. 2. Select General -> Existing projects into workspace. -3. Browse where your build tree is and select the root build tree directory. - Keep "Copy projects into workspace" unchecked. -4. You get a fully functional Eclipse project. +3. Select your root directory: Browse and select your newly created `eclipse/` + directory. Keep "Copy projects into workspace" unchecked. +4. Click on "Finish" and you will get a fully functional Eclipse project. + +After building the project, you will find the generated binaries at +`eclipse/install`. ###### Build GN3S V2 Custom firmware and driver (OPTIONAL): diff --git a/docs/changelog.md b/docs/changelog.md index 16017e0fc..da4f96ce5 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -50,6 +50,14 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades - int main() - { std::put_time(nullptr, \"\"); }" - has_put_time -) if(${has_put_time}) target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_PUT_TIME=1) endif() diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index e763155a3..e43666196 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -87,7 +87,7 @@ endif() add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${LOCAL_INSTALL_BASE_DIR}/install/$ ) install(TARGETS gnss-sdr diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 1115892b1..c3dc43cf6 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -41,7 +41,7 @@ if(NOT GOOGLETEST_FOUND) ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest GIT_TAG v1.10.x - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF @@ -69,7 +69,7 @@ if(NOT GOOGLETEST_FOUND) ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest GIT_TAG v1.10.x - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF @@ -87,7 +87,7 @@ if(NOT GOOGLETEST_FOUND) ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) if(NOT TARGET GTest::GTest) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include) add_library(GTest::GTest STATIC IMPORTED) add_dependencies(GTest::GTest gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) set_target_properties(GTest::GTest PROPERTIES @@ -103,7 +103,7 @@ if(NOT GOOGLETEST_FOUND) IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/gtest$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -135,7 +135,7 @@ if(NOT GOOGLETEST_FOUND) IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -288,7 +288,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ExternalProject_Add(gnss-sim GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} BUILD_COMMAND ${GNSS_SIM_BUILD_COMMAND} @@ -298,8 +298,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ) if(ENABLE_INSTALL_TESTS) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) + install(FILES ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) + install(FILES ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") @@ -310,8 +310,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/${CMAKE_BUILD_TYPE}/gnss_sim) endif() add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") + add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/circle.csv") endif() endif() @@ -340,9 +340,9 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON BUILD_COMMAND ${GPSTK_BUILD_COMMAND} UPDATE_COMMAND "" PATCH_COMMAND "" @@ -351,18 +351,18 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON BUILD_COMMAND ${GPSTK_BUILD_COMMAND} - BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" ) endif() - set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) + set(GPSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") + set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_BINDIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") add_library(Gpstk::gpstk SHARED IMPORTED) add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) @@ -384,40 +384,40 @@ endif() if(ENABLE_UNIT_TESTING_EXTRA) add_definitions(-DEXTRA_TESTS) message(STATUS "Downloading some data files for testing...") - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) + if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) message(STATUS "Downloading file: gps_l2c_m_prn7_5msps.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat SHOW_PROGRESS EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9 ) endif() - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) + if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) message(STATUS "Downloading file: Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a ) endif() - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat) + if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat) message(STATUS "Downloading file: BdsB1IStr01_fs25e6_if0_4ms.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB1IStr01_fs25e6_if0_4ms.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB1IStr01_fs25e6_if0_4ms.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=5a4336dad9d80f3313a16dec4fff9233 ) endif() - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat) + if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat) message(STATUS "Downloading file: BdsB3IStr01_fs50e6_if0_4ms.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB3IStr01_fs50e6_if0_4ms.dat ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB3IStr01_fs50e6_if0_4ms.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=066d0d8434a8bc81e161778b7c34cc07 ) endif() message(STATUS "Done.") if(ENABLE_INSTALL_TESTS) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) endif() endif() @@ -430,13 +430,13 @@ if(ENABLE_INSTALL_TESTS) install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) add_definitions(-DTEST_PATH="${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/") else() - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_SOURCE_DIR}/thirdparty/data/rtklib_test) - add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/thirdparty/") + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/data/rtklib_test) + file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/data/rtklib_test) + add_definitions(-DTEST_PATH="${CMAKE_BINARY_DIR}/thirdparty/") endif() set(LIST_INCLUDE_DIRS @@ -511,14 +511,14 @@ if(ENABLE_UNIT_TESTING) set_target_properties(run_tests PROPERTIES LINK_FLAGS "-s") endif() if(ENABLE_INSTALL_TESTS) - if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/run_tests) + if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/run_tests) + file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/run_tests) endif() install(TARGETS run_tests RUNTIME DESTINATION bin COMPONENT "run_tests") else() add_custom_command(TARGET run_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${LOCAL_INSTALL_BASE_DIR}/install/$ ) endif() if(ENABLE_GPERFTOOLS) @@ -629,7 +629,7 @@ function(add_system_test executable) endif() set(SYSTEM_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/${executable}.cc) # Ensure that executable is rebuilt if it was previously built and then removed - if(NOT EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) + if(NOT EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/${executable}) execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES}) endif() if(CMAKE_VERSION VERSION_GREATER 3.13) @@ -661,14 +661,14 @@ function(add_system_test executable) endif() if(ENABLE_INSTALL_TESTS) - if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/${executable}) + if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/${executable}) + file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/${executable}) endif() install(TARGETS ${executable} RUNTIME DESTINATION bin COMPONENT "${executable}_test") else() add_custom_command(TARGET ${executable} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${LOCAL_INSTALL_BASE_DIR}/install/$ ) endif() if(ENABLE_CLANG_TIDY) @@ -722,17 +722,17 @@ if(ENABLE_SYSTEM_TESTING) endif() else() # Avoid working with old executables if they were switched ON and then OFF - if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) + if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/position_test) + file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/position_test) endif() endif() else() # Avoid working with old executables if they were switched ON and then OFF - if(EXISTS ${CMAKE_SOURCE_DIR}/install/ttff) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/ttff) + if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/ttff) + file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/ttff) endif() - if(EXISTS ${CMAKE_SOURCE_DIR}/install/position_test) - file(REMOVE ${CMAKE_SOURCE_DIR}/install/position_test) + if(EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/position_test) + file(REMOVE ${LOCAL_INSTALL_BASE_DIR}/install/position_test) endif() endif() diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 5507abc2f..3f87f1c37 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -122,7 +122,7 @@ endif() add_custom_command(TARGET front-end-cal POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$) + ${LOCAL_INSTALL_BASE_DIR}/install/$) install(TARGETS front-end-cal RUNTIME DESTINATION bin diff --git a/src/utils/rinex-tools/CMakeLists.txt b/src/utils/rinex-tools/CMakeLists.txt index 440471de1..1fcad7dd5 100644 --- a/src/utils/rinex-tools/CMakeLists.txt +++ b/src/utils/rinex-tools/CMakeLists.txt @@ -12,8 +12,8 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) + set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() if(CMAKE_VERSION VERSION_GREATER 3.13) @@ -78,7 +78,7 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND add_custom_command(TARGET obsdiff POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${LOCAL_INSTALL_BASE_DIR}/install/$ ) install(TARGETS obsdiff diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 1995e4ef5..84ea001d6 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -10,8 +10,8 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) + set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() @@ -103,7 +103,7 @@ if(Boost_FOUND) add_custom_command(TARGET rinex2assist POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ - ${CMAKE_SOURCE_DIR}/install/$ + ${LOCAL_INSTALL_BASE_DIR}/install/$ ) install(TARGETS rinex2assist From c2c701d8859c5ce2f7e2bcaf938002521021d944 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 12 Jun 2020 22:33:00 +0200 Subject: [PATCH 30/54] Fix warning in CMake < 3.13 --- src/core/libs/supl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 6c60a699f..3c85e7276 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -25,7 +25,7 @@ endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") -if(CMAKE_VERSION VERSION_GREATER 3.1) +if(CMAKE_VERSION VERSION_GREATER 3.13) add_library(core_libs_supl STATIC) target_sources(core_libs_supl PRIVATE From 226689c3595f06db07fe6b7d5ab7947c664db66f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 12 Jun 2020 22:47:35 +0200 Subject: [PATCH 31/54] Use target_compile_options instead of CMAKE_C_FLAGS --- src/core/libs/supl/CMakeLists.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 3c85e7276..151d86cba 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -16,15 +16,6 @@ list(SORT ASN_SUPL_SOURCES) file(GLOB ASN_SUPL_HEADERS "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl/*.h") list(SORT ASN_SUPL_HEADERS) -set(MY_C_FLAGS "") -if(CMAKE_C_COMPILER_ID MATCHES "Clang") - if(CMAKE_BUILD_TYPE MATCHES "Release") - set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") - endif() -endif() - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") - if(CMAKE_VERSION VERSION_GREATER 3.13) add_library(core_libs_supl STATIC) target_sources(core_libs_supl @@ -46,6 +37,13 @@ else() ) endif() +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + if(CMAKE_BUILD_TYPE MATCHES "Release") + set(MY_C_FLAGS -Wno-parentheses-equality) + target_compile_options(core_libs_supl PUBLIC $<$:${MY_C_FLAGS}>) + endif() +endif() + if(OPENSSL_FOUND) target_compile_definitions(core_libs_supl PUBLIC -DUSE_OPENSSL_FALLBACK=1) endif() From 0df4277d3625b024600ff5c2fa856e683755cd88 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 00:32:40 +0200 Subject: [PATCH 32/54] Unify criteria in target definitions, more informative names --- CMakeLists.txt | 26 ++++++++++++- src/algorithms/PVT/adapters/CMakeLists.txt | 9 +++-- src/algorithms/PVT/adapters/rtklib_pvt.cc | 2 +- .../PVT/gnuradio_blocks/CMakeLists.txt | 19 ++++++---- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 4 +- src/algorithms/PVT/libs/CMakeLists.txt | 6 +-- .../PVT/libs/monitor_pvt_udp_sink.h | 2 +- src/algorithms/PVT/libs/rtcm.h | 2 +- .../acquisition/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../acquisition/libs/CMakeLists.txt | 2 +- .../channel/adapters/CMakeLists.txt | 2 +- src/algorithms/channel/libs/CMakeLists.txt | 8 ++-- .../channel/libs/channel_msg_receiver_cc.cc | 2 +- .../conditioner/adapters/CMakeLists.txt | 2 +- .../data_type_adapter/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../input_filter/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 2 +- src/algorithms/libs/CMakeLists.txt | 4 +- src/algorithms/libs/rtklib/CMakeLists.txt | 2 +- .../observables/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 8 ++-- .../gnuradio_blocks/hybrid_observables_gs.cc | 2 +- .../observables/libs/CMakeLists.txt | 2 +- .../resampler/adapters/CMakeLists.txt | 2 +- .../resampler/gnuradio_blocks/CMakeLists.txt | 2 +- .../signal_generator/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../signal_source/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 12 +++--- .../rtl_tcp_signal_source_c.cc | 4 +- .../gnuradio_blocks/rtl_tcp_signal_source_c.h | 2 +- .../signal_source/libs/CMakeLists.txt | 2 +- .../telemetry_decoder/adapters/CMakeLists.txt | 2 +- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../telemetry_decoder/libs/CMakeLists.txt | 2 +- .../libs/libswiftcnav/CMakeLists.txt | 2 +- .../tracking/adapters/CMakeLists.txt | 2 +- .../tracking/gnuradio_blocks/CMakeLists.txt | 8 ++-- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 2 +- .../dll_pll_veml_tracking_fpga.cc | 2 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- ...glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- ...glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- src/algorithms/tracking/libs/CMakeLists.txt | 6 +-- .../tracking/libs/tcp_communication.h | 2 +- src/core/libs/CMakeLists.txt | 8 ++-- src/core/libs/channel_status_msg_receiver.cc | 2 +- src/core/libs/supl/CMakeLists.txt | 2 +- src/core/monitor/CMakeLists.txt | 6 +-- src/core/monitor/gnss_synchro_udp_sink.h | 2 +- src/core/receiver/CMakeLists.txt | 6 +-- src/core/receiver/tcp_cmd_interface.cc | 2 +- src/core/system_parameters/CMakeLists.txt | 2 +- src/main/CMakeLists.txt | 2 +- src/tests/CMakeLists.txt | 38 +++++++++---------- src/tests/system-tests/libs/CMakeLists.txt | 2 +- .../acquisition/acq_performance_test.cc | 2 +- .../beidou_b1i_pcps_acquisition_test.cc | 2 +- .../beidou_b3i_pcps_acquisition_test.cc | 2 +- ...8ms_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...cps_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...e1_pcps_ambiguous_acquisition_gsoc_test.cc | 2 +- ...ileo_e1_pcps_ambiguous_acquisition_test.cc | 2 +- ...wsr_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...ync_ambiguous_acquisition_gsoc2014_test.cc | 2 +- ...ong_ambiguous_acquisition_gsoc2013_test.cc | 2 +- ...cps_acquisition_gsoc2014_gensource_test.cc | 2 +- ...ss_l1_ca_pcps_acquisition_gsoc2017_test.cc | 2 +- .../glonass_l1_ca_pcps_acquisition_test.cc | 2 +- .../glonass_l2_ca_pcps_acquisition_test.cc | 2 +- ...ps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 2 +- .../gps_l1_ca_pcps_acquisition_test.cc | 2 +- ...a_pcps_opencl_acquisition_gsoc2013_test.cc | 2 +- ...cps_quicksync_acquisition_gsoc2014_test.cc | 2 +- ..._ca_pcps_tong_acquisition_gsoc2013_test.cc | 2 +- .../gps_l2_m_pcps_acquisition_test.cc | 2 +- .../libs/CMakeLists.txt | 8 ++-- .../libs/acquisition_msg_rx.cc | 2 +- .../observables/hybrid_observables_test.cc | 4 +- .../hybrid_observables_test_fpga.cc | 2 +- .../gps_l1_ca_telemetry_decoder_test.cc | 2 +- ...onass_l1_ca_dll_pll_c_aid_tracking_test.cc | 2 +- .../glonass_l1_ca_dll_pll_tracking_test.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_test.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_test_fpga.cc | 2 +- .../tracking/gps_l1_ca_kf_tracking_test.cc | 2 +- .../gps_l2_m_dll_pll_tracking_test.cc | 2 +- .../tracking/tracking_pull-in_test.cc | 2 +- .../tracking/tracking_pull-in_test_fpga.cc | 2 +- src/utils/front-end-cal/CMakeLists.txt | 10 ++--- src/utils/front-end-cal/main.cc | 2 +- src/utils/rinex-tools/CMakeLists.txt | 2 +- src/utils/rinex2assist/CMakeLists.txt | 2 +- 96 files changed, 189 insertions(+), 159 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b912897de..459ce4d46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,6 +264,18 @@ else() set(LOCAL_INSTALL_BASE_DIR ${CMAKE_BINARY_DIR}) endif() +# Determine if CMake scripts make use of target_sources() +if(CMAKE_VERSION VERSION_GREATER 3.13) + set(USE_CMAKE_TARGET_SOURCES ON) +endif() + +# Determine if we try to use generic lambdas +if(CMAKE_VERSION VERSION_GREATER 3.1 AND + NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND + (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) + set(USE_GENERIC_LAMBDAS ON) +endif() + # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") @@ -747,6 +759,14 @@ if(Boost_VERSION_STRING VERSION_GREATER 1.70.99) endif() endif() +if(Boost_VERSION_STRING VERSION_LESS 1.58.0) + set(USE_OLD_BOOST_MATH_COMMON_FACTOR ON) +endif() + +if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) + set(USE_BOOST_ASIO_IO_CONTEXT ON) +endif() + if(Boost_VERSION_STRING VERSION_LESS 1.73) # Disable concepts to address https://github.com/boostorg/asio/issues/312 if(((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9) OR @@ -778,6 +798,11 @@ if(Boost_VERSION_STRING VERSION_LESS 1.70.0) ) endif() +# Fix for Boost >= 1.73 +if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) + set(USE_BOOST_BIND_PLACEHOLDERS ON) +endif() + ################################################################################ @@ -797,7 +822,6 @@ check_cxx_source_compiles(" ################################################################################ # Detect availability of std::put_time (Workaround for gcc < 5.0) ################################################################################ -include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #include int main() diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 2f0cf3f84..620dc6e7d 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -8,7 +8,7 @@ # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(pvt_adapters STATIC) target_sources(pvt_adapters PRIVATE @@ -35,8 +35,11 @@ target_include_directories(pvt_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) -if(Boost_VERSION_STRING VERSION_LESS 1.58.0) - target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1) +if(USE_OLD_BOOST_MATH_COMMON_FACTOR) + target_compile_definitions(pvt_adapters + PRIVATE + -DUSE_OLD_BOOST_MATH_COMMON_FACTOR=1 + ) endif() if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 59be524cb..96827272a 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -30,7 +30,7 @@ #include "rtklib_rtkpos.h" // for rtkfree, rtkinit #include // for LOG #include // for operator<< -#if OLD_BOOST +#if USE_OLD_BOOST_MATH_COMMON_FACTOR #include namespace bc = boost::math; #else diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index d5cb9dabc..87fb80cd9 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(pvt_gr_blocks STATIC) target_sources(pvt_gr_blocks PRIVATE @@ -49,7 +49,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(pvt_gr_blocks @@ -73,14 +73,17 @@ if(ENABLE_CLANG_TIDY) endif() endif() -if(Boost_VERSION_STRING VERSION_LESS 1.58.0) - target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1) -endif() - -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_OLD_BOOST_MATH_COMMON_FACTOR) target_compile_definitions(pvt_gr_blocks PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_OLD_BOOST_MATH_COMMON_FACTOR=1 + ) +endif() + +if(USE_BOOST_BIND_PLACEHOLDERS) + target_compile_definitions(pvt_gr_blocks + PRIVATE + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 77f2bef56..13c69ad4e 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -96,7 +96,7 @@ namespace fs = boost::filesystem; namespace errorlib = boost::system; #endif -#if OLD_BOOST +#if USE_OLD_BOOST_MATH_COMMON_FACTOR #include namespace bc = boost::math; #else @@ -194,7 +194,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_telemetry(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, boost::placeholders::_1)); #else boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, _1)); diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index fdaf03804..4daa5f6f0 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -46,7 +46,7 @@ set(PVT_LIB_HEADERS list(SORT PVT_LIB_HEADERS) list(SORT PVT_LIB_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(pvt_libs STATIC) target_sources(pvt_libs PRIVATE @@ -101,10 +101,10 @@ if(ENABLE_ARMA_NO_DEBUG) ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) +if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(pvt_libs PUBLIC - -DBOOST_GREATER_1_65 + -DUSE_BOOST_ASIO_IO_CONTEXT ) endif() diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h index 297b140ec..bbecda420 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -28,7 +28,7 @@ #include #include -#if BOOST_GREATER_1_65 +#if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; #else using b_io_context = boost::asio::io_service; diff --git a/src/algorithms/PVT/libs/rtcm.h b/src/algorithms/PVT/libs/rtcm.h index d90fd90b4..d5acace77 100644 --- a/src/algorithms/PVT/libs/rtcm.h +++ b/src/algorithms/PVT/libs/rtcm.h @@ -49,7 +49,7 @@ #include #include -#if BOOST_GREATER_1_65 +#if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; #else using b_io_context = boost::asio::io_service; diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index b2747381d..fc0fc4477 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -80,7 +80,7 @@ endif() list(SORT ACQ_ADAPTER_HEADERS) list(SORT ACQ_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(acquisition_adapters STATIC) target_sources(acquisition_adapters PRIVATE diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 6dc51cf5a..f414fbcf3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -43,7 +43,7 @@ endif() list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(acquisition_gr_blocks STATIC) target_sources(acquisition_gr_blocks PRIVATE diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 0d766d601..d96efdcd7 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -18,7 +18,7 @@ endif() list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(acquisition_libs STATIC) target_sources(acquisition_libs PRIVATE diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index 39a7993c7..774607f67 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(channel_adapters STATIC) target_sources(channel_adapters PRIVATE diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 5be88b305..4e933a3c3 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -20,7 +20,7 @@ set(CHANNEL_FSM_HEADERS list(SORT CHANNEL_FSM_HEADERS) list(SORT CHANNEL_FSM_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(channel_libs STATIC) target_sources(channel_libs PRIVATE @@ -56,7 +56,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(channel_libs @@ -71,10 +71,10 @@ else() ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(channel_libs PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index b168a4575..58da05f2c 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -44,7 +44,7 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr cha #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1)); diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index 80c580960..f1f3509a6 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -21,7 +21,7 @@ set(COND_ADAPTER_HEADERS list(SORT COND_ADAPTER_HEADERS) list(SORT COND_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(conditioner_adapters STATIC) target_sources(conditioner_adapters PRIVATE diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index ebb2a094f..e1a94d151 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -29,7 +29,7 @@ set(DATATYPE_ADAPTER_HEADERS list(SORT DATATYPE_ADAPTER_HEADERS) list(SORT DATATYPE_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(data_type_adapters STATIC) target_sources(data_type_adapters PRIVATE diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 0297eee3d..495a9bcd4 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -23,7 +23,7 @@ set(DATA_TYPE_GR_BLOCKS_HEADERS list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(data_type_gr_blocks STATIC) target_sources(data_type_gr_blocks PRIVATE diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index f27169b04..39025e4d5 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -28,7 +28,7 @@ set(INPUT_FILTER_ADAPTER_HEADERS list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(input_filter_adapters STATIC) target_sources(input_filter_adapters PRIVATE diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 1105e6e98..46ed867d2 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -25,7 +25,7 @@ set(INPUT_FILTER_GR_BLOCKS_HEADERS list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(input_filter_gr_blocks STATIC) target_sources(input_filter_gr_blocks PRIVATE diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 4b57638f6..a39884468 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -71,7 +71,7 @@ endif() list(SORT GNSS_SPLIBS_HEADERS) list(SORT GNSS_SPLIBS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(algorithms_libs STATIC) target_sources(algorithms_libs PRIVATE @@ -189,7 +189,7 @@ endif() ############################################################################### -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(gnss_sdr_flags STATIC) target_sources(gnss_sdr_flags PRIVATE diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index d9e9491f8..ed59fe391 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -52,7 +52,7 @@ set(RTKLIB_LIB_HEADERS list(SORT RTKLIB_LIB_HEADERS) list(SORT RTKLIB_LIB_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(algorithms_libs_rtklib STATIC) target_sources(algorithms_libs_rtklib PRIVATE diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index d1dec4961..41323820d 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(obs_adapters STATIC) target_sources(obs_adapters PRIVATE diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index ca76de937..e29a4788d 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(obs_gr_blocks STATIC) target_sources(obs_gr_blocks PRIVATE @@ -54,7 +54,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(obs_gr_blocks @@ -69,10 +69,10 @@ else() ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(obs_gr_blocks PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index cbd9569ca..b0dcf280f 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -76,7 +76,7 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_) : gr::block( #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_pvt_to_observables(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&hybrid_observables_gs::msg_handler_pvt_to_observables, this, boost::placeholders::_1)); #else boost::bind(&hybrid_observables_gs::msg_handler_pvt_to_observables, this, _1)); diff --git a/src/algorithms/observables/libs/CMakeLists.txt b/src/algorithms/observables/libs/CMakeLists.txt index 319620d74..c44657385 100644 --- a/src/algorithms/observables/libs/CMakeLists.txt +++ b/src/algorithms/observables/libs/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(observables_libs STATIC) target_sources(observables_libs PRIVATE diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 4865dd107..51a42a49b 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -21,7 +21,7 @@ set(RESAMPLER_ADAPTER_HEADERS list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(resampler_adapters STATIC) target_sources(resampler_adapters PRIVATE diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 9b4e7473c..3524ba4fa 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -23,7 +23,7 @@ set(RESAMPLER_GR_BLOCKS_HEADERS list(SORT RESAMPLER_GR_BLOCKS_HEADERS) list(SORT RESAMPLER_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(resampler_gr_blocks STATIC) target_sources(resampler_gr_blocks PRIVATE diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index 7c07bfe47..69dc589c0 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(signal_generator_adapters STATIC) target_sources(signal_generator_adapters PRIVATE diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index bd81a3d3c..4da329d81 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(signal_generator_gr_blocks STATIC) target_sources(signal_generator_gr_blocks PRIVATE diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index c49ae30cf..c007652cc 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -125,7 +125,7 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(signal_source_adapters STATIC) target_sources(signal_source_adapters PRIVATE diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index d1bf439a5..185768fd2 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -43,7 +43,7 @@ set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(signal_source_gr_blocks STATIC) target_sources(signal_source_gr_blocks PRIVATE @@ -104,21 +104,21 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) +if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(signal_source_gr_blocks PUBLIC - -DBOOST_GREATER_1_65 + -DUSE_BOOST_ASIO_IO_CONTEXT ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(signal_source_gr_blocks PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(signal_source_gr_blocks diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index c94c0195a..d3485f525 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -134,7 +134,7 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, } // 6. Start reading -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); // NOLINT(modernize-avoid-bind) #else @@ -319,7 +319,7 @@ void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, // let woker know that more data is available not_empty_.notify_one(); // Read some more -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::asio::async_read(socket_, boost::asio::buffer(data_), boost::bind(&rtl_tcp_signal_source_c::handle_read, this, boost::placeholders::_1, boost::placeholders::_2)); // NOLINT(modernize-avoid-bind) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index f730c1ba8..ee33591f6 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -51,7 +51,7 @@ using rtl_tcp_signal_source_c_sptr = std::shared_ptr; using rtl_tcp_signal_source_c_sptr = boost::shared_ptr; #endif -#if BOOST_GREATER_1_65 +#if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; #else using b_io_context = boost::asio::io_service; diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index c9aa09e94..4678b83d8 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -36,7 +36,7 @@ set(SIGNAL_SOURCE_LIB_HEADERS list(SORT SIGNAL_SOURCE_LIB_HEADERS) list(SORT SIGNAL_SOURCE_LIB_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(signal_source_libs STATIC) target_sources(signal_source_libs PRIVATE diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index ca74329ed..b3361d57c 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -37,7 +37,7 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(telemetry_decoder_adapters STATIC) target_sources(telemetry_decoder_adapters PRIVATE diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 7ffbfa98e..4a2403a36 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -34,7 +34,7 @@ set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) list(SORT TELEMETRY_DECODER_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(telemetry_decoder_gr_blocks STATIC) target_sources(telemetry_decoder_gr_blocks PRIVATE diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 5e5f3eb37..70b35b8fa 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -22,7 +22,7 @@ set(TELEMETRY_DECODER_LIB_HEADERS list(SORT TELEMETRY_DECODER_LIB_HEADERS) list(SORT TELEMETRY_DECODER_LIB_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(telemetry_decoder_libs STATIC) target_sources(telemetry_decoder_libs PRIVATE diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index 41456f235..33725d274 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -25,7 +25,7 @@ set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(telemetry_decoder_libswiftcnav STATIC) target_sources(telemetry_decoder_libswiftcnav PRIVATE diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index e8c40d1b4..f19e66baa 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -76,7 +76,7 @@ set(TRACKING_ADAPTER_HEADERS list(SORT TRACKING_ADAPTER_HEADERS) list(SORT TRACKING_ADAPTER_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(tracking_adapters STATIC) target_sources(tracking_adapters PRIVATE diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index bf49f2841..45e24a6f2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -61,7 +61,7 @@ set(TRACKING_GR_BLOCKS_HEADERS list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(tracking_gr_blocks STATIC) target_sources(tracking_gr_blocks PRIVATE @@ -120,7 +120,7 @@ if(ENABLE_ARMA_NO_DEBUG) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(tracking_gr_blocks @@ -135,10 +135,10 @@ else() ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(tracking_gr_blocks PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 4e1a00b44..3573a25fe 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -101,7 +101,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_telemetry_to_trk(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&dll_pll_veml_tracking::msg_handler_telemetry_to_trk, this, boost::placeholders::_1)); #else boost::bind(&dll_pll_veml_tracking::msg_handler_telemetry_to_trk, this, _1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index bb594b604..3552dd3be 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -91,7 +91,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_telemetry_to_trk(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk, this, boost::placeholders::_1)); #else boost::bind(&dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk, this, _1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index e93b12164..0379df914 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -115,7 +115,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, boost::placeholders::_1)); #else boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 0548192d5..35b12f51b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -112,7 +112,7 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, boost::placeholders::_1)); #else boost::bind(&glonass_l1_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, _1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 8bf9acdb8..1b6ec0a27 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -112,7 +112,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&glonass_l2_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, boost::placeholders::_1)); #else boost::bind(&glonass_l2_ca_dll_pll_c_aid_tracking_cc::msg_handler_preamble_index, this, _1)); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 3bb646ce4..2449bb26b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -110,7 +110,7 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_preamble_index(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&glonass_l2_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, boost::placeholders::_1)); #else boost::bind(&glonass_l2_ca_dll_pll_c_aid_tracking_sc::msg_handler_preamble_index, this, _1)); diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index a92c0f714..2f9128a38 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -73,7 +73,7 @@ endif() list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(tracking_libs STATIC) target_sources(tracking_libs PRIVATE @@ -111,10 +111,10 @@ if(NOT CMAKE_VERSION VERSION_GREATER 3.11) ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) +if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(tracking_libs PUBLIC - -DBOOST_GREATER_1_65 + -DUSE_BOOST_ASIO_IO_CONTEXT ) endif() diff --git a/src/algorithms/tracking/libs/tcp_communication.h b/src/algorithms/tracking/libs/tcp_communication.h index 55d56e5c8..0d789fa65 100644 --- a/src/algorithms/tracking/libs/tcp_communication.h +++ b/src/algorithms/tracking/libs/tcp_communication.h @@ -25,7 +25,7 @@ #include #include -#if BOOST_GREATER_1_65 +#if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; #else using b_io_context = boost::asio::io_service; diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index dd80ee92c..933654aa8 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -47,7 +47,7 @@ endif() list(SORT CORE_LIBS_HEADERS) list(SORT CORE_LIBS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(core_libs STATIC) target_sources(core_libs PRIVATE @@ -80,7 +80,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(core_libs @@ -95,10 +95,10 @@ else() ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(core_libs PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/core/libs/channel_status_msg_receiver.cc b/src/core/libs/channel_status_msg_receiver.cc index ba8e61ba0..63afb7172 100644 --- a/src/core/libs/channel_status_msg_receiver.cc +++ b/src/core/libs/channel_status_msg_receiver.cc @@ -45,7 +45,7 @@ channel_status_msg_receiver::channel_status_msg_receiver() : gr::block("channel_ #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&channel_status_msg_receiver::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&channel_status_msg_receiver::msg_handler_events, this, _1)); diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index 151d86cba..61e33df0e 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -16,7 +16,7 @@ list(SORT ASN_SUPL_SOURCES) file(GLOB ASN_SUPL_HEADERS "${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl/*.h") list(SORT ASN_SUPL_HEADERS) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(core_libs_supl STATIC) target_sources(core_libs_supl PRIVATE diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 650ca63fb..02d73304f 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -23,7 +23,7 @@ set(CORE_MONITOR_LIBS_HEADERS list(SORT CORE_MONITOR_LIBS_HEADERS) list(SORT CORE_MONITOR_LIBS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(core_monitor STATIC) target_sources(core_monitor PRIVATE @@ -68,10 +68,10 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) +if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(core_monitor PUBLIC - -DBOOST_GREATER_1_65 + -DUSE_BOOST_ASIO_IO_CONTEXT ) endif() diff --git a/src/core/monitor/gnss_synchro_udp_sink.h b/src/core/monitor/gnss_synchro_udp_sink.h index 379977586..7944849fc 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.h +++ b/src/core/monitor/gnss_synchro_udp_sink.h @@ -29,7 +29,7 @@ #include #include -#if BOOST_GREATER_1_65 +#if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; #else using b_io_context = boost::asio::io_service; diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 108185ac1..2c123336f 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -44,7 +44,7 @@ set(GNSS_RECEIVER_INTERFACE_HEADERS list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(core_receiver STATIC) target_sources(core_receiver PRIVATE @@ -126,10 +126,10 @@ if(ENABLE_CUDA) target_compile_definitions(core_receiver PRIVATE -DCUDA_GPU_ACCEL=1) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) +if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(core_receiver PRIVATE - -DBOOST_GREATER_1_65 + -DUSE_BOOST_ASIO_IO_CONTEXT ) endif() diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 5355c2d8f..98ae522f3 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -28,7 +28,7 @@ #include // for stringstream #include // for move -#if BOOST_GREATER_1_65 +#if USE_BOOST_ASIO_IO_CONTEXT using b_io_context = boost::asio::io_context; #else using b_io_context = boost::asio::io_service; diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index e4e8e586a..392fd47f0 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -83,7 +83,7 @@ set(SYSTEM_PARAMETERS_HEADERS list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(core_system_parameters STATIC) target_sources(core_system_parameters PRIVATE diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index e43666196..575494c3a 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_executable(gnss-sdr) target_sources(gnss-sdr PRIVATE main.cc) else() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index c3dc43cf6..7ced3a1af 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -449,7 +449,7 @@ include_directories(${LIST_INCLUDE_DIRS}) # Unit testing ################################################################################ if(ENABLE_UNIT_TESTING) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(run_tests) target_sources(run_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) else() @@ -547,7 +547,7 @@ if(ENABLE_UNIT_TESTING) ${CUDA_INCLUDE_DIRS} ) endif() - if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) + if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(run_tests @@ -561,10 +561,10 @@ if(ENABLE_UNIT_TESTING) -DHAS_GENERIC_LAMBDA=0 ) endif() - if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) + if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(run_tests PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() endif() @@ -574,7 +574,7 @@ if(ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(gps_l1_ca_dll_pll_tracking_test_fpga) target_sources(gps_l1_ca_dll_pll_tracking_test_fpga PRIVATE ${GPS_L1_CA_DLL_PLL_TRACKING_TEST_FPGA_SOURCES}) else() @@ -632,7 +632,7 @@ function(add_system_test executable) if(NOT EXISTS ${LOCAL_INSTALL_BASE_DIR}/install/${executable}) execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${SYSTEM_TEST_SOURCES}) endif() - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(${executable}) target_sources(${executable} PRIVATE ${SYSTEM_TEST_SOURCES}) else() @@ -748,7 +748,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(flowgraph_test) target_sources(flowgraph_test PRIVATE ${FLOWGRAPH_TEST_SOURCES}) else() @@ -803,7 +803,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(gnss_block_test) target_sources(gnss_block_test PRIVATE ${GNSS_BLOCK_TEST_SOURCES}) else() @@ -856,7 +856,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(gnuradio_block_test) target_sources(gnuradio_block_test PRIVATE ${GNURADIO_BLOCK_TEST_SOURCES}) else() @@ -900,7 +900,7 @@ set(MATIO_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc ) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_executable(matio_test) target_sources(matio_test PRIVATE ${MATIO_TEST_SOURCES}) else() @@ -938,7 +938,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(acq_test) target_sources(acq_test PRIVATE ${ACQ_TEST_SOURCES}) else() @@ -973,7 +973,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) add_test(acq_test acq_test) - if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) + if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(acq_test @@ -987,10 +987,10 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) -DHAS_GENERIC_LAMBDA=0 ) endif() - if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) + if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(acq_test PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() set_property(TEST acq_test PROPERTY TIMEOUT 30) @@ -1014,7 +1014,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc ${NONLINEAR_SOURCES} ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(trk_test) target_sources(trk_test PRIVATE ${TRKTEST_SOURCES}) else() @@ -1049,7 +1049,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) signal_generator_gr_blocks core_receiver ) - if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) + if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(trk_test @@ -1063,10 +1063,10 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) -DHAS_GENERIC_LAMBDA=0 ) endif() - if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) + if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(trk_test PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() @@ -1082,7 +1082,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ) - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(control_thread_test) target_sources(control_thread_test PRIVATE ${CONTROL_THREAD_TEST_SOURCES}) else() diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 3db9dca38..8f7033e0d 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -16,7 +16,7 @@ set(SYSTEM_TESTING_LIB_SOURCES file(GLOB SYSTEM_TESTING_LIB_HEADERS "*.h") list(SORT SYSTEM_TESTING_LIB_HEADERS) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(system_testing_lib STATIC) target_sources(system_testing_lib PRIVATE diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index 75c8760b9..e5a8bbc8e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -161,7 +161,7 @@ AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(Concurrent_Queue& queue) : gr::block #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&AcqPerfTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&AcqPerfTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index fd20afc78..e673da15b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -114,7 +114,7 @@ BeidouB1iPcpsAcquisitionTest_msg_rx::BeidouB1iPcpsAcquisitionTest_msg_rx() : gr: #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index f14dfdddd..f25bcd583 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -114,7 +114,7 @@ BeidouB3iPcpsAcquisitionTest_msg_rx::BeidouB3iPcpsAcquisitionTest_msg_rx() : gr: #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index 884509345..77db3ad53 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -107,7 +107,7 @@ GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguo #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index d86af8e3c..b5fd9a326 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -105,7 +105,7 @@ GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcqu #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index cefa11014..50a5087b3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -114,7 +114,7 @@ GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisit #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 50bc63946..182b61f82 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -126,7 +126,7 @@ GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionT #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index 8a39cfa36..983b64bb5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -108,7 +108,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguous #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 06ae77566..574fb1d62 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -110,7 +110,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuic #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 2601bb252..958a7e077 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -105,7 +105,7 @@ GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbig #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index e1b742f36..93d176472 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -101,7 +101,7 @@ GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisition #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 5c9ef5251..4e74d04f7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -107,7 +107,7 @@ GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC201 #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 811faca5e..4a79fe557 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -100,7 +100,7 @@ GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() : #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index e3a474876..2a388c687 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -105,7 +105,7 @@ GlonassL2CaPcpsAcquisitionTest_msg_rx::GlonassL2CaPcpsAcquisitionTest_msg_rx(con #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GlonassL2CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GlonassL2CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index 9b52e0d5e..fa358e582 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -108,7 +108,7 @@ GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_ms #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 59ea1fdbb..72ed9373e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -124,7 +124,7 @@ GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : gr::blo #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index 4cb39a048..cf39e8858 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -103,7 +103,7 @@ GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsOpenClAcquisitionGSo #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 39db80cbe..28882e13e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -108,7 +108,7 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisit #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index 73bec7a58..7cefc205f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -105,7 +105,7 @@ GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC201 #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index f3d4b6e8a..0f896c6cd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -116,7 +116,7 @@ GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : gr::block #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index 1e11782be..51fbd13a2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -21,7 +21,7 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES file(GLOB SIGNAL_PROCESSING_TESTING_LIB_HEADERS "*.h") list(SORT SIGNAL_PROCESSING_TESTING_LIB_HEADERS) -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(signal_processing_testing_lib STATIC) target_sources(signal_processing_testing_lib PRIVATE @@ -48,7 +48,7 @@ target_link_libraries(signal_processing_testing_lib Glog::glog ) -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(signal_processing_testing_lib @@ -63,10 +63,10 @@ else() ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(signal_processing_testing_lib PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc index 253441b1a..f21534835 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc @@ -58,7 +58,7 @@ Acquisition_msg_rx::Acquisition_msg_rx() : gr::block("Acquisition_msg_rx", gr::i #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&Acquisition_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&Acquisition_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 8fa9bc5e6..858a651e1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -142,7 +142,7 @@ HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : gr::block("Hybrid #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&HybridObservablesTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&HybridObservablesTest_msg_rx::msg_handler_events, this, _1)); @@ -208,7 +208,7 @@ HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : gr::block #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&HybridObservablesTest_tlm_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&HybridObservablesTest_tlm_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index bef53b841..a32c764c1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -138,7 +138,7 @@ HybridObservablesTest_msg_rx_Fpga::HybridObservablesTest_msg_rx_Fpga() : gr::blo #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&HybridObservablesTest_msg_rx_Fpga::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&HybridObservablesTest_msg_rx_Fpga::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index da25899f5..ac078155b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -110,7 +110,7 @@ GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_ #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 1d3eddfd2..99b579119 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -89,7 +89,7 @@ GlonassL1CaDllPllCAidTrackingTest_msg_rx::GlonassL1CaDllPllCAidTrackingTest_msg_ #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index ed2b08811..e7679b61a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -96,7 +96,7 @@ GlonassL1CaDllPllTrackingTest_msg_rx::GlonassL1CaDllPllTrackingTest_msg_rx() : g #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index fa957667a..e47ec2875 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -126,7 +126,7 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : gr::block #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 91a864112..11d7d33fc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -213,7 +213,7 @@ GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : g #if HAS_GENERIC_LAMBDA [this](auto &&PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 0e255c2c0..35911319f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -127,7 +127,7 @@ GpsL1CAKfTrackingTest_msg_rx::GpsL1CAKfTrackingTest_msg_rx() : gr::block("GpsL1C #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL1CAKfTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL1CAKfTrackingTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 1d1607db2..b73d73ebb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -103,7 +103,7 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : gr::block(" #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index 31d2c241e..bf191adb8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -142,7 +142,7 @@ TrackingPullInTest_msg_rx::TrackingPullInTest_msg_rx() : gr::block("TrackingPull #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&TrackingPullInTest_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&TrackingPullInTest_msg_rx::msg_handler_events, this, _1)); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index ab55d8d37..2268121a5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -140,7 +140,7 @@ TrackingPullInTest_msg_rx_Fpga::TrackingPullInTest_msg_rx_Fpga() : gr::block("Tr #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&TrackingPullInTest_msg_rx_Fpga::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&TrackingPullInTest_msg_rx_Fpga::msg_handler_events, this, _1)); diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 3f87f1c37..1f4af20d7 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -8,7 +8,7 @@ # -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_library(front_end_cal_lib STATIC) target_sources(front_end_cal_lib PRIVATE @@ -48,7 +48,7 @@ if(ENABLE_CLANG_TIDY) endif() endif() -if(CMAKE_VERSION VERSION_GREATER 3.13) +if(USE_CMAKE_TARGET_SOURCES) add_executable(front-end-cal) target_sources(front-end-cal PRIVATE main.cc) else() @@ -85,7 +85,7 @@ target_compile_definitions(front-end-cal PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) +if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) target_compile_definitions(front-end-cal @@ -100,10 +100,10 @@ else() ) endif() -if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) +if(USE_BOOST_BIND_PLACEHOLDERS) target_compile_definitions(front-end-cal PRIVATE - -DBOOST_173_OR_GREATER=1 + -DUSE_BOOST_BIND_PLACEHOLDERS=1 ) endif() diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 736cb64d5..2d9d944bd 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -150,7 +150,7 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i #if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, boost::placeholders::_1)); #else boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, _1)); diff --git a/src/utils/rinex-tools/CMakeLists.txt b/src/utils/rinex-tools/CMakeLists.txt index 1fcad7dd5..bdcca99da 100644 --- a/src/utils/rinex-tools/CMakeLists.txt +++ b/src/utils/rinex-tools/CMakeLists.txt @@ -16,7 +16,7 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(obsdiff) target_sources(obsdiff PRIVATE diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 84ea001d6..dc6411f19 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -46,7 +46,7 @@ find_program(UNCOMPRESS_EXECUTABLE uncompress if(Boost_FOUND) message(STATUS "The rinex2assist utility tool will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'") - if(CMAKE_VERSION VERSION_GREATER 3.13) + if(USE_CMAKE_TARGET_SOURCES) add_executable(rinex2assist) target_sources(rinex2assist PRIVATE From 3a0012c60cd69a1ccf3632d202140f0938f71360 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 00:41:16 +0200 Subject: [PATCH 33/54] Fix cmakelint job --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 459ce4d46..347637a84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,8 +270,7 @@ if(CMAKE_VERSION VERSION_GREATER 3.13) endif() # Determine if we try to use generic lambdas -if(CMAKE_VERSION VERSION_GREATER 3.1 AND - NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND +if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) set(USE_GENERIC_LAMBDAS ON) endif() From d029bf405ba94b349efa914f7cae504a2b8bd47b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 10:25:28 +0200 Subject: [PATCH 34/54] Improve CMake scripts Replace CMAKE_CURRENT_BINARY by CMAKE_BINARY_DIR Remove include_directories() instance Put the GPSTk install folder in its building folder instead of in its source folder --- CMakeLists.txt | 270 +++++++++--------- src/tests/CMakeLists.txt | 69 +++-- .../libs/CMakeLists.txt | 5 + src/utils/rinex-tools/CMakeLists.txt | 4 +- src/utils/rinex2assist/CMakeLists.txt | 4 +- 5 files changed, 187 insertions(+), 165 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 347637a84..60abcb35c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -976,7 +976,7 @@ if(NOT VOLKGNSSSDR_FOUND) endif() set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_COMPILER} - -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install -DENABLE_STATIC_LIBS=ON -DENABLE_PROFILING=${ENABLE_PROFILING} -DENABLE_ORC=${ORC_ENABLED} @@ -990,7 +990,7 @@ if(NOT VOLKGNSSSDR_FOUND) ) if(NOT CMAKE_TOOLCHAIN_FILE) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake ) endif() else() @@ -1002,31 +1002,31 @@ if(NOT VOLKGNSSSDR_FOUND) endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + PREFIX ${CMAKE_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=$<$:None>$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:NoOptWithASM>$<$:Coverage>$<$:O2WithASM>$<$:O3WithASM>$<$:ASAN> DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + INSTALL_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install ) else() ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build + PREFIX ${CMAKE_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=$<$:None>$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:NoOptWithASM>$<$:Coverage>$<$:O2WithASM>$<$:O3WithASM>$<$:ASAN> DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + INSTALL_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install ) endif() @@ -1036,17 +1036,17 @@ if(NOT VOLKGNSSSDR_FOUND) endif() add_library(volk_gnsssdr UNKNOWN IMPORTED) - set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") + set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES}) if(NOT TARGET Volkgnsssdr::volkgnsssdr) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/include) add_library(Volkgnsssdr::volkgnsssdr STATIC IMPORTED) add_dependencies(Volkgnsssdr::volkgnsssdr volk_gnsssdr_module) set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}" INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" @@ -1055,19 +1055,19 @@ if(NOT VOLKGNSSSDR_FOUND) if(CMAKE_VERSION VERSION_LESS 3.2) add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile ) else() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile BYPRODUCTS ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile ) endif() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr-config-info ) @@ -1092,7 +1092,7 @@ if(NOT GFLAGS_FOUND) message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(GFLAGS_BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}" + "--build" "${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_GENERATOR STREQUAL Xcode) @@ -1104,11 +1104,11 @@ if(NOT GFLAGS_FOUND) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} GIT_REPOSITORY git://github.com/gflags/gflags.git GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON @@ -1122,20 +1122,20 @@ if(NOT GFLAGS_FOUND) INSTALL_COMMAND "" ) else() - set(GFLAGS_BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GFLAGS_BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR (CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator - set(GFLAGS_BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GFLAGS_BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX}) endif() if((CMAKE_VERSION VERSION_GREATER 3.12.0) AND NOT (CMAKE_GENERATOR STREQUAL Xcode)) set(PARALLEL_BUILD "--parallel 2") endif() ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} GIT_REPOSITORY git://github.com/gflags/gflags.git GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON @@ -1153,12 +1153,12 @@ if(NOT GFLAGS_FOUND) # Note: -DBUILD_gflags_nothreads_LIB=ON is required as a workaround to a bug in gflags 2.2.2. This is fixed in gflags master branch set(GFlags_INCLUDE_DIRS - ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" + ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" ) if(CMAKE_VERSION VERSION_LESS "3.0.2") set(GFlags_LIBS - ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() @@ -1174,24 +1174,24 @@ if(NOT GFLAGS_FOUND) MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_ASAN Debug - IMPORTED_LOCATION_NONE ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_NONE ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_INCLUDE_DIRECTORIES ${GFlags_INCLUDE_DIRS} - INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) if(MSVC) set(MSVC_POSTFIX _static) endif() set_target_properties(Gflags::gflags PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}_debug${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}_debug${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -1230,11 +1230,11 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}") string(REPLACE /include "" GFLAGS_PREFIX_PATH ${GFlags_INCLUDE_DIRS}) else() - set(GFLAGS_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + set(GFLAGS_PREFIX_PATH ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) endif() set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) set(GLOG_MAKE_PROGRAM ${CMAKE_COMMAND} - "--build" "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}" + "--build" "${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_GENERATOR STREQUAL Xcode) @@ -1251,7 +1251,7 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) set(GLOG_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}) set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS}) if(${LOCAL_GFLAGS}) - set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) + set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) else() set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS}) endif() @@ -1263,7 +1263,7 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) set(GLOG_EXPORT_C_COMPILER "export CC=clang") set(GLOG_EXPORT_CXX_COMPILER "export CXX=clang++") endif() - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + file(WRITE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags "#!/bin/sh export CPPFLAGS=-I${GFlags_INCLUDE_DIRS} export LDFLAGS=-L${GFLAGS_LIBRARY_DIR_TO_LINK} @@ -1275,17 +1275,17 @@ cd ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/ aclocal automake --add-missing autoreconf -vfi -cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} +cd ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure --enable-shared=no" ) - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + file(COPY ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + DESTINATION ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) - set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) + set(GLOG_CONFIGURE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) # Ensure that aclocal and libtool are present if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") @@ -1337,11 +1337,11 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure endif() ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= BUILD_COMMAND "${GLOG_MAKE_PROGRAM}" UPDATE_COMMAND "" @@ -1349,20 +1349,20 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure INSTALL_COMMAND "" ) set(GLOG_LIBRARIES - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) set(GLOG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src ) else() # CMake > 3.0 but < 3.2 ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_PREFIX_PATH=${GFLAGS_PREFIX_PATH} @@ -1375,18 +1375,18 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure ) set(GLOG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${GFlags_INCLUDE_DIRS} ) endif() else() # CMake > 3.2 set(GLOG_BUILD_BYPRODUCTS - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR (CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator set(GLOG_BUILD_BYPRODUCTS - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() if((CMAKE_VERSION VERSION_GREATER 3.12.0) AND NOT (CMAKE_GENERATOR STREQUAL Xcode)) @@ -1394,11 +1394,11 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure endif() ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_PREFIX_PATH=${GFLAGS_PREFIX_PATH} @@ -1412,7 +1412,7 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure ) set(GLOG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${GFlags_INCLUDE_DIRS} ) endif() @@ -1422,7 +1422,7 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure # Create Glog::glog target if(NOT TARGET Glog::glog) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}) add_library(Glog::glog STATIC IMPORTED) add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION}) if(CMAKE_VERSION VERSION_LESS 3.0) @@ -1442,21 +1442,21 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_ASAN Debug - IMPORTED_LOCATION_NONE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_NONE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) set_target_properties(Glog::glog PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -1605,7 +1605,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) # Download and build Armadillo ############################################# set(ARMADILLO_BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}" + "--build" "${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_TOOLCHAIN_FILE) @@ -1624,11 +1624,11 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(armadillo-${armadillo_RELEASE} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + PREFIX ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + BINARY_DIR ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF ${ARMADILLO_CXX_VERSION} @@ -1644,11 +1644,11 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) set(PARALLEL_BUILD "--parallel 2") endif() ExternalProject_Add(armadillo-${armadillo_RELEASE} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + PREFIX ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} + BINARY_DIR ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF ${ARMADILLO_CXX_VERSION} @@ -1656,7 +1656,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) ${ARMADILLO_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> BUILD_COMMAND ${ARMADILLO_BUILD_COMMAND} ${PARALLEL_BUILD} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX} UPDATE_COMMAND "" INSTALL_COMMAND "" ) @@ -1931,7 +1931,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + PREFIX ${CMAKE_BINARY_DIR}/matio GIT_REPOSITORY https://github.com/tbeu/matio GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} @@ -1941,27 +1941,27 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS ) else() ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio + PREFIX ${CMAKE_BINARY_DIR}/matio GIT_REPOSITORY https://github.com/tbeu/matio GIT_TAG 596cb3ce71038958812bd6cf9b141f12ce155ac6 # Workaround until Matio 1.5.18 v${GNSSSDR_MATIO_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= BUILD_COMMAND ${MATIO_MAKE_PROGRAM} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX} ) endif() set(MATIO_LOCAL TRUE) if(NOT TARGET Matio::matio) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matio/include) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matio/lib) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/matio/include) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/matio/lib) add_library(Matio::matio SHARED IMPORTED) add_dependencies(Matio::matio matio-${GNSSSDR_MATIO_LOCAL_VERSION}) set_target_properties(Matio::matio PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/matio/include - INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX} + IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/matio/include + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX} ) endif() else() @@ -2002,7 +2002,7 @@ if(NOT PUGIXML_FOUND) if(DEFINED ENV{OECORE_TARGET_SYSROOT}) set(PUGIXML_COMPILER "") if(NOT CMAKE_TOOLCHAIN_FILE) - set(PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") + set(PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") else() set(PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") endif() @@ -2012,16 +2012,16 @@ if(NOT PUGIXML_FOUND) endif() endif() set(PUGIXML_BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}" + "--build" "${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} CMAKE_ARGS ${PUGIXML_COMPILER} ${PUGIXML_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> @@ -2035,23 +2035,23 @@ if(NOT PUGIXML_FOUND) set(PARALLEL_BUILD "--parallel 2") endif() ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} CMAKE_ARGS ${PUGIXML_COMPILER} ${PUGIXML_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND ${PUGIXML_BUILD_COMMAND} ${PARALLEL_BUILD} - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} INSTALL_COMMAND "" ) endif() - set(PUGIXML_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(PUGIXML_LIBRARIES ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) if(NOT TARGET Pugixml::pugixml) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) @@ -2075,11 +2075,11 @@ if(NOT PUGIXML_FOUND) ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) set_target_properties(Pugixml::pugixml PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -2185,19 +2185,19 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI if(CMAKE_CROSSCOMPILING) if(NOT Protobuf_FOUND) ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND "${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} --host=$ENV{OECORE_TARGET_ARCH} --with-protoc=${PROTOC_EXECUTABLE}" + CONFIGURE_COMMAND "${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} --host=$ENV{OECORE_TARGET_ARCH} --with-protoc=${PROTOC_EXECUTABLE}" BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc ) - set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") + set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") endif() else() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") @@ -2272,29 +2272,29 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} install ) else() ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} install - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc ) endif() @@ -2303,23 +2303,23 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI add_dependencies(protobuf::protoc protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}) endif() unset(Protobuf_PROTOC_EXECUTABLE) - set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") + set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") set_target_properties(protobuf::protoc PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" - INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protoc${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" + INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protoc${CMAKE_STATIC_LIBRARY_SUFFIX}" ) endif() - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include) if(NOT TARGET protobuf::libprotobuf) add_library(protobuf::libprotobuf STATIC IMPORTED) add_dependencies(protobuf::libprotobuf protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}) endif() set_target_properties(protobuf::libprotobuf PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include" - INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include" + INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" ) if(CMAKE_VERSION VERSION_LESS 3.10) set(Protobuf_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE}) @@ -2924,13 +2924,13 @@ endif() # Create uninstall target ################################################################################ configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake + ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in + ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake @ONLY ) add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake ) @@ -2996,27 +2996,27 @@ message(STATUS "CMake version: ${CMAKE_VERSION}") message(STATUS "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.") message(STATUS "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.") message(STATUS "") -file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/features.log) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/features.log "**********************************\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "* BUILDING CONFIGURATION SUMMARY *\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "**********************************\n\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "GNSS-SDR version: ${VERSION}\n") +file(REMOVE ${CMAKE_BINARY_DIR}/features.log) +file(WRITE ${CMAKE_BINARY_DIR}/features.log "**********************************\n") +file(APPEND ${CMAKE_BINARY_DIR}/features.log "* BUILDING CONFIGURATION SUMMARY *\n") +file(APPEND ${CMAKE_BINARY_DIR}/features.log "**********************************\n\n") +file(APPEND ${CMAKE_BINARY_DIR}/features.log "GNSS-SDR version: ${VERSION}\n") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") if(CMAKE_CROSSCOMPILING) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "Cross-compiling on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}\n") + file(APPEND ${CMAKE_BINARY_DIR}/features.log "Cross-compiling on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}\n") else() - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}\n") + file(APPEND ${CMAKE_BINARY_DIR}/features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}\n") endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "Building on ${MACOS_DISTRIBUTION}\n") + file(APPEND ${CMAKE_BINARY_DIR}/features.log "Building on ${MACOS_DISTRIBUTION}\n") endif() -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "CMake version: ${CMAKE_VERSION}\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.\n\n") +file(APPEND ${CMAKE_BINARY_DIR}/features.log "CMake version: ${CMAKE_VERSION}\n") +file(APPEND ${CMAKE_BINARY_DIR}/features.log "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.\n") +file(APPEND ${CMAKE_BINARY_DIR}/features.log "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.\n\n") if(CMAKE_VERSION VERSION_LESS 3.4) feature_summary(WHAT ALL) - feature_summary(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/features.log APPEND WHAT ALL) + feature_summary(FILENAME ${CMAKE_BINARY_DIR}/features.log APPEND WHAT ALL) else() feature_summary(WHAT REQUIRED_PACKAGES_FOUND @@ -3026,7 +3026,7 @@ else() ENABLED_FEATURES DISABLED_FEATURES ) - feature_summary(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/features.log APPEND WHAT + feature_summary(FILENAME ${CMAKE_BINARY_DIR}/features.log APPEND WHAT REQUIRED_PACKAGES_FOUND REQUIRED_PACKAGES_NOT_FOUND OPTIONAL_PACKAGES_FOUND diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 7ced3a1af..5b05850fc 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -30,7 +30,7 @@ endif() if(NOT GOOGLETEST_FOUND) set(GTEST_BUILD_COMMAND "${CMAKE_COMMAND}" - "--build" "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}" + "--build" "${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_GENERATOR STREQUAL Xcode) @@ -42,7 +42,7 @@ if(NOT GOOGLETEST_FOUND) GIT_REPOSITORY https://github.com/google/googletest GIT_TAG v1.10.x SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF @@ -56,21 +56,21 @@ if(NOT GOOGLETEST_FOUND) ) else() set(GOOGLETEST_BUILD_BYPRODUCTS - ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR (CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator set(GOOGLETEST_BUILD_BYPRODUCTS - ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_maind${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_maind${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest GIT_TAG v1.10.x SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + BINARY_DIR ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF @@ -289,7 +289,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim + BINARY_DIR ${CMAKE_BINARY_DIR}/gnss-sim CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} BUILD_COMMAND ${GNSS_SIM_BUILD_COMMAND} UPDATE_COMMAND "" @@ -297,7 +297,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) INSTALL_COMMAND "" ) if(ENABLE_INSTALL_TESTS) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim DESTINATION bin) + install(PROGRAMS ${CMAKE_BINARY_DIR}/gnss-sim/gnss_sim DESTINATION bin) install(FILES ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) install(FILES ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) @@ -305,9 +305,9 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") else() - set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/gnss_sim) + set(SW_GENERATOR_BIN ${CMAKE_BINARY_DIR}/gnss-sim/gnss_sim) if(CMAKE_GENERATOR STREQUAL Xcode) - set(SW_GENERATOR_BIN ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim/${CMAKE_BUILD_TYPE}/gnss_sim) + set(SW_GENERATOR_BIN ${CMAKE_BINARY_DIR}/gnss-sim/${CMAKE_BUILD_TYPE}/gnss_sim) endif() add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n") @@ -341,8 +341,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON + BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON BUILD_COMMAND ${GPSTK_BUILD_COMMAND} UPDATE_COMMAND "" PATCH_COMMAND "" @@ -352,17 +352,17 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON + BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} + CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON BUILD_COMMAND ${GPSTK_BUILD_COMMAND} - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" ) endif() - set(GPSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_BINDIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) + set(GPSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") + set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_BINDIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") add_library(Gpstk::gpstk SHARED IMPORTED) add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) @@ -439,11 +439,7 @@ else() add_definitions(-DTEST_PATH="${CMAKE_BINARY_DIR}/thirdparty/") endif() -set(LIST_INCLUDE_DIRS - ${CMAKE_SOURCE_DIR}/src/tests/common-files -) -include_directories(${LIST_INCLUDE_DIRS}) ################################################################################ # Unit testing @@ -499,6 +495,10 @@ if(ENABLE_UNIT_TESTING) system_testing_lib core_receiver ) + target_include_directories(run_tests + INTERFACE + ${CMAKE_SOURCE_DIR}/src/tests/common-files + ) if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(run_tests PRIVATE -DGNURADIO_USES_STD_POINTERS=1 @@ -608,6 +608,9 @@ if(ENABLE_FPGA) algorithms_libs core_receiver ) + target_include_directories(gps_l1_ca_dll_pll_tracking_test_fpga + INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files + ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga RUNTIME DESTINATION bin COMPONENT "fpga-test" @@ -648,7 +651,10 @@ function(add_system_test executable) target_link_libraries(${executable} PRIVATE Boost::filesystem Boost::system) endif() - target_include_directories(${executable} PRIVATE ${OPT_INCLUDES_} ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + target_include_directories(${executable} + PRIVATE ${OPT_INCLUDES_} ${CMAKE_SOURCE_DIR}/src/algorithms/libs + INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files + ) target_link_libraries(${executable} PRIVATE ${OPT_LIBS_} algorithms_libs) if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(${executable} @@ -838,7 +844,10 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) algorithms_libs ) - target_include_directories(gnss_block_test PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + target_include_directories(gnss_block_test + PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs + INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files + ) if(ENABLE_FPGA) target_compile_definitions(gnss_block_test PRIVATE -DENABLE_FPGA=1) @@ -927,6 +936,11 @@ target_link_libraries(matio_test core_receiver ) +target_include_directories(matio_test + INTERFACE + ${CMAKE_SOURCE_DIR}/src/tests/common-files +) + add_test(matio_test matio_test) set_property(TEST matio_test PROPERTY TIMEOUT 30) @@ -970,7 +984,10 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) signal_processing_testing_lib core_receiver ) - + target_include_directories(acq_test + INTERFACE + ${CMAKE_SOURCE_DIR}/src/tests/common-files + ) add_test(acq_test acq_test) if(USE_GENERIC_LAMBDAS) diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index 51fbd13a2..cc64b346d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -48,6 +48,11 @@ target_link_libraries(signal_processing_testing_lib Glog::glog ) +target_include_directories(signal_processing_testing_lib + INTERFACE + ${CMAKE_SOURCE_DIR}/src/tests/common-files +) + if(USE_GENERIC_LAMBDAS) set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) diff --git a/src/utils/rinex-tools/CMakeLists.txt b/src/utils/rinex-tools/CMakeLists.txt index bdcca99da..f49cebba6 100644 --- a/src/utils/rinex-tools/CMakeLists.txt +++ b/src/utils/rinex-tools/CMakeLists.txt @@ -12,8 +12,8 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) + set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() if(USE_CMAKE_TARGET_SOURCES) diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index dc6411f19..53d1a8d6d 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -10,8 +10,8 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) + set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() From ee84f60fb405c8bab4296346b68cf63e303065c8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 10:56:49 +0200 Subject: [PATCH 35/54] Simplify CMake scripts --- CMakeLists.txt | 3 +++ src/algorithms/input_filter/adapters/CMakeLists.txt | 2 +- src/algorithms/resampler/adapters/CMakeLists.txt | 2 +- src/core/receiver/CMakeLists.txt | 2 +- src/tests/CMakeLists.txt | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60abcb35c..dd040f4b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -535,6 +535,9 @@ set_package_properties(GNURADIO PROPERTIES TYPE REQUIRED ) +if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) + set(GNURADIO_IS_38_OR_GREATER ON) +endif() ################################################################################ diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 39025e4d5..546332144 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -54,7 +54,7 @@ target_link_libraries(input_filter_adapters Volk::volk ) -if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) +if(GNURADIO_IS_38_OR_GREATER) target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1) endif() diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 51a42a49b..fe494fdfe 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -51,7 +51,7 @@ target_include_directories(resampler_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) -if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) +if(GNURADIO_IS_38_OR_GREATER) target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1) endif() diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 2c123336f..33730afa6 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -73,7 +73,7 @@ if(ENABLE_RAW_UDP) target_compile_definitions(core_receiver PRIVATE -DRAW_UDP=1) endif() -if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) +if(GNURADIO_IS_38_OR_GREATER) target_compile_definitions(core_receiver PRIVATE -DGR_GREATER_38=1) endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 5b05850fc..3277e85d3 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -213,7 +213,7 @@ endif() # Definitions ################################################################################ -if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) +if(GNURADIO_IS_38_OR_GREATER) add_definitions(-DGR_GREATER_38=1) endif() From d40c225adeecf8ee3c799822d44fda3594ed6704 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 13:43:00 +0200 Subject: [PATCH 36/54] Add BLAS::BLAS AND LAPACK::LAPACK imported targets --- CMakeLists.txt | 17 ++++++++++++++--- src/algorithms/libs/rtklib/CMakeLists.txt | 4 ++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd040f4b1..256c6276f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1512,8 +1512,13 @@ if(NOT BLAS_FOUND) endif() message(FATAL_ERROR "BLAS is required to build gnss-sdr") endif() - - +if(NOT TARGET BLAS::BLAS) + add_library(BLAS::BLAS SHARED IMPORTED) + set_target_properties(BLAS::BLAS PROPERTIES + IMPORTED_LOCATION ${BLAS_LIBRARIES} + INTERFACE_LINK_LIBRARIES ${BLAS_LIBRARIES} + ) +endif() ################################################################################ # Check that LAPACK (Linear Algebra PACKage) is found in the system @@ -1540,7 +1545,13 @@ if(NOT LAPACK_FOUND) endif() message(FATAL_ERROR "LAPACK is required to build gnss-sdr") endif() - +if(NOT TARGET LAPACK::LAPACK) + add_library(LAPACK::LAPACK SHARED IMPORTED) + set_target_properties(BLAS::BLAS PROPERTIES + IMPORTED_LOCATION ${LAPACK_LIBRARIES} + INTERFACE_LINK_LIBRARIES ${LAPACK_LIBRARIES} + ) +endif() ################################################################################ diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index ed59fe391..f1149c07e 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -73,8 +73,8 @@ target_link_libraries(algorithms_libs_rtklib core_system_parameters Gflags::gflags Glog::glog - ${LAPACK_LIBRARIES} - ${BLAS_LIBRARIES} + LAPACK::LAPACK + BLAS::BLAS ) set_property(TARGET algorithms_libs_rtklib From 34ebf384a56c1c996b1e33bbe9dabd880d8f2188 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 14:01:35 +0200 Subject: [PATCH 37/54] Use parallel building for GPSTk and Protobuf --- CMakeLists.txt | 9 ++++++++- src/tests/CMakeLists.txt | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd040f4b1..054322a56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2286,6 +2286,13 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} install ) else() + if(CMAKE_MAKE_PROGRAM MATCHES "make") + include(ProcessorCount) + ProcessorCount(NUMBER_OF_PROCESSORS) + if(NUMBER_OF_PROCESSORS GREATER 1) + set(PROTOBUF_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}") + endif() + endif() ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf @@ -2294,7 +2301,7 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} + BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} ${PROTOBUF_PARALLEL_BUILD} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} install BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 3277e85d3..86bd02645 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -348,13 +348,21 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) PATCH_COMMAND "" ) else() + if(CMAKE_MAKE_PROGRAM MATCHES "make") + include(ProcessorCount) + ProcessorCount(NUMBER_OF_PROCESSORS) + if(NUMBER_OF_PROCESSORS GREATER 1) + set(GPSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}") + endif() + endif() + ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/GPSTk GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION} SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON - BUILD_COMMAND ${GPSTK_BUILD_COMMAND} + BUILD_COMMAND ${GPSTK_BUILD_COMMAND} ${GPSTK_PARALLEL_BUILD} BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" From e946cd0519036af5a8bfe20672730b35eef30b8f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 14:09:20 +0200 Subject: [PATCH 38/54] Fix wrong target --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95bf6bc0b..a1db9f5f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1547,7 +1547,7 @@ if(NOT LAPACK_FOUND) endif() if(NOT TARGET LAPACK::LAPACK) add_library(LAPACK::LAPACK SHARED IMPORTED) - set_target_properties(BLAS::BLAS PROPERTIES + set_target_properties(LAPACK::LAPACK PROPERTIES IMPORTED_LOCATION ${LAPACK_LIBRARIES} INTERFACE_LINK_LIBRARIES ${LAPACK_LIBRARIES} ) From dcf9bc52c45de51e91b38316e3380900fcbc8264 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 14:32:08 +0200 Subject: [PATCH 39/54] Clarify source definition --- CMakeLists.txt | 19 +++++++++++ src/algorithms/libs/CMakeLists.txt | 26 +++------------ src/algorithms/libs/item_type_helpers.cc | 42 ++++++++++++------------ 3 files changed, 44 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1db9f5f6..c573596b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,25 @@ if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "G set(USE_GENERIC_LAMBDAS ON) endif() +# Determine if we use lambdas +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + set(DO_NOT_USE_LAMBDAS ON) + endif() +endif() + +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(CLANG_VERSION VERSION_LESS "600") + set(DO_NOT_USE_LAMBDAS ON) + endif() + else() + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") + set(DO_NOT_USE_LAMBDAS ON) + endif() + endif() +endif() + # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index a39884468..1fefc2489 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -149,28 +149,10 @@ target_compile_definitions(algorithms_libs PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) -if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - target_compile_definitions(algorithms_libs - PRIVATE -DOLDCOMPILER=1 - ) - endif() -endif() - -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - if(CLANG_VERSION VERSION_LESS "600") - target_compile_definitions(algorithms_libs - PRIVATE -DOLDCOMPILER=1 - ) - endif() - else() - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - target_compile_definitions(algorithms_libs - PRIVATE -DOLDCOMPILER=1 - ) - endif() - endif() +if(DO_NOT_USE_LAMBDAS) + target_compile_definitions(algorithms_libs + PRIVATE -DDO_NOT_USE_LAMBDAS=1 + ) endif() set_property(TARGET algorithms_libs diff --git a/src/algorithms/libs/item_type_helpers.cc b/src/algorithms/libs/item_type_helpers.cc index ce308498a..2a5543526 100644 --- a/src/algorithms/libs/item_type_helpers.cc +++ b/src/algorithms/libs/item_type_helpers.cc @@ -177,7 +177,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (input_type == output_type) { size_t input_size = item_type_size(input_type); -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); #else @@ -189,7 +189,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { if (output_type == "short") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_8i_16i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -198,7 +198,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "float") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_8i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -211,7 +211,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "ibyte") { size_t input_size = item_type_size(input_type); -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); #else @@ -220,7 +220,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } if (output_type == "cshort" or output_type == "ishort") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_8ic_16ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -229,7 +229,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "gr_complex") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_8ic_32fc, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -242,7 +242,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "cbyte") { size_t input_size = item_type_size(input_type); -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); #else @@ -251,7 +251,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "cshort" or output_type == "ishort") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_8i_16i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -260,7 +260,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "gr_complex") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_8i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -272,7 +272,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { if (output_type == "byte") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_16i_8i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -281,7 +281,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "float") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_16i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -293,7 +293,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { if (output_type == "cbyte" or output_type == "ibyte") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_16ic_8ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -303,7 +303,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "ishort") { size_t input_size = item_type_size(input_type); -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); #else @@ -312,7 +312,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "gr_complex") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_16ic_32fc, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -324,7 +324,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { if (output_type == "cbyte" or output_type == "ibyte") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_16i_8i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -334,7 +334,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "cshort") { size_t input_size = item_type_size(input_type); -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); #else @@ -343,7 +343,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "gr_complex") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_16i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -355,7 +355,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { if (output_type == "byte") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_32f_8i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -364,7 +364,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "short") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_32f_16i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -376,7 +376,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { if (output_type == "cbyte" or output_type == "ibyte") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_32fc_8ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else @@ -385,7 +385,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, } else if (output_type == "cshort" or output_type == "ishort") { -#ifdef OLDCOMPILER +#ifdef DO_NOT_USE_LAMBDAS return std::bind(convert_32fc_16ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); #else From b712c98a5bbf754a4e1961f6fcb531cbcea53b2c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 21:13:46 +0200 Subject: [PATCH 40/54] Make clang-tidy happy --- src/algorithms/libs/item_type_helpers.cc | 63 ++++++++---------------- 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/src/algorithms/libs/item_type_helpers.cc b/src/algorithms/libs/item_type_helpers.cc index 2a5543526..cd549fed1 100644 --- a/src/algorithms/libs/item_type_helpers.cc +++ b/src/algorithms/libs/item_type_helpers.cc @@ -178,8 +178,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { size_t input_size = item_type_size(input_type); #ifdef DO_NOT_USE_LAMBDAS - return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3, input_size); + return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); }; #endif @@ -190,8 +189,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "short") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_8i_16i, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_8i_16i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_16i(arg1, arg2, arg3); }; #endif @@ -199,8 +197,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "float") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_8i_32f, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_8i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_32f(arg1, arg2, arg3); }; #endif @@ -212,8 +209,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { size_t input_size = item_type_size(input_type); #ifdef DO_NOT_USE_LAMBDAS - return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3, input_size); + return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); }; #endif @@ -221,8 +217,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "cshort" or output_type == "ishort") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_8ic_16ic, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_8ic_16ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8ic_16ic(arg1, arg2, arg3); }; #endif @@ -230,8 +225,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "gr_complex") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_8ic_32fc, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_8ic_32fc, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8ic_32fc(arg1, arg2, arg3); }; #endif @@ -243,8 +237,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { size_t input_size = item_type_size(input_type); #ifdef DO_NOT_USE_LAMBDAS - return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3, input_size); + return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); }; #endif @@ -252,8 +245,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "cshort" or output_type == "ishort") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_8i_16i, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_8i_16i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_16i(arg1, arg2, arg3); }; #endif @@ -261,8 +253,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "gr_complex") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_8i_32f, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_8i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_32f(arg1, arg2, arg3); }; #endif @@ -273,8 +264,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "byte") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_16i_8i, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_16i_8i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_8i(arg1, arg2, arg3); }; #endif @@ -282,8 +272,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "float") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_16i_32f, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_16i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_32f(arg1, arg2, arg3); }; #endif @@ -294,8 +283,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "cbyte" or output_type == "ibyte") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_16ic_8ic, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_16ic_8ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16ic_8ic(arg1, arg2, arg3); }; #endif @@ -304,8 +292,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { size_t input_size = item_type_size(input_type); #ifdef DO_NOT_USE_LAMBDAS - return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3, input_size); + return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); }; #endif @@ -313,8 +300,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "gr_complex") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_16ic_32fc, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_16ic_32fc, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16ic_32fc(arg1, arg2, arg3); }; #endif @@ -325,8 +311,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "cbyte" or output_type == "ibyte") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_16i_8i, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_16i_8i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_8i(arg1, arg2, arg3); }; #endif @@ -335,8 +320,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, { size_t input_size = item_type_size(input_type); #ifdef DO_NOT_USE_LAMBDAS - return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3, input_size); + return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, input_size); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); }; #endif @@ -344,8 +328,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "gr_complex") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_16i_32f, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_16i_32f, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_32f(arg1, arg2, arg3); }; #endif @@ -356,8 +339,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "byte") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_32f_8i, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_32f_8i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32f_8i(arg1, arg2, arg3); }; #endif @@ -365,8 +347,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "short") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_32f_16i, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_32f_16i, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32f_16i(arg1, arg2, arg3); }; #endif @@ -377,8 +358,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, if (output_type == "cbyte" or output_type == "ibyte") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_32fc_8ic, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_32fc_8ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32fc_8ic(arg1, arg2, arg3); }; #endif @@ -386,8 +366,7 @@ item_type_converter_t make_vector_converter(const std::string &input_type, else if (output_type == "cshort" or output_type == "ishort") { #ifdef DO_NOT_USE_LAMBDAS - return std::bind(convert_32fc_16ic, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3); + return std::bind(convert_32fc_16ic, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); // NOLINT(modernize-avoid-bind) #else return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32fc_16ic(arg1, arg2, arg3); }; #endif From ae50ebbaa52f122d3e8683a811cc673d46b86408 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Jun 2020 21:15:47 +0200 Subject: [PATCH 41/54] Prefer use of CMAKE_SOURCE_DIR --- src/core/receiver/CMakeLists.txt | 16 ++++++++-------- src/tests/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 33730afa6..e830b3471 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -32,14 +32,14 @@ list(SORT GNSS_RECEIVER_HEADERS) list(SORT GNSS_RECEIVER_SOURCES) set(GNSS_RECEIVER_INTERFACE_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/acquisition_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/channel_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/configuration_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/gnss_block_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/observables_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/pvt_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/telemetry_decoder_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/tracking_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/acquisition_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/channel_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/configuration_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/gnss_block_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/observables_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/pvt_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/telemetry_decoder_interface.h + ${CMAKE_SOURCE_DIR}/src/core/interfaces/tracking_interface.h ) list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 86bd02645..b35fe94ad 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -18,7 +18,7 @@ set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER set(TOOLCHAIN_ARG "") if(DEFINED ENV{OECORE_TARGET_SYSROOT}) set(GTEST_COMPILER "") - set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Toolchains/oe-sdk_cross.cmake") + set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") else() if(CMAKE_TOOLCHAIN_FILE) set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") From b301c772e8c26cb04d56e852d8e59b4b2ce48e40 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 14 Jun 2020 07:52:59 +0200 Subject: [PATCH 42/54] Fix AppleClang version detection --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c573596b8..32777aa2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,7 +284,7 @@ endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - if(CLANG_VERSION VERSION_LESS "600") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7") set(DO_NOT_USE_LAMBDAS ON) endif() else() From 90c8b8e468ed5a4123cf8f5ecb1a13f6c6678972 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 14 Jun 2020 12:57:47 +0200 Subject: [PATCH 43/54] Move decisions based on the compiler version to a better place --- CMakeLists.txt | 53 ++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32777aa2e..4d19fa995 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,31 +269,6 @@ if(CMAKE_VERSION VERSION_GREATER 3.13) set(USE_CMAKE_TARGET_SOURCES ON) endif() -# Determine if we try to use generic lambdas -if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND - (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) - set(USE_GENERIC_LAMBDAS ON) -endif() - -# Determine if we use lambdas -if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - set(DO_NOT_USE_LAMBDAS ON) - endif() -endif() - -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7") - set(DO_NOT_USE_LAMBDAS ON) - endif() - else() - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(DO_NOT_USE_LAMBDAS ON) - endif() - endif() -endif() - # Determine if we are using make or ninja if(CMAKE_MAKE_PROGRAM MATCHES "make") set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "make") @@ -393,6 +368,34 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() endif() +# Determine if we use lambdas +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + set(DO_NOT_USE_LAMBDAS ON) + endif() +endif() + +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(CLANG_VERSION VERSION_LESS "600") + set(DO_NOT_USE_LAMBDAS ON) + endif() + else() + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") + set(DO_NOT_USE_LAMBDAS ON) + endif() + endif() +endif() + +# Determine if we try to use generic lambdas +if(NOT DO_NOT_USE_LAMBDAS) + if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND + (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))) + set(USE_GENERIC_LAMBDAS ON) + endif() +endif() + + ################################################################################ From bd4a354f9a5d9f6dc92d23659daf3d10806b550c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 14 Jun 2020 13:00:36 +0200 Subject: [PATCH 44/54] Fix ENABLE_CLANG_TIDY option --- .../PVT/gnuradio_blocks/CMakeLists.txt | 1 + src/algorithms/PVT/libs/CMakeLists.txt | 16 ++-------------- src/core/monitor/CMakeLists.txt | 15 +-------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index 87fb80cd9..b1cc195a9 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -37,6 +37,7 @@ target_link_libraries(pvt_gr_blocks Gnuradio::pmt Gnuradio::runtime PRIVATE + algorithms_libs pvt_libs Gflags::gflags Glog::glog diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 4daa5f6f0..a7e2d0880 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -77,9 +77,9 @@ target_link_libraries(pvt_libs Boost::date_time protobuf::libprotobuf core_system_parameters + algorithms_libs_rtklib PRIVATE algorithms_libs - algorithms_libs_rtklib Gflags::gflags Glog::glog Matio::matio @@ -104,7 +104,7 @@ endif() if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(pvt_libs PUBLIC - -DUSE_BOOST_ASIO_IO_CONTEXT + -DUSE_BOOST_ASIO_IO_CONTEXT=1 ) endif() @@ -125,18 +125,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() endif() -if(ENABLE_CLANG_TIDY) - if(CLANG_TIDY_EXE) - set_target_properties(pvt_libs - PROPERTIES - CXX_CLANG_TIDY "${DO_CLANG_TIDY}" - ) - endif() -endif() - set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ - $ - $ - $ ) diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 02d73304f..8c508a985 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -71,11 +71,10 @@ endif() if(USE_BOOST_ASIO_IO_CONTEXT) target_compile_definitions(core_monitor PUBLIC - -DUSE_BOOST_ASIO_IO_CONTEXT + -DUSE_BOOST_ASIO_IO_CONTEXT=1 ) endif() - # Fix for Boost Asio < 1.70 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0)) @@ -93,19 +92,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() endif() - -if(ENABLE_CLANG_TIDY) - if(CLANG_TIDY_EXE) - set_target_properties(core_monitor - PROPERTIES - CXX_CLANG_TIDY "${DO_CLANG_TIDY}" - ) - endif() -endif() - - set_property(TARGET core_monitor APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $ $ ) From 8cc799235bb08dfdadb96785275a6d5e082961a8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 14 Jun 2020 13:48:20 +0200 Subject: [PATCH 45/54] Update changelog --- docs/changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index da4f96ce5..f9c8db453 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -29,6 +29,11 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades Date: Mon, 15 Jun 2020 19:23:59 +0200 Subject: [PATCH 46/54] Use lambdas if possible. Fine tuning in CMake scripts --- src/core/libs/CMakeLists.txt | 9 ++++++++- src/core/receiver/CMakeLists.txt | 16 +++++++++++++++- src/core/receiver/tcp_cmd_interface.cc | 26 ++++++++++++++++++-------- src/core/receiver/tcp_cmd_interface.h | 2 +- 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 933654aa8..70ee5bc76 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -62,8 +62,9 @@ endif() target_link_libraries(core_libs PUBLIC - Boost::headers + Gnuradio::blocks Gnuradio::runtime + Gnuradio::pmt core_libs_supl core_system_parameters pvt_libs @@ -74,6 +75,12 @@ target_link_libraries(core_libs Pugixml::pugixml ) +if(USE_GENERIC_LAMBDAS AND NOT GNURADIO_USES_STD_POINTERS) + target_link_libraries(core_libs PUBLIC Boost::headers) +else() + target_link_libraries(core_libs PRIVATE Boost::headers) +endif() + if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(core_libs PUBLIC -DGNURADIO_USES_STD_POINTERS=1 diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index e830b3471..402da9a1d 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -136,7 +136,6 @@ endif() target_link_libraries(core_receiver PUBLIC core_libs - Gnuradio::runtime PRIVATE core_monitor signal_source_adapters @@ -162,6 +161,21 @@ if(ENABLE_ARMA_NO_DEBUG) ) endif() +if(USE_GENERIC_LAMBDAS) + set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) + set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) + target_compile_definitions(core_receiver + PRIVATE + "$<$:${has_generic_lambdas}>" + "$<$>:${no_has_generic_lambdas}>" + ) +else() + target_compile_definitions(core_receiver + PRIVATE + -DHAS_GENERIC_LAMBDA=0 + ) +endif() + # Fix for Boost Asio < 1.70 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0)) diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 98ae522f3..e39c192c4 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -48,13 +48,23 @@ TcpCmdInterface::TcpCmdInterface() void TcpCmdInterface::register_functions() { - functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) - functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) - functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) - functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) - functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) - functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) - functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind) +#if HAS_GENERIC_LAMBDA + functions["status"] = [&](auto &s) { return TcpCmdInterface::status(s); }; + functions["standby"] = [&](auto &s) { return TcpCmdInterface::standby(s); }; + functions["reset"] = [&](auto &s) { return TcpCmdInterface::reset(s); }; + functions["hotstart"] = [&](auto &s) { return TcpCmdInterface::hotstart(s); }; + functions["warmstart"] = [&](auto &s) { return TcpCmdInterface::warmstart(s); }; + functions["coldstart"] = [&](auto &s) { return TcpCmdInterface::coldstart(s); }; + functions["set_ch_satellite"] = [&](auto &s) { return TcpCmdInterface::set_ch_satellite(s); }; +#else + functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); + functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); + functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); + functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); + functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); + functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); + functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); +#endif } @@ -64,7 +74,7 @@ void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) } -time_t TcpCmdInterface::get_utc_time() +time_t TcpCmdInterface::get_utc_time() const { return receiver_utc_time_; } diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index e4acb8c85..e1f62b73f 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -45,7 +45,7 @@ public: /*! * \brief gets the UTC time parsed from the last TC command issued */ - time_t get_utc_time(); + time_t get_utc_time() const; /*! * \brief gets the Latitude, Longitude and Altitude vector from the last TC command issued From 094f8f2ee919bf14a2e7f3526780aa19e26b3567 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 16 Jun 2020 08:29:10 +0200 Subject: [PATCH 47/54] Remove unneded reset of the acquisition grid --- .../acquisition/gnuradio_blocks/pcps_acquisition.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 734951fe0..40765a47e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -868,14 +868,6 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) } d_num_noncoherent_integrations_counter = 0U; d_positive_acq = 0; - // Reset grid - for (uint32_t i = 0; i < d_num_doppler_bins; i++) - { - for (uint32_t k = 0; k < d_fft_size; k++) - { - d_magnitude_grid[i][k] = 0.0; - } - } } } From 771fbf13652affc5c607401bc87d9a000243554b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 16 Jun 2020 12:22:37 +0200 Subject: [PATCH 48/54] Make use of std::rotl (C++20) if available --- CMakeLists.txt | 20 +++++++++++++++- .../gnuradio_blocks/CMakeLists.txt | 6 +++++ .../gps_l1_ca_telemetry_decoder_gs.cc | 24 ++++++++++++------- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d19fa995..6f674bd2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -833,7 +833,6 @@ endif() # Detect availability of std::span ################################################################################ unset(has_span CACHE) -include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #include int main() @@ -843,6 +842,25 @@ check_cxx_source_compiles(" +################################################################################ +# Detect availability of std::rotl +################################################################################ +unset(has_rotl CACHE) +if(CMAKE_CXX_STANDARD VERSION_GREATER 17) + check_cxx_source_compiles(" + #include + #include + int main() + { + std::uint8_t i = 0b00011101; + auto k = std::rotl(i,0); + }" + has_rotl + ) +endif() + + + ################################################################################ # Detect availability of std::put_time (Workaround for gcc < 5.0) ################################################################################ diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 4a2403a36..5fc8e8bcd 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -68,6 +68,12 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() +if(has_rotl) + target_compile_definitions(telemetry_decoder_gr_blocks + PRIVATE -DCOMPILER_HAS_ROTL=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(telemetry_decoder_gr_blocks diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 272359030..f3954b6cf 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -33,8 +33,14 @@ #include // for shared_ptr -#ifndef _rotl -auto _rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; // Used in the parity check algorithm +#ifdef COMPILER_HAS_ROTL +#include +namespace my_rotl = std; +#else +namespace my_rotl +{ +auto rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; // Used in the parity check algorithm +} #endif @@ -138,15 +144,15 @@ bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword) // check algorithm described in IS-GPS-200K. This avoids lengthy shift- // and-xor loops. d1 = gpsword & 0xFBFFBF00U; - d2 = _rotl(gpsword, 1U) & 0x07FFBF01U; - d3 = _rotl(gpsword, 2U) & 0xFC0F8100U; - d4 = _rotl(gpsword, 3U) & 0xF81FFE02U; - d5 = _rotl(gpsword, 4U) & 0xFC00000EU; - d6 = _rotl(gpsword, 5U) & 0x07F00001U; - d7 = _rotl(gpsword, 6U) & 0x00003000U; + d2 = my_rotl::rotl(gpsword, 1U) & 0x07FFBF01U; + d3 = my_rotl::rotl(gpsword, 2U) & 0xFC0F8100U; + d4 = my_rotl::rotl(gpsword, 3U) & 0xF81FFE02U; + d5 = my_rotl::rotl(gpsword, 4U) & 0xFC00000EU; + d6 = my_rotl::rotl(gpsword, 5U) & 0x07F00001U; + d7 = my_rotl::rotl(gpsword, 6U) & 0x00003000U; t = d1 ^ d2 ^ d3 ^ d4 ^ d5 ^ d6 ^ d7; // Now XOR the 5 6-bit fields together to produce the 6-bit final result. - parity = t ^ _rotl(t, 6U) ^ _rotl(t, 12U) ^ _rotl(t, 18U) ^ _rotl(t, 24U); + parity = t ^ my_rotl::rotl(t, 6U) ^ my_rotl::rotl(t, 12U) ^ my_rotl::rotl(t, 18U) ^ my_rotl::rotl(t, 24U); parity = parity & 0x3FU; if (parity == (gpsword & 0x3FU)) { From 026e0f5c1b6bf68abb43e73b3523c966d7373c08 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 16 Jun 2020 13:04:02 +0200 Subject: [PATCH 49/54] Fix for old gcc --- .../gnuradio_blocks/CMakeLists.txt | 15 +++++++++++++++ .../gps_l1_ca_telemetry_decoder_gs.cc | 12 ++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 5fc8e8bcd..48cc517ae 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -74,6 +74,21 @@ if(has_rotl) ) endif() +if(USE_GENERIC_LAMBDAS) + set(has_generic_lambdas HAS_GENERIC_LAMBDA=1) + set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0) + target_compile_definitions(telemetry_decoder_gr_blocks + PRIVATE + "$<$:${has_generic_lambdas}>" + "$<$>:${no_has_generic_lambdas}>" + ) +else() + target_compile_definitions(telemetry_decoder_gr_blocks + PRIVATE + -DHAS_GENERIC_LAMBDA=0 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(telemetry_decoder_gr_blocks diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index f3954b6cf..dd81fd043 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -39,8 +39,16 @@ namespace my_rotl = std; #else namespace my_rotl { -auto rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; // Used in the parity check algorithm -} +#ifndef _rotl +#if HAS_GENERIC_LAMBDA +auto rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; +#else +#define rotl(X, N) (((X) << (N)) ^ ((X) >> (32 - (N)))) +#endif +#else +#define rotl _rotl +#endif +} // namespace my_rotl #endif From 405d43866dfab10219028098a95441f0721e4704 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 16 Jun 2020 13:07:13 +0200 Subject: [PATCH 50/54] Add missing CMake include --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f674bd2d..1ccb2e9de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -833,6 +833,7 @@ endif() # Detect availability of std::span ################################################################################ unset(has_span CACHE) +include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #include int main() From 8932427d7a7d9daa01e1ec6daaf1140a6555e4b7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 16 Jun 2020 13:35:00 +0200 Subject: [PATCH 51/54] Fix for gcc < 8 --- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index dd81fd043..a27b8c5b8 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -39,14 +39,10 @@ namespace my_rotl = std; #else namespace my_rotl { -#ifndef _rotl #if HAS_GENERIC_LAMBDA auto rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; #else -#define rotl(X, N) (((X) << (N)) ^ ((X) >> (32 - (N)))) -#endif -#else -#define rotl _rotl +uint32_t rotl = [](uint32_t x, uint32_t n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; #endif } // namespace my_rotl #endif From 7307e82d483c45ac55f6f9885b52c218d18315e7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 16 Jun 2020 14:00:12 +0200 Subject: [PATCH 52/54] Fix for gcc < 8 --- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index a27b8c5b8..f805ff58d 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -42,7 +42,7 @@ namespace my_rotl #if HAS_GENERIC_LAMBDA auto rotl = [](auto x, auto n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; #else -uint32_t rotl = [](uint32_t x, uint32_t n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; +auto rotl = [](uint32_t x, uint32_t n) { return (((x) << (n)) ^ ((x) >> (32 - (n)))); }; #endif } // namespace my_rotl #endif From bafeb2aed04e06525f024fddfc1bc312e6f064af Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 17 Jun 2020 13:31:02 +0200 Subject: [PATCH 53/54] Fix CXX and C standard reporting in CMake < 3.1 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ccb2e9de..207b1ec1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,25 +407,32 @@ if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) set(CMAKE_CXX_EXTENSIONS OFF) else() add_compile_options("$<$,C>:-std=gnu11>") + set(CMAKE_C_STANDARD 11) # set variable just for reporting if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") add_compile_options("$<$,CXX>:-std=c++11>") + set(CMAKE_CXX_STANDARD 11) # set variable just for reporting else() add_compile_options("$<$,CXX>:-std=c++14>") + set(CMAKE_CXX_STANDARD 14) # set variable just for reporting endif() endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if(CLANG_VERSION VERSION_LESS "600") add_compile_options("$<$,CXX>:-std=c++11>") + set(CMAKE_CXX_STANDARD 11) else() add_compile_options("$<$,CXX>:-std=c++14>") + set(CMAKE_CXX_STANDARD 14) endif() else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") add_compile_options("$<$,CXX>:-std=c++11>") + set(CMAKE_CXX_STANDARD 11) else() add_compile_options("$<$,CXX>:-std=c++14>") + set(CMAKE_CXX_STANDARD 14) endif() endif() endif() From 81af1a531b551f060ffa6762f533b209ff86c6c9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 18 Jun 2020 11:49:28 +0200 Subject: [PATCH 54/54] Redesign of pointer management Avoid indirection caused by passing shared_ptr by reference The block factory does not have responsability on the lifetime of their inputs Define std::make_unique when using C++11 and make use of it Printers are turned into unique_ptr to express ownership Printers do not participate on the lifelime of the data, so they take const raw pointers Modernize tests code --- docs/changelog.md | 3 + .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 25 +- .../PVT/gnuradio_blocks/rtklib_pvt_gs.h | 12 +- src/algorithms/PVT/libs/geojson_printer.cc | 16 +- src/algorithms/PVT/libs/geojson_printer.h | 2 +- src/algorithms/PVT/libs/gpx_printer.cc | 29 +- src/algorithms/PVT/libs/gpx_printer.h | 4 +- src/algorithms/PVT/libs/kml_printer.cc | 30 +- src/algorithms/PVT/libs/kml_printer.h | 4 +- .../PVT/libs/monitor_pvt_udp_sink.cc | 8 +- .../PVT/libs/monitor_pvt_udp_sink.h | 3 +- src/algorithms/PVT/libs/nmea_printer.cc | 3 +- src/algorithms/PVT/libs/nmea_printer.h | 4 +- src/algorithms/PVT/libs/pvt_solution.h | 6 + src/algorithms/PVT/libs/rtklib_solver.h | 8 +- .../acquisition/adapters/CMakeLists.txt | 1 + ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 5 +- .../galileo_e5a_pcps_acquisition_fpga.cc | 3 +- .../gps_l1_ca_pcps_acquisition_fpga.cc | 3 +- .../gps_l2_m_pcps_acquisition_fpga.cc | 3 +- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 3 +- src/algorithms/channel/adapters/channel.cc | 14 +- src/algorithms/channel/adapters/channel.h | 8 +- src/algorithms/channel/libs/channel_fsm.cc | 6 +- src/algorithms/channel/libs/channel_fsm.h | 4 +- src/algorithms/libs/CMakeLists.txt | 1 + src/algorithms/libs/gnss_sdr_make_unique.h | 76 ++ .../adapters/signal_generator.cc | 3 +- .../adapters/signal_generator.h | 3 +- .../adapters/ad9361_fpga_signal_source.cc | 459 ++++++------ .../adapters/ad9361_fpga_signal_source.h | 9 +- .../adapters/custom_udp_signal_source.cc | 2 +- .../adapters/custom_udp_signal_source.h | 4 +- .../adapters/file_signal_source.cc | 4 +- .../adapters/file_signal_source.h | 3 +- .../adapters/flexiband_signal_source.cc | 5 +- .../adapters/flexiband_signal_source.h | 10 +- .../adapters/fmcomms2_signal_source.cc | 4 +- .../adapters/fmcomms2_signal_source.h | 3 +- .../adapters/gen_signal_source.cc | 19 +- .../adapters/gen_signal_source.h | 13 +- .../adapters/gn3s_signal_source.cc | 5 +- .../adapters/gn3s_signal_source.h | 3 +- .../adapters/labsat_signal_source.cc | 4 +- .../adapters/labsat_signal_source.h | 3 +- .../multichannel_file_signal_source.cc | 4 +- .../multichannel_file_signal_source.h | 3 +- .../adapters/nsr_file_signal_source.cc | 4 +- .../adapters/nsr_file_signal_source.h | 3 +- .../adapters/osmosdr_signal_source.cc | 4 +- .../adapters/osmosdr_signal_source.h | 3 +- .../adapters/plutosdr_signal_source.cc | 4 +- .../adapters/plutosdr_signal_source.h | 3 +- .../adapters/raw_array_signal_source.cc | 2 +- .../adapters/raw_array_signal_source.h | 3 +- .../adapters/rtl_tcp_signal_source.cc | 9 +- .../adapters/rtl_tcp_signal_source.h | 3 +- .../adapters/spir_file_signal_source.cc | 4 +- .../adapters/spir_file_signal_source.h | 3 +- .../spir_gss6450_file_signal_source.cc | 4 +- .../spir_gss6450_file_signal_source.h | 3 +- .../two_bit_cpx_file_signal_source.cc | 9 +- .../adapters/two_bit_cpx_file_signal_source.h | 3 +- .../two_bit_packed_file_signal_source.cc | 9 +- .../two_bit_packed_file_signal_source.h | 3 +- .../adapters/uhd_signal_source.cc | 4 +- .../adapters/uhd_signal_source.h | 4 +- .../gnuradio_blocks/labsat23_source.cc | 50 +- .../gnuradio_blocks/labsat23_source.h | 10 +- .../signal_source/libs/ad9361_manager.cc | 4 +- .../signal_source/libs/gnss_sdr_valve.cc | 25 +- .../signal_source/libs/gnss_sdr_valve.h | 24 +- src/core/receiver/gnss_block_factory.cc | 708 +++++++++--------- src/core/receiver/gnss_block_factory.h | 71 +- src/core/receiver/gnss_flowgraph.cc | 33 +- src/core/receiver/gnss_flowgraph.h | 11 +- src/main/CMakeLists.txt | 1 + src/main/main.cc | 3 +- .../arithmetic/code_generation_test.cc | 24 +- .../arithmetic/complex_carrier_test.cc | 13 +- .../unit-tests/arithmetic/fft_length_test.cc | 5 +- .../unit-tests/arithmetic/fft_speed_test.cc | 5 +- .../arithmetic/preamble_correlator_test.cc | 7 +- .../control-plane/control_thread_test.cc | 4 +- .../control-plane/file_configuration_test.cc | 7 +- .../control-plane/gnss_block_factory_test.cc | 44 +- .../in_memory_configuration_test.cc | 27 +- .../control-plane/string_converter_test.cc | 7 +- .../acquisition/acq_performance_test.cc | 2 +- .../beidou_b1i_pcps_acquisition_test.cc | 2 +- .../beidou_b3i_pcps_acquisition_test.cc | 2 +- ...8ms_ambiguous_acquisition_gsoc2013_test.cc | 24 +- ...cps_ambiguous_acquisition_gsoc2013_test.cc | 24 +- ...e1_pcps_ambiguous_acquisition_gsoc_test.cc | 8 +- ...ileo_e1_pcps_ambiguous_acquisition_test.cc | 8 +- ...wsr_ambiguous_acquisition_gsoc2013_test.cc | 24 +- ...ync_ambiguous_acquisition_gsoc2014_test.cc | 33 +- ...ong_ambiguous_acquisition_gsoc2013_test.cc | 24 +- ...cps_acquisition_gsoc2014_gensource_test.cc | 9 +- ...ss_l1_ca_pcps_acquisition_gsoc2017_test.cc | 23 +- .../glonass_l1_ca_pcps_acquisition_test.cc | 2 +- .../glonass_l2_ca_pcps_acquisition_test.cc | 33 +- ...ps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 33 +- .../gps_l1_ca_pcps_acquisition_test.cc | 4 +- ...a_pcps_opencl_acquisition_gsoc2013_test.cc | 16 +- ...cps_quicksync_acquisition_gsoc2014_test.cc | 23 +- ..._ca_pcps_tong_acquisition_gsoc2013_test.cc | 16 +- .../gps_l2_m_pcps_acquisition_test.cc | 4 +- .../filter/fir_filter_test.cc | 39 +- .../filter/notch_filter_lite_test.cc | 16 +- .../filter/notch_filter_test.cc | 16 +- .../filter/pulse_blanking_filter_test.cc | 16 +- .../libs/item_type_helpers_test.cc | 1 + .../libs/observables_dump_reader.cc | 21 +- .../libs/observables_dump_reader.h | 14 +- .../observables/hybrid_observables_test.cc | 6 +- .../hybrid_observables_test_fpga.cc | 4 +- .../pvt/nmea_printer_test.cc | 2 +- .../pvt/rtcm_printer_test.cc | 5 +- .../pvt/rtklib_solver_test.cc | 3 +- .../direct_resampler_conditioner_cc_test.cc | 10 +- .../resampler/mmse_resampler_test.cc | 20 +- .../sources/file_signal_source_test.cc | 13 +- .../sources/gnss_sdr_valve_test.cc | 10 +- .../gps_l1_ca_telemetry_decoder_test.cc | 2 +- .../galileo_e1_dll_pll_veml_tracking_test.cc | 10 +- .../tracking/galileo_e5a_tracking_test.cc | 4 +- ...onass_l1_ca_dll_pll_c_aid_tracking_test.cc | 2 +- .../glonass_l1_ca_dll_pll_tracking_test.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_test.cc | 2 +- .../tracking/gps_l1_ca_kf_tracking_test.cc | 2 +- .../gps_l2_m_dll_pll_tracking_test.cc | 2 +- .../tracking/tracking_pull-in_test.cc | 4 +- .../tracking/tracking_pull-in_test_fpga.cc | 6 +- src/utils/front-end-cal/main.cc | 37 +- 135 files changed, 1295 insertions(+), 1302 deletions(-) create mode 100644 src/algorithms/libs/gnss_sdr_make_unique.h diff --git a/docs/changelog.md b/docs/changelog.md index f9c8db453..21c028a1b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -26,6 +26,9 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades (nchannels, 0.0); channel_initialized = std::vector(nchannels, false); max_obs_block_rx_clock_offset_ms = conf_.max_obs_block_rx_clock_offset_ms; - d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; d_report_rate_ms = 1000; // report every second PVT to gnss_synchro @@ -211,7 +210,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, } if (d_kml_output_enabled) { - d_kml_dump = std::make_shared(conf_.kml_output_path); + d_kml_dump = std::make_unique(conf_.kml_output_path); d_kml_dump->set_headers(kml_dump_filename); } else @@ -230,7 +229,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, } if (d_gpx_output_enabled) { - d_gpx_dump = std::make_shared(conf_.gpx_output_path); + d_gpx_dump = std::make_unique(conf_.gpx_output_path); d_gpx_dump->set_headers(gpx_dump_filename); } else @@ -249,7 +248,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, } if (d_geojson_output_enabled) { - d_geojson_printer = std::make_shared(conf_.geojson_output_path); + d_geojson_printer = std::make_unique(conf_.geojson_output_path); d_geojson_printer->set_headers(geojson_dump_filename); } else @@ -267,7 +266,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, if (d_nmea_output_file_enabled) { - d_nmea_printer = std::make_shared(conf_.nmea_dump_filename, conf_.nmea_output_file_enabled, conf_.flag_nmea_tty_port, conf_.nmea_dump_devname, conf_.nmea_output_file_path); + d_nmea_printer = std::make_unique(conf_.nmea_dump_filename, conf_.nmea_output_file_enabled, conf_.flag_nmea_tty_port, conf_.nmea_dump_devname, conf_.nmea_output_file_path); } else { @@ -279,7 +278,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, rtcm_dump_filename = d_dump_filename; if (conf_.flag_rtcm_server or conf_.flag_rtcm_tty_port or conf_.rtcm_output_file_enabled) { - d_rtcm_printer = std::make_shared(rtcm_dump_filename, conf_.rtcm_output_file_enabled, conf_.flag_rtcm_server, conf_.flag_rtcm_tty_port, conf_.rtcm_tcp_port, conf_.rtcm_station_id, conf_.rtcm_dump_devname, true, conf_.rtcm_output_file_path); + d_rtcm_printer = std::make_unique(rtcm_dump_filename, conf_.rtcm_output_file_enabled, conf_.flag_rtcm_server, conf_.flag_rtcm_tty_port, conf_.rtcm_tcp_port, conf_.rtcm_station_id, conf_.rtcm_dump_devname, true, conf_.rtcm_output_file_path); std::map rtcm_msg_rate_ms = conf_.rtcm_msg_rate_ms; if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end()) { @@ -355,7 +354,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_rinex_version = conf_.rinex_version; if (b_rinex_output_enabled) { - rp = std::make_shared(d_rinex_version, conf_.rinex_output_path, conf_.rinex_name); + rp = std::make_unique(d_rinex_version, conf_.rinex_output_path, conf_.rinex_name); rp->set_pre_2009_file(conf_.pre_2009_file); } else @@ -413,7 +412,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, std::sort(udp_addr_vec.begin(), udp_addr_vec.end()); udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end()); - udp_sink_ptr = std::unique_ptr(new Monitor_Pvt_Udp_Sink(udp_addr_vec, conf_.udp_port, conf_.protobuf_enabled)); + udp_sink_ptr = std::make_unique(udp_addr_vec, conf_.udp_port, conf_.protobuf_enabled); } else { @@ -2283,28 +2282,28 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (current_RX_time_ms % d_kml_rate_ms == 0) { - d_kml_dump->print_position(d_user_pvt_solver, false); + d_kml_dump->print_position(d_user_pvt_solver.get(), false); } } if (d_gpx_output_enabled) { if (current_RX_time_ms % d_gpx_rate_ms == 0) { - d_gpx_dump->print_position(d_user_pvt_solver, false); + d_gpx_dump->print_position(d_user_pvt_solver.get(), false); } } if (d_geojson_output_enabled) { if (current_RX_time_ms % d_geojson_rate_ms == 0) { - d_geojson_printer->print_position(d_user_pvt_solver, false); + d_geojson_printer->print_position(d_user_pvt_solver.get(), false); } } if (d_nmea_output_file_enabled) { if (current_RX_time_ms % d_nmea_rate_ms == 0) { - d_nmea_printer->Print_Nmea_Line(d_user_pvt_solver, false); + d_nmea_printer->Print_Nmea_Line(d_user_pvt_solver.get(), false); } } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index 6334657ab..66ee465c0 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h @@ -191,12 +191,12 @@ private: int32_t d_display_rate_ms; int32_t d_report_rate_ms; - std::shared_ptr rp; - std::shared_ptr d_kml_dump; - std::shared_ptr d_gpx_dump; - std::shared_ptr d_nmea_printer; - std::shared_ptr d_geojson_printer; - std::shared_ptr d_rtcm_printer; + std::unique_ptr rp; + std::unique_ptr d_kml_dump; + std::unique_ptr d_gpx_dump; + std::unique_ptr d_nmea_printer; + std::unique_ptr d_geojson_printer; + std::unique_ptr d_rtcm_printer; double d_rx_time; bool d_geojson_output_enabled; diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 533839a6e..bb13c1ae0 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -176,25 +176,23 @@ bool GeoJSON_Printer::set_headers(const std::string& filename, bool time_tag_nam } -bool GeoJSON_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool GeoJSON_Printer::print_position(const Pvt_Solution* position, bool print_average_values) { double latitude; double longitude; double height; - const std::shared_ptr& position_ = position; - if (print_average_values == false) { - latitude = position_->get_latitude(); - longitude = position_->get_longitude(); - height = position_->get_height(); + latitude = position->get_latitude(); + longitude = position->get_longitude(); + height = position->get_height(); } else { - latitude = position_->get_avg_latitude(); - longitude = position_->get_avg_longitude(); - height = position_->get_avg_height(); + latitude = position->get_avg_latitude(); + longitude = position->get_avg_longitude(); + height = position->get_avg_height(); } if (geojson_file.is_open()) diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h index 7806493b4..ec4dfe2dc 100644 --- a/src/algorithms/PVT/libs/geojson_printer.h +++ b/src/algorithms/PVT/libs/geojson_printer.h @@ -40,7 +40,7 @@ public: explicit GeoJSON_Printer(const std::string& base_path = "."); ~GeoJSON_Printer(); bool set_headers(const std::string& filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const Pvt_Solution* position, bool print_average_values); bool close_file(); private: diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index f1aef11e8..d60e54235 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -20,7 +20,7 @@ #include "gpx_printer.h" -#include "rtklib_solver.h" +#include "pvt_solution.h" #include #include #include // for tm @@ -162,22 +162,21 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name) } -bool Gpx_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool Gpx_Printer::print_position(const Pvt_Solution* position, bool print_average_values) { double latitude; double longitude; double height; positions_printed = true; - const std::shared_ptr& position_ = position; - double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s - double course_over_ground = position_->get_course_over_ground(); // expressed in deg + double speed_over_ground = position->get_speed_over_ground(); // expressed in m/s + double course_over_ground = position->get_course_over_ground(); // expressed in deg - double hdop = position_->get_hdop(); - double vdop = position_->get_vdop(); - double pdop = position_->get_pdop(); - std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); + double hdop = position->get_hdop(); + double vdop = position->get_vdop(); + double pdop = position->get_pdop(); + std::string utc_time = to_iso_extended_string(position->get_position_UTC_time()); if (utc_time.length() < 23) { utc_time += "."; @@ -187,15 +186,15 @@ bool Gpx_Printer::print_position(const std::shared_ptr& position, if (print_average_values == false) { - latitude = position_->get_latitude(); - longitude = position_->get_longitude(); - height = position_->get_height(); + latitude = position->get_latitude(); + longitude = position->get_longitude(); + height = position->get_height(); } else { - latitude = position_->get_avg_latitude(); - longitude = position_->get_avg_longitude(); - height = position_->get_avg_height(); + latitude = position->get_avg_latitude(); + longitude = position->get_avg_longitude(); + height = position->get_avg_height(); } if (gpx_file.is_open()) diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index a38c8195e..0500eaff8 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -27,7 +27,7 @@ #include #include -class Rtklib_Solver; +class Pvt_Solution; /*! * \brief Prints PVT information to GPX format file @@ -40,7 +40,7 @@ public: explicit Gpx_Printer(const std::string& base_path = "."); ~Gpx_Printer(); bool set_headers(const std::string& filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const Pvt_Solution* position, bool print_average_values); bool close_file(); private: diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index ccd3cc416..d8978faf3 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -20,7 +20,7 @@ */ #include "kml_printer.h" -#include "rtklib_solver.h" +#include "pvt_solution.h" #include #include #include // for mkstemp @@ -231,7 +231,7 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name) } -bool Kml_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool Kml_Printer::print_position(const Pvt_Solution* position, bool print_average_values) { double latitude; double longitude; @@ -239,15 +239,13 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, positions_printed = true; - const std::shared_ptr& position_ = position; + double speed_over_ground = position->get_speed_over_ground(); // expressed in m/s + double course_over_ground = position->get_course_over_ground(); // expressed in deg - double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s - double course_over_ground = position_->get_course_over_ground(); // expressed in deg - - double hdop = position_->get_hdop(); - double vdop = position_->get_vdop(); - double pdop = position_->get_pdop(); - std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); + double hdop = position->get_hdop(); + double vdop = position->get_vdop(); + double pdop = position->get_pdop(); + std::string utc_time = to_iso_extended_string(position->get_position_UTC_time()); if (utc_time.length() < 23) { utc_time += "."; @@ -257,15 +255,15 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, if (print_average_values == false) { - latitude = position_->get_latitude(); - longitude = position_->get_longitude(); - height = position_->get_height(); + latitude = position->get_latitude(); + longitude = position->get_longitude(); + height = position->get_height(); } else { - latitude = position_->get_avg_latitude(); - longitude = position_->get_avg_longitude(); - height = position_->get_avg_height(); + latitude = position->get_avg_latitude(); + longitude = position->get_avg_longitude(); + height = position->get_avg_height(); } if (kml_file.is_open() && tmp_file.is_open()) diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 58019aff2..6d9fa2ac4 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -26,7 +26,7 @@ #include // for shared_ptr #include -class Rtklib_Solver; +class Pvt_Solution; /*! * \brief Prints PVT information to OGC KML format file (can be viewed with Google Earth) @@ -39,7 +39,7 @@ public: explicit Kml_Printer(const std::string& base_path = std::string(".")); ~Kml_Printer(); bool set_headers(const std::string& filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const Pvt_Solution* position, bool print_average_values); bool close_file(); private: diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc index 58fb5ce81..454d9e667 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc @@ -22,6 +22,7 @@ #include #include #include +#include Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector& addresses, const uint16_t& port, bool protobuf_enabled) : socket{io_context} @@ -40,19 +41,20 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector& addre } -bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const std::shared_ptr& monitor_pvt) +bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(std::shared_ptr monitor_pvt) { + monitor_pvt_ = std::move(monitor_pvt); std::string outbound_data; if (use_protobuf == false) { std::ostringstream archive_stream; boost::archive::binary_oarchive oa{archive_stream}; - oa << *monitor_pvt.get(); + oa << *monitor_pvt_.get(); outbound_data = archive_stream.str(); } else { - outbound_data = serdes.createProtobuffer(monitor_pvt); + outbound_data = serdes.createProtobuffer(monitor_pvt_); } for (const auto& endpoint : endpoints) diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h index bbecda420..1f5fa2bcb 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -38,7 +38,7 @@ class Monitor_Pvt_Udp_Sink { public: Monitor_Pvt_Udp_Sink(const std::vector& addresses, const uint16_t& port, bool protobuf_enabled); - bool write_monitor_pvt(const std::shared_ptr& monitor_pvt); + bool write_monitor_pvt(std::shared_ptr monitor_pvt); private: b_io_context io_context; @@ -46,6 +46,7 @@ private: boost::system::error_code error; std::vector endpoints; Serdes_Monitor_Pvt serdes; + std::shared_ptr monitor_pvt_; bool use_protobuf; }; diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 405dab140..559d51a99 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -119,6 +119,7 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi nmea_dev_descriptor = -1; } print_avg_pos = false; + d_PVT_data = nullptr; } @@ -213,7 +214,7 @@ void Nmea_Printer::close_serial() } -bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values) +bool Nmea_Printer::Print_Nmea_Line(const Rtklib_Solver* pvt_data, bool print_average_values) { std::string GPRMC; std::string GPGGA; diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index 4a19edbd6..c05ca4af1 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -49,7 +49,7 @@ public: /*! * \brief Print NMEA PVT and satellite info to the initialized device */ - bool Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values); + bool Print_Nmea_Line(const Rtklib_Solver* pvt_data, bool print_average_values); /*! * \brief Default destructor. @@ -62,7 +62,7 @@ private: std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file std::string nmea_devname; int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) - std::shared_ptr d_PVT_data; + const Rtklib_Solver* d_PVT_data; int init_serial(const std::string& serial_device); // serial port control void close_serial(); std::string get_GPGGA(); // fix data diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 190ba0ede..afbb694da 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -38,6 +38,7 @@ class Pvt_Solution { public: Pvt_Solution(); + virtual ~Pvt_Solution() = default; void set_pre_2009_file(bool pre_2009_file); //!< Flag for the week rollover computation in post processing mode for signals older than 2009 double get_time_offset_s() const; //!< Get RX time offset [s] void set_time_offset_s(double offset); //!< Set RX time offset [s] @@ -123,6 +124,11 @@ public: */ int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); + virtual double get_hdop() const = 0; + virtual double get_vdop() const = 0; + virtual double get_pdop() const = 0; + virtual double get_gdop() const = 0; + protected: bool d_pre_2009_file; // Flag to correct week rollover in post processing mode for signals older than 2009 private: diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 913d057e4..b07642bba 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -75,10 +75,10 @@ public: sol_t pvt_sol{}; std::array pvt_ssat{}; - double get_hdop() const; - double get_vdop() const; - double get_pdop() const; - double get_gdop() const; + double get_hdop() const override; + double get_vdop() const override; + double get_pdop() const override; + double get_gdop() const override; Monitor_Pvt get_monitor_pvt() const; std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index fc0fc4477..258c3c7f4 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -118,6 +118,7 @@ endif() if(ENABLE_FPGA) target_link_libraries(acquisition_adapters PRIVATE + algorithms_libs Gnuradio::fft Volk::volk Volkgnsssdr::volkgnsssdr diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 381568a7b..92e9ea00c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -23,6 +23,7 @@ #include "configuration_interface.h" #include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" +#include "gnss_sdr_make_unique.h" #include #include // for fft_complex #include // for gr_complex @@ -87,8 +88,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // compute all the GALILEO E1 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT - volk_gnsssdr::vector> code(nsamples_total); // buffer for the local code + auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT + volk_gnsssdr::vector> code(nsamples_total); // buffer for the local code volk_gnsssdr::vector fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 8e0c1fd59..ddfbbd589 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -23,6 +23,7 @@ #include "configuration_interface.h" #include "galileo_e5_signal_processing.h" #include "gnss_sdr_flags.h" +#include "gnss_sdr_make_unique.h" #include #include // for fft_complex #include // for gr_complex @@ -88,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf // compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT + auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 6c582cd2a..35bceda00 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -25,6 +25,7 @@ #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gnss_sdr_make_unique.h" #include "gps_sdr_signal_processing.h" #include #include @@ -80,7 +81,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); + auto fft_if = std::make_unique(nsamples_total, true); // allocate memory to compute all the PRNs and compute all the possible codes volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index 1df49c9d4..56dffc3d3 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -24,6 +24,7 @@ #include "GPS_L2C.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gnss_sdr_make_unique.h" #include "gnss_synchro.h" #include "gps_l2c_signal.h" #include @@ -81,7 +82,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( // compute all the GPS L2C PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT + auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT // allocate memory to compute all the PRNs and compute all the possible codes volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index 0f123169f..4b0a25216 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -25,6 +25,7 @@ #include "GPS_L5.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gnss_sdr_make_unique.h" #include "gps_l5_signal.h" #include #include // for fft_complex @@ -85,7 +86,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT + auto fft_if = std::make_unique(nsamples_total, true); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); volk_gnsssdr::vector> fft_codes_padded(nsamples_total); d_all_fft_codes_ = std::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 68fc67dd4..aa81225c0 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -29,17 +29,17 @@ #include // for std::move -Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, const std::shared_ptr& acq, - const std::shared_ptr& trk, const std::shared_ptr& nav, - const std::string& role, const std::string& implementation, const std::shared_ptr >& queue) +Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr acq, + std::shared_ptr trk, std::shared_ptr nav, + const std::string& role, const std::string& implementation, Concurrent_Queue* queue) { - acq_ = acq; - trk_ = trk; - nav_ = nav; + acq_ = std::move(acq); + trk_ = std::move(trk); + nav_ = std::move(nav); + queue_ = queue; role_ = role; implementation_ = implementation; channel_ = channel; - queue_ = queue; channel_fsm_ = std::make_shared(); flag_enable_fpga = configuration->property("GNSS-SDR.enable_FPGA", false); diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index ec5194114..d2d965798 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -54,9 +54,9 @@ class Channel : public ChannelInterface { public: //! Constructor - Channel(ConfigurationInterface* configuration, uint32_t channel, const std::shared_ptr& acq, - const std::shared_ptr& trk, const std::shared_ptr& nav, - const std::string& role, const std::string& implementation, const std::shared_ptr>& queue); + Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr acq, + std::shared_ptr trk, std::shared_ptr nav, + const std::string& role, const std::string& implementation, Concurrent_Queue* queue); ~Channel() = default; //!< Destructor @@ -97,7 +97,7 @@ private: bool connected_; bool repeat_; std::shared_ptr channel_fsm_; - std::shared_ptr> queue_; + Concurrent_Queue* queue_; std::mutex mx; }; diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 3802b720d..3a1a840c9 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -30,6 +30,7 @@ ChannelFsm::ChannelFsm() trk_ = nullptr; channel_ = 0U; d_state = 0U; + queue_ = nullptr; } @@ -38,6 +39,7 @@ ChannelFsm::ChannelFsm(std::shared_ptr acquisition) : acq_ trk_ = nullptr; channel_ = 0U; d_state = 0U; + queue_ = nullptr; } @@ -168,10 +170,10 @@ void ChannelFsm::set_telemetry(std::shared_ptr teleme } -void ChannelFsm::set_queue(std::shared_ptr> queue) +void ChannelFsm::set_queue(Concurrent_Queue* queue) { std::lock_guard lk(mx); - queue_ = std::move(queue); + queue_ = queue; } diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index 4b696a278..09461c567 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -45,7 +45,7 @@ public: void set_acquisition(std::shared_ptr acquisition); void set_tracking(std::shared_ptr tracking); void set_telemetry(std::shared_ptr telemetry); - void set_queue(std::shared_ptr> queue); + void set_queue(Concurrent_Queue* queue); void set_channel(uint32_t channel); void start_acquisition(); // FSM EVENTS @@ -67,7 +67,7 @@ private: std::shared_ptr acq_; std::shared_ptr trk_; std::shared_ptr nav_; - std::shared_ptr> queue_; + Concurrent_Queue* queue_; uint32_t channel_; uint32_t d_state; std::mutex mx; diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 1fefc2489..1c5a3c827 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -55,6 +55,7 @@ set(GNSS_SPLIBS_HEADERS conjugate_sc.h conjugate_ic.h gnss_sdr_create_directory.h + gnss_sdr_make_unique.h gnss_circular_deque.h geofunctions.h item_type_helpers.h diff --git a/src/algorithms/libs/gnss_sdr_make_unique.h b/src/algorithms/libs/gnss_sdr_make_unique.h new file mode 100644 index 000000000..6ca5350d9 --- /dev/null +++ b/src/algorithms/libs/gnss_sdr_make_unique.h @@ -0,0 +1,76 @@ +/*! + * \file gnss_sdr_make_unique.h + * \brief This file implements std::make_unique for C++11 + * + * \author Carles Fernandez-Prades, 2020. cfernandez(at)cttc.es + * + * Based on https://stackoverflow.com/a/17902439 + * + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_GNSS_SDR_MAKE_UNIQUE_H +#define GNSS_SDR_GNSS_SDR_MAKE_UNIQUE_H + +#if __cplusplus == 201103L + +#include +#include +#include +#include + +namespace std +{ +template +struct _Unique_if +{ + typedef unique_ptr _Single_object; +}; + +template +struct _Unique_if +{ + typedef unique_ptr _Unknown_bound; +}; + +template +struct _Unique_if +{ + typedef void _Known_bound; +}; + +template +typename _Unique_if::_Single_object +make_unique(Args&&... args) +{ + return unique_ptr(new T(std::forward(args)...)); +} + +template +typename _Unique_if::_Unknown_bound +make_unique(size_t n) +{ + typedef typename remove_extent::type U; + return unique_ptr(new U[n]()); +} + +template +typename _Unique_if::_Known_bound +make_unique(Args&&...) = delete; +} // namespace std + +#endif // __cplusplus == 201103L + +#endif // GNSS_SDR_GNSS_SDR_MAKE_UNIQUE_H diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index 4b0f0285c..77e658144 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -33,7 +33,8 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr > queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + unsigned int out_stream, + Concurrent_Queue* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/gen_source.dat"; diff --git a/src/algorithms/signal_generator/adapters/signal_generator.h b/src/algorithms/signal_generator/adapters/signal_generator.h index 26c0e456f..9bb607f1d 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.h +++ b/src/algorithms/signal_generator/adapters/signal_generator.h @@ -44,7 +44,7 @@ class SignalGenerator : public GNSSBlockInterface public: SignalGenerator(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr > queue); + unsigned int out_stream, Concurrent_Queue* queue); ~SignalGenerator() = default; @@ -86,7 +86,6 @@ private: #endif gr::blocks::vector_to_stream::sptr vector_to_stream_; gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr > queue_; }; #endif // GNSS_SDR_SIGNAL_GENERATOR_H diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index fa5227d81..f909c43c0 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -40,238 +40,10 @@ #include #include -void run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA) -{ - const int MAX_INPUT_SAMPLES_TOTAL = 16384; - int max_value = 0; - int tx_fd; // DMA descriptor - std::ifstream infile1; - infile1.exceptions(std::ifstream::failbit | std::ifstream::badbit); - - try - { - infile1.open(Filename1, std::ios::binary); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Exception opening file " << Filename1 << std::endl; - return; - } - - std::ifstream infile2; - infile2.exceptions(std::ifstream::failbit | std::ifstream::badbit); - try - { - infile2.open(Filename2, std::ios::binary); - } - catch (const std::ifstream::failure &e) - { - // could not exist - } - - // rx signal - std::vector input_samples(MAX_INPUT_SAMPLES_TOTAL * 2); - std::vector input_samples2(MAX_INPUT_SAMPLES_TOTAL * 2); - std::vector input_samples_dma(MAX_INPUT_SAMPLES_TOTAL * 2 * 2); - - int nread_elements; - int nread_elements2; - int file_completed = 0; - int num_transferred_bytes; - - //************************************************************************** - // Open DMA device - //************************************************************************** - tx_fd = open("/dev/loop_tx", O_WRONLY); - if (tx_fd < 0) - { - std::cout << "Cannot open loop device" << std::endl; - return; - } - - //************************************************************************** - // Open input file - //************************************************************************** - int nsamples = 0; - - while ((file_completed == 0) && (enable_DMA == true)) - { - unsigned int dma_index = 0; - - if (FreqBand == "L1") - { - try - { - infile1.read(reinterpret_cast(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Exception reading file " << Filename1 << std::endl; - } - if (infile1) - { - nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2; - } - else - { - nread_elements = 0; - } - nsamples += (nread_elements / 2); - - for (int index0 = 0; index0 < (nread_elements); index0 += 2) - { - // channel 1 (queue 1) - input_samples_dma[dma_index] = 0; - input_samples_dma[dma_index + 1] = 0; - // channel 0 (queue 0) - input_samples_dma[dma_index + 2] = input_samples[index0]; - input_samples_dma[dma_index + 3] = input_samples[index0 + 1]; - - dma_index += 4; - } - } - else if (FreqBand == "L2") - { - try - { - infile1.read(reinterpret_cast(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Exception reading file " << Filename1 << std::endl; - } - if (infile1) - { - nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2; - } - else - { - nread_elements = 0; - } - nsamples += (nread_elements / 2); - - for (int index0 = 0; index0 < (nread_elements); index0 += 2) - { - // channel 1 (queue 1) - input_samples_dma[dma_index] = input_samples[index0]; - input_samples_dma[dma_index + 1] = input_samples[index0 + 1]; - // channel 0 (queue 0) - input_samples_dma[dma_index + 2] = 0; - input_samples_dma[dma_index + 3] = 0; - - dma_index += 4; - } - } - else if (FreqBand == "L1L2") - { - try - { - infile1.read(reinterpret_cast(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Exception reading file " << Filename1 << std::endl; - } - if (infile1) - { - nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2; - } - else - { - nread_elements = 0; - } - try - { - infile2.read(reinterpret_cast(input_samples2.data()), MAX_INPUT_SAMPLES_TOTAL * 2); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Exception reading file " << Filename1 << std::endl; - } - if (infile2) - { - nread_elements2 = MAX_INPUT_SAMPLES_TOTAL * 2; - } - else - { - nread_elements2 = 0; - } - - if (nread_elements > nread_elements2) - { - nread_elements = nread_elements2; // take the smallest - } - - nsamples += (nread_elements / 2); - - for (int index0 = 0; index0 < (nread_elements); index0 += 2) - { - input_samples[index0] = input_samples[index0]; - input_samples[index0 + 1] = input_samples[index0 + 1]; - - if (input_samples[index0] > max_value) - { - max_value = input_samples[index0]; - } - else if (-input_samples[index0] > max_value) - { - max_value = -input_samples[index0]; - } - - if (input_samples[index0 + 1] > max_value) - { - max_value = input_samples[index0 + 1]; - } - else if (-input_samples[index0 + 1] > max_value) - { - max_value = -input_samples[index0 + 1]; - } - - // channel 1 (queue 1) - input_samples_dma[dma_index] = input_samples2[index0]; - input_samples_dma[dma_index + 1] = input_samples2[index0 + 1]; - // channel 0 (queue 0) - input_samples_dma[dma_index + 2] = input_samples[index0]; - input_samples_dma[dma_index + 3] = input_samples[index0 + 1]; - - dma_index += 4; - } - } - - if (nread_elements > 0) - { - num_transferred_bytes = nread_elements * 2; - int num_bytes_sent = write(tx_fd, input_samples_dma.data(), nread_elements * 2); - if (num_bytes_sent != num_transferred_bytes) - { - std::cerr << "Error: DMA could not send all the required samples " << std::endl; - } - - // Throttle the DMA - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } - - if (nread_elements != MAX_INPUT_SAMPLES_TOTAL * 2) - { - file_completed = 1; - } - } - - try - { - infile1.close(); - infile2.close(); - } - catch (const std::ifstream::failure &e) - { - std::cerr << "Exception closing files " << Filename1 << " and " << Filename2 << std::endl; - } -} - Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface *configuration, const std::string &role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + Concurrent_Queue *queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_gain_mode("slow_attack"); double default_tx_attenuation_db = -10.0; @@ -564,6 +336,235 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() } +void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA) +{ + const int MAX_INPUT_SAMPLES_TOTAL = 16384; + int max_value = 0; + int tx_fd; // DMA descriptor + std::ifstream infile1; + infile1.exceptions(std::ifstream::failbit | std::ifstream::badbit); + + try + { + infile1.open(Filename1, std::ios::binary); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Exception opening file " << Filename1 << std::endl; + return; + } + + std::ifstream infile2; + infile2.exceptions(std::ifstream::failbit | std::ifstream::badbit); + try + { + infile2.open(Filename2, std::ios::binary); + } + catch (const std::ifstream::failure &e) + { + // could not exist + } + + // rx signal + std::vector input_samples(MAX_INPUT_SAMPLES_TOTAL * 2); + std::vector input_samples2(MAX_INPUT_SAMPLES_TOTAL * 2); + std::vector input_samples_dma(MAX_INPUT_SAMPLES_TOTAL * 2 * 2); + + int nread_elements; + int nread_elements2; + int file_completed = 0; + int num_transferred_bytes; + + //************************************************************************** + // Open DMA device + //************************************************************************** + tx_fd = open("/dev/loop_tx", O_WRONLY); + if (tx_fd < 0) + { + std::cout << "Cannot open loop device" << std::endl; + return; + } + + //************************************************************************** + // Open input file + //************************************************************************** + int nsamples = 0; + + while ((file_completed == 0) && (enable_DMA == true)) + { + unsigned int dma_index = 0; + + if (FreqBand == "L1") + { + try + { + infile1.read(reinterpret_cast(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Exception reading file " << Filename1 << std::endl; + } + if (infile1) + { + nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2; + } + else + { + nread_elements = 0; + } + nsamples += (nread_elements / 2); + + for (int index0 = 0; index0 < (nread_elements); index0 += 2) + { + // channel 1 (queue 1) + input_samples_dma[dma_index] = 0; + input_samples_dma[dma_index + 1] = 0; + // channel 0 (queue 0) + input_samples_dma[dma_index + 2] = input_samples[index0]; + input_samples_dma[dma_index + 3] = input_samples[index0 + 1]; + + dma_index += 4; + } + } + else if (FreqBand == "L2") + { + try + { + infile1.read(reinterpret_cast(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Exception reading file " << Filename1 << std::endl; + } + if (infile1) + { + nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2; + } + else + { + nread_elements = 0; + } + nsamples += (nread_elements / 2); + + for (int index0 = 0; index0 < (nread_elements); index0 += 2) + { + // channel 1 (queue 1) + input_samples_dma[dma_index] = input_samples[index0]; + input_samples_dma[dma_index + 1] = input_samples[index0 + 1]; + // channel 0 (queue 0) + input_samples_dma[dma_index + 2] = 0; + input_samples_dma[dma_index + 3] = 0; + + dma_index += 4; + } + } + else if (FreqBand == "L1L2") + { + try + { + infile1.read(reinterpret_cast(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Exception reading file " << Filename1 << std::endl; + } + if (infile1) + { + nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2; + } + else + { + nread_elements = 0; + } + try + { + infile2.read(reinterpret_cast(input_samples2.data()), MAX_INPUT_SAMPLES_TOTAL * 2); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Exception reading file " << Filename1 << std::endl; + } + if (infile2) + { + nread_elements2 = MAX_INPUT_SAMPLES_TOTAL * 2; + } + else + { + nread_elements2 = 0; + } + + if (nread_elements > nread_elements2) + { + nread_elements = nread_elements2; // take the smallest + } + + nsamples += (nread_elements / 2); + + for (int index0 = 0; index0 < (nread_elements); index0 += 2) + { + input_samples[index0] = input_samples[index0]; + input_samples[index0 + 1] = input_samples[index0 + 1]; + + if (input_samples[index0] > max_value) + { + max_value = input_samples[index0]; + } + else if (-input_samples[index0] > max_value) + { + max_value = -input_samples[index0]; + } + + if (input_samples[index0 + 1] > max_value) + { + max_value = input_samples[index0 + 1]; + } + else if (-input_samples[index0 + 1] > max_value) + { + max_value = -input_samples[index0 + 1]; + } + + // channel 1 (queue 1) + input_samples_dma[dma_index] = input_samples2[index0]; + input_samples_dma[dma_index + 1] = input_samples2[index0 + 1]; + // channel 0 (queue 0) + input_samples_dma[dma_index + 2] = input_samples[index0]; + input_samples_dma[dma_index + 3] = input_samples[index0 + 1]; + + dma_index += 4; + } + } + + if (nread_elements > 0) + { + num_transferred_bytes = nread_elements * 2; + int num_bytes_sent = write(tx_fd, input_samples_dma.data(), nread_elements * 2); + if (num_bytes_sent != num_transferred_bytes) + { + std::cerr << "Error: DMA could not send all the required samples " << std::endl; + } + + // Throttle the DMA + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + + if (nread_elements != MAX_INPUT_SAMPLES_TOTAL * 2) + { + file_completed = 1; + } + } + + try + { + infile1.close(); + infile2.close(); + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Exception closing files " << Filename1 << " and " << Filename2 << std::endl; + } +} + + void Ad9361FpgaSignalSource::connect(gr::top_block_sptr top_block) { if (top_block) diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index f8af17830..a861ac844 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -35,9 +35,9 @@ class ConfigurationInterface; class Ad9361FpgaSignalSource : public GNSSBlockInterface { public: - Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + Ad9361FpgaSignalSource(ConfigurationInterface *configuration, + const std::string &role, unsigned int in_stream, + unsigned int out_stream, Concurrent_Queue *queue); ~Ad9361FpgaSignalSource(); @@ -102,8 +102,6 @@ private: size_t item_size_; - std::shared_ptr> queue_; - std::shared_ptr switch_fpga; int32_t switch_position; @@ -114,6 +112,7 @@ private: bool enable_DMA_; bool rf_shutdown_; + void run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA); }; #endif // GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index 518607d76..c0e2d0479 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -29,7 +29,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + Concurrent_Queue* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { // DUMP PARAMETERS std::string empty = ""; diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index cab739186..2c5a490b0 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -48,7 +48,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface public: CustomUDPSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~CustomUDPSignalSource() = default; @@ -98,8 +98,6 @@ private: #endif Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_; - - std::shared_ptr> queue_; }; #endif // GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index 40631b2cb..b5f347744 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -33,7 +33,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + Concurrent_Queue* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_filename = "./example_capture.dat"; std::string default_item_type = "short"; @@ -211,7 +211,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); + valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; if (dump_) diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 6e6476170..7624bd4a1 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -50,7 +50,7 @@ class FileSignalSource : public GNSSBlockInterface public: FileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); ~FileSignalSource() = default; @@ -121,7 +121,6 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; - std::shared_ptr> queue_; size_t item_size_; // Throttle control bool enable_throttle_control_; diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 717977214..95af50c4d 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -31,10 +31,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), - in_stream_(in_stream), - out_stream_(out_stream), - queue_(std::move(queue)) + Concurrent_Queue* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "byte"; item_type_ = configuration->property(role + ".item_type", default_item_type); diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index d59d03b6d..3f8be56f6 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -47,7 +47,7 @@ class FlexibandSignalSource : public GNSSBlockInterface public: FlexibandSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~FlexibandSignalSource() = default; @@ -94,13 +94,11 @@ private: int n_channels_; int sel_ch_; - gr::block_sptr flexiband_source_; + boost::shared_ptr flexiband_source_; - std::vector> char_to_float; - std::vector> float_to_complex_; + std::vector> char_to_float; + std::vector> float_to_complex_; std::vector null_sinks_; - - std::shared_ptr> queue_; }; #endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index 7c9c85db2..f1f96f3fc 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -34,7 +34,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface *configuration, const std::string &role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + Concurrent_Queue *queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -320,7 +320,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface *configuration if (samples_ != 0) { DLOG(INFO) << "Send STOP signal after " << samples_ << " samples"; - valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); + valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; } diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index e91e78a07..0e30fc0d1 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -46,7 +46,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface public: Fmcomms2SignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~Fmcomms2SignalSource(); @@ -127,7 +127,6 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.cc b/src/algorithms/signal_source/adapters/gen_signal_source.cc index c2367c0b4..71a2f668b 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gen_signal_source.cc @@ -29,24 +29,17 @@ // Constructor -GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter, - std::string role, std::shared_ptr> queue) : signal_generator_(signal_generator), - filter_(filter), - role_(std::move(role)), - queue_(std::move(queue)) +GenSignalSource::GenSignalSource(std::shared_ptr signal_generator, + std::shared_ptr filter, + std::string role, + Concurrent_Queue *queue __attribute__((unused))) : signal_generator_(std::move(signal_generator)), + filter_(std::move(filter)), + role_(std::move(role)) { connected_ = false; } -// Destructor -GenSignalSource::~GenSignalSource() -{ - delete signal_generator_; - delete filter_; -} - - void GenSignalSource::connect(gr::top_block_sptr top_block) { if (connected_) diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.h b/src/algorithms/signal_source/adapters/gen_signal_source.h index b22d33f05..148db05db 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.h +++ b/src/algorithms/signal_source/adapters/gen_signal_source.h @@ -37,11 +37,11 @@ class GenSignalSource : public GNSSBlockInterface { public: //! Constructor - GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter, - std::string role, std::shared_ptr> queue); + GenSignalSource(std::shared_ptr signal_generator, std::shared_ptr filter, + std::string role, Concurrent_Queue *queue); //! Virtual destructor - virtual ~GenSignalSource(); + virtual ~GenSignalSource() = default; void connect(gr::top_block_sptr top_block) override; void disconnect(gr::top_block_sptr top_block) override; @@ -52,15 +52,14 @@ public: //! Returns "Signal Source" inline std::string implementation() override { return "Signal Source"; } inline size_t item_size() override { return 0; } - inline GNSSBlockInterface *signal_generator() const { return signal_generator_; } + inline std::shared_ptr signal_generator() const { return signal_generator_; } private: - GNSSBlockInterface *signal_generator_; - GNSSBlockInterface *filter_; + std::shared_ptr signal_generator_; + std::shared_ptr filter_; std::string role_; std::string implementation_; bool connected_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_GEN_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc index e1bd04d70..824429655 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc @@ -25,7 +25,10 @@ Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, + unsigned int in_stream, + unsigned int out_stream, + Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "short"; std::string default_dump_file = "./data/gn3s_source.dat"; diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.h b/src/algorithms/signal_source/adapters/gn3s_signal_source.h index 2973646a3..1eeea5ec4 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.h +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.h @@ -40,7 +40,7 @@ class Gn3sSignalSource : public GNSSBlockInterface public: Gn3sSignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~Gn3sSignalSource() = default; @@ -78,7 +78,6 @@ private: std::string dump_filename_; gr::block_sptr gn3s_source_; gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_GN3S_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.cc b/src/algorithms/signal_source/adapters/labsat_signal_source.cc index 3b788385e..fa828795b 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.cc +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.cc @@ -26,7 +26,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, - const std::string& role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./labsat_output.dat"; @@ -42,7 +42,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); - labsat23_source_ = labsat23_make_source_sptr(filename_.c_str(), channel_selector, queue_); + labsat23_source_ = labsat23_make_source_sptr(filename_.c_str(), channel_selector, queue); DLOG(INFO) << "Item size " << item_size_; DLOG(INFO) << "labsat23_source_(" << labsat23_source_->unique_id() << ")"; } diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.h b/src/algorithms/signal_source/adapters/labsat_signal_source.h index 8a353420e..67e170b8f 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.h +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.h @@ -39,7 +39,7 @@ class LabsatSignalSource : public GNSSBlockInterface public: LabsatSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~LabsatSignalSource() = default; @@ -77,7 +77,6 @@ private: std::string dump_filename_; gr::block_sptr labsat23_source_; gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_LABSAT_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc index 76ba2d7fc..22ce5e3cb 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc @@ -32,7 +32,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + Concurrent_Queue* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_filename = "./example_capture.dat"; std::string default_item_type = "short"; @@ -205,7 +205,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterfac DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); + valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; if (enable_throttle_control_) diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h index 480aedc63..e4f1f1ffd 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h @@ -51,7 +51,7 @@ class MultichannelFileSignalSource : public GNSSBlockInterface public: MultichannelFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); ~MultichannelFileSignalSource() = default; @@ -121,7 +121,6 @@ private: #endif gr::blocks::file_sink::sptr sink_; std::vector throttle_vec_; - std::shared_ptr> queue_; size_t item_size_; // Throttle control bool enable_throttle_control_; diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index 9515c78b1..b365c0d20 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -33,7 +33,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + Concurrent_Queue* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -137,7 +137,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue_); + valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; if (dump_) diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index 5c6ca67a2..171b4f343 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -50,7 +50,7 @@ class NsrFileSignalSource : public GNSSBlockInterface public: NsrFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); ~NsrFileSignalSource() = default; inline std::string role() override @@ -121,7 +121,6 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; - std::shared_ptr> queue_; size_t item_size_; // Throttle control bool enable_throttle_control_; diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index 10cb7c453..14c056489 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -31,7 +31,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { // DUMP PARAMETERS std::string empty = ""; @@ -123,7 +123,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, if (samples_ != 0) { DLOG(INFO) << "Send STOP signal after " << samples_ << " samples"; - valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); + valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; } diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index fd9230548..d514562e1 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -48,7 +48,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface public: OsmosdrSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~OsmosdrSignalSource() = default; @@ -108,7 +108,6 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index 5419b4130..161ccdff5 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -28,7 +28,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -135,7 +135,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration if (samples_ != 0) { DLOG(INFO) << "Send STOP signal after " << samples_ << " samples"; - valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); + valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; } diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index d701742a5..edb54fe37 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -48,7 +48,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface public: PlutosdrSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~PlutosdrSignalSource() = default; @@ -112,7 +112,6 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc index 39e85e4f1..26d64f7cb 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -27,7 +27,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/raw_array_source.dat"; diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index e14eb9530..fd3272b72 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -39,7 +39,7 @@ class RawArraySignalSource : public GNSSBlockInterface public: RawArraySignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~RawArraySignalSource() = default; @@ -78,7 +78,6 @@ private: std::string eth_device_; gr::block_sptr raw_array_source_; gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index bdf84a135..8edde7ee4 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -34,10 +34,9 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), - in_stream_(in_stream), - out_stream_(out_stream), - queue_(std::move(queue)) + Concurrent_Queue* queue) : role_(role), + in_stream_(in_stream), + out_stream_(out_stream) { // DUMP PARAMETERS std::string empty = ""; @@ -111,7 +110,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, if (samples_ != 0ULL) { DLOG(INFO) << "Send STOP signal after " << samples_ << " samples"; - valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); + valve_ = gnss_sdr_make_valve(item_size_, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; } diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index 134906233..56ae6975e 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -51,7 +51,7 @@ public: const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue); + Concurrent_Queue* queue); ~RtlTcpSignalSource() = default; @@ -111,7 +111,6 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; - std::shared_ptr> queue_; }; #endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index 5c3a3c163..a14bab6ad 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -32,7 +32,7 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + Concurrent_Queue* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "int"; @@ -136,7 +136,7 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue_); + valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; if (dump_) diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index 517747a65..d4d35f826 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -48,7 +48,7 @@ class SpirFileSignalSource : public GNSSBlockInterface public: SpirFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); ~SpirFileSignalSource() = default; inline std::string role() override @@ -119,7 +119,6 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; - std::shared_ptr> queue_; size_t item_size_; // Throttle control bool enable_throttle_control_; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index cce6e49e9..76ba6a20e 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -29,7 +29,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, - const std::string& role, uint32_t in_streams, uint32_t out_streams, std::shared_ptr> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue)) + const std::string& role, uint32_t in_streams, uint32_t out_streams, Concurrent_Queue* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { std::string default_filename = "../data/my_capture.dat"; std::string default_dump_filename = "../data/my_capture_dump.dat"; @@ -137,7 +137,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* for (uint32_t i = 0; i < (n_channels_); i++) { - valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_)); + valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue)); if (dump_) { std::string tmp_str = dump_filename_ + "_ch" + std::to_string(i); diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index 3a1d32d47..bfda945a2 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -53,7 +53,7 @@ class SpirGSS6450FileSignalSource : public GNSSBlockInterface { public: SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, const std::string& role, - uint32_t in_streams, uint32_t out_streams, std::shared_ptr> queue); + uint32_t in_streams, uint32_t out_streams, Concurrent_Queue* queue); ~SpirGSS6450FileSignalSource() = default; inline std::string role() override @@ -130,7 +130,6 @@ private: #endif std::vector sink_vec_; std::vector throttle_vec_; - std::shared_ptr> queue_; size_t item_size_; }; diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index f600ae324..93c4c196a 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -34,10 +34,9 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue) : role_(role), - in_streams_(in_streams), - out_streams_(out_streams), - queue_(queue) + Concurrent_Queue* queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -142,7 +141,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_); + valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; if (dump_) diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index ae9ad36b0..bfb997d44 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -54,7 +54,7 @@ public: const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); ~TwoBitCpxFileSignalSource() = default; inline std::string role() override @@ -126,7 +126,6 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; - std::shared_ptr> queue_; size_t item_size_; // Throttle control bool enable_throttle_control_; diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index 721bf6c9d..cb4032487 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -36,10 +36,9 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue) : role_(role), - in_streams_(in_streams), - out_streams_(out_streams), - queue_(queue) + Concurrent_Queue* queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -206,7 +205,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; - valve_ = gnss_sdr_make_valve(output_item_size, samples_, queue_); + valve_ = gnss_sdr_make_valve(output_item_size, samples_, queue); DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; if (dump_) diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index cd2365c85..21ace2c68 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -53,7 +53,7 @@ class TwoBitPackedFileSignalSource : public GNSSBlockInterface public: TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); ~TwoBitPackedFileSignalSource() = default; inline std::string role() override @@ -145,7 +145,6 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; - std::shared_ptr> queue_; size_t item_size_; bool big_endian_items_; bool big_endian_bytes_; diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 51bdaffff..ea6b30150 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -31,7 +31,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - std::shared_ptr> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) + Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { // DUMP PARAMETERS std::string empty = ""; @@ -204,7 +204,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, if (samples_.at(i) != 0ULL) { LOG(INFO) << "RF_channel " << i << " Send STOP signal after " << samples_.at(i) << " samples"; - valve_.emplace_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_)); + valve_.emplace_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue)); DLOG(INFO) << "valve(" << valve_.at(i)->unique_id() << ")"; } diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index 623664148..91cfcb8c9 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -46,7 +46,7 @@ class UhdSignalSource : public GNSSBlockInterface public: UhdSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, - unsigned int out_stream, std::shared_ptr> queue); + unsigned int out_stream, Concurrent_Queue* queue); ~UhdSignalSource() = default; @@ -103,8 +103,6 @@ private: std::vector> valve_; #endif std::vector file_sink_; - - std::shared_ptr> queue_; }; #endif // GNSS_SDR_UHD_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index c2a99eb3c..006577344 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -30,18 +30,18 @@ #include -labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, std::shared_ptr> queue) +labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, Concurrent_Queue *queue) { - return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector, std::move(queue))); + return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector, queue)); } labsat23_source::labsat23_source(const char *signal_file_basename, int channel_selector, - std::shared_ptr> queue) : gr::block("labsat23_source", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(gr_complex))), - d_queue(std::move(queue)) + Concurrent_Queue *queue) : gr::block("labsat23_source", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(1, 1, sizeof(gr_complex))), + d_queue(queue) { if (channel_selector < 1 or channel_selector > 2) { @@ -60,16 +60,15 @@ labsat23_source::labsat23_source(const char *signal_file_basename, std::string signal_file; this->set_output_multiple(8); signal_file = generate_filename(); - binary_input_file = new std::ifstream(signal_file.c_str(), std::ios::in | std::ios::binary); + binary_input_file.open(signal_file.c_str(), std::ios::in | std::ios::binary); - if (binary_input_file->is_open()) + if (binary_input_file.is_open()) { std::cout << "Labsat file source is reading samples from " << signal_file << std::endl; } else { std::cout << "Labsat file " << signal_file << " could not be opened!" << std::endl; - delete binary_input_file; exit(1); } } @@ -79,9 +78,9 @@ labsat23_source::~labsat23_source() { try { - if (binary_input_file->is_open()) + if (binary_input_file.is_open()) { - binary_input_file->close(); + binary_input_file.close(); } } catch (const std::ifstream::failure &e) @@ -92,7 +91,6 @@ labsat23_source::~labsat23_source() { std::cerr << e.what() << '\n'; } - delete binary_input_file; } @@ -202,10 +200,10 @@ int labsat23_source::general_work(int noutput_items, if (d_header_parsed == false) { - if (binary_input_file->eof() == false) + if (binary_input_file.eof() == false) { std::array memblock{}; - binary_input_file->read(memblock.data(), 1024); + binary_input_file.read(memblock.data(), 1024); // parse Labsat header // check preamble int byte_counter = 0; @@ -392,8 +390,8 @@ int labsat23_source::general_work(int noutput_items, // end of header d_header_parsed = true; // seek file to the first signal sample - binary_input_file->clear(); - binary_input_file->seekg(header_bytes, binary_input_file->beg); + binary_input_file.clear(); + binary_input_file.seekg(header_bytes, binary_input_file.beg); return 0; } std::cout << "Labsat file header error: section 2 is not available." << std::endl; @@ -419,8 +417,8 @@ int labsat23_source::general_work(int noutput_items, if (n_int16_to_read > 0) { std::vector memblock(n_int16_to_read); - binary_input_file->read(reinterpret_cast(memblock.data()), n_int16_to_read * 2); - n_int16_to_read = binary_input_file->gcount() / 2; // from bytes to int16 + binary_input_file.read(reinterpret_cast(memblock.data()), n_int16_to_read * 2); + n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16 if (n_int16_to_read > 0) { int output_pointer = 0; @@ -438,9 +436,9 @@ int labsat23_source::general_work(int noutput_items, { std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; } - binary_input_file->close(); - binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); - if (binary_input_file->is_open()) + binary_input_file.close(); + binary_input_file.open(generate_filename().c_str(), std::ios::in | std::ios::binary); + if (binary_input_file.is_open()) { std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; return 0; @@ -477,8 +475,8 @@ int labsat23_source::general_work(int noutput_items, if (n_int16_to_read > 0) { std::vector memblock(n_int16_to_read); - binary_input_file->read(reinterpret_cast(memblock.data()), n_int16_to_read * 2); - n_int16_to_read = binary_input_file->gcount() / 2; // from bytes to int16 + binary_input_file.read(reinterpret_cast(memblock.data()), n_int16_to_read * 2); + n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16 if (n_int16_to_read > 0) { int output_pointer = 0; @@ -496,9 +494,9 @@ int labsat23_source::general_work(int noutput_items, { std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; } - binary_input_file->close(); - binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); - if (binary_input_file->is_open()) + binary_input_file.close(); + binary_input_file.open(generate_filename().c_str(), std::ios::in | std::ios::binary); + if (binary_input_file.is_open()) { std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; return 0; diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h index 0a19a2ceb..40bbee142 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h @@ -43,7 +43,7 @@ using labsat23_source_sptr = boost::shared_ptr; labsat23_source_sptr labsat23_make_source_sptr( const char *signal_file_basename, int channel_selector, - std::shared_ptr> queue); + Concurrent_Queue *queue); /*! * \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex @@ -62,11 +62,11 @@ private: friend labsat23_source_sptr labsat23_make_source_sptr( const char *signal_file_basename, int channel_selector, - std::shared_ptr> queue); + Concurrent_Queue *queue); labsat23_source(const char *signal_file_basename, int channel_selector, - std::shared_ptr> queue); + Concurrent_Queue *queue); std::string generate_filename(); void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type); @@ -77,10 +77,10 @@ private: int d_current_file_number; uint8_t d_labsat_version; std::string d_signal_file_basename; - std::ifstream *binary_input_file; + std::ifstream binary_input_file; uint8_t d_ref_clock; uint8_t d_bits_per_sample; - std::shared_ptr> d_queue; + Concurrent_Queue *d_queue; }; #endif // GNSS_SDR_LABSAT23_SOURCE_H diff --git a/src/algorithms/signal_source/libs/ad9361_manager.cc b/src/algorithms/signal_source/libs/ad9361_manager.cc index 94f847689..f30930302 100644 --- a/src/algorithms/signal_source/libs/ad9361_manager.cc +++ b/src/algorithms/signal_source/libs/ad9361_manager.cc @@ -180,8 +180,8 @@ bool config_ad9361_rx_local(uint64_t bandwidth_, bool quadrature_, bool rfdc_, bool bbdc_, - std::string filter_source_, - std::string filter_filename_, + std::string filter_source_, // NOLINT(performance-unnecessary-value-param) + std::string filter_filename_, // NOLINT(performance-unnecessary-value-param) float Fpass_, float Fstop_) diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.cc b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc index a13102301..b9048dace 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.cc +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc @@ -31,42 +31,43 @@ Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue, + Concurrent_Queue* queue, bool stop_flowgraph) : gr::sync_block("valve", gr::io_signature::make(1, 20, sizeof_stream_item), gr::io_signature::make(1, 20, sizeof_stream_item)), d_nitems(nitems), d_ncopied_items(0), - d_queue(std::move(queue)), + d_queue(queue), d_stop_flowgraph(stop_flowgraph) { d_open_valve = false; } + #if GNURADIO_USES_STD_POINTERS -std::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr> queue, bool stop_flowgraph) +std::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph) { - std::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph)); + std::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph)); return valve_; } -std::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr> queue) +std::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue) { - std::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true)); + std::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true)); return valve_; } #else -boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr> queue, bool stop_flowgraph) +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue, bool stop_flowgraph) { - boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph)); + boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph)); return valve_; } -boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr> queue) +boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue* queue) { - boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true)); + boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true)); return valve_; } #endif @@ -79,8 +80,8 @@ void Gnss_Sdr_Valve::open_valve() int Gnss_Sdr_Valve::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) { if (d_open_valve == false) { diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.h b/src/algorithms/signal_source/libs/gnss_sdr_valve.h index 61b1f9584..b2aa7559f 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.h +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.h @@ -41,23 +41,23 @@ class Gnss_Sdr_Valve; std::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue); + Concurrent_Queue* queue); std::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue, + Concurrent_Queue* queue, bool stop_flowgraph); #else boost::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue); + Concurrent_Queue* queue); boost::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue, + Concurrent_Queue* queue, bool stop_flowgraph); #endif @@ -71,40 +71,40 @@ public: void open_valve(); int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); private: #if GNURADIO_USES_STD_POINTERS friend std::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue); + Concurrent_Queue* queue); friend std::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue, + Concurrent_Queue* queue, bool stop_flowgraph); #else friend boost::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue); + Concurrent_Queue* queue); friend boost::shared_ptr gnss_sdr_make_valve( size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue, + Concurrent_Queue* queue, bool stop_flowgraph); #endif Gnss_Sdr_Valve(size_t sizeof_stream_item, uint64_t nitems, - std::shared_ptr> queue, bool stop_flowgraph); + Concurrent_Queue* queue, bool stop_flowgraph); uint64_t d_nitems; uint64_t d_ncopied_items; - std::shared_ptr> d_queue; + Concurrent_Queue* d_queue; bool d_stop_flowgraph; bool d_open_valve; }; diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index d645720bb..136716f8f 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -5,13 +5,15 @@ * Luis Esteve, 2012. luis(at)epsilon-formacion.com * Javier Arribas, 2011. jarribas(at)cttc.es * Marc Majoral, 2018. mmajoral(at)cttc.es + * Carles Fernandez-Prades, 2014-2020. cfernandez(at)cttc.es * * This class encapsulates the complexity behind the instantiation * of GNSS blocks. * - * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) + * ----------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -20,7 +22,7 @@ * * SPDX-License-Identifier: GPL-3.0-or-later * - * ------------------------------------------------------------------------- + * ----------------------------------------------------------------------------- */ @@ -62,6 +64,7 @@ #include "glonass_l2_ca_pcps_acquisition.h" #include "glonass_l2_ca_telemetry_decoder.h" #include "gnss_block_interface.h" +#include "gnss_sdr_make_unique.h" #include "gps_l1_ca_dll_pll_tracking.h" #include "gps_l1_ca_kf_tracking.h" #include "gps_l1_ca_pcps_acquisition.h" @@ -165,7 +168,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( - const std::shared_ptr& configuration, const std::shared_ptr> queue, int ID) // NOLINT(performance-unnecessary-value-param) + ConfigurationInterface* configuration, Concurrent_Queue* queue, int ID) // NOLINT(performance-unnecessary-value-param) { std::string default_implementation = "File_Signal_Source"; std::string role = "SignalSource"; // backwards compatibility for old conf files @@ -187,7 +190,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( std::unique_ptr GNSSBlockFactory::GetSignalConditioner( - const std::shared_ptr& configuration, int ID) + ConfigurationInterface* configuration, int ID) { std::string default_implementation = "Pass_Through"; // backwards compatibility for old conf files @@ -235,25 +238,25 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( if (signal_conditioner == "Array_Signal_Conditioner") { // instantiate the array version - std::unique_ptr conditioner_(new ArraySignalConditioner(configuration.get(), + std::unique_ptr conditioner_ = std::make_unique(configuration, GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1), GetBlock(configuration, role_inputfilter, input_filter, 1, 1), GetBlock(configuration, role_resampler, resampler, 1, 1), - role_conditioner, "Signal_Conditioner")); + role_conditioner, "Signal_Conditioner"); return conditioner_; } // single-antenna version - std::unique_ptr conditioner_(new SignalConditioner(configuration.get(), + std::unique_ptr conditioner_ = std::make_unique(configuration, GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1), GetBlock(configuration, role_inputfilter, input_filter, 1, 1), GetBlock(configuration, role_resampler, resampler, 1, 1), - role_conditioner, "Signal_Conditioner")); + role_conditioner, "Signal_Conditioner"); return conditioner_; } -std::unique_ptr GNSSBlockFactory::GetObservables(const std::shared_ptr& configuration) +std::unique_ptr GNSSBlockFactory::GetObservables(ConfigurationInterface* configuration) { std::string default_implementation = "Hybrid_Observables"; std::string implementation = configuration->property("Observables.implementation", default_implementation); @@ -281,7 +284,7 @@ std::unique_ptr GNSSBlockFactory::GetObservables(const std:: } -std::unique_ptr GNSSBlockFactory::GetPVT(const std::shared_ptr& configuration) +std::unique_ptr GNSSBlockFactory::GetPVT(ConfigurationInterface* configuration) { std::string default_implementation = "RTKLIB_PVT"; std::string implementation = configuration->property("PVT.implementation", default_implementation); @@ -302,9 +305,9 @@ std::unique_ptr GNSSBlockFactory::GetPVT(const std::shared_p // ********* GPS L1 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1C( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { // "appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters // can find their specific configurations when they read the config @@ -343,8 +346,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1C" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1C" + appendix2 + ".item_type", default_item_type); @@ -352,17 +353,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1C" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1C" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1C" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1C", queue)); + "Channel", "1C", queue); return channel_; } @@ -370,9 +370,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( // ********* GPS L2C (M) CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2S( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " << acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; @@ -407,8 +407,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2S" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2S" + appendix2 + ".item_type", default_item_type); @@ -416,17 +414,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_2S" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_2S" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_2S" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2S", queue)); + "Channel", "2S", queue); return channel_; } @@ -434,9 +431,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( // ********* GALILEO E1 B CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1B( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -474,8 +471,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1B" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1B" + appendix2 + ".item_type", default_item_type); @@ -483,17 +478,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1B" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1B" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1B" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1B", queue)); + "Channel", "1B", queue); return channel_; } @@ -501,9 +495,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( // ********* GALILEO E5a CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_5X( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -541,8 +535,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_5X" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_5X" + appendix2 + ".item_type", default_item_type); @@ -550,17 +542,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_5X" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_5X" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_5X" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "5X", queue)); + "Channel", "5X", queue); return channel_; } @@ -568,9 +559,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( // ********* GLONASS L1 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1G( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -609,8 +600,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_1G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1G" + appendix2 + ".item_type", default_item_type); @@ -618,17 +607,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1G" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1G" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1G" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1G", queue)); + "Channel", "1G", queue); return channel_; } @@ -636,9 +624,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( // ********* GLONASS L2 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2G( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -677,8 +665,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_2G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2G" + appendix2 + ".item_type", default_item_type); @@ -686,17 +672,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_2G" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_2G" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_2G" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2G", queue)); + "Channel", "2G", queue); return channel_; } @@ -704,9 +689,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( // ********* GPS L5 CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_L5( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -744,8 +729,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_L5" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_L5" + appendix2 + ".item_type", default_item_type); @@ -753,17 +736,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_L5" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_L5" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_L5" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "L5", queue)); + "Channel", "L5", queue); return channel_; } @@ -771,9 +753,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( // ********* BeiDou B1I CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_B1( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -811,8 +793,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_B1" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_B1" + appendix2 + ".item_type", default_item_type); @@ -820,17 +800,16 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_B1" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_B1" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_B1" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "B1", queue)); + "Channel", "B1", queue); return channel_; } @@ -838,9 +817,9 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( // ********* BeiDou B3I CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_B3( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue) + Concurrent_Queue* queue) { std::stringstream stream; stream << channel; @@ -878,8 +857,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( appendix3 = ""; } // Automatically detect input data type - std::shared_ptr config; - config = std::make_shared(); std::string default_item_type = "gr_complex"; std::string acq_item_type = configuration->property("Acquisition_B3" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_B3" + appendix2 + ".item_type", default_item_type); @@ -887,24 +864,23 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( { LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!"; } - config->set_property("Channel.item_type", acq_item_type); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_B3" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_B3" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_B3" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, + std::unique_ptr channel_ = std::make_unique(configuration, channel, std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "B3", queue)); + "Channel", "B3", queue); return channel_; } std::unique_ptr>> GNSSBlockFactory::GetChannels( - const std::shared_ptr& configuration, const std::shared_ptr> queue) // NOLINT(performance-unnecessary-value-param) + ConfigurationInterface* configuration, Concurrent_Queue* queue) // NOLINT(performance-unnecessary-value-param) { std::string default_implementation = "Pass_Through"; std::string tracking_implementation; @@ -933,7 +909,7 @@ std::unique_ptr>> GNSSBlockFacto Channels_B1_count + Channels_B3_count; - std::unique_ptr>> channels(new std::vector>(total_channels)); + auto channels = std::make_unique>>(total_channels); try { // **************** GPS L1 C/A CHANNELS ********************** @@ -1221,17 +1197,17 @@ std::unique_ptr>> GNSSBlockFacto * (see below) */ std::unique_ptr GNSSBlockFactory::GetBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, - unsigned int out_streams, const std::shared_ptr> queue) // NOLINT(performance-unnecessary-value-param) + unsigned int out_streams, Concurrent_Queue* queue) // NOLINT(performance-unnecessary-value-param) { std::unique_ptr block; // PASS THROUGH ------------------------------------------------------------ if (implementation == "Pass_Through") { - std::unique_ptr block_(new Pass_Through(configuration.get(), role, in_streams, out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, out_streams); block = std::move(block_); } @@ -1240,8 +1216,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new FileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } @@ -1255,8 +1231,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new MultichannelFileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } @@ -1271,8 +1247,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new CustomUDPSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } @@ -1287,8 +1263,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new NsrFileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } catch (const std::exception& e) @@ -1301,8 +1277,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new TwoBitCpxFileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } catch (const std::exception& e) @@ -1315,8 +1291,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new TwoBitPackedFileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } catch (const std::exception& e) @@ -1329,8 +1305,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new SpirFileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } catch (const std::exception& e) @@ -1343,8 +1319,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new SpirGSS6450FileSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } catch (const std::exception& e) @@ -1357,8 +1333,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new RtlTcpSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } catch (const std::exception& e) @@ -1371,8 +1347,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( { try { - std::unique_ptr block_(new LabsatSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } @@ -1385,16 +1361,16 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #if UHD_DRIVER else if (implementation == "UHD_Signal_Source") { - std::unique_ptr block_(new UhdSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif #if GN3S_DRIVER else if (implementation == "GN3S_Signal_Source") { - std::unique_ptr block_(new Gn3sSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1402,8 +1378,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #if RAW_ARRAY_DRIVER else if (implementation == "Raw_Array_Signal_Source") { - std::unique_ptr block_(new RawArraySignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1411,8 +1387,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #if OSMOSDR_DRIVER else if (implementation == "Osmosdr_Signal_Source") { - std::unique_ptr block_(new OsmosdrSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1420,8 +1396,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #if PLUTOSDR_DRIVER else if (implementation == "Plutosdr_Signal_Source") { - std::unique_ptr block_(new PlutosdrSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1429,8 +1405,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #if FMCOMMS2_DRIVER else if (implementation == "Fmcomms2_Signal_Source") { - std::unique_ptr block_(new Fmcomms2SignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1438,8 +1414,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( #if FLEXIBAND_DRIVER else if (implementation == "Flexiband_Signal_Source") { - std::unique_ptr block_(new FlexibandSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1447,447 +1423,447 @@ std::unique_ptr GNSSBlockFactory::GetBlock( // DATA TYPE ADAPTER ----------------------------------------------------------- else if (implementation == "Byte_To_Short") { - std::unique_ptr block_(new ByteToShort(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Ibyte_To_Cbyte") { - std::unique_ptr block_(new IbyteToCbyte(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Ibyte_To_Cshort") { - std::unique_ptr block_(new IbyteToCshort(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Ibyte_To_Complex") { - std::unique_ptr block_(new IbyteToComplex(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Ishort_To_Cshort") { - std::unique_ptr block_(new IshortToCshort(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Ishort_To_Complex") { - std::unique_ptr block_(new IshortToComplex(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } // INPUT FILTER ---------------------------------------------------------------- else if (implementation == "Fir_Filter") { - std::unique_ptr block_(new FirFilter(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Freq_Xlating_Fir_Filter") { - std::unique_ptr block_(new FreqXlatingFirFilter(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Beamformer_Filter") { - std::unique_ptr block_(new BeamformerFilter(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Pulse_Blanking_Filter") { - std::unique_ptr block_(new PulseBlankingFilter(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Notch_Filter") { - std::unique_ptr block_(new NotchFilter(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Notch_Filter_Lite") { - std::unique_ptr block_(new NotchFilterLite(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } // RESAMPLER ------------------------------------------------------------------- else if (implementation == "Direct_Resampler") { - std::unique_ptr block_(new DirectResamplerConditioner(configuration.get(), role, - in_streams, out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, + in_streams, out_streams); block = std::move(block_); } else if ((implementation == "Fractional_Resampler") || (implementation == "Mmse_Resampler")) { - std::unique_ptr block_(new MmseResamplerConditioner(configuration.get(), role, - in_streams, out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, + in_streams, out_streams); block = std::move(block_); } // ACQUISITION BLOCKS --------------------------------------------------------- else if (implementation == "GPS_L1_CA_PCPS_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fpga") { - std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if OPENCL_BLOCKS else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { - std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsQuickSyncAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L2_M_PCPS_Acquisition") { - std::unique_ptr block_(new GpsL2MPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L2_M_PCPS_Acquisition_Fpga") { - std::unique_ptr block_(new GpsL2MPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L5i_PCPS_Acquisition") { - std::unique_ptr block_(new GpsL5iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L5i_PCPS_Acquisition_Fpga") { - std::unique_ptr block_(new GpsL5iPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") { - std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") { - std::unique_ptr block_(new GalileoE5aNoncoherentIQAcquisitionCaf(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_Pcps_Acquisition") { - std::unique_ptr block_(new GalileoE5aPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E5a_Pcps_Acquisition_Fpga") { - std::unique_ptr block_(new GalileoE5aPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { - std::unique_ptr block_(new GlonassL1CaPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { - std::unique_ptr block_(new GlonassL2CaPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B1I_PCPS_Acquisition") { - std::unique_ptr block_(new BeidouB1iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B3I_PCPS_Acquisition") { - std::unique_ptr block_(new BeidouB3iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } // TRACKING BLOCKS ------------------------------------------------------------- else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { - std::unique_ptr block_(new GpsL1CaDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L1_CA_KF_Tracking") { - std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { - std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L1_CA_TCP_CONNECTOR_Tracking") { - std::unique_ptr block_(new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { - std::unique_ptr block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L2_M_DLL_PLL_Tracking_Fpga") { - std::unique_ptr block_(new GpsL2MDllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if ((implementation == "GPS_L5i_DLL_PLL_Tracking") or (implementation == "GPS_L5_DLL_PLL_Tracking")) { - std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if ((implementation == "GPS_L5i_DLL_PLL_Tracking_Fpga") or (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")) { - std::unique_ptr block_(new GpsL5DllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif #if CUDA_GPU_ACCEL else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_GPU") { - std::unique_ptr block_(new GpsL1CaDllPllTrackingGPU(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { - std::unique_ptr block_(new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") { - std::unique_ptr block_(new GalileoE1DllPllVemlTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_TCP_CONNECTOR_Tracking") { - std::unique_ptr block_(new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { - std::unique_ptr block_(new GalileoE5aDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { - std::unique_ptr block_(new GalileoE5aDllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GLONASS_L1_CA_DLL_PLL_Tracking") { - std::unique_ptr block_(new GlonassL1CaDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") { - std::unique_ptr block_(new GlonassL1CaDllPllCAidTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_DLL_PLL_Tracking") { - std::unique_ptr block_(new GlonassL2CaDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") { - std::unique_ptr block_(new GlonassL2CaDllPllCAidTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B1I_DLL_PLL_Tracking") { - std::unique_ptr block_(new BeidouB1iDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B3I_DLL_PLL_Tracking") { - std::unique_ptr block_(new BeidouB3iDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } // TELEMETRY DECODERS ---------------------------------------------------------- else if (implementation == "GPS_L1_CA_Telemetry_Decoder") { - std::unique_ptr block_(new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L2C_Telemetry_Decoder") { - std::unique_ptr block_(new GpsL2CTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L5_Telemetry_Decoder") { - std::unique_ptr block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1B_Telemetry_Decoder") { - std::unique_ptr block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "SBAS_L1_Telemetry_Decoder") { - std::unique_ptr block_(new SbasL1TelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_Telemetry_Decoder") { - std::unique_ptr block_(new GalileoE5aTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L1_CA_Telemetry_Decoder") { - std::unique_ptr block_(new GlonassL1CaTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_Telemetry_Decoder") { - std::unique_ptr block_(new GlonassL2CaTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B1I_Telemetry_Decoder") { - std::unique_ptr block_(new BeidouB1iTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B3I_Telemetry_Decoder") { - std::unique_ptr block_(new BeidouB3iTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } @@ -1895,16 +1871,16 @@ std::unique_ptr GNSSBlockFactory::GetBlock( else if ((implementation == "Hybrid_Observables") || (implementation == "GPS_L1_CA_Observables") || (implementation == "GPS_L2C_Observables") || (implementation == "Galileo_E5A_Observables")) { - std::unique_ptr block_(new HybridObservables(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } // PVT ------------------------------------------------------------------------- else if ((implementation == "RTKLIB_PVT") || (implementation == "GPS_L1_CA_PVT") || (implementation == "Galileo_E1_PVT") || (implementation == "Hybrid_PVT")) { - std::unique_ptr block_(new Rtklib_Pvt(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } @@ -1913,8 +1889,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( // in post-processing mode, the receiver is configured and ready when the DMA starts sending samples to the receiver. else if (implementation == "Ad9361_Fpga_Signal_Source") { - std::unique_ptr block_(new Ad9361FpgaSignalSource(configuration.get(), role, in_streams, - out_streams, queue)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams, queue); block = std::move(block_); } #endif @@ -1937,7 +1913,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( */ std::unique_ptr GNSSBlockFactory::GetAcqBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams) @@ -1946,161 +1922,161 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( // ACQUISITION BLOCKS --------------------------------------------------------- if (implementation == "GPS_L1_CA_PCPS_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fpga") { - std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L1_CA_PCPS_Assisted_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L1_CA_PCPS_Tong_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if OPENCL_BLOCKS else if (implementation == "GPS_L1_CA_PCPS_OpenCl_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { - std::unique_ptr block_(new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L1_CA_PCPS_QuickSync_Acquisition") { - std::unique_ptr block_(new GpsL1CaPcpsQuickSyncAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L2_M_PCPS_Acquisition") { - std::unique_ptr block_(new GpsL2MPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L2_M_PCPS_Acquisition_Fpga") { - std::unique_ptr block_(new GpsL2MPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L5i_PCPS_Acquisition") { - std::unique_ptr block_(new GpsL5iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L5i_PCPS_Acquisition_Fpga") { - std::unique_ptr block_(new GpsL5iPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga") { - std::unique_ptr block_(new GalileoE1PcpsAmbiguousAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition") { - std::unique_ptr block_(new GalileoE1PcpsQuickSyncAmbiguousAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_Noncoherent_IQ_Acquisition_CAF") { - std::unique_ptr block_(new GalileoE5aNoncoherentIQAcquisitionCaf(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_Pcps_Acquisition") { - std::unique_ptr block_(new GalileoE5aPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E5a_Pcps_Acquisition_Fpga") { - std::unique_ptr block_(new GalileoE5aPcpsAcquisitionFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { - std::unique_ptr block_(new GlonassL1CaPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { - std::unique_ptr block_(new GlonassL2CaPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B1I_PCPS_Acquisition") { - std::unique_ptr block_(new BeidouB1iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B3I_PCPS_Acquisition") { - std::unique_ptr block_(new BeidouB3iPcpsAcquisition(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else @@ -2113,7 +2089,7 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( std::unique_ptr GNSSBlockFactory::GetTrkBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams) @@ -2123,134 +2099,134 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( // TRACKING BLOCKS ------------------------------------------------------------- if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { - std::unique_ptr block_(new GpsL1CaDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L1_CA_KF_Tracking") { - std::unique_ptr block_(new GpsL1CaKfTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_Fpga") { - std::unique_ptr block_(new GpsL1CaDllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L1_CA_TCP_CONNECTOR_Tracking") { - std::unique_ptr block_(new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { - std::unique_ptr block_(new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") { - std::unique_ptr block_(new GalileoE1DllPllVemlTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "Galileo_E1_TCP_CONNECTOR_Tracking") { - std::unique_ptr block_(new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { - std::unique_ptr block_(new GalileoE5aDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga") { - std::unique_ptr block_(new GalileoE5aDllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { - std::unique_ptr block_(new GpsL2MDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if (implementation == "GPS_L2_M_DLL_PLL_Tracking_Fpga") { - std::unique_ptr block_(new GpsL2MDllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if ((implementation == "GPS_L5i_DLL_PLL_Tracking") or (implementation == "GPS_L5_DLL_PLL_Tracking")) { - std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #if ENABLE_FPGA else if ((implementation == "GPS_L5i_DLL_PLL_Tracking_Fpga") or (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")) { - std::unique_ptr block_(new GpsL5DllPllTrackingFpga(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif #if CUDA_GPU_ACCEL else if (implementation == "GPS_L1_CA_DLL_PLL_Tracking_GPU") { - std::unique_ptr block_(new GpsL1CaDllPllTrackingGPU(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } #endif else if (implementation == "GLONASS_L1_CA_DLL_PLL_Tracking") { - std::unique_ptr block_(new GlonassL1CaDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking") { - std::unique_ptr block_(new GlonassL1CaDllPllCAidTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_DLL_PLL_Tracking") { - std::unique_ptr block_(new GlonassL2CaDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking") { - std::unique_ptr block_(new GlonassL2CaDllPllCAidTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B1I_DLL_PLL_Tracking") { - std::unique_ptr block_(new BeidouB1iDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B3I_DLL_PLL_Tracking") { - std::unique_ptr block_(new BeidouB3iDllPllTracking(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } @@ -2264,7 +2240,7 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( std::unique_ptr GNSSBlockFactory::GetTlmBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams) @@ -2274,62 +2250,62 @@ std::unique_ptr GNSSBlockFactory::GetTlmBlock( // TELEMETRY DECODERS ---------------------------------------------------------- if (implementation == "GPS_L1_CA_Telemetry_Decoder") { - std::unique_ptr block_(new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E1B_Telemetry_Decoder") { - std::unique_ptr block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "SBAS_L1_Telemetry_Decoder") { - std::unique_ptr block_(new SbasL1TelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "Galileo_E5a_Telemetry_Decoder") { - std::unique_ptr block_(new GalileoE5aTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L2C_Telemetry_Decoder") { - std::unique_ptr block_(new GpsL2CTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L1_CA_Telemetry_Decoder") { - std::unique_ptr block_(new GlonassL1CaTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GLONASS_L2_CA_Telemetry_Decoder") { - std::unique_ptr block_(new GlonassL2CaTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "GPS_L5_Telemetry_Decoder") { - std::unique_ptr block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B1I_Telemetry_Decoder") { - std::unique_ptr block_(new BeidouB1iTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } else if (implementation == "BEIDOU_B3I_Telemetry_Decoder") { - std::unique_ptr block_(new BeidouB3iTelemetryDecoder(configuration.get(), role, in_streams, - out_streams)); + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + out_streams); block = std::move(block_); } diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index a669b8641..cdf89e8a2 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -4,14 +4,15 @@ * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * Javier Arribas, 2011. jarribas(at)cttc.es - * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es + * Carles Fernandez-Prades, 2014-2020. cfernandez(at)cttc.es * * This class encapsulates the complexity behind the instantiation * of GNSS blocks. * - * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) + * ----------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -20,7 +21,7 @@ * * SPDX-License-Identifier: GPL-3.0-or-later * - * ------------------------------------------------------------------------- + * ----------------------------------------------------------------------------- */ #ifndef GNSS_SDR_BLOCK_FACTORY_H @@ -28,7 +29,7 @@ #include "concurrent_queue.h" #include -#include // for unique_ptr, shared_ptr +#include // for unique_ptr #include // for string #include // for vector @@ -48,77 +49,77 @@ public: GNSSBlockFactory() = default; ~GNSSBlockFactory() = default; - std::unique_ptr GetSignalSource(const std::shared_ptr& configuration, - const std::shared_ptr> queue, int ID = -1); // NOLINT(performance-unnecessary-value-param) + std::unique_ptr GetSignalSource(ConfigurationInterface* configuration, + Concurrent_Queue* queue, int ID = -1); // NOLINT(performance-unnecessary-value-param) - std::unique_ptr GetSignalConditioner(const std::shared_ptr& configuration, int ID = -1); + std::unique_ptr GetSignalConditioner(ConfigurationInterface* configuration, int ID = -1); - std::unique_ptr>> GetChannels(const std::shared_ptr& configuration, - const std::shared_ptr> queue); // NOLINT(performance-unnecessary-value-param) + std::unique_ptr>> GetChannels(ConfigurationInterface* configuration, + Concurrent_Queue* queue); // NOLINT(performance-unnecessary-value-param) - std::unique_ptr GetObservables(const std::shared_ptr& configuration); + std::unique_ptr GetObservables(ConfigurationInterface* configuration); - std::unique_ptr GetPVT(const std::shared_ptr& configuration); + std::unique_ptr GetPVT(ConfigurationInterface* configuration); /*! * \brief Returns the block with the required configuration and implementation */ - std::unique_ptr GetBlock(const std::shared_ptr& configuration, + std::unique_ptr GetBlock(ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams, - const std::shared_ptr> queue = nullptr); // NOLINT(performance-unnecessary-value-param) + Concurrent_Queue* queue = nullptr); // NOLINT(performance-unnecessary-value-param) private: - std::unique_ptr GetChannel_1C(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_1C(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_2S(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_2S(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_1B(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_1B(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_5X(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_5X(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_L5(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_L5(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_1G(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_1G(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_2G(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_2G(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_B1(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_B1(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); - std::unique_ptr GetChannel_B3(const std::shared_ptr& configuration, + std::unique_ptr GetChannel_B3(ConfigurationInterface* configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - const std::shared_ptr>& queue); + Concurrent_Queue* queue); std::unique_ptr GetAcqBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTrkBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTlmBlock( - const std::shared_ptr& configuration, + ConfigurationInterface* configuration, const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams); diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index f471ebf8a..cd09aee1e 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -3,13 +3,14 @@ * \brief Implementation of a GNSS receiver flow graph * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2012. luis(at)epsilon-formacion.com - * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es + * Carles Fernandez-Prades, 2014-2020. cfernandez(at)cttc.es * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com * Javier Arribas, 2018. javiarribas(at)gmail.com * + * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -34,6 +35,7 @@ #include "gnss_block_factory.h" #include "gnss_block_interface.h" #include "gnss_satellite.h" +#include "gnss_sdr_make_unique.h" #include "gnss_synchro_monitor.h" #include // for boost::lexical_cast #include // for boost::tokenizer @@ -52,7 +54,10 @@ #include // for std::shared_ptr #include // for set #include // for invalid_argument -#include // for thread +#include // for std::thread +#include // for std::move + + #ifdef GR_GREATER_38 #include #else @@ -63,12 +68,12 @@ #define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS 8 -GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, const std::shared_ptr> queue) // NOLINT(performance-unnecessary-value-param) +GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, std::shared_ptr> queue) // NOLINT(performance-unnecessary-value-param) { connected_ = false; running_ = false; configuration_ = std::move(configuration); - queue_ = queue; + queue_ = std::move(queue); multiband_ = GNSSFlowgraph::is_multiband(); init(); } @@ -1482,7 +1487,7 @@ void GNSSFlowgraph::init() /* * Instantiates the receiver blocks */ - std::unique_ptr block_factory_(new GNSSBlockFactory()); + auto block_factory_ = std::make_unique(); channels_status_ = channel_status_msg_receiver_make(); @@ -1497,7 +1502,7 @@ void GNSSFlowgraph::init() for (int i = 0; i < sources_count_; i++) { std::cout << "Creating source " << i << std::endl; - sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, i)); + sig_source_.push_back(block_factory_->GetSignalSource(configuration_.get(), queue_.get(), i)); // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. // Include GetRFChannels in the interface to avoid read config parameters here // read the number of RF channels for each front-end @@ -1505,7 +1510,7 @@ void GNSSFlowgraph::init() std::cout << "RF Channels " << RF_Channels << std::endl; for (int j = 0; j < RF_Channels; j++) { - sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, signal_conditioner_ID)); + sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_.get(), signal_conditioner_ID)); signal_conditioner_ID++; } } @@ -1513,7 +1518,7 @@ void GNSSFlowgraph::init() else { // backwards compatibility for old config files - sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, -1)); + sig_source_.push_back(block_factory_->GetSignalSource(configuration_.get(), queue_.get(), -1)); // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. // Include GetRFChannels in the interface to avoid read config parameters here // read the number of RF channels for each front-end @@ -1522,18 +1527,18 @@ void GNSSFlowgraph::init() { for (int j = 0; j < RF_Channels; j++) { - sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, signal_conditioner_ID)); + sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_.get(), signal_conditioner_ID)); signal_conditioner_ID++; } } else { // old config file, single signal source and single channel, not specified - sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, -1)); + sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_.get(), -1)); } } - observables_ = block_factory_->GetObservables(configuration_); + observables_ = block_factory_->GetObservables(configuration_.get()); // Mark old implementations as deprecated std::string default_str("Default"); std::string obs_implementation = configuration_->property("Observables.implementation", default_str); @@ -1544,7 +1549,7 @@ void GNSSFlowgraph::init() std::cout << "Please update your configuration file." << std::endl; } - pvt_ = block_factory_->GetPVT(configuration_); + pvt_ = block_factory_->GetPVT(configuration_.get()); // Mark old implementations as deprecated std::string pvt_implementation = configuration_->property("PVT.implementation", default_str); if ((pvt_implementation == "GPS_L1_CA_PVT") || (pvt_implementation == "Galileo_E1_PVT") || (pvt_implementation == "Hybrid_PVT")) @@ -1553,7 +1558,7 @@ void GNSSFlowgraph::init() std::cout << "Please update your configuration file." << std::endl; } - std::shared_ptr>> channels = block_factory_->GetChannels(configuration_, queue_); + auto channels = block_factory_->GetChannels(configuration_.get(), queue_.get()); channels_count_ = channels->size(); for (unsigned int i = 0; i < channels_count_; i++) diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 89e64d8b1..d678e9781 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -3,15 +3,16 @@ * \brief Interface of a GNSS receiver flow graph. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com - * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es + * Carles Fernandez-Prades, 2014-2020. cfernandez(at)cttc.es * Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com * * It contains a signal source, * a signal conditioner, a set of channels, an observables block and a pvt. * - * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) + * ----------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -20,7 +21,7 @@ * * SPDX-License-Identifier: GPL-3.0-or-later * - * ------------------------------------------------------------------------- + * ----------------------------------------------------------------------------- */ #ifndef GNSS_SDR_GNSS_FLOWGRAPH_H @@ -61,7 +62,7 @@ public: /*! * \brief Constructor that initializes the receiver flow graph */ - GNSSFlowgraph(std::shared_ptr configuration, const std::shared_ptr> queue); // NOLINT(performance-unnecessary-value-param) + GNSSFlowgraph(std::shared_ptr configuration, std::shared_ptr> queue); // NOLINT(performance-unnecessary-value-param) /*! * \brief Destructor diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 575494c3a..b6c01d75e 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -27,6 +27,7 @@ endif() target_link_libraries(gnss-sdr PRIVATE + algorithms_libs core_receiver Boost::headers Boost::thread diff --git a/src/main/main.cc b/src/main/main.cc index 095f23407..cb9595b7a 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -31,6 +31,7 @@ #include "concurrent_map.h" #include "concurrent_queue.h" #include "control_thread.h" +#include "gnss_sdr_make_unique.h" #include "gps_acq_assist.h" #include // for diagnostic_information #include // for exception @@ -139,7 +140,7 @@ int main(int argc, char** argv) int return_code = 0; try { - std::unique_ptr control_thread(new ControlThread()); + auto control_thread = std::make_unique(); // record startup time start = std::chrono::system_clock::now(); return_code = control_thread->run(); diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index ec59c4c25..850e97a69 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -20,19 +20,14 @@ #include "gnss_signal_processing.h" #include "gps_sdr_signal_processing.h" +#include #include #include - -#if HAS_STD_SPAN -#include -namespace gsl = std; -#else -#include -#endif +#include TEST(CodeGenerationTest, CodeGenGPSL1Test) { - auto* _dest = new std::complex[1023]; + std::array, 1023> _dest{}; signed int _prn = 1; unsigned int _chip_shift = 4; @@ -43,13 +38,12 @@ TEST(CodeGenerationTest, CodeGenGPSL1Test) for (int i = 0; i < iterations; i++) { - gps_l1_ca_code_gen_complex(own::span>(_dest, 1023), _prn, _chip_shift); + gps_l1_ca_code_gen_complex(_dest, _prn, _chip_shift); } end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - delete[] _dest; ASSERT_LE(0, elapsed_seconds.count()); std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -63,7 +57,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) const signed int _codeFreqBasis = 1023000; // Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); - auto* _dest = new std::complex[_samplesPerCode]; + std::vector> _dest(_samplesPerCode); int iterations = 1000; @@ -72,13 +66,12 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) for (int i = 0; i < iterations; i++) { - gps_l1_ca_code_gen_complex_sampled(own::span>(_dest, _samplesPerCode), _prn, _fs, _chip_shift); + gps_l1_ca_code_gen_complex_sampled(_dest, _prn, _fs, _chip_shift); } end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - delete[] _dest; ASSERT_LE(0, elapsed_seconds.count()); std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } @@ -91,7 +84,7 @@ TEST(CodeGenerationTest, ComplexConjugateTest) const signed int _codeFreqBasis = 1023000; // Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); - auto* _dest = new std::complex[_samplesPerCode]; + std::vector> _dest(_samplesPerCode); int iterations = 1000; @@ -100,13 +93,12 @@ TEST(CodeGenerationTest, ComplexConjugateTest) for (int i = 0; i < iterations; i++) { - complex_exp_gen_conj(own::span>(_dest, _samplesPerCode), _f, _fs); + complex_exp_gen_conj(_dest, _f, _fs); } end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - delete[] _dest; ASSERT_LE(0, elapsed_seconds.count()); std::cout << "Generation completed in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 1ba901475..739e56f30 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -24,12 +24,6 @@ #include #include -#if HAS_STD_SPAN -#include -namespace gsl = std; -#else -#include -#endif DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); @@ -110,13 +104,14 @@ TEST(ComplexCarrierTest, C11ComplexImplementation) TEST(ComplexCarrierTest, OwnComplexImplementation) { - auto* output = new std::complex[FLAGS_size_carrier_test]; + std::vector> output(FLAGS_size_carrier_test); + double _f = 2000.0; double _fs = 2000000.0; std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - complex_exp_gen(own::span>(output, static_cast(FLAGS_size_carrier_test)), _f, _fs); + complex_exp_gen(output, _f, _fs); end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; @@ -130,7 +125,7 @@ TEST(ComplexCarrierTest, OwnComplexImplementation) { mag[i] = output[i] * std::conj(output[i]); } - delete[] output; + for (int i = 0; i < FLAGS_size_carrier_test; i++) { ASSERT_NEAR(std::norm(expected), std::norm(mag[i]), 0.0001); diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index d6c16d09e..24e616ed4 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -18,6 +18,7 @@ * ------------------------------------------------------------------------- */ +#include "gnss_sdr_make_unique.h" #include "gnuplot_i.h" #include "test_flags.h" #include @@ -72,9 +73,8 @@ TEST(FFTLengthTest, MeasureExecutionTime) EXPECT_NO_THROW( for (it = fft_sizes_v.cbegin(); it != fft_sizes_v.cend(); ++it) { - gr::fft::fft_complex* d_fft; d_fft_size = *it; - d_fft = new gr::fft::fft_complex(d_fft_size, true); + auto d_fft = std::make_unique(d_fft_size, true); std::generate_n(d_fft->get_inbuf(), d_fft_size, gen); @@ -88,7 +88,6 @@ TEST(FFTLengthTest, MeasureExecutionTime) double exec_time = elapsed_seconds.count() / static_cast(FLAGS_fft_iterations_test); execution_times.push_back(exec_time * 1e3); std::cout << "FFT execution time for length=" << d_fft_size << " : " << exec_time << " [s]" << std::endl; - delete d_fft; if ((d_fft_size & (d_fft_size - 1)) == 0) // if it is a power of two { diff --git a/src/tests/unit-tests/arithmetic/fft_speed_test.cc b/src/tests/unit-tests/arithmetic/fft_speed_test.cc index a96228b91..e919da746 100644 --- a/src/tests/unit-tests/arithmetic/fft_speed_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_speed_test.cc @@ -19,6 +19,7 @@ * ------------------------------------------------------------------------- */ +#include "gnss_sdr_make_unique.h" #include #include #include @@ -38,8 +39,7 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) for (unsigned int fft_size : fft_sizes) { d_fft_size = fft_size; - gr::fft::fft_complex* d_gr_fft; - d_gr_fft = new gr::fft::fft_complex(d_fft_size, true); + auto d_gr_fft = std::make_unique(d_fft_size, true); arma::arma_rng::set_seed_random(); arma::cx_fvec d_arma_fft = arma::cx_fvec(d_fft_size).randn() + gr_complex(0.0, 1.0) * arma::cx_fvec(d_fft_size).randn(); arma::cx_fvec d_arma_fft_result(d_fft_size); @@ -54,7 +54,6 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) elapsed_seconds = end - start; d_execution_time = elapsed_seconds.count() / static_cast(FLAGS_fft_speed_iterations_test); std::cout << "GNU Radio FFT execution time for length = " << d_fft_size << " : " << d_execution_time * 1e6 << " [us]" << std::endl; - delete d_gr_fft; start = std::chrono::system_clock::now(); for (int k = 0; k < FLAGS_fft_speed_iterations_test; k++) diff --git a/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc b/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc index 76ca3d681..467379ff7 100644 --- a/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc +++ b/src/tests/unit-tests/arithmetic/preamble_correlator_test.cc @@ -19,6 +19,7 @@ */ #include "GPS_L1_CA.h" +#include #include #include #include @@ -44,10 +45,8 @@ TEST(PreambleCorrelationTest, TestMethods) std::random_device rd; std::default_random_engine e2(rd()); std::uniform_real_distribution<> dist(-1.0, 1.0); - for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) - { - d_symbol_history[i] = dist(e2); - } + + std::generate(d_symbol_history.begin(), d_symbol_history.end(), [&dist, &e2]() { return dist(e2); }); int32_t n = 0; for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) diff --git a/src/tests/unit-tests/control-plane/control_thread_test.cc b/src/tests/unit-tests/control-plane/control_thread_test.cc index 1fb3f4209..33d19c6f8 100644 --- a/src/tests/unit-tests/control-plane/control_thread_test.cc +++ b/src/tests/unit-tests/control-plane/control_thread_test.cc @@ -24,6 +24,7 @@ #include "command_event.h" #include "concurrent_queue.h" #include "control_thread.h" +#include "gnss_sdr_make_unique.h" #include "in_memory_configuration.h" #include #include @@ -167,7 +168,7 @@ TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages2 /*unused*/) config->set_property("PVT.item_type", "gr_complex"); config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); - std::unique_ptr control_thread2(new ControlThread(config)); + auto control_thread2 = std::make_unique(config); std::shared_ptr> control_queue2 = std::make_shared>(); control_queue2->push(pmt::make_any(channel_event_make(0, 0))); @@ -176,7 +177,6 @@ TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages2 /*unused*/) control_queue2->push(pmt::make_any(channel_event_make(3, 0))); control_queue2->push(pmt::make_any(command_event_make(200, 0))); - control_thread2->set_control_queue(control_queue2); try diff --git a/src/tests/unit-tests/control-plane/file_configuration_test.cc b/src/tests/unit-tests/control-plane/file_configuration_test.cc index 371d072fc..d42c6e292 100644 --- a/src/tests/unit-tests/control-plane/file_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/file_configuration_test.cc @@ -20,6 +20,7 @@ #include "file_configuration.h" +#include "gnss_sdr_make_unique.h" #include @@ -28,7 +29,7 @@ TEST(FileConfigurationTest, OverridedProperties) std::string path = std::string(TEST_PATH); std::string filename = path + "data/config_file_sample.txt"; // std::shared_ptr configuration = std::make_shared(filename); - std::unique_ptr configuration(new FileConfiguration(filename)); + std::unique_ptr configuration = std::make_unique(filename); std::string default_value = "default_value"; std::string value = configuration->property("NotThere", default_value); EXPECT_STREQ("default_value", value.c_str()); @@ -40,7 +41,7 @@ TEST(FileConfigurationTest, OverridedProperties) TEST(FileConfigurationTest, LoadFromNonExistentFile) { - std::unique_ptr configuration(new FileConfiguration("./i_dont_exist.conf")); + std::unique_ptr configuration = std::make_unique("./i_dont_exist.conf"); std::string default_value = "default_value"; std::string value = configuration->property("whatever.whatever", default_value); EXPECT_STREQ("default_value", value.c_str()); @@ -51,7 +52,7 @@ TEST(FileConfigurationTest, PropertyDoesNotExist) { std::string path = std::string(TEST_PATH); std::string filename = path + "data/config_file_sample.txt"; - std::unique_ptr configuration(new FileConfiguration(filename)); + std::unique_ptr configuration = std::make_unique(filename); std::string default_value = "default_value"; std::string value = configuration->property("whatever.whatever", default_value); EXPECT_STREQ("default_value", value.c_str()); diff --git a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc index 659980c73..0f0ef62f9 100644 --- a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc @@ -47,7 +47,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource) // Example of a factory as a shared_ptr std::shared_ptr factory = std::make_shared(); // Example of a block as a shared_ptr - std::shared_ptr signal_source = factory->GetSignalSource(configuration, queue); + std::shared_ptr signal_source = factory->GetSignalSource(configuration.get(), queue.get()); EXPECT_STREQ("SignalSource", signal_source->role().c_str()); EXPECT_STREQ("File_Signal_Source", signal_source->implementation().c_str()); } @@ -61,7 +61,7 @@ TEST(GNSSBlockFactoryTest, InstantiateWrongSignalSource) // Example of a factory as a unique_ptr std::unique_ptr factory; // Example of a block as a unique_ptr - std::unique_ptr signal_source = factory->GetSignalSource(configuration, queue); + std::unique_ptr signal_source = factory->GetSignalSource(configuration.get(), queue.get()); EXPECT_EQ(nullptr, signal_source); } @@ -71,7 +71,7 @@ TEST(GNSSBlockFactoryTest, InstantiateSignalConditioner) std::shared_ptr configuration = std::make_shared(); configuration->set_property("SignalConditioner.implementation", "Signal_Conditioner"); std::unique_ptr factory; - std::unique_ptr signal_conditioner = factory->GetSignalConditioner(configuration); + std::unique_ptr signal_conditioner = factory->GetSignalConditioner(configuration.get()); EXPECT_STREQ("SignalConditioner", signal_conditioner->role().c_str()); EXPECT_STREQ("Signal_Conditioner", signal_conditioner->implementation().c_str()); } @@ -104,7 +104,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFIRFilter) configuration->set_property("InputFilter.grid_density", "16"); std::unique_ptr factory; - std::unique_ptr input_filter = factory->GetBlock(configuration, "InputFilter", "Fir_Filter", 1, 1); + std::unique_ptr input_filter = factory->GetBlock(configuration.get(), "InputFilter", "Fir_Filter", 1, 1); EXPECT_STREQ("InputFilter", input_filter->role().c_str()); EXPECT_STREQ("Fir_Filter", input_filter->implementation().c_str()); @@ -139,7 +139,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter) configuration->set_property("InputFilter.sampling_frequency", "4000000"); configuration->set_property("InputFilter.IF", "34000"); std::unique_ptr factory; - std::unique_ptr input_filter = factory->GetBlock(configuration, "InputFilter", "Freq_Xlating_Fir_Filter", 1, 1); + std::unique_ptr input_filter = factory->GetBlock(configuration.get(), "InputFilter", "Freq_Xlating_Fir_Filter", 1, 1); EXPECT_STREQ("InputFilter", input_filter->role().c_str()); EXPECT_STREQ("Freq_Xlating_Fir_Filter", input_filter->implementation().c_str()); @@ -152,7 +152,7 @@ TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter) configuration->set_property("InputFilter.implementation", "Pulse_Blanking_Filter"); std::unique_ptr factory; - std::unique_ptr input_filter = factory->GetBlock(configuration, "InputFilter", "Pulse_Blanking_Filter", 1, 1); + std::unique_ptr input_filter = factory->GetBlock(configuration.get(), "InputFilter", "Pulse_Blanking_Filter", 1, 1); EXPECT_STREQ("InputFilter", input_filter->role().c_str()); EXPECT_STREQ("Pulse_Blanking_Filter", input_filter->implementation().c_str()); @@ -165,7 +165,7 @@ TEST(GNSSBlockFactoryTest, InstantiateNotchFilter) configuration->set_property("InputFilter.implementation", "Notch_Filter"); std::unique_ptr factory; - std::unique_ptr input_filter = factory->GetBlock(configuration, "InputFilter", "Notch_Filter", 1, 1); + std::unique_ptr input_filter = factory->GetBlock(configuration.get(), "InputFilter", "Notch_Filter", 1, 1); EXPECT_STREQ("InputFilter", input_filter->role().c_str()); EXPECT_STREQ("Notch_Filter", input_filter->implementation().c_str()); @@ -178,7 +178,7 @@ TEST(GNSSBlockFactoryTest, InstantiateNotchFilterLite) configuration->set_property("InputFilter.implementation", "Notch_Filter_Lite"); std::unique_ptr factory; - std::unique_ptr input_filter = factory->GetBlock(configuration, "InputFilter", "Notch_Filter_Lite", 1, 1); + std::unique_ptr input_filter = factory->GetBlock(configuration.get(), "InputFilter", "Notch_Filter_Lite", 1, 1); EXPECT_STREQ("InputFilter", input_filter->role().c_str()); EXPECT_STREQ("Notch_Filter_Lite", input_filter->implementation().c_str()); @@ -189,7 +189,7 @@ TEST(GNSSBlockFactoryTest, InstantiateDirectResampler) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Resampler.implementation", "Direct_Resampler"); std::unique_ptr factory; - std::unique_ptr resampler = factory->GetBlock(configuration, "Resampler", "Direct_Resampler", 1, 1); + std::unique_ptr resampler = factory->GetBlock(configuration.get(), "Resampler", "Direct_Resampler", 1, 1); EXPECT_STREQ("Resampler", resampler->role().c_str()); EXPECT_STREQ("Direct_Resampler", resampler->implementation().c_str()); } @@ -199,7 +199,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPcpsAcquisition) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition"); std::unique_ptr factory; - std::shared_ptr acq_ = factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(configuration.get(), "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); EXPECT_STREQ("Acquisition", acquisition->role().c_str()); EXPECT_STREQ("GPS_L1_CA_PCPS_Acquisition", acquisition->implementation().c_str()); @@ -211,7 +211,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaPcpsQuickSyncAcquisition) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_QuickSync_Acquisition"); std::shared_ptr factory = std::make_shared(); - std::shared_ptr acq_ = factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_QuickSync_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(configuration.get(), "Acquisition", "GPS_L1_CA_PCPS_QuickSync_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); EXPECT_STREQ("Acquisition", acquisition->role().c_str()); EXPECT_STREQ("GPS_L1_CA_PCPS_QuickSync_Acquisition", acquisition->implementation().c_str()); @@ -222,7 +222,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGalileoE1PcpsQuickSyncAmbiguousAcquisition std::shared_ptr configuration = std::make_shared(); configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition"); std::shared_ptr factory = std::make_shared(); - std::shared_ptr acq_ = factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(configuration.get(), "Acquisition", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); EXPECT_STREQ("Acquisition", acquisition->role().c_str()); EXPECT_STREQ("Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", acquisition->implementation().c_str()); @@ -234,7 +234,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGalileoE1PcpsAmbiguousAcquisition) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition"); std::unique_ptr factory; - std::shared_ptr acq_ = factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(configuration.get(), "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); EXPECT_STREQ("Acquisition", acquisition->role().c_str()); EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str()); @@ -246,7 +246,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaDllPllTracking) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_Tracking"); std::unique_ptr factory; - std::shared_ptr trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_Tracking", 1, 1); + std::shared_ptr trk_ = factory->GetBlock(configuration.get(), "Tracking", "GPS_L1_CA_DLL_PLL_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); EXPECT_STREQ("Tracking", tracking->role().c_str()); EXPECT_STREQ("GPS_L1_CA_DLL_PLL_Tracking", tracking->implementation().c_str()); @@ -258,7 +258,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaTcpConnectorTracking) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Tracking.implementation", "GPS_L1_CA_TCP_CONNECTOR_Tracking"); std::unique_ptr factory; - std::shared_ptr trk_ = factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_TCP_CONNECTOR_Tracking", 1, 1); + std::shared_ptr trk_ = factory->GetBlock(configuration.get(), "Tracking", "GPS_L1_CA_TCP_CONNECTOR_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); EXPECT_STREQ("Tracking", tracking->role().c_str()); EXPECT_STREQ("GPS_L1_CA_TCP_CONNECTOR_Tracking", tracking->implementation().c_str()); @@ -270,7 +270,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGalileoE1DllPllVemlTracking) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking"); std::unique_ptr factory; - std::shared_ptr trk_ = factory->GetBlock(configuration, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); + std::shared_ptr trk_ = factory->GetBlock(configuration.get(), "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); EXPECT_STREQ("Tracking", tracking->role().c_str()); EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str()); @@ -282,7 +282,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaTelemetryDecoder) std::shared_ptr configuration = std::make_shared(); configuration->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder"); std::unique_ptr factory; - std::shared_ptr telemetry_decoder = factory->GetBlock(configuration, "TelemetryDecoder", "GPS_L1_CA_Telemetry_Decoder", 1, 1); + std::shared_ptr telemetry_decoder = factory->GetBlock(configuration.get(), "TelemetryDecoder", "GPS_L1_CA_Telemetry_Decoder", 1, 1); EXPECT_STREQ("TelemetryDecoder", telemetry_decoder->role().c_str()); EXPECT_STREQ("GPS_L1_CA_Telemetry_Decoder", telemetry_decoder->implementation().c_str()); } @@ -301,7 +301,7 @@ TEST(GNSSBlockFactoryTest, InstantiateChannels) configuration->set_property("Channel1.item_type", "gr_complex"); std::shared_ptr> queue = std::make_shared>(); std::unique_ptr factory; - std::unique_ptr>> channels = factory->GetChannels(configuration, queue); + std::unique_ptr>> channels = factory->GetChannels(configuration.get(), queue.get()); EXPECT_EQ(static_cast(2), channels->size()); channels->erase(channels->begin(), channels->end()); } @@ -312,7 +312,7 @@ TEST(GNSSBlockFactoryTest, InstantiateObservables) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Observables.implementation", "Pass_Through"); std::unique_ptr factory; - auto observables = factory->GetObservables(configuration); + auto observables = factory->GetObservables(configuration.get()); EXPECT_STREQ("Observables", observables->role().c_str()); EXPECT_STREQ("Pass_Through", observables->implementation().c_str()); } @@ -323,7 +323,7 @@ TEST(GNSSBlockFactoryTest, InstantiateGpsL1CaObservables) std::shared_ptr configuration = std::make_shared(); configuration->set_property("Observables.implementation", "Hybrid_Observables"); std::unique_ptr factory; - std::unique_ptr observables = factory->GetObservables(configuration); + std::unique_ptr observables = factory->GetObservables(configuration.get()); EXPECT_STREQ("Observables", observables->role().c_str()); EXPECT_STREQ("Hybrid_Observables", observables->implementation().c_str()); } @@ -334,7 +334,7 @@ TEST(GNSSBlockFactoryTest, InstantiateRTKLIBPvt) std::shared_ptr configuration = std::make_shared(); configuration->set_property("PVT.implementation", "RTKLIB_PVT"); std::unique_ptr factory; - std::shared_ptr pvt_ = factory->GetPVT(configuration); + std::shared_ptr pvt_ = factory->GetPVT(configuration.get()); std::shared_ptr pvt = std::dynamic_pointer_cast(pvt_); EXPECT_STREQ("PVT", pvt->role().c_str()); EXPECT_STREQ("RTKLIB_PVT", pvt->implementation().c_str()); @@ -346,7 +346,7 @@ TEST(GNSSBlockFactoryTest, InstantiateWrongPvt) std::shared_ptr configuration = std::make_shared(); configuration->set_property("PVT.implementation", "Pepito"); std::unique_ptr factory; - std::shared_ptr pvt_ = factory->GetPVT(configuration); + std::shared_ptr pvt_ = factory->GetPVT(configuration.get()); std::shared_ptr pvt = std::dynamic_pointer_cast(pvt_); EXPECT_EQ(nullptr, pvt); } diff --git a/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc b/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc index 5c9130bfe..d4a6ea95c 100644 --- a/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/in_memory_configuration_test.cc @@ -19,89 +19,98 @@ */ #include "configuration_interface.h" +#include "gnss_sdr_make_unique.h" #include "in_memory_configuration.h" TEST(InMemoryConfiguration, IsPresent) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); EXPECT_FALSE(configuration->is_present("NotThere")); configuration->set_property("NotThere", "Yes!"); EXPECT_TRUE(configuration->is_present("NotThere")); } + TEST(InMemoryConfiguration, StoreAndRetrieve) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); configuration->set_property("Foo.property1", "value"); std::string default_value = "default_value"; std::string value = configuration->property("Foo.property1", default_value); EXPECT_STREQ("value", value.c_str()); } + TEST(InMemoryConfiguration, NoStoringAndRetrieve) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); std::string default_value = "default_value"; std::string value = configuration->property("Foo.property1", default_value); EXPECT_STREQ("default_value", value.c_str()); } + TEST(InMemoryConfiguration, RetrieveBool) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); configuration->set_property("Foo.property1", "true"); bool value = configuration->property("Foo.property1", false); bool expectedtrue = true; EXPECT_EQ(expectedtrue, value); } + TEST(InMemoryConfiguration, RetrieveBoolFail) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); configuration->set_property("Foo.property1", "tru"); bool value = configuration->property("Foo.property1", false); bool expectedfalse = false; EXPECT_EQ(expectedfalse, value); } + TEST(InMemoryConfiguration, RetrieveBoolNoDefine) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); bool value = configuration->property("Foo.property1", false); bool expectedfalse = false; EXPECT_EQ(expectedfalse, value); } + TEST(InMemoryConfiguration, RetrieveSizeT) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); configuration->set_property("Foo.property1", "8"); unsigned int value = configuration->property("Foo.property1", 4); unsigned int expected8 = 8; EXPECT_EQ(expected8, value); } + TEST(InMemoryConfiguration, RetrieveSizeTFail) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); configuration->set_property("Foo.property1", "true"); unsigned int value = configuration->property("Foo.property1", 4); unsigned int expected4 = 4; EXPECT_EQ(expected4, value); } + TEST(InMemoryConfiguration, RetrieveSizeTNoDefine) { // std::shared_ptr configuration = std::make_shared(); - std::unique_ptr configuration(new InMemoryConfiguration); + auto configuration = std::make_unique(); unsigned int value = configuration->property("Foo.property1", 4); unsigned int expected4 = 4; EXPECT_EQ(expected4, value); diff --git a/src/tests/unit-tests/control-plane/string_converter_test.cc b/src/tests/unit-tests/control-plane/string_converter_test.cc index 7e94fcc6d..ff63de09f 100644 --- a/src/tests/unit-tests/control-plane/string_converter_test.cc +++ b/src/tests/unit-tests/control-plane/string_converter_test.cc @@ -19,12 +19,13 @@ * ------------------------------------------------------------------------- */ +#include "gnss_sdr_make_unique.h" #include "string_converter.h" TEST(StringConverterTest, StringToBool) { - std::unique_ptr converter(new StringConverter()); + auto converter = std::make_unique(); bool conversion_result = converter->convert("false", true); bool expected_false = false; EXPECT_EQ(expected_false, conversion_result); @@ -45,7 +46,7 @@ TEST(StringConverterTest, StringToSizeT) TEST(StringConverterTest, StringToBoolFail) { - std::unique_ptr converter(new StringConverter()); + auto converter = std::make_unique(); bool conversion_result = converter->convert("lse", true); bool expected_true = true; EXPECT_EQ(expected_true, conversion_result); @@ -54,7 +55,7 @@ TEST(StringConverterTest, StringToBoolFail) TEST(StringConverterTest, StringToSizeTFail) { - std::unique_ptr converter(new StringConverter()); + auto converter = std::make_unique(); size_t conversion_result = converter->convert("false", 1); unsigned int expected1 = 1; EXPECT_EQ(expected1, conversion_result); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index e5a8bbc8e..a89ac0ff1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -608,7 +608,7 @@ int AcquisitionPerformanceTest::run_receiver() init(); int nsamples = floor(config->property("GNSS-SDR.internal_fs_sps", 2000000) * generated_signal_duration_s); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); if (implementation == "GPS_L1_CA_PCPS_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc index e673da15b..ae15ded1b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b1i_pcps_acquisition_test.cc @@ -275,7 +275,7 @@ TEST_F(BeidouB1iPcpsAcquisitionTest, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc index f25bcd583..c0f745b3f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/beidou_b3i_pcps_acquisition_test.cc @@ -274,7 +274,7 @@ TEST_F(BeidouB3iPcpsAcquisitionTest, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index 77db3ad53..203fe6899 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -433,7 +433,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::stop_queue() TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, Instantiate) { config_1(); - auto acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); + auto acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); } @@ -447,7 +447,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -474,7 +474,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -497,7 +497,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0, queue); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0, queue.get()); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -528,10 +528,9 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -585,7 +584,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb config_2(); queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -616,10 +615,9 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index b5fd9a326..7d39259b5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -434,7 +434,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::stop_queue() TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, Instantiate) { config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); } @@ -448,14 +448,14 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) queue = std::make_shared>(); config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -477,7 +477,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) config_1(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -504,10 +504,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -558,7 +557,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi config_2(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -585,10 +584,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index 50a5087b3..c241a42d6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -216,7 +216,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::stop_queue() TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate) { init(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str()); } @@ -232,14 +232,14 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); init(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -263,7 +263,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults) top_block = gr::make_top_block("Acquisition test"); init(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(channel_internal_queue); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 182b61f82..0f6828b8d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -268,7 +268,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate) { init(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); } @@ -282,14 +282,14 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); std::shared_ptr> queue = std::make_shared>(); init(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make(); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -324,7 +324,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) double expected_doppler_hz = -632; init(); top_block = gr::make_top_block("Acquisition test"); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index 983b64bb5..ec1235deb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -436,7 +436,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::stop_queue() TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate) { config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); } @@ -451,14 +451,14 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -480,7 +480,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) config_1(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); @@ -512,10 +512,9 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -573,7 +572,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili config_2(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); @@ -605,10 +604,9 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 574fb1d62..67ca50933 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -555,7 +555,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::stop_queue() TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, Instantiate) { config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); } @@ -571,7 +571,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun) config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); @@ -580,7 +580,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun) auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); auto valve = - gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -606,7 +606,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); @@ -638,10 +638,9 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -697,7 +696,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); @@ -729,10 +728,9 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -785,7 +783,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(channel_internal_queue); @@ -816,10 +814,9 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 958a7e077..a87e5657b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -434,7 +434,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::stop_queue() TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate) { config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); } @@ -447,13 +447,13 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); config_1(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; @@ -474,7 +474,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) config_1(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -506,10 +506,9 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -563,7 +562,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro config_2(); top_block = gr::make_top_block("Acquisition test"); queue = std::make_shared>(); - std::shared_ptr acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); + std::shared_ptr acq_ = factory->GetBlock(config.get(), "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); acquisition = std::dynamic_pointer_cast(acq_); auto msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); @@ -594,10 +593,9 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index 93d176472..d84c99051 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -553,7 +553,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -605,11 +605,10 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM) // USING THE SIGNAL GENERATOR ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); filter->connect(top_block); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 4e74d04f7..860c1af34 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -149,7 +149,7 @@ protected: std::shared_ptr> queue; gr::top_block_sptr top_block; - GlonassL1CaPcpsAcquisition* acquisition; + std::shared_ptr acquisition; std::shared_ptr config; Gnss_Synchro gnss_synchro; size_t item_size; @@ -440,8 +440,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::stop_queue() TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, Instantiate) { config_1(); - acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); - delete acquisition; + acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } @@ -454,13 +453,13 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); config_1(); - acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); auto msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -474,8 +473,6 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun) }) << "Failure running the top_block."; std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - - delete acquisition; } @@ -485,7 +482,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); + acquisition = acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); auto msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ @@ -512,7 +509,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); signal_generator->connect(top_block); top_block->connect(signal_generator->get_right_block(), 0, filter->get_left_block(), 0); @@ -559,8 +556,6 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) ch_thread.join(); }) << "Failure while waiting the queue to stop"; } - - delete acquisition; } @@ -569,7 +564,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) config_2(); queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); auto msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ @@ -596,7 +591,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); signal_generator->connect(top_block); top_block->connect(signal_generator->get_right_block(), 0, filter->get_left_block(), 0); @@ -646,6 +641,4 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) }) << "Failure while waiting the queue to stop" << std::endl; } - - delete acquisition; } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 4a79fe557..3aa0f4377 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -210,7 +210,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index 2a388c687..97bb911b5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -151,7 +151,7 @@ protected: std::shared_ptr > queue; gr::top_block_sptr top_block; - GlonassL2CaPcpsAcquisition* acquisition; + std::shared_ptr acquisition; std::shared_ptr config; Gnss_Synchro gnss_synchro; size_t item_size; @@ -437,8 +437,7 @@ void GlonassL2CaPcpsAcquisitionTest::stop_queue() TEST_F(GlonassL2CaPcpsAcquisitionTest, Instantiate) { config_1(); - acquisition = new GlonassL2CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); - delete acquisition; + acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } @@ -451,13 +450,13 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); config_1(); - acquisition = new GlonassL2CaPcpsAcquisition(config.get(), "Acquisition_2G", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition_2G", 1, 0); auto msg_rx = GlonassL2CaPcpsAcquisitionTest_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -471,8 +470,6 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ConnectAndRun) }) << "Failure running the top_block."; std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - - delete acquisition; } @@ -482,7 +479,7 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResults) queue = std::make_shared >(); top_block = gr::make_top_block("Acquisition test"); - acquisition = new GlonassL2CaPcpsAcquisition(config.get(), "Acquisition_2G", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition_2G", 1, 0); auto msg_rx = GlonassL2CaPcpsAcquisitionTest_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ @@ -513,10 +510,9 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; @@ -561,8 +557,6 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResults) ch_thread.join(); }) << "Failure while waiting the queue to stop"; } - - delete acquisition; } @@ -571,7 +565,7 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) config_2(); queue = std::make_shared >(); top_block = gr::make_top_block("Acquisition test"); - acquisition = new GlonassL2CaPcpsAcquisition(config.get(), "Acquisition_2G", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition_2G", 1, 0); auto msg_rx = GlonassL2CaPcpsAcquisitionTest_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ @@ -602,10 +596,9 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; @@ -651,6 +644,4 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) ch_thread.join(); }) << "Failure while waiting the queue to stop"; } - - delete acquisition; } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index fa358e582..911eb5b4e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -149,7 +149,7 @@ protected: std::shared_ptr> queue; gr::top_block_sptr top_block; - GpsL1CaPcpsAcquisition* acquisition; + std::shared_ptr acquisition; std::shared_ptr config; Gnss_Synchro gnss_synchro; size_t item_size; @@ -433,8 +433,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::stop_queue() TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate) { config_1(); - acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); - delete acquisition; + acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } @@ -447,13 +446,13 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun) top_block = gr::make_top_block("Acquisition test"); config_1(); - acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition_1C", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 0); auto msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -467,8 +466,6 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun) }) << "Failure running the top_block."; std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; - - delete acquisition; } @@ -478,7 +475,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition_1C", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 0); auto msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ @@ -505,10 +502,9 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; @@ -553,8 +549,6 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) ch_thread.join(); }) << "Failure while waiting the queue to stop"; } - - delete acquisition; } @@ -563,7 +557,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) config_2(); queue = std::make_shared>(); top_block = gr::make_top_block("Acquisition test"); - acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition_1C", 1, 0); + acquisition = std::make_shared(config.get(), "Acquisition_1C", 1, 0); auto msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); ASSERT_NO_THROW({ @@ -590,10 +584,9 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); }) << "Failure connecting the blocks of acquisition test."; @@ -639,6 +632,4 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) ch_thread.join(); }) << "Failure while waiting the queue to stop"; } - - delete acquisition; } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 72ed9373e..5f185af40 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -291,10 +291,10 @@ TEST_F(GpsL1CaPcpsAcquisitionTest /*unused*/, ConnectAndRun /*unused*/) acquisition->connect(top_block); #if GNURADIO_USES_STD_POINTERS auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); #else boost::shared_ptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); #endif top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index cf39e8858..41abc4dc1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -450,7 +450,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -507,10 +507,9 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults) else { ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -595,10 +594,9 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie else { ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 28882e13e..9e9395e78 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -560,7 +560,7 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -613,10 +613,9 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults) acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -707,10 +706,9 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsWithNoise acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -786,10 +784,9 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResultsProbabili acquisition->reset(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index 7cefc205f..44797e866 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -446,7 +446,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -499,10 +499,9 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); @@ -587,10 +586,9 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) acquisition->init(); ASSERT_NO_THROW({ - std::shared_ptr signal_source; - SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue); - FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1); - signal_source.reset(new GenSignalSource(signal_generator, filter, "SignalSource", queue)); + std::shared_ptr signal_generator = std::make_shared(config.get(), "SignalSource", 0, 1, queue.get()); + std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + std::shared_ptr signal_source = std::make_shared(signal_generator, filter, "SignalSource", queue.get()); signal_source->connect(top_block); top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0); top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index 0f896c6cd..400150a22 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -280,7 +280,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun) ASSERT_NO_THROW({ acquisition->connect(top_block); auto source = gr::analog::sig_source_c::make(sampling_frequency_hz, gr::analog::GR_SIN_WAVE, 2000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, acquisition->get_left_block(), 0); auto msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make(); @@ -353,7 +353,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); // gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make(); // gr::blocks::char_to_short::sptr gr_char_to_short_ = gr::blocks::char_to_short::make(); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); // top_block->connect(file_source, 0, gr_char_to_short_, 0); // top_block->connect(gr_char_to_short_, 0, gr_interleaved_short_to_complex_ , 0); top_block->connect(file_source, 0, valve, 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index ee1c5f410..a1003ae88 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -33,6 +33,7 @@ #include "fir_filter.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_make_unique.h" #include "gnss_sdr_valve.h" #include "in_memory_configuration.h" #include "interleaved_byte_to_complex_byte.h" @@ -124,7 +125,7 @@ TEST_F(FirFilterTest, InstantiateGrComplexGrComplex) { init(); configure_gr_complex_gr_complex(); - std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -133,11 +134,12 @@ TEST_F(FirFilterTest, InstantiateGrComplexGrComplex) ASSERT_EQ(1, res); } + TEST_F(FirFilterTest, InstantiateCshortCshort) { init(); configure_cshort_cshort(); - std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -151,7 +153,7 @@ TEST_F(FirFilterTest, InstantiateCbyteCbyte) { init(); configure_cbyte_cbyte(); - std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -165,7 +167,7 @@ TEST_F(FirFilterTest, InstantiateCbyteGrComplex) { init(); configure_cbyte_gr_complex(); - std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -185,12 +187,12 @@ TEST_F(FirFilterTest, ConnectAndRun) init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); ASSERT_NO_THROW({ filter->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); auto null_sink = gr::blocks::null_sink::make(item_size); top_block->connect(source, 0, valve, 0); @@ -217,8 +219,8 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex) init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -232,7 +234,7 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); auto null_sink = gr::blocks::null_sink::make(item_size); @@ -250,6 +252,7 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex) std::cout << "Filtered " << nsamples << " gr_complex samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl; } + TEST_F(FirFilterTest, ConnectAndRunCshorts) { std::chrono::time_point start; @@ -259,8 +262,8 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts) init(); configure_cshort_cshort(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -274,7 +277,7 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); interleaved_short_to_complex_short_sptr ishort_to_cshort_ = make_interleaved_short_to_complex_short(); @@ -304,8 +307,8 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes) init(); configure_cbyte_cbyte(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -319,7 +322,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); interleaved_byte_to_complex_byte_sptr ibyte_to_cbyte_ = make_interleaved_byte_to_complex_byte(); @@ -349,8 +352,8 @@ TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) init(); configure_cbyte_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -364,7 +367,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); interleaved_byte_to_complex_byte_sptr ibyte_to_cbyte_ = make_interleaved_byte_to_complex_byte(); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index 64f9c46eb..59a9e2ce7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -32,6 +32,7 @@ #include "file_signal_source.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_make_unique.h" #include "gnss_sdr_valve.h" #include "in_memory_configuration.h" #include "notch_filter_lite.h" @@ -72,17 +73,19 @@ void NotchFilterLiteTest::init() config->set_property("InputFilter.segments_reset", "5000000"); } + void NotchFilterLiteTest::configure_gr_complex_gr_complex() { config->set_property("InputFilter.input_item_type", "gr_complex"); config->set_property("InputFilter.output_item_type", "gr_complex"); } + TEST_F(NotchFilterLiteTest, InstantiateGrComplexGrComplex) { init(); configure_gr_complex_gr_complex(); - std::unique_ptr filter(new NotchFilterLite(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -91,6 +94,7 @@ TEST_F(NotchFilterLiteTest, InstantiateGrComplexGrComplex) ASSERT_EQ(1, res); } + TEST_F(NotchFilterLiteTest, ConnectAndRun) { int fs_in = 4000000; @@ -100,12 +104,12 @@ TEST_F(NotchFilterLiteTest, ConnectAndRun) top_block = gr::make_top_block("Notch filter lite test"); init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); ASSERT_NO_THROW({ filter->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); auto null_sink = gr::blocks::null_sink::make(item_size); top_block->connect(source, 0, valve, 0); @@ -131,8 +135,8 @@ TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) top_block = gr::make_top_block("Notch filter lite test"); init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -146,7 +150,7 @@ TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); auto null_sink = gr::blocks::null_sink::make(item_size); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc index 317ba6cd8..adbd8a4bf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc @@ -32,6 +32,7 @@ #include "file_signal_source.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_make_unique.h" #include "gnss_sdr_valve.h" #include "in_memory_configuration.h" #include "notch_filter.h" @@ -72,17 +73,19 @@ void NotchFilterTest::init() config->set_property("InputFilter.segments_reset", "5000000"); } + void NotchFilterTest::configure_gr_complex_gr_complex() { config->set_property("InputFilter.input_item_type", "gr_complex"); config->set_property("InputFilter.output_item_type", "gr_complex"); } + TEST_F(NotchFilterTest, InstantiateGrComplexGrComplex) { init(); configure_gr_complex_gr_complex(); - std::unique_ptr filter(new NotchFilter(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -91,6 +94,7 @@ TEST_F(NotchFilterTest, InstantiateGrComplexGrComplex) ASSERT_EQ(1, res); } + TEST_F(NotchFilterTest, ConnectAndRun) { int fs_in = 4000000; @@ -100,12 +104,12 @@ TEST_F(NotchFilterTest, ConnectAndRun) top_block = gr::make_top_block("Notch filter test"); init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); ASSERT_NO_THROW({ filter->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); auto null_sink = gr::blocks::null_sink::make(item_size); top_block->connect(source, 0, valve, 0); @@ -131,8 +135,8 @@ TEST_F(NotchFilterTest, ConnectAndRunGrcomplex) top_block = gr::make_top_block("Notch filter test"); init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -146,7 +150,7 @@ TEST_F(NotchFilterTest, ConnectAndRunGrcomplex) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); auto null_sink = gr::blocks::null_sink::make(item_size); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc index 79dfa4521..187a0ddb3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc @@ -32,6 +32,7 @@ #include "file_signal_source.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" +#include "gnss_sdr_make_unique.h" #include "gnss_sdr_valve.h" #include "in_memory_configuration.h" #include "pulse_blanking_filter.h" @@ -71,17 +72,19 @@ void PulseBlankingFilterTest::init() config->set_property("InputFilter.segments_reset", "5000000"); } + void PulseBlankingFilterTest::configure_gr_complex_gr_complex() { config->set_property("InputFilter.input_item_type", "gr_complex"); config->set_property("InputFilter.output_item_type", "gr_complex"); } + TEST_F(PulseBlankingFilterTest, InstantiateGrComplexGrComplex) { init(); configure_gr_complex_gr_complex(); - std::unique_ptr filter(new PulseBlankingFilter(config.get(), "InputFilter", 1, 1)); + auto filter = std::make_unique(config.get(), "InputFilter", 1, 1); int res = 0; if (filter) { @@ -90,6 +93,7 @@ TEST_F(PulseBlankingFilterTest, InstantiateGrComplexGrComplex) ASSERT_EQ(1, res); } + TEST_F(PulseBlankingFilterTest, ConnectAndRun) { int fs_in = 4000000; @@ -99,12 +103,12 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRun) top_block = gr::make_top_block("Pulse Blanking filter test"); init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); item_size = sizeof(gr_complex); ASSERT_NO_THROW({ filter->connect(top_block); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); auto null_sink = gr::blocks::null_sink::make(item_size); top_block->connect(source, 0, valve, 0); @@ -130,8 +134,8 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex) top_block = gr::make_top_block("Pulse Blanking filter test"); init(); configure_gr_complex_gr_complex(); - std::shared_ptr filter = std::make_shared(config.get(), "InputFilter", 1, 1); - std::shared_ptr config2 = std::make_shared(); + auto filter = std::make_shared(config.get(), "InputFilter", 1, 1); + auto config2 = std::make_shared(); config2->set_property("Test_Source.samples", std::to_string(nsamples)); config2->set_property("Test_Source.sampling_frequency", "4000000"); @@ -145,7 +149,7 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex) ASSERT_NO_THROW({ filter->connect(top_block); - std::shared_ptr source(new FileSignalSource(config2.get(), "Test_Source", 0, 1, queue)); + auto source = std::make_shared(config2.get(), "Test_Source", 0, 1, queue.get()); source->connect(top_block); auto null_sink = gr::blocks::null_sink::make(item_size); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc b/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc index 461bc068c..5cdd24fdd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc @@ -21,6 +21,7 @@ #include "item_type_helpers.h" #include +#include #include class ItemTypeHelpersTest : public ::testing::Test diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc index d5a672e6c..5497815c1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc @@ -109,13 +109,13 @@ void Observables_Dump_Reader::close_obs_file() Observables_Dump_Reader::Observables_Dump_Reader(int n_channels_) { n_channels = n_channels_; - RX_time = new double[n_channels]; - TOW_at_current_symbol_s = new double[n_channels]; - Carrier_Doppler_hz = new double[n_channels]; - Acc_carrier_phase_hz = new double[n_channels]; - Pseudorange_m = new double[n_channels]; - PRN = new double[n_channels]; - valid = new double[n_channels]; + RX_time = std::vector(n_channels); + TOW_at_current_symbol_s = std::vector(n_channels); + Carrier_Doppler_hz = std::vector(n_channels); + Acc_carrier_phase_hz = std::vector(n_channels); + Pseudorange_m = std::vector(n_channels); + PRN = std::vector(n_channels); + valid = std::vector(n_channels); } @@ -136,11 +136,4 @@ Observables_Dump_Reader::~Observables_Dump_Reader() { std::cerr << e.what() << '\n'; } - delete[] RX_time; - delete[] TOW_at_current_symbol_s; - delete[] Carrier_Doppler_hz; - delete[] Acc_carrier_phase_hz; - delete[] Pseudorange_m; - delete[] PRN; - delete[] valid; } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h index 121a3ba73..23997a577 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h @@ -37,13 +37,13 @@ public: void close_obs_file(); // dump variables - double* RX_time; - double* TOW_at_current_symbol_s; - double* Carrier_Doppler_hz; - double* Acc_carrier_phase_hz; - double* Pseudorange_m; - double* PRN; - double* valid; + std::vector RX_time; + std::vector TOW_at_current_symbol_s; + std::vector Carrier_Doppler_hz; + std::vector Acc_carrier_phase_hz; + std::vector Pseudorange_m; + std::vector PRN; + std::vector valid; private: int n_channels; diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 858a651e1..07e2d20aa 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -1806,9 +1806,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults) // create the tracking channels and create the telemetry decoders - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); tracking_ch_vec.push_back(std::dynamic_pointer_cast(trk_)); - std::shared_ptr tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); + std::shared_ptr tlm_ = factory->GetBlock(config.get(), "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); tlm_ch_vec.push_back(std::dynamic_pointer_cast(tlm_)); // create null sinks for observables output @@ -1843,7 +1843,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) auto dummy_msg_rx_trk = HybridObservablesTest_msg_rx_make(); auto dummy_tlm_msg_rx = HybridObservablesTest_tlm_msg_rx_make(); // Observables - std::shared_ptr observables(new HybridObservables(config.get(), "Observables", tracking_ch_vec.size() + 1, tracking_ch_vec.size())); + std::shared_ptr observables = std::make_shared(config.get(), "Observables", tracking_ch_vec.size() + 1, tracking_ch_vec.size()); for (auto& n : tracking_ch_vec) { diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index a32c764c1..2de1e8695 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -1935,9 +1935,9 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) gnss_synchro_vec.at(n).Channel_ID = n; // create the tracking channels and create the telemetry decoders - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); tracking_ch_vec.push_back(std::dynamic_pointer_cast(trk_)); - std::shared_ptr tlm_ = factory->GetBlock(config, "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); + std::shared_ptr tlm_ = factory->GetBlock(config.get(), "TelemetryDecoder", config->property("TelemetryDecoder.implementation", std::string("undefined")), 1, 1); tlm_ch_vec.push_back(std::dynamic_pointer_cast(tlm_)); // create null sinks for observables output diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index ac47babca..2eefc1e2c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -184,7 +184,7 @@ TEST_F(NmeaPrinterTest, PrintLine) bool flag_nmea_output_file = true; ASSERT_NO_THROW({ std::shared_ptr nmea_printer = std::make_shared(filename, flag_nmea_output_file, false, ""); - nmea_printer->Print_Nmea_Line(pvt_solution, false); + nmea_printer->Print_Nmea_Line(pvt_solution.get(), false); }) << "Failure printing NMEA messages."; std::ifstream test_file(filename); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc index 039bbf0d2..d8332d2ee 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc @@ -18,6 +18,7 @@ */ +#include "gnss_sdr_make_unique.h" #include "rtcm_printer.h" #include @@ -31,7 +32,7 @@ TEST(RtcmPrinterTest, Instantiate) bool rtcm_file_output_enabled = false; unsigned short rtcm_tcp_port = 2101; unsigned short rtcm_station_id = 1234; - std::unique_ptr RTCM_printer(new Rtcm_Printer(filename, rtcm_file_output_enabled, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname)); + auto RTCM_printer = std::make_unique(filename, rtcm_file_output_enabled, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname); } @@ -45,7 +46,7 @@ TEST(RtcmPrinterTest, Run) unsigned short rtcm_tcp_port = 2101; unsigned short rtcm_station_id = 1234; - std::unique_ptr RTCM_printer(new Rtcm_Printer(filename, rtcm_file_output_enabled, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname)); + auto RTCM_printer = std::make_unique(filename, rtcm_file_output_enabled, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname); std::string reference_msg = "D300133ED7D30202980EDEEF34B4BD62AC0941986F33360B98"; diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index 5e6da928e..06bc503aa 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -18,6 +18,7 @@ */ #include "geofunctions.h" +#include "gnss_sdr_make_unique.h" #include "gnss_sdr_supl_client.h" #include "in_memory_configuration.h" #include "rtklib_solver.h" @@ -385,7 +386,7 @@ TEST(RTKLibSolverTest, test1) bool save_to_mat = false; rtk_t rtk = configure_rtklib_options(); - std::unique_ptr d_ls_pvt(new Rtklib_Solver(nchannels, dump_filename, flag_dump_to_file, save_to_mat, rtk)); + auto d_ls_pvt = std::make_unique(nchannels, dump_filename, flag_dump_to_file, save_to_mat, rtk); d_ls_pvt->set_averaging_depth(1); // load ephemeris diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc index 11074e75c..31157617c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc @@ -41,17 +41,17 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); int nsamples = 1000000; // Number of samples to be computed - std::shared_ptr> queue = std::make_shared>(); - gr::top_block_sptr top_block = gr::make_top_block("direct_resampler_conditioner_cc_test"); + auto queue = std::make_shared>(); + auto top_block = gr::make_top_block("direct_resampler_conditioner_cc_test"); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); EXPECT_NO_THROW({ direct_resampler_conditioner_cc_sptr resampler = direct_resampler_make_conditioner_cc(fs_in, fs_out); }) << "Failure in instantiation of direct_resampler_conditioner."; - direct_resampler_conditioner_cc_sptr resampler = direct_resampler_make_conditioner_cc(fs_in, fs_out); - gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(gr_complex)); + auto resampler = direct_resampler_make_conditioner_cc(fs_in, fs_out); + auto sink = gr::blocks::null_sink::make(sizeof(gr_complex)); EXPECT_NO_THROW({ top_block->connect(source, 0, valve, 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc index 90429530c..4018380a2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc @@ -38,10 +38,10 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); int nsamples = 1000000; // Number of samples to be computed - std::shared_ptr> queue = std::make_shared>(); - gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); + auto queue = std::make_shared>(); + auto top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); std::shared_ptr config; config = std::make_shared(); @@ -49,9 +49,9 @@ TEST(MmseResamplerTest, InstantiationAndRunTestWarning) config->set_property("Resampler.sample_freq_in", std::to_string(fs_in)); config->set_property("Resampler.sample_freq_out", std::to_string(fs_out)); - std::shared_ptr resampler = std::make_shared(config.get(), "Resampler", 1, 1); + auto resampler = std::make_shared(config.get(), "Resampler", 1, 1); - gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(gr_complex)); + auto sink = gr::blocks::null_sink::make(sizeof(gr_complex)); EXPECT_NO_THROW({ resampler->connect(top_block); @@ -79,10 +79,10 @@ TEST(MmseResamplerTest, InstantiationAndRunTest2) std::chrono::time_point start, end; std::chrono::duration elapsed_seconds(0); int nsamples = 1000000; // Number of samples to be computed - std::shared_ptr> queue = std::make_shared>(); - gr::top_block_sptr top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); + auto queue = std::make_shared>(); + auto top_block = gr::make_top_block("mmse_resampler_conditioner_cc_test"); auto source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000.0, 1.0, gr_complex(0.0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); std::shared_ptr config; config = std::make_shared(); @@ -90,9 +90,9 @@ TEST(MmseResamplerTest, InstantiationAndRunTest2) config->set_property("Resampler.sample_freq_in", std::to_string(fs_in)); config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_out)); - std::shared_ptr resampler = std::make_shared(config.get(), "Resampler", 1, 1); + auto resampler = std::make_shared(config.get(), "Resampler", 1, 1); - gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(gr_complex)); + auto sink = gr::blocks::null_sink::make(sizeof(gr_complex)); EXPECT_NO_THROW({ resampler->connect(top_block); diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc index b723fa3e0..d0c8a43e4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc @@ -20,6 +20,7 @@ #include "concurrent_queue.h" #include "file_signal_source.h" +#include "gnss_sdr_make_unique.h" #include "in_memory_configuration.h" #include #include @@ -27,8 +28,8 @@ TEST(FileSignalSource, Instantiate) { - std::shared_ptr> queue = std::make_shared>(); - std::shared_ptr config = std::make_shared(); + auto queue = std::make_shared>(); + auto config = std::make_shared(); config->set_property("Test.samples", "0"); config->set_property("Test.sampling_frequency", "0"); @@ -38,7 +39,7 @@ TEST(FileSignalSource, Instantiate) config->set_property("Test.item_type", "gr_complex"); config->set_property("Test.repeat", "false"); - std::unique_ptr signal_source(new FileSignalSource(config.get(), "Test", 0, 1, queue)); + auto signal_source = std::make_unique(config.get(), "Test", 0, 1, queue.get()); EXPECT_STREQ("gr_complex", signal_source->item_type().c_str()); EXPECT_TRUE(signal_source->repeat() == false); @@ -46,8 +47,8 @@ TEST(FileSignalSource, Instantiate) TEST(FileSignalSource, InstantiateFileNotExists) { - std::shared_ptr> queue = std::make_shared>(); - std::shared_ptr config = std::make_shared(); + auto queue = std::make_shared>(); + auto config = std::make_shared(); config->set_property("Test.samples", "0"); config->set_property("Test.sampling_frequency", "0"); @@ -55,5 +56,5 @@ TEST(FileSignalSource, InstantiateFileNotExists) config->set_property("Test.item_type", "gr_complex"); config->set_property("Test.repeat", "false"); - EXPECT_THROW({ auto uptr = std::make_shared(config.get(), "Test", 0, 1, queue); }, std::exception); + EXPECT_THROW({ auto uptr = std::make_shared(config.get(), "Test", 0, 1, queue.get()); }, std::exception); } diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc index 187d63219..051ce348e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc @@ -34,13 +34,13 @@ TEST(ValveTest, CheckEventSentAfter100Samples) { - std::shared_ptr> queue = std::make_shared>(); + auto queue = std::make_shared>(); - gr::top_block_sptr top_block = gr::make_top_block("gnss_sdr_valve_test"); + auto top_block = gr::make_top_block("gnss_sdr_valve_test"); - gr::analog::sig_source_f::sptr source = gr::analog::sig_source_f::make(100, gr::analog::GR_CONST_WAVE, 100, 1, 0); - auto valve = gnss_sdr_make_valve(sizeof(float), 100, queue); - gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(float)); + auto source = gr::analog::sig_source_f::make(100, gr::analog::GR_CONST_WAVE, 100, 1, 0); + auto valve = gnss_sdr_make_valve(sizeof(float), 100, queue.get()); + auto sink = gr::blocks::null_sink::make(sizeof(float)); bool expected0 = false; pmt::pmt_t msg; diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index ac078155b..e55639437 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -393,7 +393,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz; gnss_synchro.Acq_samplestamp_samples = 0; - std::shared_ptr tlm(new GpsL1CaTelemetryDecoder(config.get(), "TelemetryDecoder_1C", 1, 1)); + std::shared_ptr tlm = std::make_shared(config.get(), "TelemetryDecoder_1C", 1, 1); tlm->set_channel(0); std::shared_ptr tlm_msg_rx = GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc index 51411a78c..76e1df291 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc @@ -91,7 +91,7 @@ void GalileoE1DllPllVemlTrackingInternalTest::init() TEST_F(GalileoE1DllPllVemlTrackingInternalTest, Instantiate) { init(); - auto tracking = factory->GetBlock(config, "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); + auto tracking = factory->GetBlock(config.get(), "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str()); } @@ -108,7 +108,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun) top_block = gr::make_top_block("Tracking test"); // Example using smart pointers and the block factory - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); ASSERT_NO_THROW({ @@ -122,7 +122,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun) ASSERT_NO_THROW({ tracking->connect(top_block); gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, tracking->get_left_block(), 0); @@ -156,7 +156,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) top_block = gr::make_top_block("Tracking test"); // Example using smart pointers and the block factory - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking_1B", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); // gnss_synchro.Acq_delay_samples = 1753; // 4 Msps @@ -183,7 +183,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults) const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); gr::blocks::skiphead::sptr skip_head = gr::blocks::skiphead::make(sizeof(gr_complex), skiphead_sps); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), num_samples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), num_samples, queue.get()); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, skip_head, 0); top_block->connect(skip_head, 0, valve, 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc index c545fdcef..307d35945 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc @@ -103,7 +103,7 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults) top_block = gr::make_top_block("Tracking test"); // Example using smart pointers and the block factory - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_5X", "Galileo_E5a_DLL_PLL_Tracking", 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking_5X", "Galileo_E5a_DLL_PLL_Tracking", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); // REAL @@ -127,7 +127,7 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults) ASSERT_NO_THROW({ gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0)); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(source, 0, valve, 0); top_block->connect(valve, 0, tracking->get_left_block(), 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 99b579119..cd01585bf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -183,7 +183,7 @@ TEST_F(GlonassL1CaDllPllCAidTrackingTest, ValidationOfResults) std::string file = path + "signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin"; const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, valve, 0); top_block->connect(valve, 0, tracking->get_left_block(), 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index e7679b61a..ae99757d1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -190,7 +190,7 @@ TEST_F(GlonassL1CaDllPllTrackingTest, ValidationOfResults) std::string file = path + "signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin"; const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, valve, 0); top_block->connect(valve, 0, tracking->get_left_block(), 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index e47ec2875..61d0c82bf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -610,7 +610,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) top_block = gr::make_top_block("Tracking test"); - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1C", implementation, 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking_1C", implementation, 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); auto msg_rx = GpsL1CADllPllTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 35911319f..5e7955106 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -411,7 +411,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) top_block = gr::make_top_block("Tracking test"); - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking_1C", implementation, 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking_1C", implementation, 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); // std::make_shared(config.get(), "Tracking_1C", 1, 1); auto msg_rx = GpsL1CAKfTrackingTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index b73d73ebb..9e678dbed 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -197,7 +197,7 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults) std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat"; const char* file_name = file.c_str(); gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false); - auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); + auto valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue.get()); gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro)); top_block->connect(file_source, 0, valve, 0); top_block->connect(valve, 0, tracking->get_left_block(), 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index bf191adb8..4186e7d5f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -808,7 +808,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) // create the msg queue for valve queue = std::make_shared>(); long long int acq_to_trk_delay_samples = ceil(static_cast(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s); - auto resetable_valve_ = gnss_sdr_make_valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue, false); + auto resetable_valve_ = gnss_sdr_make_valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue.get(), false); // CN0 LOOP std::vector> pull_in_results_v_v; @@ -828,7 +828,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) // create flowgraph auto top_block_trk = gr::make_top_block("Tracking test"); - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); auto msg_rx = TrackingPullInTest_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index 2268121a5..80b11e4d9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -295,7 +295,6 @@ void* handler_DMA_trk_pull_in_test(void* arguments) // Throttle the DMA std::this_thread::sleep_for(std::chrono::milliseconds(1)); - nsamples_remaining -= nsamples_block_size; if (nsamples_remaining == 0) @@ -474,14 +473,12 @@ public: return true; } - bool Event_failed_acquisition_repeat() override { acquisition_successful = false; return true; } - bool Event_failed_acquisition_no_repeat() override { acquisition_successful = false; @@ -882,7 +879,6 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) } } - // use generator or use an external capture file if (FLAGS_enable_external_signal_file) { @@ -1011,7 +1007,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) // create flowgraph top_block = gr::make_top_block("Tracking test"); - std::shared_ptr trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); + std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); auto msg_rx = TrackingPullInTest_msg_rx_Fpga_make(); diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 2d9d944bd..39c15ce68 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -92,10 +92,8 @@ Concurrent_Map global_gps_acq_assist_map; bool stop; Concurrent_Queue channel_internal_queue; -GpsL1CaPcpsAcquisitionFineDoppler* acquisition; -Gnss_Synchro* gnss_synchro; std::vector gnss_sync_vector; - +Gnss_Synchro gnss_synchro{}; // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class FrontEndCal_msg_rx; @@ -170,7 +168,7 @@ void wait_message() switch (message) { case 1: // Positive acq - gnss_sync_vector.push_back(*gnss_synchro); + gnss_sync_vector.push_back(gnss_synchro); // acquisition->reset(); break; case 2: // negative acq @@ -198,7 +196,7 @@ bool front_end_capture(const std::shared_ptr& configurat std::shared_ptr source; try { - source = block_factory.GetSignalSource(configuration, queue); + source = block_factory.GetSignalSource(configuration.get(), queue.get()); } catch (const boost::exception_ptr& e) { @@ -209,7 +207,7 @@ bool front_end_capture(const std::shared_ptr& configurat std::shared_ptr conditioner; try { - conditioner = block_factory.GetSignalConditioner(configuration); + conditioner = block_factory.GetSignalConditioner(configuration.get()); } catch (const boost::exception_ptr& e) { @@ -359,20 +357,20 @@ int main(int argc, char** argv) top_block = gr::make_top_block("Acquisition test"); // Satellite signal definition - gnss_synchro = new Gnss_Synchro(); - gnss_synchro->Channel_ID = 0; - gnss_synchro->System = 'G'; + gnss_synchro = Gnss_Synchro(); + gnss_synchro.Channel_ID = 0; + gnss_synchro.System = 'G'; std::string signal = "1C"; - signal.copy(gnss_synchro->Signal, 2, 0); - gnss_synchro->PRN = 1; + signal.copy(gnss_synchro.Signal, 2, 0); + gnss_synchro.PRN = 1; int64_t fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", 2048000); configuration->set_property("Acquisition.max_dwells", "10"); - acquisition = new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), "Acquisition", 1, 1); + auto acquisition = std::make_shared(configuration.get(), "Acquisition", 1, 1); acquisition->set_channel(1); - acquisition->set_gnss_synchro(gnss_synchro); + acquisition->set_gnss_synchro(&gnss_synchro); acquisition->set_threshold(configuration->property("Acquisition.threshold", 2.0)); acquisition->set_doppler_max(configuration->property("Acquisition.doppler_max", 10000)); acquisition->set_doppler_step(configuration->property("Acquisition.doppler_step", 250)); @@ -425,8 +423,8 @@ int main(int argc, char** argv) for (unsigned int PRN = 1; PRN < 33; PRN++) { - gnss_synchro->PRN = PRN; - acquisition->set_gnss_synchro(gnss_synchro); + gnss_synchro.PRN = PRN; + acquisition->set_gnss_synchro(&gnss_synchro); acquisition->init(); acquisition->set_local_code(); acquisition->reset(); @@ -515,8 +513,6 @@ int main(int argc, char** argv) else { std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl; - delete acquisition; - delete gnss_synchro; google::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; return 0; @@ -525,8 +521,6 @@ int main(int argc, char** argv) catch (const boost::exception& e) { std::cout << "Exception in getting Global ephemeris map" << std::endl; - delete acquisition; - delete gnss_synchro; google::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; return 0; @@ -546,8 +540,6 @@ int main(int argc, char** argv) if (doppler_measurements_map.empty()) { std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl; - delete acquisition; - delete gnss_synchro; google::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; return 0; @@ -642,9 +634,6 @@ int main(int argc, char** argv) } } - delete acquisition; - delete gnss_synchro; - google::ShutDownCommandLineFlags(); std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; }