mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next
This commit is contained in:
commit
6c63372ec6
@ -345,7 +345,7 @@ set(GNSSSDR_MATIO_MIN_VERSION "1.5.3")
|
||||
################################################################################
|
||||
# Versions to download and build (but not installed) if not found
|
||||
################################################################################
|
||||
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1")
|
||||
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2")
|
||||
set(GNSSSDR_GLOG_LOCAL_VERSION "0.3.5")
|
||||
set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x")
|
||||
set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1")
|
||||
@ -354,12 +354,15 @@ set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6")
|
||||
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13")
|
||||
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9")
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.0.2")
|
||||
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1")
|
||||
endif(CMAKE_VERSION VERSION_LESS "3.0.2")
|
||||
|
||||
################################################################################
|
||||
# Check cmake version
|
||||
################################################################################
|
||||
if(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
|
||||
message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}. For more information check https://github.com/joakimkarlsson/bandit/issues/40")
|
||||
message(STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least ${GNSSSDR_CMAKE_MIN_VERSION}.") # For more information check https://github.com/joakimkarlsson/bandit/issues/40
|
||||
message(FATAL_ERROR "Fatal error: CMake >= ${GNSSSDR_CMAKE_MIN_VERSION} required.")
|
||||
endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
|
||||
|
||||
@ -371,11 +374,6 @@ endif(CMAKE_VERSION VERSION_LESS ${GNSSSDR_CMAKE_MIN_VERSION})
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION})
|
||||
message(STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}")
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Ubuntu")
|
||||
if(${LINUX_VER} MATCHES "12.04")
|
||||
message(STATUS "For instructions on how to upgrade GCC, check https://askubuntu.com/a/271561")
|
||||
endif(${LINUX_VER} MATCHES "12.04")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Ubuntu")
|
||||
message(FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required.")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${GNSSSDR_GCC_MIN_VERSION})
|
||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
@ -438,7 +436,7 @@ endif(NOT ENABLE_GENERIC_ARCH)
|
||||
################################################################################
|
||||
if(CMAKE_VERSION VERSION_LESS 3.1)
|
||||
find_package(Threads REQUIRED)
|
||||
link_libraries(${CMAKE_THREAD_LIBS_INIT})
|
||||
set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
else(CMAKE_VERSION VERSION_LESS 3.1)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
@ -447,7 +445,7 @@ else(CMAKE_VERSION VERSION_LESS 3.1)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
endif(CMAKE_CROSSCOMPILING)
|
||||
find_package(Threads REQUIRED)
|
||||
link_libraries(Threads::Threads)
|
||||
set(THREAD_LIBRARIES Threads::Threads)
|
||||
endif(CMAKE_VERSION VERSION_LESS 3.1)
|
||||
|
||||
|
||||
@ -625,9 +623,9 @@ if(NOT VOLK_GNSSSDR_FOUND)
|
||||
|
||||
set(READ_ENVIRO "")
|
||||
if(ENABLE_PACKAGING)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
if(NOT DEFINED ENV{PROTECT_PASSWORDS})
|
||||
set(READ_ENVIRO ${CMAKE_COMMAND} -E environment)
|
||||
endif(NOT DEFINED ENV{PROTECT_PASSWORDS})
|
||||
@ -1512,9 +1510,9 @@ if(ENABLE_GPERFTOOLS)
|
||||
# Set GPerftools related flags if it is available
|
||||
# See https://github.com/gperftools/gperftools/blob/master/README
|
||||
if(GPERFTOOLS_FOUND)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin")
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
@ -1527,11 +1525,11 @@ endif(ENABLE_GPERFTOOLS)
|
||||
# GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/
|
||||
########################################################################
|
||||
if(ENABLE_GPROF)
|
||||
#if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
|
||||
#endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
endif(ENABLE_GPROF)
|
||||
|
||||
|
||||
@ -1541,7 +1539,7 @@ endif(ENABLE_GPROF)
|
||||
# Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8)
|
||||
# Enable C++14 support in GCC >= 6.1.1
|
||||
# Fallback to C++11 when using GCC < 6.1.1
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
||||
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
@ -1552,7 +1550,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
# endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
|
||||
# Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8)
|
||||
# Enable C++14 support in Clang >= 3.5.0 or AppleClang >= 600
|
||||
@ -1586,17 +1584,17 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif(OS_IS_MACOSX)
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32)
|
||||
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
||||
endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32)
|
||||
|
||||
# Processor-architecture related flags
|
||||
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
|
||||
if (NOT ARCH_COMPILER_FLAGS)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
if(OS_IS_MACOSX)
|
||||
set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse")
|
||||
else(OS_IS_MACOSX)
|
||||
@ -1615,16 +1613,16 @@ if (NOT ARCH_COMPILER_FLAGS)
|
||||
endif(IS_ARM)
|
||||
endif(NOT ${ENABLE_GENERIC_ARCH})
|
||||
endif(OS_IS_MACOSX)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
endif (NOT ARCH_COMPILER_FLAGS)
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
# https://gcc.gnu.org/wiki/Visibility
|
||||
add_definitions(-fvisibility=hidden)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
|
||||
|
||||
|
||||
|
@ -114,7 +114,7 @@ If you are using Arch Linux (with base-devel group installed):
|
||||
|
||||
~~~~~~
|
||||
$ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \
|
||||
blas lapack gflags google-glog openssl pugixml python2-mako python2-six \
|
||||
blas lapack gflags google-glog openssl pugixml python-mako python-six \
|
||||
libmatio libpcap gtest
|
||||
~~~~~~
|
||||
|
||||
@ -202,9 +202,9 @@ The full stop separated from ```cmake``` by a space is important. [CMake](https:
|
||||
#### Install [Gflags](https://github.com/gflags/gflags "Gflags' Homepage"), a commandline flags processing module for C++:
|
||||
|
||||
~~~~~~
|
||||
$ wget https://github.com/gflags/gflags/archive/v2.2.1.tar.gz
|
||||
$ tar xvfz v2.2.1.tar.gz
|
||||
$ cd gflags-2.2.1
|
||||
$ wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
|
||||
$ tar xvfz v2.2.2.tar.gz
|
||||
$ cd gflags-2.2.2
|
||||
$ cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DBUILD_gflags_nothreads_LIB=OFF .
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
@ -41,7 +41,7 @@ message(STATUS "Checking for ARM")
|
||||
set (IS_ARM NO)
|
||||
set (ARM_VERSION "")
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
execute_process(COMMAND echo "int main(){}"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E -
|
||||
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
|
||||
@ -94,11 +94,11 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
message(STATUS "System is not ARM")
|
||||
endif(NOT ARM_FOUND STREQUAL "")
|
||||
|
||||
else (CMAKE_COMPILE_IS_GNUCXX)
|
||||
else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# TODO: Other compilers
|
||||
message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false")
|
||||
message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
|
||||
set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM")
|
||||
set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version")
|
||||
|
@ -2,6 +2,7 @@
|
||||
* \file gnss_sdr_valve.cc
|
||||
* \brief Implementation of a GNU Radio block that sends a STOP message to the
|
||||
* control queue right after a specific number of samples have passed through it.
|
||||
* \author Javier Arribas, 2018. jarribas(at)cttc.es
|
||||
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
||||
*
|
||||
*
|
||||
@ -39,42 +40,65 @@
|
||||
|
||||
gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue) : gr::sync_block("valve",
|
||||
gr::io_signature::make(1, 1, sizeof_stream_item),
|
||||
gr::io_signature::make(1, 1, sizeof_stream_item)),
|
||||
d_nitems(nitems),
|
||||
d_ncopied_items(0),
|
||||
d_queue(queue)
|
||||
gr::msg_queue::sptr queue, bool stop_flowgraph) : gr::sync_block("valve",
|
||||
gr::io_signature::make(1, 1, sizeof_stream_item),
|
||||
gr::io_signature::make(1, 1, sizeof_stream_item)),
|
||||
d_nitems(nitems),
|
||||
d_ncopied_items(0),
|
||||
d_queue(queue),
|
||||
d_stop_flowgraph(stop_flowgraph)
|
||||
{
|
||||
d_open_valve = false;
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue)
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue, bool stop_flowgraph)
|
||||
{
|
||||
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue));
|
||||
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, stop_flowgraph));
|
||||
return valve_;
|
||||
}
|
||||
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, unsigned long long nitems, gr::msg_queue::sptr queue)
|
||||
{
|
||||
boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, false));
|
||||
return valve_;
|
||||
}
|
||||
|
||||
void gnss_sdr_valve::open_valve()
|
||||
{
|
||||
d_open_valve = true;
|
||||
}
|
||||
int gnss_sdr_valve::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
if (d_ncopied_items >= d_nitems)
|
||||
if (d_open_valve == false)
|
||||
{
|
||||
ControlMessageFactory *cmf = new ControlMessageFactory();
|
||||
d_queue->handle(cmf->GetQueueMessage(200, 0));
|
||||
LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed";
|
||||
delete cmf;
|
||||
return -1; // Done!
|
||||
if (d_ncopied_items >= d_nitems)
|
||||
{
|
||||
ControlMessageFactory *cmf = new ControlMessageFactory();
|
||||
d_queue->handle(cmf->GetQueueMessage(200, 0));
|
||||
LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed";
|
||||
delete cmf;
|
||||
if (d_stop_flowgraph)
|
||||
{
|
||||
return -1; // Done!
|
||||
}
|
||||
else
|
||||
{
|
||||
usleep(1000000);
|
||||
return 0; //do not produce or consume
|
||||
}
|
||||
}
|
||||
unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast<long long unsigned int>(noutput_items));
|
||||
if (n == 0) return 0;
|
||||
memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0));
|
||||
d_ncopied_items += n;
|
||||
return n;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(output_items[0], input_items[0], noutput_items * input_signature()->sizeof_stream_item(0));
|
||||
return noutput_items;
|
||||
}
|
||||
unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast<long long unsigned int>(noutput_items));
|
||||
if (n == 0) return 0;
|
||||
memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0));
|
||||
//for(long long i = 0; i++; i<n)
|
||||
// {
|
||||
// output_items[i] = input_items[i];
|
||||
// }
|
||||
d_ncopied_items += n;
|
||||
return n;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
* \file gnss_sdr_valve.h
|
||||
* \brief Interface of a GNU Radio block that sends a STOP message to the
|
||||
* control queue right after a specific number of samples have passed through it.
|
||||
* \author Javier Arribas, 2018. jarribas(at)cttc.es
|
||||
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
@ -37,10 +38,13 @@
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue);
|
||||
boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue,
|
||||
bool stop_flowgraph);
|
||||
/*!
|
||||
* \brief Implementation of a GNU Radio block that sends a STOP message to the
|
||||
* control queue right after a specific number of samples have passed through it.
|
||||
@ -50,14 +54,24 @@ class gnss_sdr_valve : public gr::sync_block
|
||||
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue);
|
||||
gnss_sdr_valve(size_t sizeof_stream_item,
|
||||
friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue);
|
||||
gr::msg_queue::sptr queue,
|
||||
bool stop_flowgraph);
|
||||
|
||||
|
||||
unsigned long long d_nitems;
|
||||
unsigned long long d_ncopied_items;
|
||||
gr::msg_queue::sptr d_queue;
|
||||
bool d_stop_flowgraph;
|
||||
bool d_open_valve;
|
||||
|
||||
public:
|
||||
gnss_sdr_valve(size_t sizeof_stream_item,
|
||||
unsigned long long nitems,
|
||||
gr::msg_queue::sptr queue, bool stop_flowgraph);
|
||||
void open_valve();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
@ -63,7 +63,7 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Enable C++14 support in 8.0.0 > GCC >= 6.1.1
|
||||
# Fallback to C++11 when using GCC < 6.1.1
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
||||
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
@ -74,7 +74,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
|
||||
# Enable C++17 support in Clang >= 6.0.0
|
||||
# Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600
|
||||
@ -100,12 +100,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
||||
endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
|
@ -75,10 +75,10 @@ endif(ENABLE_STATIC_LIBS)
|
||||
|
||||
|
||||
if(ENABLE_STRIP)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
set_target_properties(volk_gnsssdr_profile
|
||||
PROPERTIES LINK_FLAGS "-s")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
endif(ENABLE_STRIP)
|
||||
|
||||
|
||||
@ -99,10 +99,10 @@ else(ENABLE_STATIC_LIBS)
|
||||
endif(ENABLE_STATIC_LIBS)
|
||||
|
||||
if(ENABLE_STRIP)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
set_target_properties(volk_gnsssdr-config-info
|
||||
PROPERTIES LINK_FLAGS "-s")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
endif(ENABLE_STRIP)
|
||||
|
||||
install(
|
||||
|
@ -213,7 +213,7 @@ if(CPU_IS_x86)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
|
||||
# Disable SSE4a if Clang is less than version 3.2
|
||||
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||
# Figure out the version of Clang
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.10")
|
||||
# Exctract the Clang version from the --version string.
|
||||
@ -227,7 +227,7 @@ if(CPU_IS_x86)
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2")
|
||||
OVERRULE_ARCH(sse4_a "Clang >= 3.2 required for SSE4a")
|
||||
endif(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2")
|
||||
endif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
endif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||
|
||||
endif(CPU_IS_x86)
|
||||
|
||||
|
@ -82,6 +82,7 @@ add_custom_command(TARGET gnss-sdr POST_BUILD
|
||||
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:gnss-sdr> )
|
||||
|
||||
target_link_libraries(gnss-sdr ${MAC_LIBRARIES}
|
||||
${THREAD_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
|
@ -95,7 +95,7 @@ if(NOT ${GTEST_DIR_LOCAL})
|
||||
set(GTEST_LIBRARIES
|
||||
${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
)
|
||||
${THREAD_LIBRARIES} )
|
||||
set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest")
|
||||
else(NOT ${GTEST_DIR_LOCAL})
|
||||
if(GTEST_INCLUDE_DIRS)
|
||||
@ -109,6 +109,7 @@ else(NOT ${GTEST_DIR_LOCAL})
|
||||
add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc)
|
||||
set(GTEST_LIBRARIES gtest)
|
||||
endif(GTEST_INCLUDE_DIRS)
|
||||
target_link_libraries(gtest ${THREAD_LIBRARIES})
|
||||
endif(NOT ${GTEST_DIR_LOCAL})
|
||||
|
||||
|
||||
@ -495,6 +496,7 @@ if(ENABLE_SYSTEM_TESTING)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}")
|
||||
string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}")
|
||||
string(REPLACE "\"" "" HOST_SYSTEM "${HOST_SYSTEM}")
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(HOST_SYSTEM "MacOS")
|
||||
@ -502,7 +504,7 @@ if(ENABLE_SYSTEM_TESTING)
|
||||
add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}")
|
||||
|
||||
#### TTFF
|
||||
set(OPT_LIBS_ ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES}
|
||||
set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES} ${GTEST_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES}
|
||||
${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs
|
||||
@ -512,7 +514,7 @@ if(ENABLE_SYSTEM_TESTING)
|
||||
|
||||
if(ENABLE_SYSTEM_TESTING_EXTRA)
|
||||
#### POSITION_TEST
|
||||
set(OPT_LIBS_ ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES}
|
||||
set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES}
|
||||
${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES}
|
||||
${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES}
|
||||
@ -601,6 +603,7 @@ if(NOT ${GTEST_DIR_LOCAL})
|
||||
else(NOT ${GTEST_DIR_LOCAL})
|
||||
add_dependencies(gnss_block_test gtest)
|
||||
endif(NOT ${GTEST_DIR_LOCAL})
|
||||
set_property(TEST gnss_block_test PROPERTY TIMEOUT 60)
|
||||
|
||||
#########################################################
|
||||
|
||||
|
@ -67,6 +67,9 @@ DEFINE_double(acq_Delay_error_chips_start, 2.0, "Acquisition Code Delay error st
|
||||
DEFINE_double(acq_Delay_error_chips_stop, -2.0, "Acquisition Code Delay error stop sweep value [Chips]");
|
||||
DEFINE_double(acq_Delay_error_chips_step, -0.1, "Acquisition Code Delay error sweep step value [Chips]");
|
||||
|
||||
DEFINE_double(acq_to_trk_delay_s, 0.0, "Acquisition to Tracking delay value [s]");
|
||||
|
||||
|
||||
DEFINE_int64(skip_samples, 0, "Skip an initial transitory in the processed signal file capture [samples]");
|
||||
|
||||
DEFINE_int32(plot_detail_level, 0, "Specify the desired plot detail (0,1,2): 0 - Minimum plots (default) 2 - Plot all tracking parameters");
|
||||
|
@ -33,7 +33,9 @@
|
||||
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "gnss_block_factory.h"
|
||||
#include "control_message_factory.h"
|
||||
#include "tracking_interface.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "gps_l2_m_pcps_acquisition.h"
|
||||
#include "gps_l1_ca_pcps_acquisition.h"
|
||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||
@ -56,6 +58,7 @@
|
||||
#include <gnuradio/blocks/null_sink.h>
|
||||
#include <gnuradio/blocks/skiphead.h>
|
||||
#include <gnuradio/blocks/head.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
@ -186,6 +189,8 @@ public:
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
};
|
||||
|
||||
|
||||
@ -658,6 +663,18 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
|
||||
<< " [Hz], estimated Initial code delay " << true_acq_delay_samples << " [Samples]"
|
||||
<< " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << std::endl;
|
||||
}
|
||||
|
||||
// create the msg queue for valve
|
||||
|
||||
queue = gr::msg_queue::make(0);
|
||||
boost::shared_ptr<gnss_sdr_valve> reseteable_valve;
|
||||
long long int acq_to_trk_delay_samples = ceil(static_cast<double>(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s);
|
||||
boost::shared_ptr<gnss_sdr_valve> resetable_valve_(new gnss_sdr_valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue, false));
|
||||
|
||||
std::shared_ptr<ControlMessageFactory> control_message_factory_;
|
||||
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages_;
|
||||
|
||||
|
||||
//CN0 LOOP
|
||||
std::vector<std::vector<double>> pull_in_results_v_v;
|
||||
|
||||
@ -710,7 +727,15 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
|
||||
gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration);
|
||||
top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0);
|
||||
top_block->connect(gr_interleaved_char_to_complex, 0, head_samples, 0);
|
||||
top_block->connect(head_samples, 0, tracking->get_left_block(), 0);
|
||||
if (acq_to_trk_delay_samples > 0)
|
||||
{
|
||||
top_block->connect(head_samples, 0, resetable_valve_, 0);
|
||||
top_block->connect(resetable_valve_, 0, tracking->get_left_block(), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
top_block->connect(head_samples, 0, tracking->get_left_block(), 0);
|
||||
}
|
||||
top_block->connect(tracking->get_right_block(), 0, sink, 0);
|
||||
top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
|
||||
file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample
|
||||
@ -721,18 +746,46 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
|
||||
//***** STEP 5: Perform the signal tracking and read the results *****
|
||||
//********************************************************************
|
||||
std::cout << "--- START TRACKING WITH PULL-IN ERROR: " << acq_doppler_error_hz_values.at(current_acq_doppler_error_idx) << " [Hz] and " << acq_delay_error_chips_values.at(current_acq_doppler_error_idx).at(current_acq_code_error_idx) << " [Chips] ---" << std::endl;
|
||||
tracking->start_tracking();
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
EXPECT_NO_THROW({
|
||||
start = std::chrono::system_clock::now();
|
||||
top_block->run(); // Start threads and wait
|
||||
end = std::chrono::system_clock::now();
|
||||
}) << "Failure running the top_block.";
|
||||
if (acq_to_trk_delay_samples > 0)
|
||||
{
|
||||
EXPECT_NO_THROW({
|
||||
start = std::chrono::system_clock::now();
|
||||
std::cout << "--- SIMULATING A PULL-IN DELAY OF " << FLAGS_acq_to_trk_delay_s << " SECONDS ---\n";
|
||||
top_block->start();
|
||||
std::cout << " Waiting for valve...\n";
|
||||
//wait the valve message indicating the circulation of the amount of samples of the delay
|
||||
gr::message::sptr queue_message = queue->delete_head();
|
||||
if (queue_message != 0)
|
||||
{
|
||||
control_messages_ = control_message_factory_->GetControlMessages(queue_message);
|
||||
}
|
||||
else
|
||||
{
|
||||
control_messages_->clear();
|
||||
}
|
||||
std::cout << " Starting tracking...\n";
|
||||
tracking->start_tracking();
|
||||
resetable_valve_->open_valve();
|
||||
std::cout << " Waiting flowgraph..\n";
|
||||
top_block->wait();
|
||||
end = std::chrono::system_clock::now();
|
||||
}) << "Failure running the top_block.";
|
||||
}
|
||||
else
|
||||
{
|
||||
tracking->start_tracking();
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
EXPECT_NO_THROW({
|
||||
start = std::chrono::system_clock::now();
|
||||
top_block->run(); // Start threads and wait
|
||||
end = std::chrono::system_clock::now();
|
||||
}) << "Failure running the top_block.";
|
||||
}
|
||||
|
||||
std::chrono::duration<double> elapsed_seconds = end - start;
|
||||
std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds" << std::endl;
|
||||
|
||||
|
||||
pull_in_results_v.push_back(msg_rx->rx_message != 3); //save last asynchronous tracking message in order to detect a loss of lock
|
||||
|
||||
//********************************
|
||||
|
@ -32,7 +32,7 @@ include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs
|
||||
@ -51,6 +51,7 @@ add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS})
|
||||
source_group(Headers FILES ${FRONT_END_CAL_HEADERS})
|
||||
|
||||
target_link_libraries(front_end_cal_lib ${MAC_LIBRARIES}
|
||||
${THREAD_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
|
Loading…
Reference in New Issue
Block a user