From 1a11b5a2ecca0ae73863e2ac6190096e13bf6ba6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 3 Aug 2019 19:51:50 +0200 Subject: [PATCH 1/4] Remove unnecessary links and includes to boost::thread --- .../signal_source/adapters/gen_signal_source.cc | 1 - .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.h | 2 -- .../glonass_l2_ca_dll_pll_c_aid_tracking_sc.h | 2 -- src/core/receiver/CMakeLists.txt | 11 +++++++++-- src/core/receiver/control_thread.cc | 4 +++- src/core/receiver/control_thread.h | 14 ++++++++++---- src/main/CMakeLists.txt | 4 +++- src/main/main.cc | 2 +- src/utils/front-end-cal/CMakeLists.txt | 4 ---- 9 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.cc b/src/algorithms/signal_source/adapters/gen_signal_source.cc index fe1029ec5..8c7ddb133 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gen_signal_source.cc @@ -32,7 +32,6 @@ #include "gen_signal_source.h" #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 00712ec0d..049f3ab40 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -44,8 +44,6 @@ #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index 01bdd5c96..b57db18a1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -42,8 +42,6 @@ #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include -#include #include #include #include diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index b91ce963f..416339b9d 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -135,7 +135,6 @@ target_link_libraries(core_receiver PUBLIC core_libs core_monitor - Boost::thread Gnuradio::runtime PRIVATE signal_source_adapters @@ -150,7 +149,6 @@ target_link_libraries(core_receiver obs_adapters pvt_adapters Boost::boost - Boost::chrono Gflags::gflags Glog::glog Armadillo::armadillo @@ -179,6 +177,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_FPGA) + target_link_libraries(core_receiver + PUBLIC + Boost::thread + PRIVATE + Boost::chrono + ) +endif() + if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) target_link_libraries(core_receiver PRIVATE diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 244aa4309..02b81e0a8 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -65,7 +65,6 @@ #include "rtklib_ephemeris.h" // for alm2pos, eph2pos #include "rtklib_rtkcmn.h" // for utc2gpst #include // for interaction with geofunctions -#include // for steady_clock #include // for bad_lexical_cast #include // for LOG #include // for make_any @@ -82,6 +81,9 @@ #include // for IPC_CREAT #include // for msgctl, msgget +#ifdef ENABLE_FPGA +#include // for steady_clock +#endif extern Concurrent_Map global_gps_acq_assist_map; extern Concurrent_Queue global_gps_acq_assist_queue; diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index dae3c3022..de3c3d631 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -40,7 +40,6 @@ #include "concurrent_queue.h" // for Concurrent_Queue #include "gnss_sdr_supl_client.h" // for Gnss_Sdr_Supl_Client #include "tcp_cmd_interface.h" // for TcpCmdInterface -#include // for boost::thread #include #include // for array #include // for time_t (gmtime, strftime in implementation) @@ -50,6 +49,11 @@ #include // for pair #include // for vector +#ifdef ENABLE_FPGA +#include // for boost::thread +#endif + + class ConfigurationInterface; class GNSSFlowgraph; class Gnss_Satellite; @@ -173,8 +177,6 @@ private: unsigned int processed_control_messages_; unsigned int applied_actions_; - boost::thread fpga_helper_thread_; - std::thread keyboard_thread_; std::thread sysv_queue_thread_; std::thread gps_acq_assist_data_collector_thread_; @@ -201,6 +203,10 @@ private: Agnss_Ref_Location agnss_ref_location_; Agnss_Ref_Time agnss_ref_time_; + +#ifdef ENABLE_FPGA + boost::thread fpga_helper_thread_; +#endif }; -#endif /*GNSS_SDR_CONTROL_THREAD_H_*/ +#endif /* GNSS_SDR_CONTROL_THREAD_H_ */ diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 3ff4c9106..ded24273d 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -31,10 +31,12 @@ endif() target_link_libraries(gnss-sdr PUBLIC + core_receiver + Boost::boost + Boost::thread Gflags::gflags Glog::glog Threads::Threads - core_receiver ) target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}") diff --git a/src/main/main.cc b/src/main/main.cc index 7aba038c4..9e6343766 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -43,7 +43,7 @@ #include "concurrent_queue.h" #include "control_thread.h" #include "gps_acq_assist.h" -#include // for diagnostic_informatio +#include // for diagnostic_information #include // for exception #include // for thread_resource_error #include // for ShutDownCommandLineFlags diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 303b4640d..a6122e4e2 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -27,10 +27,6 @@ target_link_libraries(front_end_cal_lib PUBLIC Armadillo::armadillo Threads::Threads - Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} - signal_source_adapters - signal_source_gr_blocks - signal_source_libs acquisition_adapters gnss_sdr_flags channel_libs From ff71f0ec1803b2a43c2f7c1b57fa2734044a5568 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 3 Aug 2019 19:56:37 +0200 Subject: [PATCH 2/4] Remove unused linking --- src/utils/front-end-cal/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index a6122e4e2..2a8df2820 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -64,11 +64,11 @@ endif() target_link_libraries(front-end-cal PUBLIC - Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} core_libs core_receiver front_end_cal_lib gnss_sdr_flags + Boost::boost PRIVATE Gflags::gflags Glog::glog From 5ced9d4322d30dbcd4aa159d5c843e07a402b75d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 3 Aug 2019 20:15:49 +0200 Subject: [PATCH 3/4] Make build Reproducible --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf4749a7a..e40a156d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -924,7 +924,7 @@ if(NOT VOLKGNSSSDR_FOUND) DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install ) else() @@ -936,7 +936,7 @@ if(NOT VOLKGNSSSDR_FOUND) DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND "" - BUILD_COMMAND ${READ_ENVIRO} ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile + 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 From 2e93dbe8dc5220082ce9d5a14c3136eaa9fc0418 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 3 Aug 2019 20:31:53 +0200 Subject: [PATCH 4/4] Make build Reproducible --- CMakeLists.txt | 8 ++------ .../libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e40a156d6..a86474bb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -875,14 +875,10 @@ if(NOT VOLKGNSSSDR_FOUND) ) endif() - set(READ_ENVIRO "") 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") endif() - if(NOT DEFINED ENV{PROTECT_PASSWORDS}) - set(READ_ENVIRO ${CMAKE_COMMAND} -E environment) - endif() endif() set(VOLK_GNSSSDR_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}") @@ -920,7 +916,7 @@ if(NOT VOLKGNSSSDR_FOUND) 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 - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND "" @@ -932,7 +928,7 @@ if(NOT VOLKGNSSSDR_FOUND) 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 - CMAKE_ARGS ${READ_ENVIRO} ${VOLK_GNSSSDR_CMAKE_ARGS} + CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND "" diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 1460129f1..c98f4f7bf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -163,6 +163,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF) +if(ENABLE_STRIP) + set(CMAKE_VERBOSE_MAKEFILE ON) +endif() include(VolkBuildTypes) # select the release build type by default to get optimization flags @@ -181,7 +184,6 @@ include(VolkVersion) # setup version info - ######################################################################## # Environment setup ########################################################################