diff --git a/AUTHORS b/AUTHORS
index 2dd1239cb..e6508f5ce 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3,7 +3,7 @@ GNSS-SDR Authorship
The GNSS-SDR project is hosted and sponsored by the Centre Tecnològic de
Telecomunicacions de Catalunya (CTTC), a non-profit research foundation located
-in Castelldefels (40.396764 N, 3.713379 E), 20 km south of Barcelona, Spain.
+in Castelldefels (41.27504 N, 1.987709 E), 20 km south of Barcelona, Spain.
GNSS-SDR is the by-product of GNSS research conducted at the Communications
Systems Division of CTTC, and it is the combined effort of students,
software engineers and researchers from different institutions around the World.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1f798eb9..9be84be8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -270,7 +270,19 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif(${DARWIN_VERSION} MATCHES "10")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-#select the release build type by default to get optimization flags
+# Define extra build types and select Release by default to get optimization flags
+include(GnsssdrBuildTypes)
+# Available options:
+# - None: nothing set
+# - Debug: -O2 -g
+# - Release: -O3
+# - RelWithDebInfo: -O3 -g
+# - MinSizeRel: -Os
+# - Coverage: -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage
+# - NoOptWithASM: -O0 -g -save-temps
+# - O2WithASM: -O2 -g -save-temps
+# - O3WithASM: -O3 -g -save-temps
+# - ASAN: -Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer
if(NOT CMAKE_BUILD_TYPE)
if(ENABLE_GPERFTOOLS OR ENABLE_GPROF)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
@@ -282,11 +294,9 @@ if(NOT CMAKE_BUILD_TYPE)
else(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.")
endif(NOT CMAKE_BUILD_TYPE)
+GNSSSDR_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
-# Append -O2 optimization flag for Debug builds
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
-
# allow 'large' files in 32 bit builds
if(UNIX)
add_definitions( -D_LARGEFILE_SOURCE
@@ -318,6 +328,7 @@ set(GNSSSDR_APPLECLANG_MIN_VERSION "500")
set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3")
set(GNSSSDR_BOOST_MIN_VERSION "1.45")
set(GNSSSDR_PYTHON_MIN_VERSION "2.7")
+set(GNSSSDR_PYTHON3_MIN_VERSION "3.4")
set(GNSSSDR_MAKO_MIN_VERSION "0.4.2")
set(GNSSSDR_ARMADILLO_MIN_VERSION "5.300.0")
set(GNSSSDR_MATIO_MIN_VERSION "1.5.3")
@@ -566,25 +577,28 @@ if(NOT VOLK_GNSSSDR_FOUND)
###############################
# Find Python required modules
###############################
- include(SetupPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
- GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
- GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
- GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
+ include(SetupPython) # sets PYTHON_EXECUTABLE and search for required modules
if(NOT PYTHON_MIN_VER_FOUND)
message(FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR")
- endif()
+ endif(NOT PYTHON_MIN_VER_FOUND)
+
+ if(${PYTHON3})
+ set(PYTHON_NAME "python3")
+ else(${PYTHON3})
+ set(PYTHON_NAME "python")
+ endif(${PYTHON3})
# Mako
if(NOT MAKO_FOUND)
- message(STATUS "Mako templates not found. See http://www.makotemplates.org/ ")
+ message(STATUS "Mako template library not found. See http://www.makotemplates.org/ ")
message(STATUS " You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
- message(STATUS " sudo yum install python-mako")
+ message(STATUS " sudo yum install ${PYTHON_NAME}-mako")
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
- message(STATUS " sudo zypper install python-Mako")
+ message(STATUS " sudo zypper install ${PYTHON_NAME}-Mako")
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
- message(STATUS " sudo apt-get install python-mako")
+ message(STATUS " sudo apt-get install ${PYTHON_NAME}-mako")
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR")
endif(NOT MAKO_FOUND)
@@ -594,11 +608,11 @@ if(NOT VOLK_GNSSSDR_FOUND)
message(STATUS "python-six not found. See https://pythonhosted.org/six/ ")
message(STATUS " You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
- message(STATUS " sudo yum install python-six")
+ message(STATUS " sudo yum install ${PYTHON_NAME}-six")
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
- message(STATUS " sudo zypper install python-six")
+ message(STATUS " sudo zypper install ${PYTHON_NAME}-six")
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
- message(STATUS " sudo apt-get install python-six")
+ message(STATUS " sudo apt-get install ${PYTHON_NAME}-six")
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR")
endif(NOT SIX_FOUND)
diff --git a/cmake/Modules/GnsssdrBuildTypes.cmake b/cmake/Modules/GnsssdrBuildTypes.cmake
new file mode 100644
index 000000000..ae618b758
--- /dev/null
+++ b/cmake/Modules/GnsssdrBuildTypes.cmake
@@ -0,0 +1,219 @@
+# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
+#
+# This file is part of GNSS-SDR.
+#
+# GNSS-SDR is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GNSS-SDR is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNSS-SDR. If not, see .
+
+if(DEFINED __INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE)
+ return()
+endif()
+set(__INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE TRUE)
+
+# Standard CMake Build Types and their basic CFLAGS:
+# - None: nothing set
+# - Debug: -O2 -g
+# - Release: -O3
+# - RelWithDebInfo: -O3 -g
+# - MinSizeRel: -Os
+
+# Additional Build Types, defined below:
+# - NoOptWithASM: -O0 -g -save-temps
+# - O2WithASM: -O2 -g -save-temps
+# - O3WithASM: -O3 -g -save-temps
+
+# Defines the list of acceptable cmake build types. When adding a new
+# build type below, make sure to add it to this list.
+list(APPEND AVAIL_BUILDTYPES
+ None Debug Release RelWithDebInfo MinSizeRel
+ Coverage NoOptWithASM O2WithASM O3WithASM ASAN
+)
+
+########################################################################
+# GNSSSDR_CHECK_BUILD_TYPE(build type)
+#
+# Use this to check that the build type set in CMAKE_BUILD_TYPE on the
+# commandline is one of the valid build types used by this project. It
+# checks the value set in the cmake interface against the list of
+# known build types in AVAIL_BUILDTYPES. If the build type is found,
+# the function exits immediately. If nothing is found by the end of
+# checking all available build types, we exit with an error and list
+# the avialable build types.
+########################################################################
+function(GNSSSDR_CHECK_BUILD_TYPE settype)
+ string(TOUPPER ${settype} _settype)
+ foreach(btype ${AVAIL_BUILDTYPES})
+ string(TOUPPER ${btype} _btype)
+ if(${_settype} STREQUAL ${_btype})
+ return() # found it; exit cleanly
+ endif(${_settype} STREQUAL ${_btype})
+ endforeach(btype)
+ # Build type not found; error out
+ message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}")
+endfunction(GNSSSDR_CHECK_BUILD_TYPE)
+
+
+########################################################################
+# For GCC and Clang, we can set a build type:
+#
+# -DCMAKE_BUILD_TYPE=Coverage
+#
+# This type uses no optimization (-O0), outputs debug symbols (-g) and
+# outputs all intermediary files the build system produces, including
+# all assembly (.s) files. Look in the build directory for these
+# files.
+# NOTE: This is not defined on Windows systems.
+########################################################################
+if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING
+ "Flags used by the C++ compiler during Coverage builds." FORCE)
+ set(CMAKE_C_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING
+ "Flags used by the C compiler during Coverage builds." FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ "-W" CACHE STRING
+ "Flags used for linking binaries during Coverage builds." FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ "-W" CACHE STRING
+ "Flags used by the shared lib linker during Coverage builds." FORCE)
+
+ MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_COVERAGE
+ CMAKE_C_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
+endif(NOT WIN32)
+
+
+########################################################################
+# For GCC and Clang, we can set a build type:
+#
+# -DCMAKE_BUILD_TYPE=NoOptWithASM
+#
+# This type uses no optimization (-O0), outputs debug symbols (-g) and
+# outputs all intermediary files the build system produces, including
+# all assembly (.s) files. Look in the build directory for these
+# files.
+# NOTE: This is not defined on Windows systems.
+########################################################################
+if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING
+ "Flags used by the C++ compiler during NoOptWithASM builds." FORCE)
+ set(CMAKE_C_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING
+ "Flags used by the C compiler during NoOptWithASM builds." FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
+ "-W" CACHE STRING
+ "Flags used for linking binaries during NoOptWithASM builds." FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM
+ "-W" CACHE STRING
+ "Flags used by the shared lib linker during NoOptWithASM builds." FORCE)
+
+ MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_NOOPTWITHASM
+ CMAKE_C_FLAGS_NOOPTWITHASM
+ CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
+ CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM)
+endif(NOT WIN32)
+
+
+
+########################################################################
+# For GCC and Clang, we can set a build type:
+#
+# -DCMAKE_BUILD_TYPE=O2WithASM
+#
+# This type uses level 2 optimization (-O2), outputs debug symbols
+# (-g) and outputs all intermediary files the build system produces,
+# including all assembly (.s) files. Look in the build directory for
+# these files.
+# NOTE: This is not defined on Windows systems.
+########################################################################
+
+if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING
+ "Flags used by the C++ compiler during O2WithASM builds." FORCE)
+ set(CMAKE_C_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING
+ "Flags used by the C compiler during O2WithASM builds." FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM
+ "-W" CACHE STRING
+ "Flags used for linking binaries during O2WithASM builds." FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM
+ "-W" CACHE STRING
+ "Flags used by the shared lib linker during O2WithASM builds." FORCE)
+
+ MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_O2WITHASM
+ CMAKE_C_FLAGS_O2WITHASM
+ CMAKE_EXE_LINKER_FLAGS_O2WITHASM
+ CMAKE_SHARED_LINKER_FLAGS_O2WITHASM)
+endif(NOT WIN32)
+
+
+########################################################################
+# For GCC and Clang, we can set a build type:
+#
+# -DCMAKE_BUILD_TYPE=O3WithASM
+#
+# This type uses level 3 optimization (-O3), outputs debug symbols
+# (-g) and outputs all intermediary files the build system produces,
+# including all assembly (.s) files. Look in the build directory for
+# these files.
+# NOTE: This is not defined on Windows systems.
+########################################################################
+
+if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING
+ "Flags used by the C++ compiler during O3WithASM builds." FORCE)
+ set(CMAKE_C_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING
+ "Flags used by the C compiler during O3WithASM builds." FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM
+ "-W" CACHE STRING
+ "Flags used for linking binaries during O3WithASM builds." FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM
+ "-W" CACHE STRING
+ "Flags used by the shared lib linker during O3WithASM builds." FORCE)
+
+ MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_O3WITHASM
+ CMAKE_C_FLAGS_O3WITHASM
+ CMAKE_EXE_LINKER_FLAGS_O3WITHASM
+ CMAKE_SHARED_LINKER_FLAGS_O3WITHASM)
+endif(NOT WIN32)
+
+
+########################################################################
+# For GCC and Clang, we can set a build type:
+#
+# -DCMAKE_BUILD_TYPE=ASAN
+#
+# This type creates an address sanitized build (-fsanitize=address)
+# and defaults to the DebugParanoid linker flags.
+# NOTE: This is not defined on Windows systems.
+########################################################################
+if(NOT WIN32)
+ set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
+ "Flags used by the C++ compiler during Address Sanitized builds." FORCE)
+ set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
+ "Flags used by the C compiler during Address Sanitized builds." FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_ASAN
+ "-W" CACHE STRING
+ "Flags used for linking binaries during Address Sanitized builds." FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_ASAN
+ "-W" CACHE STRING
+ "Flags used by the shared lib linker during Address Sanitized builds." FORCE)
+
+ MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_ASAN
+ CMAKE_C_FLAGS_ASAN
+ CMAKE_EXE_LINKER_FLAGS_ASAN
+ CMAKE_SHARED_LINKER_ASAN)
+endif(NOT WIN32)
diff --git a/cmake/Modules/SetupPython.cmake b/cmake/Modules/SetupPython.cmake
index eb4e7a55d..d8bde9efd 100644
--- a/cmake/Modules/SetupPython.cmake
+++ b/cmake/Modules/SetupPython.cmake
@@ -15,54 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see .
-########################################################################
-# Setup the python interpreter:
-# This allows the user to specify a specific interpreter,
-# or finds the interpreter via the built-in cmake module.
-########################################################################
-#this allows the user to override PYTHON_EXECUTABLE
-if(PYTHON_EXECUTABLE)
-
- set(PYTHONINTERP_FOUND TRUE)
-
-#otherwise if not set, try to automatically find it
-else(PYTHON_EXECUTABLE)
-
- #use the built-in find script
- set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
- find_package(PythonInterp 2)
-
- #and if that fails use the find program routine
- if(NOT PYTHONINTERP_FOUND)
- find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python3)
- if(PYTHON_EXECUTABLE)
- set(PYTHONINTERP_FOUND TRUE)
- endif(PYTHON_EXECUTABLE)
- endif(NOT PYTHONINTERP_FOUND)
-
-endif(PYTHON_EXECUTABLE)
-
-if (CMAKE_CROSSCOMPILING)
- set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
-else (CMAKE_CROSSCOMPILING)
- set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
-endif(CMAKE_CROSSCOMPILING)
-
-#make the path to the executable appear in the cmake gui
-set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
-set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")
-
-#make sure we can use -B with python (introduced in 2.6)
-if(PYTHON_EXECUTABLE)
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -B -c ""
- OUTPUT_QUIET ERROR_QUIET
- RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT
- )
- if(PYTHON_HAS_DASH_B_RESULT EQUAL 0)
- set(PYTHON_DASH_B "-B")
- endif()
-endif(PYTHON_EXECUTABLE)
########################################################################
# Check for the existence of a python module:
@@ -71,25 +23,99 @@ endif(PYTHON_EXECUTABLE)
# - cmd an additional command to run
# - have the result variable to set
########################################################################
-macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have)
- message(STATUS "Python checking for ${desc}")
+macro(GNSSSDR_PYTHON_CHECK_MODULE_RAW desc python_code have)
execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "
-#########################################
-try: import ${mod}
-except:
- try: ${mod}
- except: exit(-1)
-try: assert ${cmd}
-except: exit(-1)
-#########################################"
- RESULT_VARIABLE ${have}
+ COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
+ OUTPUT_QUIET ERROR_QUIET
+ RESULT_VARIABLE return_code
)
- if(${have} EQUAL 0)
+ if(return_code EQUAL 0)
message(STATUS "Python checking for ${desc} - found")
set(${have} TRUE)
- else(${have} EQUAL 0)
+ else()
message(STATUS "Python checking for ${desc} - not found")
set(${have} FALSE)
- endif(${have} EQUAL 0)
+ endif()
+endmacro(GNSSSDR_PYTHON_CHECK_MODULE_RAW)
+
+macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have)
+ GNSSSDR_PYTHON_CHECK_MODULE_RAW(
+ "${desc}" "
+#########################################
+try:
+ import ${mod}
+ assert ${cmd}
+except (ImportError, AssertionError): exit(-1)
+except: pass
+#########################################"
+ "${have}")
endmacro(GNSSSDR_PYTHON_CHECK_MODULE)
+
+
+########################################################################
+# Setup the python interpreter:
+# This allows the user to specify a specific interpreter,
+# or finds the interpreter via the built-in cmake module.
+########################################################################
+
+if(CMAKE_VERSION VERSION_LESS 3.12)
+ if(PYTHON_EXECUTABLE)
+ message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
+ string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3)
+ if(IS_PYTHON3 EQUAL -1)
+ find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED)
+ else(IS_PYTHON3 EQUAL -1)
+ find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
+ endif(IS_PYTHON3 EQUAL -1)
+ GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
+ else(PYTHON_EXECUTABLE)
+ message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2")
+ message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.")
+ find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION})
+ if(NOT PYTHONINTERP_FOUND)
+ message(STATUS "python2 not found - trying with python3")
+ find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
+ endif(NOT PYTHONINTERP_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
+ endif(PYTHON_EXECUTABLE)
+ find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
+else(CMAKE_VERSION VERSION_LESS 3.12)
+ find_package (Python3 COMPONENTS Interpreter)
+ if(Python3_FOUND)
+ set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+ set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
+ GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
+ endif(Python3_FOUND)
+ if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND)
+ find_package(Python2 COMPONENTS Interpreter)
+ if(Python2_FOUND)
+ set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
+ set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR})
+ GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
+ GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
+ endif(Python2_FOUND)
+ endif(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND)
+endif(CMAKE_VERSION VERSION_LESS 3.12)
+
+if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
+ set(PYTHON3 TRUE)
+endif(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
+
+
+if(CMAKE_CROSSCOMPILING)
+ set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
+else(CMAKE_CROSSCOMPILING)
+ set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
+endif(CMAKE_CROSSCOMPILING)
+
+
+#make the path to the executable appear in the cmake gui
+set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
+set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")
diff --git a/conf/gnss-sdr-kalman-bayes.conf b/conf/gnss-sdr-kalman-bayes.conf
new file mode 100644
index 000000000..051d080de
--- /dev/null
+++ b/conf/gnss-sdr-kalman-bayes.conf
@@ -0,0 +1,63 @@
+[GNSS-SDR]
+
+;######### GLOBAL OPTIONS ##################
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+GNSS-SDR.internal_fs_sps=2000000
+GNSS-SDR.internal_fs_hz=2000000
+
+;######### SIGNAL_SOURCE CONFIG ############
+SignalSource.implementation=File_Signal_Source
+SignalSource.filename=/home/glamountain/gnss-sdr/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
+SignalSource.item_type=ishort
+SignalSource.sampling_frequency=4000000
+SignalSource.freq=1575420000
+SignalSource.samples=0
+
+;######### SIGNAL_CONDITIONER CONFIG ############
+SignalConditioner.implementation=Signal_Conditioner
+DataTypeAdapter.implementation=Ishort_To_Complex
+InputFilter.implementation=Pass_Through
+InputFilter.item_type=gr_complex
+Resampler.implementation=Direct_Resampler
+Resampler.sample_freq_in=4000000
+Resampler.sample_freq_out=2000000
+Resampler.item_type=gr_complex
+
+;######### CHANNELS GLOBAL CONFIG ############
+Channels_1C.count=8
+Channels.in_acquisition=1
+Channel.signal=1C
+
+;######### ACQUISITION GLOBAL CONFIG ############
+Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
+Acquisition_1C.item_type=gr_complex
+Acquisition_1C.threshold=0.008
+Acquisition_1C.doppler_max=10000
+Acquisition_1C.doppler_step=250
+Acquisition_1C.dump=false
+Acquisition_1C.dump_filename=../data/kalman/acq_dump
+
+;######### TRACKING GLOBAL CONFIG ############
+Tracking_1C.implementation=GPS_L1_CA_KF_Tracking
+Tracking_1C.item_type=gr_complex
+Tracking_1C.pll_bw_hz=40.0;
+Tracking_1C.dll_bw_hz=4.0;
+Tracking_1C.order=3;
+Tracking_1C.dump=true
+Tracking_1C.dump_filename=../data/kalman/epl_tracking_ch_
+Tracking_1C.bce_run = true;
+Tracking_1C.p_transient = 0;
+Tracking_1C.s_transient = 100;
+
+;######### TELEMETRY DECODER GPS CONFIG ############
+TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
+
+;######### OBSERVABLES CONFIG ############
+Observables.implementation=GPS_L1_CA_Observables
+
+;######### PVT CONFIG ############
+PVT.implementation=GPS_L1_CA_PVT
+PVT.averaging_depth=100
+PVT.flag_averaging=true
+PVT.output_rate_ms=10
+PVT.display_rate_ms=500
diff --git a/conf/gnss-sdr_GPS_L1_nsr_kf.conf b/conf/gnss-sdr_GPS_L1_nsr_kf.conf
new file mode 100644
index 000000000..d2a84cd9f
--- /dev/null
+++ b/conf/gnss-sdr_GPS_L1_nsr_kf.conf
@@ -0,0 +1,211 @@
+; Default configuration file
+; You can define your own receiver and invoke it by doing
+; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
+;
+
+[GNSS-SDR]
+
+;######### GLOBAL OPTIONS ##################
+;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
+;GNSS-SDR.internal_fs_sps=6826700
+GNSS-SDR.internal_fs_sps=2560000
+;GNSS-SDR.internal_fs_sps=4096000
+;GNSS-SDR.internal_fs_sps=5120000
+
+;######### SIGNAL_SOURCE CONFIG ############
+;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
+SignalSource.implementation=Nsr_File_Signal_Source
+
+;#filename: path to file with the captured GNSS signal samples to be processed
+SignalSource.filename=/home/javier/signals/ifen/E1L1_FE0_Band0.stream ; <- PUT YOUR FILE HERE
+
+;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
+SignalSource.item_type=byte
+
+;#sampling_frequency: Original Signal sampling frequency in [Hz]
+SignalSource.sampling_frequency=20480000
+
+;#freq: RF front-end center frequency in [Hz]
+SignalSource.freq=1575420000
+
+;#samples: Number of samples to be processed. Notice that 0 indicates the entire file.
+SignalSource.samples=0
+
+;#repeat: Repeat the processing file. Disable this option in this version
+SignalSource.repeat=false
+
+;#dump: Dump the Signal source data to a file. Disable this option in this version
+SignalSource.dump=false
+
+SignalSource.dump_filename=../data/signal_source.dat
+
+
+;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
+; it helps to not overload the CPU, but the processing time will be longer.
+SignalSource.enable_throttle_control=false
+
+
+;######### SIGNAL_CONDITIONER CONFIG ############
+;## It holds blocks to change data type, filter and resample input data.
+
+;#implementation: Use [Pass_Through] or [Signal_Conditioner]
+;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
+;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
+SignalConditioner.implementation=Signal_Conditioner
+
+;######### DATA_TYPE_ADAPTER CONFIG ############
+;## Changes the type of input data.
+;#implementation: [Pass_Through] disables this block
+DataTypeAdapter.implementation=Pass_Through
+DataTypeAdapter.item_type=float
+
+;######### INPUT_FILTER CONFIG ############
+;## Filter the input data. Can be combined with frequency translation for IF signals
+
+;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter]
+;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation
+;# that shifts IF down to zero Hz.
+
+InputFilter.implementation=Freq_Xlating_Fir_Filter
+
+;#dump: Dump the filtered data to a file.
+InputFilter.dump=false
+
+;#dump_filename: Log path and filename.
+InputFilter.dump_filename=../data/input_filter.dat
+
+;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation.
+;#These options are based on parameters of gnuradio's function: gr_remez.
+;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse
+;#reponse given a set of band edges, the desired reponse on those bands,
+;#and the weight given to the error in those bands.
+
+;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
+InputFilter.input_item_type=float
+
+;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
+InputFilter.output_item_type=gr_complex
+
+;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version.
+InputFilter.taps_item_type=float
+
+;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time
+InputFilter.number_of_taps=5
+
+;#number_of _bands: Number of frequency bands in the filter.
+InputFilter.number_of_bands=2
+
+;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...].
+;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
+;#The number of band_begin and band_end elements must match the number of bands
+
+InputFilter.band1_begin=0.0
+InputFilter.band1_end=0.45
+InputFilter.band2_begin=0.55
+InputFilter.band2_end=1.0
+
+;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...].
+;#The number of ampl_begin and ampl_end elements must match the number of bands
+
+InputFilter.ampl1_begin=1.0
+InputFilter.ampl1_end=1.0
+InputFilter.ampl2_begin=0.0
+InputFilter.ampl2_end=0.0
+
+;#band_error: weighting applied to each band (usually 1).
+;#The number of band_error elements must match the number of bands
+InputFilter.band1_error=1.0
+InputFilter.band2_error=1.0
+
+;#filter_type: one of "bandpass", "hilbert" or "differentiator"
+InputFilter.filter_type=bandpass
+
+;#grid_density: determines how accurately the filter will be constructed.
+;The minimum value is 16; higher values are slower to compute the filter.
+InputFilter.grid_density=16
+
+;# Original sampling frequency stored in the signal file
+InputFilter.sampling_frequency=20480000
+
+;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
+;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz
+
+InputFilter.IF=5499998.47412109
+
+;# Decimation factor after the frequency tranaslating block
+InputFilter.decimation_factor=8
+
+
+;######### RESAMPLER CONFIG ############
+;## Resamples the input data.
+
+;#implementation: Use [Pass_Through] or [Direct_Resampler]
+;#[Pass_Through] disables this block
+;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation
+Resampler.implementation=Pass_Through
+
+;######### CHANNELS GLOBAL CONFIG ############
+;#count: Number of available GPS satellite channels.
+Channels_1C.count=8
+Channels.in_acquisition=1
+#Channel.signal=1C
+
+
+;######### ACQUISITION GLOBAL CONFIG ############
+Acquisition_1C.dump=false
+Acquisition_1C.dump_filename=./acq_dump.dat
+Acquisition_1C.item_type=gr_complex
+Acquisition_1C.if=0
+Acquisition_1C.sampled_ms=1
+Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
+;#use_CFAR_algorithm: If enabled, acquisition estimates the input signal power to implement CFAR detection algorithms
+;#notice that this affects the Acquisition threshold range!
+Acquisition_1C.use_CFAR_algorithm=false;
+;#threshold: Acquisition threshold
+Acquisition_1C.threshold=10
+;Acquisition_1C.pfa=0.01
+Acquisition_1C.doppler_max=5000
+Acquisition_1C.doppler_step=100
+
+
+;######### TRACKING GPS CONFIG ############
+Tracking_1C.implementation=GPS_L1_CA_KF_Tracking
+Tracking_1C.item_type=gr_complex
+Tracking_1C.if=0
+Tracking_1C.dump=true
+Tracking_1C.dump_filename=../data/epl_tracking_ch_
+Tracking_1C.pll_bw_hz=15.0;
+Tracking_1C.dll_bw_hz=2.0;
+Tracking_1C.order=3;
+
+
+;######### TELEMETRY DECODER GPS CONFIG ############
+TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
+TelemetryDecoder_1C.dump=false
+TelemetryDecoder_1C.decimation_factor=1;
+
+;######### OBSERVABLES CONFIG ############
+;#implementation:
+Observables.implementation=Hybrid_Observables
+
+;#dump: Enable or disable the Observables internal binary data file logging [true] or [false]
+Observables.dump=false
+
+;#dump_filename: Log path and filename.
+Observables.dump_filename=./observables.dat
+
+;######### PVT CONFIG ############
+PVT.implementation=RTKLIB_PVT
+PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
+PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
+PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
+PVT.output_rate_ms=100
+PVT.display_rate_ms=500
+PVT.dump_filename=./PVT
+PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
+PVT.flag_nmea_tty_port=false;
+PVT.nmea_dump_devname=/dev/pts/4
+PVT.flag_rtcm_server=false
+PVT.flag_rtcm_tty_port=false
+PVT.rtcm_dump_devname=/dev/pts/1
+PVT.dump=true
diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt
index 73c996521..0eb2becca 100644
--- a/src/algorithms/PVT/adapters/CMakeLists.txt
+++ b/src/algorithms/PVT/adapters/CMakeLists.txt
@@ -16,6 +16,11 @@
# along with GNSS-SDR. If not, see .
#
+
+if(Boost_VERSION LESS 105800)
+ add_definitions(-DOLD_BOOST=1)
+endif(Boost_VERSION LESS 105800)
+
set(PVT_ADAPTER_SOURCES
rtklib_pvt.cc
)
diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc
index 24f4c9150..dc8cf894a 100644
--- a/src/algorithms/PVT/adapters/rtklib_pvt.cc
+++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc
@@ -34,9 +34,15 @@
#include "gnss_sdr_flags.h"
#include
#include
-#include
#include
#include
+#if OLD_BOOST
+#include
+namespace bc = boost::math;
+#else
+#include
+namespace bc = boost::integer;
+#endif
using google::LogMessage;
@@ -94,8 +100,8 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
{
rinex_version = 2;
}
- int rinexobs_rate_ms = boost::math::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), output_rate_ms);
- int rinexnav_rate_ms = boost::math::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), output_rate_ms);
+ int rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), output_rate_ms);
+ int rinexnav_rate_ms = bc::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), output_rate_ms);
// RTCM Printer settings
bool flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
@@ -104,13 +110,13 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
unsigned short rtcm_tcp_port = configuration->property(role + ".rtcm_tcp_port", 2101);
unsigned short rtcm_station_id = configuration->property(role + ".rtcm_station_id", 1234);
// RTCM message rates: least common multiple with output_rate_ms
- int rtcm_MT1019_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), output_rate_ms);
- int rtcm_MT1020_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), output_rate_ms);
- int rtcm_MT1045_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), output_rate_ms);
- int rtcm_MSM_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), output_rate_ms);
- int rtcm_MT1077_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
- int rtcm_MT1087_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
- int rtcm_MT1097_rate_ms = boost::math::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
+ int rtcm_MT1019_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), output_rate_ms);
+ int rtcm_MT1020_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), output_rate_ms);
+ int rtcm_MT1045_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), output_rate_ms);
+ int rtcm_MSM_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), output_rate_ms);
+ int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
+ int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
+ int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
std::map rtcm_msg_rate_ms;
rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
@@ -498,7 +504,7 @@ bool RtklibPvt::save_assistance_to_XML()
LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename_;
std::map eph_map = pvt_->get_GPS_L1_ephemeris_map();
- if (eph_map.size() > 0)
+ if (eph_map.empty() == false)
{
try
{
diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
index 34013b2ad..03bf64caf 100644
--- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
@@ -16,6 +16,11 @@
# along with GNSS-SDR. If not, see .
#
+
+if(Boost_VERSION LESS 105800)
+ add_definitions(-DOLD_BOOST=1)
+endif(Boost_VERSION LESS 105800)
+
set(PVT_GR_BLOCKS_SOURCES
rtklib_pvt_cc.cc
)
diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
index 1fc243cb3..6bbf91c2d 100644
--- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
+++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
@@ -29,43 +29,49 @@
*/
#include "rtklib_pvt_cc.h"
-#include
-#include
+#include "display.h"
#include
#include
-#include
+#include
#include
+#include
#include
#include
#include
-#include "display.h"
#include
#include
#include