From df6d8eacb5b61a63a05317cea00949a3e18822bc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 24 Nov 2019 22:24:46 +0100 Subject: [PATCH 1/9] Do not have two files with the same name --- src/tests/test_main.cc | 2 +- .../{item_type_helpers.cc => item_type_helpers_test.cc} | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) rename src/tests/unit-tests/signal-processing-blocks/libs/{item_type_helpers.cc => item_type_helpers_test.cc} (99%) diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index c93cf5eab..ce048c510 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -92,7 +92,7 @@ DECLARE_string(log_dir); #include "unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc" #include "unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc" // #include "unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc" -#include "unit-tests/signal-processing-blocks/libs/item_type_helpers.cc" +#include "unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc" #if OPENCL_BLOCKS_TEST #include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc" diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers.cc b/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc similarity index 99% rename from src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers.cc rename to src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc index 1cb5e7190..380b663bc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/item_type_helpers_test.cc @@ -72,6 +72,7 @@ public: std::array float_array_out; }; + TEST_F(ItemTypeHelpersTest, CheckValidTypes) { for (auto &valid_type : valid_item_types) @@ -85,6 +86,7 @@ TEST_F(ItemTypeHelpersTest, CheckValidTypes) } } + TEST_F(ItemTypeHelpersTest, CheckSizes) { EXPECT_EQ(item_type_size("byte"), 1); @@ -98,13 +100,13 @@ TEST_F(ItemTypeHelpersTest, CheckSizes) EXPECT_EQ(item_type_size("float"), 4); EXPECT_EQ(item_type_size("gr_complex"), 8); - for (auto &invalid_type : invalid_item_types) { EXPECT_EQ(item_type_size(invalid_type), 0); } } + TEST_F(ItemTypeHelpersTest, CheckMakeConverters) { for (auto &input_type : valid_item_types) @@ -126,6 +128,7 @@ TEST_F(ItemTypeHelpersTest, CheckMakeConverters) } } + TEST_F(ItemTypeHelpersTest, CheckConversionsReal) { std::string input_type = "byte"; @@ -180,6 +183,7 @@ TEST_F(ItemTypeHelpersTest, CheckConversionsReal) EXPECT_TRUE(std::equal(float_array_in.begin(), float_array_in.begin() + N, float_array_out.begin())); } + TEST_F(ItemTypeHelpersTest, CheckConversionsComplex) { std::string input_type = "cbyte"; From 6993890587f93b8c411357effdc9c52a0efe6528 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 24 Nov 2019 22:25:18 +0100 Subject: [PATCH 2/9] Remove old comments --- .../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 4ce10bab2..872a645b5 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -160,15 +160,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu d_samplesPerChip = acq_parameters.samples_per_chip; d_buffer_count = 0U; - // todo: CFAR statistic not available for non-coherent integration - //if (acq_parameters.max_dwells == 1) - //{ d_use_CFAR_algorithm_flag = acq_parameters.use_CFAR_algorithm_flag; - //} - //else - //{ - //d_use_CFAR_algorithm_flag = false; - //} d_dump_number = 0LL; d_dump_channel = acq_parameters.dump_channel; d_dump = acq_parameters.dump; From bc7edede7c49e2e507d8fefc8d540a33b103a94b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 25 Nov 2019 21:48:52 +0100 Subject: [PATCH 3/9] Fixes for MSVC --- .../volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake | 3 +++ .../include/volk_gnsssdr/volk_gnsssdr_complex.h | 3 +++ ...ssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h | 2 +- .../volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt | 9 +++++---- .../volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c | 1 + 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake index 7bc06a9b1..3eff98fff 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake @@ -139,6 +139,9 @@ endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")) set(CMAKE_REQUIRED_FLAGS "-std=c++17") endif() +if(MSVC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18")) + set(CMAKE_REQUIRED_FLAGS "/std:c++17") +endif() # Normalize and check the component list we were given set(want_components ${FILESYSTEM_FIND_COMPONENTS}) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h index 38ce9b033..65fb6bd37 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h @@ -45,6 +45,9 @@ #ifdef __cplusplus +#ifdef _MSC_VER +#include +#endif #include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h index 6b732c3b6..d3cbe5d85 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h @@ -103,7 +103,7 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g } tmp32_1 = *in_common++ * (*phase); phase_doppler *= phase_inc; - phase_doppler_rate = cpowf(phase_inc_rate, lv_cmake(n * n, 0.0f)); + phase_doppler_rate = cpowf(phase_inc_rate, lv_cmake((float)(n * n), 0.0f)); phase_doppler_rate /= hypotf(lv_creal(phase_doppler_rate), lv_cimag(phase_doppler_rate)); (*phase) = phase_doppler * phase_doppler_rate; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index 8aa034e00..5c3b6f5d8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -80,7 +80,7 @@ if(HAVE_POSIX_MEMALIGN) add_definitions(-DHAVE_POSIX_MEMALIGN) endif() -if(NOT DEFINED _XOPEN_SOURCE) +if(NOT DEFINED _XOPEN_SOURCE AND NOT MSVC) add_definitions(-D_XOPEN_SOURCE=700) endif() @@ -213,7 +213,7 @@ if(CPU_IS_x86) endif() # Disable SSE4a if Clang is less than version 3.2 - if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "Clang") # Figure out the version of Clang if(CMAKE_VERSION VERSION_LESS "2.8.10") # Extract the Clang version from the --version string. @@ -564,7 +564,8 @@ list(APPEND volk_gnsssdr_sources set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.c ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_machines.c -PROPERTIES COMPILE_DEFINITIONS "${machine_defs}") + PROPERTIES COMPILE_DEFINITIONS "${machine_defs}" +) if(MSVC) #add compatibility includes for stdint types @@ -583,7 +584,7 @@ if(NOT (CMAKE_GENERATOR STREQUAL Xcode)) PUBLIC $ PRIVATE ${PROJECT_SOURCE_DIR}/kernels PRIVATE ${CMAKE_CURRENT_BINARY_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index 808013fd5..782661319 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -59,6 +59,7 @@ static inline unsigned long long _xgetbv(unsigned int index) #elif defined(_MSC_VER) && defined(HAVE_INTRIN_H) #include #define cpuid_x86(op, r) __cpuid(((int *)r), op) +#define cpuid_x86_count(op, count, regs) __cpuidex((int *)regs, op, count) #if defined(_XCR_XFEATURE_ENABLED_MASK) #define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK) From 625561a6550e02932a44b70ebca5e218a0e03b2b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 25 Nov 2019 22:47:31 +0100 Subject: [PATCH 4/9] Remove deprecated cstdbool header --- .../volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h | 1 - .../libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h | 1 - .../libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc | 1 - 3 files changed, 3 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h index 82a123925..f4959b10f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h @@ -27,7 +27,6 @@ * ------------------------------------------------------------------------- */ -#include // for bool #include // for ofstream #include // for string #include // for vector diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h index 2c734f3f7..458deba7f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h @@ -25,7 +25,6 @@ #include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t -#include // for bool, false #include // for NULL #include // for map #include // for string, basic_string diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index a67e05ded..4309d2f43 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -21,7 +21,6 @@ #include "kernel_tests.h" // for init_test_list #include "qa_utils.h" // for volk_gnsssdr_test_case_t, volk_gnsssdr_test_results_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t -#include // for bool, false, true #include // IWYU pragma: keep #include // for operator<<, basic_ostream, endl, char... #include // for map, map<>::iterator, _Rb_tree_iterator From 6fca79ed6d966a01bd2ccc34702ab6536bbfe291 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 25 Nov 2019 23:04:10 +0100 Subject: [PATCH 5/9] Add flag for MSVC --- cmake/Modules/FindFILESYSTEM.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Modules/FindFILESYSTEM.cmake b/cmake/Modules/FindFILESYSTEM.cmake index a670d0fde..6eb6deeec 100644 --- a/cmake/Modules/FindFILESYSTEM.cmake +++ b/cmake/Modules/FindFILESYSTEM.cmake @@ -140,6 +140,9 @@ endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")) set(CMAKE_REQUIRED_FLAGS "-std=c++17") endif() +if(MSVC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18")) + set(CMAKE_REQUIRED_FLAGS "/std:c++17") +endif() # Normalize and check the component list we were given set(want_components ${FILESYSTEM_FIND_COMPONENTS}) From 264a5c8ac60d44c98ae39250389afef4946f5823 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 25 Nov 2019 23:22:30 +0100 Subject: [PATCH 6/9] Add MSVC-generated files to .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 96a025531..bcecf5706 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ cmake-build-debug/ /install .DS_Store .pydevproject +.vscode/ +.vs/ +Testing/ From 990feb74824ba015dcae6976f41b45ca55fb6d1e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 26 Nov 2019 08:11:12 +0100 Subject: [PATCH 7/9] Update changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 308ad41c5..e6a522d52 100644 --- a/docs/changelog +++ b/docs/changelog @@ -49,6 +49,7 @@ - Fixed building in some ARM-based devices. Now Clang and ARMClang can be used for native building. - Added toolchain files for building gnss-sdr and the volk_gnsssdr library in several ARM processor architectures, including those in Raspberry Pi 3 and 4. - The software can now be built using Xcode (passing -GXcode to CMake) without previous manual installation of volk_gnsssdr. +- Now the volk_gnsssdr library can be built on Microsoft Windows. ### Improvements in Reliability: From 0ca8a713f685aa2d4992e83597f6fd6ba1c5440c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 26 Nov 2019 08:25:17 +0100 Subject: [PATCH 8/9] Update Proocol Buffers version to 3.11.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bbd7c505..31a221e0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -410,7 +410,7 @@ set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GPSTK_LOCAL_VERSION "2.12") set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.17") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.10") -set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.10.1") +set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.11.0") if(CMAKE_VERSION VERSION_LESS "3.0.2") set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1") # Fix for CentOS 7 From 94388913bb5075400a48850498f3701fceb972d0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 26 Nov 2019 08:25:33 +0100 Subject: [PATCH 9/9] Update Proocol Buffers version to 3.11.0 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b8da612c0..e66fa8481 100644 --- a/README.md +++ b/README.md @@ -302,9 +302,9 @@ $ sudo apt-get install autoconf automake libtool curl make g++ unzip and then: ~~~~~~ -$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.10.1/protobuf-cpp-3.10.1.tar.gz -$ tar xvfz protobuf-cpp-3.10.1.tar.gz -$ cd protobuf-3.10.1 +$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.0/protobuf-cpp-3.11.0.tar.gz +$ tar xvfz protobuf-cpp-3.11.0.tar.gz +$ cd protobuf-3.11.0 $ ./autogen.sh $ ./configure $ make