mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next
This commit is contained in:
		
							
								
								
									
										638
									
								
								CMakeLists.txt
									
									
									
									
									
								
							
							
						
						
									
										638
									
								
								CMakeLists.txt
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							| @@ -64,7 +64,8 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time | |||||||
|        libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ |        libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ | ||||||
|        libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \ |        libboost-serialization-dev liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr \ | ||||||
|        libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \ |        libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \ | ||||||
|        libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev libgtest-dev |        libgnutls-openssl-dev libpcap-dev python-mako python-six libmatio-dev libpugixml-dev \ | ||||||
|  |        libgtest-dev | ||||||
| ~~~~~~ | ~~~~~~ | ||||||
|  |  | ||||||
| Please note that the required files from `libgtest-dev` were moved to `googletest` in Debian 9 "stretch" and Ubuntu 18.04 "bionic", and moved back again to `libgtest-dev` in Debian 10 "buster" and Ubuntu 18.10 "cosmic". | Please note that the required files from `libgtest-dev` were moved to `googletest` in Debian 9 "stretch" and Ubuntu 18.04 "bionic", and moved back again to `libgtest-dev` in Debian 10 "buster" and Ubuntu 18.10 "cosmic". | ||||||
| @@ -85,7 +86,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel | |||||||
|        boost-date-time boost-system boost-filesystem boost-thread boost-chrono \ |        boost-date-time boost-system boost-filesystem boost-thread boost-chrono \ | ||||||
|        boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \ |        boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \ | ||||||
|        blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \ |        blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \ | ||||||
|        glog-devel openssl-devel libpcap-devel python-mako python-six |        glog-devel openssl-devel libpcap-devel python-mako python-six pugixml-devel | ||||||
| ~~~~~~ | ~~~~~~ | ||||||
|  |  | ||||||
| Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). | Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). | ||||||
| @@ -102,7 +103,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \ | |||||||
|        hdf5-devel cmake git boost-devel boost-date-time boost-system \ |        hdf5-devel cmake git boost-devel boost-date-time boost-system \ | ||||||
|        boost-filesystem boost-thread boost-chrono boost-serialization \ |        boost-filesystem boost-thread boost-chrono boost-serialization \ | ||||||
|        log4cpp-devel gnuradio-devel gr-osmosdr-devel blas-devel lapack-devel \ |        log4cpp-devel gnuradio-devel gr-osmosdr-devel blas-devel lapack-devel \ | ||||||
|        armadillo-devel openssl-devel libpcap-devel python-mako python-six |        armadillo-devel openssl-devel libpcap-devel python-mako python-six pugixml-devel | ||||||
| ~~~~~~ | ~~~~~~ | ||||||
|  |  | ||||||
| Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). | Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). | ||||||
| @@ -113,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 \ | $ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \ | ||||||
|        blas lapack gflags google-glog openssl python2-mako python2-six \ |        blas lapack gflags google-glog openssl pugixml python-mako python-six \ | ||||||
|        libmatio libpcap gtest |        libmatio libpcap gtest | ||||||
| ~~~~~~ | ~~~~~~ | ||||||
|  |  | ||||||
| @@ -201,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++: | #### 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 | $ wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz | ||||||
| $ tar xvfz v2.2.1.tar.gz | $ tar xvfz v2.2.2.tar.gz | ||||||
| $ cd gflags-2.2.1 | $ cd gflags-2.2.2 | ||||||
| $ cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DBUILD_gflags_nothreads_LIB=OFF . | $ cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DBUILD_gflags_nothreads_LIB=OFF . | ||||||
| $ make | $ make | ||||||
| $ sudo make install | $ sudo make install | ||||||
| @@ -547,6 +548,7 @@ $ sudo port install google-glog +gflags | |||||||
| $ sudo port install py27-mako | $ sudo port install py27-mako | ||||||
| $ sudo port install py27-six | $ sudo port install py27-six | ||||||
| $ sudo port install matio | $ sudo port install matio | ||||||
|  | $ sudo port install pugixml | ||||||
| ~~~~~~ | ~~~~~~ | ||||||
|  |  | ||||||
| You also might need to activate a Python installation. The list of installed versions can be retrieved with: | You also might need to activate a Python installation. The list of installed versions can be retrieved with: | ||||||
| @@ -586,6 +588,7 @@ $ brew install armadillo | |||||||
| $ brew install glog gflags gnutls | $ brew install glog gflags gnutls | ||||||
| $ brew install gnuradio | $ brew install gnuradio | ||||||
| $ brew install libmatio | $ brew install libmatio | ||||||
|  | $ brew install pugixml | ||||||
| $ pip install mako | $ pip install mako | ||||||
| $ pip install six | $ pip install six | ||||||
| ~~~~~~ | ~~~~~~ | ||||||
|   | |||||||
| @@ -1,138 +0,0 @@ | |||||||
| # CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...) |  | ||||||
| # |  | ||||||
| # CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for |  | ||||||
| # parsing the arguments given to that macro or function. |  | ||||||
| # It processes the arguments and defines a set of variables which hold the |  | ||||||
| # values of the respective options. |  | ||||||
| # |  | ||||||
| # The <options> argument contains all options for the respective macro, |  | ||||||
| # i.e. keywords which can be used when calling the macro without any value |  | ||||||
| # following, like e.g. the OPTIONAL keyword of the install() command. |  | ||||||
| # |  | ||||||
| # The <one_value_keywords> argument contains all keywords for this macro |  | ||||||
| # which are followed by one value, like e.g. DESTINATION keyword of the |  | ||||||
| # install() command. |  | ||||||
| # |  | ||||||
| # The <multi_value_keywords> argument contains all keywords for this macro |  | ||||||
| # which can be followed by more than one value, like e.g. the TARGETS or |  | ||||||
| # FILES keywords of the install() command. |  | ||||||
| # |  | ||||||
| # When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the |  | ||||||
| # keywords listed in <options>, <one_value_keywords> and |  | ||||||
| # <multi_value_keywords> a variable composed of the given <prefix> |  | ||||||
| # followed by "_" and the name of the respective keyword. |  | ||||||
| # These variables will then hold the respective value from the argument list. |  | ||||||
| # For the <options> keywords this will be TRUE or FALSE. |  | ||||||
| # |  | ||||||
| # All remaining arguments are collected in a variable |  | ||||||
| # <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether |  | ||||||
| # your macro was called with unrecognized parameters. |  | ||||||
| # |  | ||||||
| # As an example here a my_install() macro, which takes similar arguments as the |  | ||||||
| # real install() command: |  | ||||||
| # |  | ||||||
| #   function(MY_INSTALL) |  | ||||||
| #     set(options OPTIONAL FAST) |  | ||||||
| #     set(oneValueArgs DESTINATION RENAME) |  | ||||||
| #     set(multiValueArgs TARGETS CONFIGURATIONS) |  | ||||||
| #     cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) |  | ||||||
| #     ... |  | ||||||
| # |  | ||||||
| # Assume my_install() has been called like this: |  | ||||||
| #   my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) |  | ||||||
| # |  | ||||||
| # After the cmake_parse_arguments() call the macro will have set the following |  | ||||||
| # variables: |  | ||||||
| #   MY_INSTALL_OPTIONAL = TRUE |  | ||||||
| #   MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() |  | ||||||
| #   MY_INSTALL_DESTINATION = "bin" |  | ||||||
| #   MY_INSTALL_RENAME = "" (was not used) |  | ||||||
| #   MY_INSTALL_TARGETS = "foo;bar" |  | ||||||
| #   MY_INSTALL_CONFIGURATIONS = "" (was not used) |  | ||||||
| #   MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" |  | ||||||
| # |  | ||||||
| # You can the continue and process these variables. |  | ||||||
| # |  | ||||||
| # Keywords terminate lists of values, e.g. if directly after a one_value_keyword |  | ||||||
| # another recognized keyword follows, this is interpreted as the beginning of |  | ||||||
| # the new option. |  | ||||||
| # E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in |  | ||||||
| # MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would |  | ||||||
| # be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. |  | ||||||
|  |  | ||||||
| #============================================================================= |  | ||||||
| # Copyright 2010 Alexander Neundorf <neundorf@kde.org> |  | ||||||
| # |  | ||||||
| # Distributed under the OSI-approved BSD License (the "License"); |  | ||||||
| # see accompanying file Copyright.txt for details. |  | ||||||
| # |  | ||||||
| # This software is distributed WITHOUT ANY WARRANTY; without even the |  | ||||||
| # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |  | ||||||
| # See the License for more information. |  | ||||||
| #============================================================================= |  | ||||||
| # (To distribute this file outside of CMake, substitute the full |  | ||||||
| #  License text for the above reference.) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) |  | ||||||
|   return() |  | ||||||
| endif() |  | ||||||
| set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) |  | ||||||
|   # first set all result variables to empty/FALSE |  | ||||||
|   foreach(arg_name ${_singleArgNames} ${_multiArgNames}) |  | ||||||
|     set(${prefix}_${arg_name}) |  | ||||||
|   endforeach(arg_name) |  | ||||||
|  |  | ||||||
|   foreach(option ${_optionNames}) |  | ||||||
|     set(${prefix}_${option} FALSE) |  | ||||||
|   endforeach(option) |  | ||||||
|  |  | ||||||
|   set(${prefix}_UNPARSED_ARGUMENTS) |  | ||||||
|  |  | ||||||
|   set(insideValues FALSE) |  | ||||||
|   set(currentArgName) |  | ||||||
|  |  | ||||||
|   # now iterate over all arguments and fill the result variables |  | ||||||
|   foreach(currentArg ${ARGN}) |  | ||||||
|     list(FIND _optionNames "${currentArg}" optionIndex)  # ... then this marks the end of the arguments belonging to this keyword |  | ||||||
|     list(FIND _singleArgNames "${currentArg}" singleArgIndex)  # ... then this marks the end of the arguments belonging to this keyword |  | ||||||
|     list(FIND _multiArgNames "${currentArg}" multiArgIndex)  # ... then this marks the end of the arguments belonging to this keyword |  | ||||||
|  |  | ||||||
|     if(${optionIndex} EQUAL -1  AND  ${singleArgIndex} EQUAL -1  AND  ${multiArgIndex} EQUAL -1) |  | ||||||
|       if(insideValues) |  | ||||||
|         if("${insideValues}" STREQUAL "SINGLE") |  | ||||||
|           set(${prefix}_${currentArgName} ${currentArg}) |  | ||||||
|           set(insideValues FALSE) |  | ||||||
|         elseif("${insideValues}" STREQUAL "MULTI") |  | ||||||
|           list(APPEND ${prefix}_${currentArgName} ${currentArg}) |  | ||||||
|         endif() |  | ||||||
|       else(insideValues) |  | ||||||
|         list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) |  | ||||||
|       endif(insideValues) |  | ||||||
|     else() |  | ||||||
|       if(NOT ${optionIndex} EQUAL -1) |  | ||||||
|         set(${prefix}_${currentArg} TRUE) |  | ||||||
|         set(insideValues FALSE) |  | ||||||
|       elseif(NOT ${singleArgIndex} EQUAL -1) |  | ||||||
|         set(currentArgName ${currentArg}) |  | ||||||
|         set(${prefix}_${currentArgName}) |  | ||||||
|         set(insideValues "SINGLE") |  | ||||||
|       elseif(NOT ${multiArgIndex} EQUAL -1) |  | ||||||
|         set(currentArgName ${currentArg}) |  | ||||||
|         set(${prefix}_${currentArgName}) |  | ||||||
|         set(insideValues "MULTI") |  | ||||||
|       endif() |  | ||||||
|     endif() |  | ||||||
|  |  | ||||||
|   endforeach(currentArg) |  | ||||||
|  |  | ||||||
|   # propagate the result variables to the caller: |  | ||||||
|   foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) |  | ||||||
|     set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE) |  | ||||||
|   endforeach(arg_name) |  | ||||||
|   set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) |  | ||||||
|  |  | ||||||
| endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) |  | ||||||
							
								
								
									
										102
									
								
								cmake/Modules/FindGFLAGS.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								cmake/Modules/FindGFLAGS.cmake
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,102 @@ | |||||||
|  | # 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 <https://www.gnu.org/licenses/>. | ||||||
|  |  | ||||||
|  | # - Try to find GFlags | ||||||
|  | # | ||||||
|  | # The following variables are optionally searched for defaults | ||||||
|  | # GFlags_ROOT_DIR: Base directory where all GFlags components are found | ||||||
|  | # | ||||||
|  | # The following are set after configuration is done: | ||||||
|  | # GFlags_FOUND | ||||||
|  | # GFlags_INCLUDE_DIRS | ||||||
|  | # GFlags_LIBS | ||||||
|  | # GFlags_LIBRARY_DIRS | ||||||
|  |  | ||||||
|  | if(APPLE) | ||||||
|  |     find_path(GFlags_ROOT_DIR | ||||||
|  |       libgflags.dylib | ||||||
|  |       PATHS | ||||||
|  |       /opt/local/lib | ||||||
|  |       /usr/local/lib | ||||||
|  |     ) | ||||||
|  | else() | ||||||
|  |     find_path(GFlags_ROOT_DIR | ||||||
|  |       libgflags.so | ||||||
|  |       HINTS | ||||||
|  |       /usr/local/lib | ||||||
|  |       /usr/lib/x86_64-linux-gnu | ||||||
|  |       /usr/lib/i386-linux-gnu | ||||||
|  |       /usr/lib/arm-linux-gnueabihf | ||||||
|  |       /usr/lib/arm-linux-gnueabi | ||||||
|  |       /usr/lib/aarch64-linux-gnu | ||||||
|  |       /usr/lib/mipsel-linux-gnu | ||||||
|  |       /usr/lib/mips-linux-gnu | ||||||
|  |       /usr/lib/mips64el-linux-gnuabi64 | ||||||
|  |       /usr/lib/powerpc-linux-gnu | ||||||
|  |       /usr/lib/powerpc64-linux-gnu | ||||||
|  |       /usr/lib/powerpc64le-linux-gnu | ||||||
|  |       /usr/lib/powerpc-linux-gnuspe | ||||||
|  |       /usr/lib/hppa-linux-gnu | ||||||
|  |       /usr/lib/s390x-linux-gnu | ||||||
|  |       /usr/lib/i386-gnu | ||||||
|  |       /usr/lib/hppa-linux-gnu | ||||||
|  |       /usr/lib/x86_64-kfreebsd-gnu | ||||||
|  |       /usr/lib/i386-kfreebsd-gnu | ||||||
|  |       /usr/lib/m68k-linux-gnu | ||||||
|  |       /usr/lib/sh4-linux-gnu | ||||||
|  |       /usr/lib/sparc64-linux-gnu | ||||||
|  |       /usr/lib/x86_64-linux-gnux32 | ||||||
|  |       /usr/lib/alpha-linux-gnu | ||||||
|  |       /usr/lib64 | ||||||
|  |       /usr/lib | ||||||
|  |     ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  | if(GFlags_ROOT_DIR) | ||||||
|  |     # We are testing only a couple of files in the include directories | ||||||
|  |     find_path(GFlags_INCLUDE_DIRS | ||||||
|  |       gflags/gflags.h | ||||||
|  |       HINTS | ||||||
|  |       /opt/local/include | ||||||
|  |       /usr/local/include | ||||||
|  |       /usr/include | ||||||
|  |       ${GFlags_ROOT_DIR}/src | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |     # Find the libraries | ||||||
|  |     set(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) | ||||||
|  |  | ||||||
|  |     find_library(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) | ||||||
|  |     if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) | ||||||
|  |       set(GFLAGS_GREATER_20 TRUE) | ||||||
|  |     else() | ||||||
|  |       set(GFLAGS_GREATER_20 FALSE) | ||||||
|  |     endif() | ||||||
|  |     # set up include and link directory | ||||||
|  |     include_directories(${GFlags_INCLUDE_DIRS}) | ||||||
|  |     link_directories(${GFlags_LIBRARY_DIRS}) | ||||||
|  |     message(STATUS "gflags library found at ${GFlags_lib}") | ||||||
|  |     set(GFlags_LIBS ${GFlags_lib}) | ||||||
|  |     set(GFlags_FOUND true) | ||||||
|  |     mark_as_advanced(GFlags_INCLUDE_DIRS) | ||||||
|  | else() | ||||||
|  |     message(STATUS "Cannot find gflags") | ||||||
|  |     set(GFlags_FOUND false) | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  | include(FindPackageHandleStandardArgs) | ||||||
|  | find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) | ||||||
| @@ -144,5 +144,5 @@ | |||||||
|         /usr/lib/gcc/alpha-linux-gnu/8 |         /usr/lib/gcc/alpha-linux-gnu/8 | ||||||
| ) | ) | ||||||
|  |  | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN) | find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN) | ||||||
|   | |||||||
| @@ -1,102 +0,0 @@ | |||||||
| # 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 <https://www.gnu.org/licenses/>. |  | ||||||
|  |  | ||||||
| # - Try to find GFlags |  | ||||||
| # |  | ||||||
| # The following variables are optionally searched for defaults |  | ||||||
| # GFlags_ROOT_DIR: Base directory where all GFlags components are found |  | ||||||
| # |  | ||||||
| # The following are set after configuration is done: |  | ||||||
| # GFlags_FOUND |  | ||||||
| # GFlags_INCLUDE_DIRS |  | ||||||
| # GFlags_LIBS |  | ||||||
| # GFlags_LIBRARY_DIRS |  | ||||||
|  |  | ||||||
| cmake_minimum_required(VERSION 2.6) |  | ||||||
|  |  | ||||||
| if(APPLE) |  | ||||||
|      FIND_PATH(GFlags_ROOT_DIR |  | ||||||
|      libgflags.dylib |  | ||||||
|      PATHS |  | ||||||
|      /opt/local/lib |  | ||||||
|      /usr/local/lib |  | ||||||
|      ) |  | ||||||
| else(APPLE) |  | ||||||
|      FIND_PATH(GFlags_ROOT_DIR |  | ||||||
|      libgflags.so |  | ||||||
|      HINTS |  | ||||||
|      /usr/local/lib |  | ||||||
|      /usr/lib/x86_64-linux-gnu |  | ||||||
|      /usr/lib/i386-linux-gnu |  | ||||||
|      /usr/lib/arm-linux-gnueabihf |  | ||||||
|      /usr/lib/arm-linux-gnueabi |  | ||||||
|      /usr/lib/aarch64-linux-gnu |  | ||||||
|      /usr/lib/mipsel-linux-gnu |  | ||||||
|      /usr/lib/mips-linux-gnu |  | ||||||
|      /usr/lib/mips64el-linux-gnuabi64 |  | ||||||
|      /usr/lib/powerpc-linux-gnu |  | ||||||
|      /usr/lib/powerpc64-linux-gnu |  | ||||||
|      /usr/lib/powerpc64le-linux-gnu |  | ||||||
|      /usr/lib/powerpc-linux-gnuspe |  | ||||||
|      /usr/lib/hppa-linux-gnu |  | ||||||
|      /usr/lib/s390x-linux-gnu |  | ||||||
|      /usr/lib/i386-gnu |  | ||||||
|      /usr/lib/hppa-linux-gnu |  | ||||||
|      /usr/lib/x86_64-kfreebsd-gnu |  | ||||||
|      /usr/lib/i386-kfreebsd-gnu |  | ||||||
|      /usr/lib/m68k-linux-gnu |  | ||||||
|      /usr/lib/sh4-linux-gnu |  | ||||||
|      /usr/lib/sparc64-linux-gnu |  | ||||||
|      /usr/lib/x86_64-linux-gnux32 |  | ||||||
|      /usr/lib/alpha-linux-gnu |  | ||||||
|      /usr/lib64 |  | ||||||
|      /usr/lib |  | ||||||
|      ) |  | ||||||
| endif(APPLE) |  | ||||||
|  |  | ||||||
| IF(GFlags_ROOT_DIR) |  | ||||||
|      # We are testing only a couple of files in the include directories |  | ||||||
|           FIND_PATH(GFlags_INCLUDE_DIRS |  | ||||||
|           gflags/gflags.h |  | ||||||
|           HINTS |  | ||||||
|           /opt/local/include |  | ||||||
|           /usr/local/include |  | ||||||
|           /usr/include |  | ||||||
|           ${GFlags_ROOT_DIR}/src |  | ||||||
|           ) |  | ||||||
|  |  | ||||||
|      # Find the libraries |  | ||||||
|      SET(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) |  | ||||||
|  |  | ||||||
|      FIND_LIBRARY(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) |  | ||||||
|      if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) |  | ||||||
|          set(GFLAGS_GREATER_20 TRUE) |  | ||||||
|      else(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) |  | ||||||
|          set(GFLAGS_GREATER_20 FALSE) |  | ||||||
|      endif(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) |  | ||||||
|      # set up include and link directory |  | ||||||
|      include_directories(${GFlags_INCLUDE_DIRS}) |  | ||||||
|      link_directories(${GFlags_LIBRARY_DIRS}) |  | ||||||
|      message(STATUS "gflags library found at ${GFlags_lib}") |  | ||||||
|      SET(GFlags_LIBS ${GFlags_lib}) |  | ||||||
|      SET(GFlags_FOUND true) |  | ||||||
|      MARK_AS_ADVANCED(GFlags_INCLUDE_DIRS) |  | ||||||
| ELSE(GFlags_ROOT_DIR) |  | ||||||
|      MESSAGE(STATUS "Cannot find gflags") |  | ||||||
|      SET(GFlags_FOUND false) |  | ||||||
| ENDIF(GFlags_ROOT_DIR) |  | ||||||
|  |  | ||||||
| @@ -30,13 +30,13 @@ | |||||||
|  |  | ||||||
| if(NOT DEFINED GLOG_ROOT) | if(NOT DEFINED GLOG_ROOT) | ||||||
|     set(GLOG_ROOT /usr /usr/local) |     set(GLOG_ROOT /usr /usr/local) | ||||||
| endif (NOT DEFINED GLOG_ROOT) | endif() | ||||||
|  |  | ||||||
| if(MSVC) | if(MSVC) | ||||||
|     set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) |     set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) | ||||||
| else(MSVC) | else() | ||||||
|     set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) |     set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| macro(_FIND_GLOG_LIBRARIES _var) | macro(_FIND_GLOG_LIBRARIES _var) | ||||||
|     find_library(${_var} |     find_library(${_var} | ||||||
| @@ -88,7 +88,7 @@ if(MSVC) | |||||||
|             ${GLOG_ROOT}/src/windows |             ${GLOG_ROOT}/src/windows | ||||||
|             ${GLOG_ROOT}/src/windows/glog |             ${GLOG_ROOT}/src/windows/glog | ||||||
|     ) |     ) | ||||||
| else(MSVC) | else() | ||||||
|     # Linux/OS X builds |     # Linux/OS X builds | ||||||
|     find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h |     find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h | ||||||
|         PATHS |         PATHS | ||||||
| @@ -96,20 +96,20 @@ else(MSVC) | |||||||
|             /usr/include/glog |             /usr/include/glog | ||||||
|             /opt/local/include/glog   # default location in Macports |             /opt/local/include/glog   # default location in Macports | ||||||
|     ) |     ) | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| # Find the libraries | # Find the libraries | ||||||
| if(MSVC) | if(MSVC) | ||||||
|      _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.lib) |     _find_glog_libraries(GLOG_LIBRARIES libglog.lib) | ||||||
| else(MSVC) | else() | ||||||
|     # Linux/OS X builds |     # Linux/OS X builds | ||||||
|     if(UNIX) |     if(UNIX) | ||||||
|           _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.so) |         _find_glog_libraries(GLOG_LIBRARIES libglog.so) | ||||||
|      endif(UNIX) |     endif() | ||||||
|     if(APPLE) |     if(APPLE) | ||||||
|           _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.dylib) |         _find_glog_libraries(GLOG_LIBRARIES libglog.dylib) | ||||||
|      endif(APPLE) |     endif() | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| if(GLOG_FOUND) | if(GLOG_FOUND) | ||||||
|     message(STATUS "glog library found at ${GLOG_LIBRARIES}") |     message(STATUS "glog library found at ${GLOG_LIBRARIES}") | ||||||
| @@ -117,20 +117,19 @@ endif() | |||||||
|  |  | ||||||
| # handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if | # handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if | ||||||
| # all listed variables are TRUE | # all listed variables are TRUE | ||||||
| include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake") | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glog DEFAULT_MSG | find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES) | ||||||
|      GLOG_LIBRARIES) |  | ||||||
|  |  | ||||||
| if(MSVC) | if(MSVC) | ||||||
|     string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) |     string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) | ||||||
|     string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) |     string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) | ||||||
|     set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") |     set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") | ||||||
|     string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) |     string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) | ||||||
| else(MSVC) | else() | ||||||
|     # Linux/OS X builds |     # Linux/OS X builds | ||||||
|     set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) |     set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) | ||||||
|     string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) |     string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| if(GLOG_FOUND) | if(GLOG_FOUND) | ||||||
|     # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) |     # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) | ||||||
|   | |||||||
| @@ -15,7 +15,6 @@ | |||||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| find_program(SW_GENERATOR_BIN gnss_sim | find_program(SW_GENERATOR_BIN gnss_sim | ||||||
|     PATHS /usr/bin |     PATHS /usr/bin | ||||||
|         /usr/local/bin |         /usr/local/bin | ||||||
| @@ -23,6 +22,6 @@ find_program(SW_GENERATOR_BIN gnss_sim | |||||||
|         ${CMAKE_INSTALL_PREFIX}/bin |         ${CMAKE_INSTALL_PREFIX}/bin | ||||||
|     PATH_SUFFIXES bin) |     PATH_SUFFIXES bin) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNSS-SIMULATOR  DEFAULT_MSG  SW_GENERATOR_BIN) | find_package_handle_standard_args(GNSSSIMULATOR  DEFAULT_MSG  SW_GENERATOR_BIN) | ||||||
| MARK_AS_ADVANCED(SW_GENERATOR_BIN) | mark_as_advanced(SW_GENERATOR_BIN) | ||||||
| @@ -19,15 +19,14 @@ | |||||||
| # Find GNU Radio | # Find GNU Radio | ||||||
| ######################################################################## | ######################################################################## | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| 
 | 
 | ||||||
| # if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list | # if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list | ||||||
| if(NOT GR_REQUIRED_COMPONENTS) | if(NOT GR_REQUIRED_COMPONENTS) | ||||||
|   set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD) |   set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| # Allows us to use all .cmake files in this directory | # Allows us to use all .cmake files in this directory | ||||||
| list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) | list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) | ||||||
| 
 | 
 | ||||||
| @@ -35,18 +34,17 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) | |||||||
| set(GNURADIO_ALL_LIBRARIES "") | set(GNURADIO_ALL_LIBRARIES "") | ||||||
| set(GNURADIO_ALL_INCLUDE_DIRS "") | set(GNURADIO_ALL_INCLUDE_DIRS "") | ||||||
| 
 | 
 | ||||||
| MACRO(LIST_CONTAINS var value) | macro(LIST_CONTAINS var value) | ||||||
|   SET(${var}) |   set(${var}) | ||||||
|   FOREACH(value2 ${ARGN}) |   foreach(value2 ${ARGN}) | ||||||
|     IF (${value} STREQUAL ${value2}) |     if(${value} STREQUAL ${value2}) | ||||||
|       SET(${var} TRUE) |       set(${var} TRUE) | ||||||
|     ENDIF(${value} STREQUAL ${value2}) |     endif() | ||||||
|   ENDFOREACH(value2) |   endforeach() | ||||||
| ENDMACRO(LIST_CONTAINS) | endmacro() | ||||||
| 
 | 
 | ||||||
| function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | ||||||
| 
 |     list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) | ||||||
|     LIST_CONTAINS(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) |  | ||||||
|     if(NOT REQUIRED_MODULE) |     if(NOT REQUIRED_MODULE) | ||||||
|         #message("Ignoring GNU Radio Module ${EXTVAR}") |         #message("Ignoring GNU Radio Module ${EXTVAR}") | ||||||
|         return() |         return() | ||||||
| @@ -55,7 +53,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | |||||||
|     message(STATUS "Checking for GNU Radio Module: ${EXTVAR}") |     message(STATUS "Checking for GNU Radio Module: ${EXTVAR}") | ||||||
| 
 | 
 | ||||||
|     # check for .pc hints |     # check for .pc hints | ||||||
|     PKG_CHECK_MODULES(PC_GNURADIO_${EXTVAR} ${PCNAME}) |     pkg_check_modules(PC_GNURADIO_${EXTVAR} ${PCNAME}) | ||||||
| 
 | 
 | ||||||
|     if(NOT PC_GNURADIO_${EXTVAR}_FOUND) |     if(NOT PC_GNURADIO_${EXTVAR}_FOUND) | ||||||
|         set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE}) |         set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE}) | ||||||
| @@ -67,7 +65,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | |||||||
|     set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) |     set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) | ||||||
| 
 | 
 | ||||||
|     # look for include files |     # look for include files | ||||||
|     FIND_PATH( |     find_path( | ||||||
|         ${INCVAR_NAME} |         ${INCVAR_NAME} | ||||||
|         NAMES ${INCFILE} |         NAMES ${INCFILE} | ||||||
|         HINTS $ENV{GNURADIO_RUNTIME_DIR}/include |         HINTS $ENV{GNURADIO_RUNTIME_DIR}/include | ||||||
| @@ -81,7 +79,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | |||||||
| 
 | 
 | ||||||
|     # look for libs |     # look for libs | ||||||
|     foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) |     foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) | ||||||
|         FIND_LIBRARY( |         find_library( | ||||||
|             ${LIBVAR_NAME}_${libname} |             ${LIBVAR_NAME}_${libname} | ||||||
|             NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} |             NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} | ||||||
|             HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib |             HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib | ||||||
| @@ -119,7 +117,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | |||||||
|                   ${GNURADIO_INSTALL_PREFIX}/lib |                   ${GNURADIO_INSTALL_PREFIX}/lib | ||||||
|         ) |         ) | ||||||
|         list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) |         list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) | ||||||
|     endforeach(libname) |     endforeach() | ||||||
| 
 | 
 | ||||||
|     set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE) |     set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE) | ||||||
| 
 | 
 | ||||||
| @@ -131,7 +129,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | |||||||
|     set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE) |     set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE) | ||||||
|     set(GNURADIO_ALL_LIBRARIES    ${GNURADIO_ALL_LIBRARIES}    ${GNURADIO_${EXTVAR}_LIBRARIES}    PARENT_SCOPE) |     set(GNURADIO_ALL_LIBRARIES    ${GNURADIO_ALL_LIBRARIES}    ${GNURADIO_${EXTVAR}_LIBRARIES}    PARENT_SCOPE) | ||||||
| 
 | 
 | ||||||
|     FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) |     find_package_handle_standard_args(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) | ||||||
|     message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}") |     message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}") | ||||||
|     set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE) |     set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE) | ||||||
| 
 | 
 | ||||||
| @@ -140,29 +138,28 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) | |||||||
|         message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") |         message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") | ||||||
|     endif() |     endif() | ||||||
| 
 | 
 | ||||||
|     MARK_AS_ADVANCED(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) |     mark_as_advanced(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) | ||||||
| 
 |  | ||||||
| endfunction() | endfunction() | ||||||
| 
 | 
 | ||||||
| GR_MODULE(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) | gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) | ||||||
| GR_MODULE(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) | gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) | ||||||
| GR_MODULE(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) | gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) | ||||||
| GR_MODULE(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) | gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) | ||||||
| GR_MODULE(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) | gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) | ||||||
| GR_MODULE(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) | gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) | ||||||
| GR_MODULE(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) | gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) | ||||||
| GR_MODULE(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) | gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) | ||||||
| GR_MODULE(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) | gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) | ||||||
| GR_MODULE(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) | gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) | ||||||
| GR_MODULE(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) | gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) | ||||||
| GR_MODULE(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) | gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) | ||||||
| GR_MODULE(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) | gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) | ||||||
| GR_MODULE(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) | gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) | ||||||
| GR_MODULE(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) | gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) | ||||||
| GR_MODULE(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) | gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) | ||||||
| GR_MODULE(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) | gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) | ||||||
| GR_MODULE(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) | gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) | ||||||
| GR_MODULE(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) | gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) | ||||||
| 
 | 
 | ||||||
| list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS) | list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS) | ||||||
| list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) | list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) | ||||||
| @@ -180,7 +177,7 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) | |||||||
|               ) |               ) | ||||||
|     if(GNURADIO_VERSION_GREATER_THAN_373) |     if(GNURADIO_VERSION_GREATER_THAN_373) | ||||||
|         set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") |         set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") | ||||||
|      endif(GNURADIO_VERSION_GREATER_THAN_373) |     endif() | ||||||
| 
 | 
 | ||||||
|     find_file(GNURADIO_VERSION_GREATER_THAN_38 |     find_file(GNURADIO_VERSION_GREATER_THAN_38 | ||||||
|               NAMES gnuradio/filter/mmse_resampler_cc.h |               NAMES gnuradio/filter/mmse_resampler_cc.h | ||||||
| @@ -193,5 +190,5 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION) | |||||||
|               ) |               ) | ||||||
|     if(GNURADIO_VERSION_GREATER_THAN_38) |     if(GNURADIO_VERSION_GREATER_THAN_38) | ||||||
|         set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") |         set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") | ||||||
|      endif(GNURADIO_VERSION_GREATER_THAN_38) |     endif() | ||||||
| endif(NOT PC_GNURADIO_RUNTIME_VERSION) | endif() | ||||||
| @@ -19,7 +19,7 @@ | |||||||
| # | # | ||||||
| # Usage of this module as follows: | # Usage of this module as follows: | ||||||
| # | # | ||||||
| # find_package(Gperftools) | # find_package(GPERFTOOLS) | ||||||
| # | # | ||||||
| # Variables used by this module, they can change the default behaviour and need | # Variables used by this module, they can change the default behaviour and need | ||||||
| # to be set before calling find_package: | # to be set before calling find_package: | ||||||
| @@ -54,7 +54,7 @@ set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) | |||||||
| 
 | 
 | ||||||
| include(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| find_package_handle_standard_args( | find_package_handle_standard_args( | ||||||
|   Gperftools |   GPERFTOOLS | ||||||
|   DEFAULT_MSG |   DEFAULT_MSG | ||||||
|   GPERFTOOLS_LIBRARIES |   GPERFTOOLS_LIBRARIES | ||||||
|   GPERFTOOLS_INCLUDE_DIR |   GPERFTOOLS_INCLUDE_DIR | ||||||
| @@ -19,29 +19,22 @@ | |||||||
| # Find the native gpstk includes and library | # Find the native gpstk includes and library | ||||||
| # This module defines | # This module defines | ||||||
| #  GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc. | #  GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc. | ||||||
| #  GPSTK_LIBRARIES, libraries to link against to use GPSTK. |  | ||||||
| #  GPSTK_FOUND, If false, do not try to use GPSTK. | #  GPSTK_FOUND, If false, do not try to use GPSTK. | ||||||
| # also defined, but not for general use are |  | ||||||
| #  GPSTK_LIBRARY, where to find the GPSTK library. | #  GPSTK_LIBRARY, where to find the GPSTK library. | ||||||
|  |  | ||||||
| FIND_PATH(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp | find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp | ||||||
|     HINTS /usr/include |     HINTS /usr/include | ||||||
|         /usr/local/include |         /usr/local/include | ||||||
|         /opt/local/include) |         /opt/local/include) | ||||||
|  |  | ||||||
| SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) | set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) | ||||||
| FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} | find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} | ||||||
|     HINTS /usr/lib |     HINTS /usr/lib | ||||||
|         /usr/local/lib |         /usr/local/lib | ||||||
|         /opt/local/lib) |         /opt/local/lib) | ||||||
|  |  | ||||||
| # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if | # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if | ||||||
| # all listed variables are TRUE | # all listed variables are TRUE | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK  DEFAULT_MSG  GPSTK_LIBRARY  GPSTK_INCLUDE_DIR) | find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) | ||||||
|  | mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR) | ||||||
| IF(GPSTK_FOUND) |  | ||||||
|   SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} ) |  | ||||||
| ENDIF(GPSTK_FOUND) |  | ||||||
|  |  | ||||||
| MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY) |  | ||||||
|   | |||||||
| @@ -19,10 +19,10 @@ | |||||||
| # Find  GR-DBFCTTC Module | # Find  GR-DBFCTTC Module | ||||||
| ######################################################################## | ######################################################################## | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_GR_DBFCTTC gr-dbfcttc) | pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     GR_DBFCTTC_INCLUDE_DIRS |     GR_DBFCTTC_INCLUDE_DIRS | ||||||
|     NAMES dbfcttc/api.h |     NAMES dbfcttc/api.h | ||||||
|     HINTS $ENV{GR_DBFCTTC_DIR}/include |     HINTS $ENV{GR_DBFCTTC_DIR}/include | ||||||
| @@ -32,7 +32,7 @@ FIND_PATH( | |||||||
|           /usr/local/include |           /usr/local/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     GR_DBFCTTC_LIBRARIES |     GR_DBFCTTC_LIBRARIES | ||||||
|     NAMES gnuradio-dbfcttc |     NAMES gnuradio-dbfcttc | ||||||
|     HINTS $ENV{GR_DBFCTTC_DIR}/lib |     HINTS $ENV{GR_DBFCTTC_DIR}/lib | ||||||
| @@ -45,6 +45,6 @@ FIND_LIBRARY( | |||||||
|           /usr/local/lib64 |           /usr/local/lib64 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_DBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) | find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) | mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) | ||||||
| @@ -19,10 +19,10 @@ | |||||||
| # Find  GR-GN3S Module | # Find  GR-GN3S Module | ||||||
| ######################################################################## | ######################################################################## | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_GR_GN3S gr-gn3s) | pkg_check_modules(PC_GR_GN3S gr-gn3s) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     GR_GN3S_INCLUDE_DIRS |     GR_GN3S_INCLUDE_DIRS | ||||||
|     NAMES gn3s/gn3s_api.h |     NAMES gn3s/gn3s_api.h | ||||||
|     HINTS $ENV{GR_GN3S_DIR}/include |     HINTS $ENV{GR_GN3S_DIR}/include | ||||||
| @@ -32,7 +32,7 @@ FIND_PATH( | |||||||
|           /usr/include |           /usr/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     GR_GN3S_LIBRARIES |     GR_GN3S_LIBRARIES | ||||||
|     NAMES gr-gn3s |     NAMES gr-gn3s | ||||||
|     HINTS $ENV{GR_GN3S_DIR}/lib |     HINTS $ENV{GR_GN3S_DIR}/lib | ||||||
| @@ -45,6 +45,6 @@ FIND_LIBRARY( | |||||||
|           /usr/lib64 |           /usr/lib64 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_GN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) | find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) | mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) | ||||||
| @@ -15,10 +15,10 @@ | |||||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_IIO gnuradio-iio) | pkg_check_modules(PC_IIO gnuradio-iio) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     IIO_INCLUDE_DIRS |     IIO_INCLUDE_DIRS | ||||||
|     NAMES gnuradio/iio/api.h |     NAMES gnuradio/iio/api.h | ||||||
|     HINTS $ENV{IIO_DIR}/include |     HINTS $ENV{IIO_DIR}/include | ||||||
| @@ -28,7 +28,7 @@ FIND_PATH( | |||||||
|           /usr/include |           /usr/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     IIO_LIBRARIES |     IIO_LIBRARIES | ||||||
|     NAMES gnuradio-iio |     NAMES gnuradio-iio | ||||||
|     HINTS $ENV{IIO_DIR}/lib |     HINTS $ENV{IIO_DIR}/lib | ||||||
| @@ -63,6 +63,6 @@ FIND_LIBRARY( | |||||||
|           /usr/lib/sh4-linux-gnu |           /usr/lib/sh4-linux-gnu | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(IIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) | find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(IIO_LIBRARIES IIO_INCLUDE_DIRS) | mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS) | ||||||
| @@ -19,7 +19,7 @@ | |||||||
| # | # | ||||||
| # Usage of this module as follows: | # Usage of this module as follows: | ||||||
| # | # | ||||||
| # find_package(GrOsmoSDR) | # find_package(GROSMOSDR) | ||||||
| # | # | ||||||
| # Variables used by this module, they can change the default behaviour and need | # Variables used by this module, they can change the default behaviour and need | ||||||
| # to be set before calling find_package: | # to be set before calling find_package: | ||||||
| @@ -34,7 +34,6 @@ | |||||||
| # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) | # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) | ||||||
| # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers | # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers | ||||||
| 
 | 
 | ||||||
| if(NOT GROSMOSDR_FOUND) |  | ||||||
| pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) | pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) | ||||||
| find_path(GROSMOSDR_INCLUDE_DIR | find_path(GROSMOSDR_INCLUDE_DIR | ||||||
|   NAMES osmosdr/source.h |   NAMES osmosdr/source.h | ||||||
| @@ -77,14 +76,6 @@ if(NOT GROSMOSDR_FOUND) | |||||||
|     /usr/lib64 |     /usr/lib64 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|   if(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) | include(FindPackageHandleStandardArgs) | ||||||
|     set(GROSMOSDR_FOUND TRUE CACHE INTERNAL "gnuradio-osmosdr found") | find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) | ||||||
|     message(STATUS "Found gnuradio-osmosdr: ${GROSMOSDR_INCLUDE_DIR}, ${GROSMOSDR_LIBRARIES}") | mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) | ||||||
|   else(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) |  | ||||||
|     set(GROSMOSDR_FOUND FALSE CACHE INTERNAL "gnuradio-osmosdr found") |  | ||||||
|     message(STATUS "gnuradio-osmosdr not found.") |  | ||||||
|   endif(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) |  | ||||||
| 
 |  | ||||||
| mark_as_advanced(GROSMOSDR_INCLUDE_DIR GROSMOSDR_LIBRARIES) |  | ||||||
| 
 |  | ||||||
| endif(NOT GROSMOSDR_FOUND) |  | ||||||
| @@ -15,10 +15,10 @@ | |||||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_LIBIIO libiio) | pkg_check_modules(PC_LIBIIO libiio) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     LIBIIO_INCLUDE_DIRS |     LIBIIO_INCLUDE_DIRS | ||||||
|     NAMES iio.h |     NAMES iio.h | ||||||
|     HINTS $ENV{LIBIIO_DIR}/include |     HINTS $ENV{LIBIIO_DIR}/include | ||||||
| @@ -29,7 +29,7 @@ FIND_PATH( | |||||||
|           /opt/local/include |           /opt/local/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     LIBIIO_LIBRARIES |     LIBIIO_LIBRARIES | ||||||
|     NAMES iio libiio.so.0 |     NAMES iio libiio.so.0 | ||||||
|     HINTS $ENV{LIBIIO_DIR}/lib |     HINTS $ENV{LIBIIO_DIR}/lib | ||||||
| @@ -65,6 +65,6 @@ FIND_LIBRARY( | |||||||
|           /Library/Frameworks/iio.framework/ |           /Library/Frameworks/iio.framework/ | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) | find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) | mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) | ||||||
| @@ -19,7 +19,7 @@ | |||||||
| # | # | ||||||
| # Usage of this module as follows: | # Usage of this module as follows: | ||||||
| # | # | ||||||
| # find_package(LibOsmoSDR) | # find_package(LIBOSMOSDR) | ||||||
| # | # | ||||||
| # | # | ||||||
| # Variables defined by this module: | # Variables defined by this module: | ||||||
| @@ -28,8 +28,6 @@ | |||||||
| # LIBOSMOSDR_LIBRARIES The libosmosdr libraries | # LIBOSMOSDR_LIBRARIES The libosmosdr libraries | ||||||
| # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers | # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| if(NOT LIBOSMOSDR_FOUND) |  | ||||||
| pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) | pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) | ||||||
| find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h | find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h | ||||||
|   PATHS |   PATHS | ||||||
| @@ -69,14 +67,6 @@ if(NOT LIBOSMOSDR_FOUND) | |||||||
|     /usr/lib64 |     /usr/lib64 | ||||||
|   ) |   ) | ||||||
| 
 | 
 | ||||||
|   if(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) | include(FindPackageHandleStandardArgs) | ||||||
|     set(LIBOSMOSDR_FOUND TRUE CACHE INTERNAL "libosmosdr found") | find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) | ||||||
|     message(STATUS "Found libosmosdr: ${LIBOSMOSDR_INCLUDE_DIR}, ${LIBOSMOSDR_LIBRARIES}") |  | ||||||
|   else(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) |  | ||||||
|     set(LIBOSMOSDR_FOUND FALSE CACHE INTERNAL "libosmosdr found") |  | ||||||
|     message(STATUS "libosmosdr not found.") |  | ||||||
|   endif(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) |  | ||||||
| 
 |  | ||||||
| mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) | mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) | ||||||
| 
 |  | ||||||
| endif(NOT LIBOSMOSDR_FOUND) |  | ||||||
| @@ -70,7 +70,6 @@ find_library(LOG4CPP_LIBRARY | |||||||
|         /opt/local/lib |         /opt/local/lib | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) | if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) | ||||||
|   set(LOG4CPP_FOUND TRUE) |   set(LOG4CPP_FOUND TRUE) | ||||||
|   set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) |   set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) | ||||||
| @@ -83,13 +82,5 @@ else () | |||||||
|   set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) |   set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| if (LOG4CPP_FOUND) | include(FindPackageHandleStandardArgs) | ||||||
|   if (NOT LOG4CPP_FIND_QUIETLY) | find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) | ||||||
|     message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}") |  | ||||||
|   endif () |  | ||||||
| else () |  | ||||||
|   if (LOG4CPP_FIND_REQUIRED) |  | ||||||
|     message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.") |  | ||||||
|     message(FATAL_ERROR "Could NOT find LOG4CPP library") |  | ||||||
|   endif () |  | ||||||
| endif () |  | ||||||
| @@ -99,19 +99,17 @@ if(MATIO_INCLUDE_DIR) | |||||||
|     set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") |     set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| #================== |  | ||||||
|  |  | ||||||
| mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) | mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) | ||||||
|  |  | ||||||
| # handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if | # handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if | ||||||
| # all listed variables are TRUE | # all listed variables are TRUE | ||||||
| include(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) | find_package_handle_standard_args(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) | ||||||
|  |  | ||||||
| if(MATIO_FOUND) | if(MATIO_FOUND) | ||||||
|   set(MATIO_LIBRARIES ${MATIO_LIBRARY}) |   set(MATIO_LIBRARIES ${MATIO_LIBRARY}) | ||||||
|   set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR}) |   set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR}) | ||||||
| else(MATIO_FOUND) | else() | ||||||
|   set(MATIO_LIBRARIES) |   set(MATIO_LIBRARIES) | ||||||
|   set(MATIO_INCLUDE_DIRS) |   set(MATIO_INCLUDE_DIRS) | ||||||
| endif(MATIO_FOUND) | endif() | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ | |||||||
| # The following environment variable is optionally searched | # The following environment variable is optionally searched | ||||||
| # OPENBLAS_HOME: Base directory where all OpenBlas components are found | # OPENBLAS_HOME: Base directory where all OpenBlas components are found | ||||||
| 
 | 
 | ||||||
| SET(OPEN_BLAS_SEARCH_PATHS  /lib/  | set(OPEN_BLAS_SEARCH_PATHS  /lib/ | ||||||
|                             /lib64/ |                             /lib64/ | ||||||
|                             /usr/lib |                             /usr/lib | ||||||
|                             /usr/lib64 |                             /usr/lib64 | ||||||
| @@ -32,11 +32,13 @@ SET(OPEN_BLAS_SEARCH_PATHS  /lib/ | |||||||
|                             $ENV{OPENBLAS_HOME}/lib |                             $ENV{OPENBLAS_HOME}/lib | ||||||
|                             ) |                             ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) | find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) | ||||||
| 
 | 
 | ||||||
| IF (OPENBLAS) | if(OPENBLAS) | ||||||
|     SET(OPENBLAS_FOUND ON) |     set(OPENBLAS_FOUND ON) | ||||||
|     MESSAGE(STATUS "Found OpenBLAS") |     message(STATUS "Found OpenBLAS") | ||||||
| ENDIF (OPENBLAS) | endif() | ||||||
| 
 | 
 | ||||||
| MARK_AS_ADVANCED(OPENBLAS) | include(FindPackageHandleStandardArgs) | ||||||
|  | find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS) | ||||||
|  | mark_as_advanced(OPENBLAS) | ||||||
							
								
								
									
										110
									
								
								cmake/Modules/FindOPENCL.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										110
									
								
								cmake/Modules/FindOPENCL.cmake
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,110 @@ | |||||||
|  | # 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 <https://www.gnu.org/licenses/>. | ||||||
|  |  | ||||||
|  | # | ||||||
|  | # This file taken from FindOpenCL project @ http://gitorious.com/findopencl | ||||||
|  | # | ||||||
|  | # - Try to find OpenCL | ||||||
|  | # This module tries to find an OpenCL implementation on your system. It supports | ||||||
|  | # AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. | ||||||
|  | # | ||||||
|  | # Once done this will define | ||||||
|  | # OPENCL_FOUND - system has OpenCL | ||||||
|  | # OPENCL_INCLUDE_DIRS - the OpenCL include directory | ||||||
|  | # OPENCL_LIBRARIES - link these to use OpenCL | ||||||
|  | # | ||||||
|  | # WIN32 should work, but is untested | ||||||
|  |  | ||||||
|  | include(FindPackageHandleStandardArgs) | ||||||
|  |  | ||||||
|  | set(OPENCL_VERSION_STRING "0.1.0") | ||||||
|  | set(OPENCL_VERSION_MAJOR 0) | ||||||
|  | set(OPENCL_VERSION_MINOR 1) | ||||||
|  | set(OPENCL_VERSION_PATCH 0) | ||||||
|  |  | ||||||
|  | if(APPLE) | ||||||
|  |   find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") | ||||||
|  |   find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") | ||||||
|  |   find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") | ||||||
|  |  | ||||||
|  | else() | ||||||
|  |   if(WIN32) | ||||||
|  |     find_path(OPENCL_INCLUDE_DIRS CL/cl.h) | ||||||
|  |     find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) | ||||||
|  |  | ||||||
|  |     # The AMD SDK currently installs both x86 and x86_64 libraries | ||||||
|  |     # This is only a hack to find out architecture | ||||||
|  |     if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") | ||||||
|  |       set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") | ||||||
|  |       set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") | ||||||
|  |     else() | ||||||
|  |       set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") | ||||||
|  |       set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") | ||||||
|  |     endif() | ||||||
|  |  | ||||||
|  |     # find out if the user asked for a 64-bit build, and use the corresponding | ||||||
|  |     # 64 or 32 bit NVIDIA library paths to the search: | ||||||
|  |     string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) | ||||||
|  |     if("${ISWIN64}" STREQUAL "Win64") | ||||||
|  |       find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) | ||||||
|  |     else() | ||||||
|  |       find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) | ||||||
|  |     endif() | ||||||
|  |  | ||||||
|  |     get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) | ||||||
|  |  | ||||||
|  |     # On Win32 search relative to the library | ||||||
|  |     find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) | ||||||
|  |     find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) | ||||||
|  |  | ||||||
|  |   else() | ||||||
|  |     # Unix style platforms | ||||||
|  |     find_library(OPENCL_LIBRARIES OpenCL | ||||||
|  |       ENV LD_LIBRARY_PATH | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |     get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) | ||||||
|  |     get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) | ||||||
|  |  | ||||||
|  |     # The AMD SDK currently does not place its headers | ||||||
|  |     # in /usr/include, therefore also search relative | ||||||
|  |     # to the library | ||||||
|  |     find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") | ||||||
|  |     find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") | ||||||
|  |   endif() | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  | find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS) | ||||||
|  |  | ||||||
|  | if(_OPENCL_CPP_INCLUDE_DIRS) | ||||||
|  |   set(OPENCL_HAS_CPP_BINDINGS TRUE) | ||||||
|  |   list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS}) | ||||||
|  |   # This is often the same, so clean up | ||||||
|  |   list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS) | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  | mark_as_advanced( | ||||||
|  |   OPENCL_INCLUDE_DIRS | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES) | ||||||
|  |     set( OPENCL_FOUND TRUE ) | ||||||
|  |     add_definitions( -DOPENCL=1 ) | ||||||
|  | else() | ||||||
|  |     set( OPENCL_FOUND FALSE ) | ||||||
|  |     add_definitions( -DOPENCL=0 ) | ||||||
|  | endif() | ||||||
| @@ -15,19 +15,19 @@ | |||||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
|  |  | ||||||
| FIND_PACKAGE(PkgConfig) | find_package(PkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") | pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") | ||||||
|  |  | ||||||
| FIND_PROGRAM(ORCC_EXECUTABLE orcc | find_program(ORCC_EXECUTABLE orcc | ||||||
|     HINTS ${PC_ORC_TOOLSDIR} |     HINTS ${PC_ORC_TOOLSDIR} | ||||||
|     PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) |     PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) | ||||||
|  |  | ||||||
| FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h | find_path(ORC_INCLUDE_DIR NAMES orc/orc.h | ||||||
|     HINTS ${PC_ORC_INCLUDEDIR} |     HINTS ${PC_ORC_INCLUDEDIR} | ||||||
|     PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) |     PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) | ||||||
|  |  | ||||||
|  |  | ||||||
| FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} | find_path(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} | ||||||
|     HINTS ${PC_ORC_LIBDIR} |     HINTS ${PC_ORC_LIBDIR} | ||||||
|         /usr/local/lib |         /usr/local/lib | ||||||
|         /usr/lib/x86_64-linux-gnu |         /usr/lib/x86_64-linux-gnu | ||||||
| @@ -47,20 +47,20 @@ FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHA | |||||||
|         /usr/lib |         /usr/lib | ||||||
|     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) |     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) | ||||||
|  |  | ||||||
| FIND_LIBRARY(ORC_LIB orc-0.4 | find_library(ORC_LIB orc-0.4 | ||||||
|     HINTS ${PC_ORC_LIBRARY_DIRS} |     HINTS ${PC_ORC_LIBRARY_DIRS} | ||||||
|     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) |     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) | ||||||
|  |  | ||||||
| LIST(APPEND ORC_LIBRARY | list(APPEND ORC_LIBRARY | ||||||
|     ${ORC_LIB} |     ${ORC_LIB} | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) | set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) | ||||||
| SET(ORC_LIBRARIES ${ORC_LIBRARY}) | set(ORC_LIBRARIES ${ORC_LIBRARY}) | ||||||
| SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) | set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) | ||||||
|  |  | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) | find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) | ||||||
|  |  | ||||||
| mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) | mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) | ||||||
| @@ -1,116 +0,0 @@ | |||||||
| # 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 <https://www.gnu.org/licenses/>. |  | ||||||
|  |  | ||||||
| # |  | ||||||
| # This file taken from FindOpenCL project @ http://gitorious.com/findopencl |  | ||||||
| # |  | ||||||
| # - Try to find OpenCL |  | ||||||
| # This module tries to find an OpenCL implementation on your system. It supports |  | ||||||
| # AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. |  | ||||||
| # |  | ||||||
| # Once done this will define |  | ||||||
| # OPENCL_FOUND - system has OpenCL |  | ||||||
| # OPENCL_INCLUDE_DIRS - the OpenCL include directory |  | ||||||
| # OPENCL_LIBRARIES - link these to use OpenCL |  | ||||||
| # |  | ||||||
| # WIN32 should work, but is untested |  | ||||||
|  |  | ||||||
| FIND_PACKAGE( PackageHandleStandardArgs ) |  | ||||||
|  |  | ||||||
| SET (OPENCL_VERSION_STRING "0.1.0") |  | ||||||
| SET (OPENCL_VERSION_MAJOR 0) |  | ||||||
| SET (OPENCL_VERSION_MINOR 1) |  | ||||||
| SET (OPENCL_VERSION_PATCH 0) |  | ||||||
|  |  | ||||||
| IF (APPLE) |  | ||||||
|  |  | ||||||
|   FIND_LIBRARY(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") |  | ||||||
|   FIND_PATH(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") |  | ||||||
|   FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") |  | ||||||
|  |  | ||||||
| ELSE (APPLE) |  | ||||||
|  |  | ||||||
|   IF (WIN32) |  | ||||||
|  |  | ||||||
|     FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h) |  | ||||||
|     FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) |  | ||||||
|  |  | ||||||
|     # The AMD SDK currently installs both x86 and x86_64 libraries |  | ||||||
|     # This is only a hack to find out architecture |  | ||||||
|     IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" ) |  | ||||||
|       SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") |  | ||||||
|       SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") |  | ||||||
|     ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") |  | ||||||
|       SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") |  | ||||||
|       SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") |  | ||||||
|     ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" ) |  | ||||||
|  |  | ||||||
|     # find out if the user asked for a 64-bit build, and use the corresponding |  | ||||||
|     # 64 or 32 bit NVIDIA library paths to the search: |  | ||||||
|     STRING(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) |  | ||||||
|     IF("${ISWIN64}" STREQUAL "Win64") |  | ||||||
|       FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) |  | ||||||
|     ELSE("${ISWIN64}" STREQUAL "Win64") |  | ||||||
|       FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) |  | ||||||
|     ENDIF("${ISWIN64}" STREQUAL "Win64") |  | ||||||
|  |  | ||||||
|     GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) |  | ||||||
|  |  | ||||||
|     # On Win32 search relative to the library |  | ||||||
|     FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) |  | ||||||
|     FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) |  | ||||||
|  |  | ||||||
|   ELSE (WIN32) |  | ||||||
|  |  | ||||||
|     # Unix style platforms |  | ||||||
|     FIND_LIBRARY(OPENCL_LIBRARIES OpenCL |  | ||||||
|       ENV LD_LIBRARY_PATH |  | ||||||
|     ) |  | ||||||
|  |  | ||||||
|     GET_FILENAME_COMPONENT(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) |  | ||||||
|     GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) |  | ||||||
|  |  | ||||||
|     # The AMD SDK currently does not place its headers |  | ||||||
|     # in /usr/include, therefore also search relative |  | ||||||
|     # to the library |  | ||||||
|     FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") |  | ||||||
|     FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") |  | ||||||
|  |  | ||||||
|   ENDIF (WIN32) |  | ||||||
|  |  | ||||||
| ENDIF (APPLE) |  | ||||||
|  |  | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS ) |  | ||||||
|  |  | ||||||
| IF( _OPENCL_CPP_INCLUDE_DIRS ) |  | ||||||
|   SET( OPENCL_HAS_CPP_BINDINGS TRUE ) |  | ||||||
|   LIST( APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS} ) |  | ||||||
|   # This is often the same, so clean up |  | ||||||
|   LIST( REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS ) |  | ||||||
| ENDIF( _OPENCL_CPP_INCLUDE_DIRS ) |  | ||||||
|  |  | ||||||
| MARK_AS_ADVANCED( |  | ||||||
|   OPENCL_INCLUDE_DIRS |  | ||||||
| ) |  | ||||||
|  |  | ||||||
| IF( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES ) |  | ||||||
|     SET( OPENCL_FOUND TRUE ) |  | ||||||
|     add_definitions( -DOPENCL=1 ) |  | ||||||
| ELSE( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES ) |  | ||||||
|     SET( OPENCL_FOUND FALSE ) |  | ||||||
|     add_definitions( -DOPENCL=0 ) |  | ||||||
| ENDIF( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES ) |  | ||||||
| @@ -45,8 +45,8 @@ | |||||||
| #  PCAP_FOUND       - True if pcap found. | #  PCAP_FOUND       - True if pcap found. | ||||||
|  |  | ||||||
|  |  | ||||||
| IF(EXISTS $ENV{PCAPDIR}) | if(EXISTS $ENV{PCAPDIR}) | ||||||
|   FIND_PATH(PCAP_INCLUDE_DIR  |   find_path(PCAP_INCLUDE_DIR | ||||||
|     NAMES |     NAMES | ||||||
|     pcap/pcap.h |     pcap/pcap.h | ||||||
|     pcap.h |     pcap.h | ||||||
| @@ -54,68 +54,60 @@ IF(EXISTS $ENV{PCAPDIR}) | |||||||
|       $ENV{PCAPDIR} |       $ENV{PCAPDIR} | ||||||
|     NO_DEFAULT_PATH |     NO_DEFAULT_PATH | ||||||
|   ) |   ) | ||||||
|    |   find_library(PCAP_LIBRARY | ||||||
|   FIND_LIBRARY(PCAP_LIBRARY |  | ||||||
|     NAMES |     NAMES | ||||||
|       pcap |       pcap | ||||||
|     PATHS |     PATHS | ||||||
|       $ENV{PCAPDIR} |       $ENV{PCAPDIR} | ||||||
|     NO_DEFAULT_PATH |     NO_DEFAULT_PATH | ||||||
|   ) |   ) | ||||||
|    | else() | ||||||
|  |   find_path(PCAP_INCLUDE_DIR | ||||||
| ELSE(EXISTS $ENV{PCAPDIR}) |  | ||||||
|   FIND_PATH(PCAP_INCLUDE_DIR  |  | ||||||
|     NAMES |     NAMES | ||||||
|     pcap/pcap.h |     pcap/pcap.h | ||||||
|     pcap.h |     pcap.h | ||||||
|   ) |   ) | ||||||
|  |  | ||||||
|   FIND_LIBRARY(PCAP_LIBRARY |   find_library(PCAP_LIBRARY | ||||||
|     NAMES |     NAMES | ||||||
|       pcap |       pcap | ||||||
|   ) |   ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| ENDIF(EXISTS $ENV{PCAPDIR}) | set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) | ||||||
|  | set(PCAP_LIBRARIES ${PCAP_LIBRARY}) | ||||||
|  |  | ||||||
| SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) | if(PCAP_INCLUDE_DIRS) | ||||||
| SET(PCAP_LIBRARIES ${PCAP_LIBRARY}) |   message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") | ||||||
|  | else() | ||||||
|  |   message(FATAL " Pcap include dirs cannot be found") | ||||||
|  | endif() | ||||||
|  |  | ||||||
| IF(PCAP_INCLUDE_DIRS) | if(PCAP_LIBRARIES) | ||||||
|   MESSAGE(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") |   message(STATUS "Pcap library set to ${PCAP_LIBRARIES}") | ||||||
| ELSE(PCAP_INCLUDE_DIRS) | else() | ||||||
|   MESSAGE(FATAL " Pcap include dirs cannot be found") |   message(FATAL "Pcap library cannot be found") | ||||||
| ENDIF(PCAP_INCLUDE_DIRS) | endif() | ||||||
|  |  | ||||||
| IF(PCAP_LIBRARIES) |  | ||||||
|   MESSAGE(STATUS "Pcap library set to ${PCAP_LIBRARIES}") |  | ||||||
| ELSE(PCAP_LIBRARIES) |  | ||||||
|   MESSAGE(FATAL "Pcap library cannot be found") |  | ||||||
| ENDIF(PCAP_LIBRARIES) |  | ||||||
|  |  | ||||||
| #Functions | #Functions | ||||||
| INCLUDE(CheckFunctionExists) | include(CheckFunctionExists) | ||||||
| SET(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) | set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) | ||||||
| SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) | set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_breakloop" HAVE_PCAP_BREAKLOOP) | check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) | check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) | check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) | check_function_exists("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_freecode" HAVE_PCAP_FREECODE) | check_function_exists("pcap_freecode" HAVE_PCAP_FREECODE) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) | check_function_exists("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION) | check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) | check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) | check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) | ||||||
| CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) | check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) | ||||||
|  |  | ||||||
|  | mark_as_advanced( | ||||||
| #Is pcap found ? |  | ||||||
| IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) |  | ||||||
|   SET( PCAP_FOUND true ) |  | ||||||
| ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| MARK_AS_ADVANCED( |  | ||||||
|   PCAP_LIBRARIES |   PCAP_LIBRARIES | ||||||
|   PCAP_INCLUDE_DIRS |   PCAP_INCLUDE_DIRS | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | include(FindPackageHandleStandardArgs) | ||||||
|  | find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) | ||||||
|   | |||||||
							
								
								
									
										67
									
								
								cmake/Modules/FindPUGIXML.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								cmake/Modules/FindPUGIXML.cmake
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,67 @@ | |||||||
|  | # 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 <https://www.gnu.org/licenses/>. | ||||||
|  |  | ||||||
|  | # Find the pugixml XML parsing library. | ||||||
|  | # | ||||||
|  | # Sets the usual variables expected for find_package scripts: | ||||||
|  | # | ||||||
|  | # PUGIXML_INCLUDE_DIR - header location | ||||||
|  | # PUGIXML_LIBRARIES - library to link against | ||||||
|  | # PUGIXML_FOUND - true if pugixml was found. | ||||||
|  |  | ||||||
|  | find_path(PUGIXML_INCLUDE_DIR | ||||||
|  |     NAMES pugixml.hpp | ||||||
|  |     PATHS ${PUGIXML_HOME}/include | ||||||
|  |         /usr/include | ||||||
|  |         /usr/local/include | ||||||
|  |         /opt/local/include) | ||||||
|  |  | ||||||
|  | find_library(PUGIXML_LIBRARY | ||||||
|  |     NAMES pugixml | ||||||
|  |     PATHS ${PUGIXML_HOME}/lib | ||||||
|  |         /usr/lib/x86_64-linux-gnu | ||||||
|  |         /usr/lib/aarch64-linux-gnu | ||||||
|  |         /usr/lib/arm-linux-gnueabi | ||||||
|  |         /usr/lib/arm-linux-gnueabihf | ||||||
|  |         /usr/lib/i386-linux-gnu | ||||||
|  |         /usr/lib/mips-linux-gnu | ||||||
|  |         /usr/lib/mips64el-linux-gnuabi64 | ||||||
|  |         /usr/lib/mipsel-linux-gnu | ||||||
|  |         /usr/lib/powerpc64le-linux-gnu | ||||||
|  |         /usr/lib/s390x-linux-gnu | ||||||
|  |         /usr/local/lib | ||||||
|  |         /opt/local/lib | ||||||
|  |         /usr/lib | ||||||
|  |         /usr/lib64 | ||||||
|  |         /usr/local/lib64) | ||||||
|  |  | ||||||
|  | # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. | ||||||
|  | include(FindPackageHandleStandardArgs) | ||||||
|  | find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_LIBRARY | ||||||
|  |         PUGIXML_INCLUDE_DIR) | ||||||
|  |  | ||||||
|  | if(PUGIXML_FOUND) | ||||||
|  |     set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY}) | ||||||
|  |     if(NOT PUGIXML_FIND_QUIETLY) | ||||||
|  |         message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") | ||||||
|  |         message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}") | ||||||
|  |     endif() | ||||||
|  | else() | ||||||
|  |     message(STATUS "PugiXML not found.") | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  | mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) | ||||||
| @@ -15,10 +15,10 @@ | |||||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_TELEORBIT teleorbit) | pkg_check_modules(PC_TELEORBIT teleorbit) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     TELEORBIT_INCLUDE_DIRS |     TELEORBIT_INCLUDE_DIRS | ||||||
|     NAMES teleorbit/api.h |     NAMES teleorbit/api.h | ||||||
|     HINTS $ENV{TELEORBIT_DIR}/include |     HINTS $ENV{TELEORBIT_DIR}/include | ||||||
| @@ -28,7 +28,7 @@ FIND_PATH( | |||||||
|           /usr/include |           /usr/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     TELEORBIT_LIBRARIES |     TELEORBIT_LIBRARIES | ||||||
|     NAMES gnuradio-teleorbit |     NAMES gnuradio-teleorbit | ||||||
|     HINTS $ENV{TELEORBIT_DIR}/lib |     HINTS $ENV{TELEORBIT_DIR}/lib | ||||||
| @@ -41,6 +41,6 @@ FIND_LIBRARY( | |||||||
|           /usr/lib64 |           /usr/lib64 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) | find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) | mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) | ||||||
| @@ -19,10 +19,10 @@ | |||||||
| # Find the library for the USRP Hardware Driver | # Find the library for the USRP Hardware Driver | ||||||
| ######################################################################## | ######################################################################## | ||||||
|  |  | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_UHD uhd) | pkg_check_modules(PC_UHD uhd) | ||||||
|  |  | ||||||
| FIND_PATH( | find_path( | ||||||
|     UHD_INCLUDE_DIRS |     UHD_INCLUDE_DIRS | ||||||
|     NAMES uhd/config.hpp |     NAMES uhd/config.hpp | ||||||
|     HINTS $ENV{UHD_DIR}/include |     HINTS $ENV{UHD_DIR}/include | ||||||
| @@ -32,7 +32,7 @@ FIND_PATH( | |||||||
|           ${GNURADIO_INSTALL_PREFIX}/include |           ${GNURADIO_INSTALL_PREFIX}/include | ||||||
| ) | ) | ||||||
|  |  | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     UHD_LIBRARIES |     UHD_LIBRARIES | ||||||
|     NAMES uhd |     NAMES uhd | ||||||
|     HINTS $ENV{UHD_DIR}/lib |     HINTS $ENV{UHD_DIR}/lib | ||||||
| @@ -66,6 +66,6 @@ FIND_LIBRARY( | |||||||
|           ${GNURADIO_INSTALL_PREFIX}/lib |           ${GNURADIO_INSTALL_PREFIX}/lib | ||||||
| ) | ) | ||||||
|  |  | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) | find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS) | mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS) | ||||||
|   | |||||||
| @@ -19,10 +19,10 @@ | |||||||
| # Find VOLK (Vector-Optimized Library of Kernels) | # Find VOLK (Vector-Optimized Library of Kernels) | ||||||
| ######################################################################## | ######################################################################## | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_VOLK volk) | pkg_check_modules(PC_VOLK volk) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     VOLK_INCLUDE_DIRS |     VOLK_INCLUDE_DIRS | ||||||
|     NAMES volk/volk.h |     NAMES volk/volk.h | ||||||
|     HINTS $ENV{VOLK_DIR}/include |     HINTS $ENV{VOLK_DIR}/include | ||||||
| @@ -32,7 +32,7 @@ FIND_PATH( | |||||||
|           ${CMAKE_INSTALL_PREFIX}/include |           ${CMAKE_INSTALL_PREFIX}/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     VOLK_LIBRARIES |     VOLK_LIBRARIES | ||||||
|     NAMES volk |     NAMES volk | ||||||
|     HINTS $ENV{VOLK_DIR}/lib |     HINTS $ENV{VOLK_DIR}/lib | ||||||
| @@ -67,7 +67,6 @@ FIND_LIBRARY( | |||||||
|           ${CMAKE_INSTALL_PREFIX}/lib |           ${CMAKE_INSTALL_PREFIX}/lib | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 | include(FindPackageHandleStandardArgs) | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) | mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) | ||||||
| MARK_AS_ADVANCED(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) |  | ||||||
| @@ -19,10 +19,10 @@ | |||||||
| # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library | # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library | ||||||
| ######################################################################## | ######################################################################## | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) | pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) | ||||||
| 
 | 
 | ||||||
| FIND_PATH( | find_path( | ||||||
|     VOLK_GNSSSDR_INCLUDE_DIRS |     VOLK_GNSSSDR_INCLUDE_DIRS | ||||||
|     NAMES volk_gnsssdr/volk_gnsssdr.h |     NAMES volk_gnsssdr/volk_gnsssdr.h | ||||||
|     HINTS $ENV{VOLK_GNSSSDR_DIR}/include |     HINTS $ENV{VOLK_GNSSSDR_DIR}/include | ||||||
| @@ -32,7 +32,7 @@ FIND_PATH( | |||||||
|           ${GNURADIO_INSTALL_PREFIX}/include |           ${GNURADIO_INSTALL_PREFIX}/include | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     VOLK_GNSSSDR_LIBRARIES |     VOLK_GNSSSDR_LIBRARIES | ||||||
|     NAMES volk_gnsssdr |     NAMES volk_gnsssdr | ||||||
|     HINTS $ENV{VOLK_GNSSSDR_DIR}/lib |     HINTS $ENV{VOLK_GNSSSDR_DIR}/lib | ||||||
| @@ -44,6 +44,6 @@ FIND_LIBRARY( | |||||||
|           ${GNURADIO_INSTALL_PREFIX}/lib |           ${GNURADIO_INSTALL_PREFIX}/lib | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | ||||||
| @@ -56,11 +56,11 @@ function(GNSSSDR_CHECK_BUILD_TYPE settype) | |||||||
|     string(TOUPPER ${btype} _btype) |     string(TOUPPER ${btype} _btype) | ||||||
|     if(${_settype} STREQUAL ${_btype}) |     if(${_settype} STREQUAL ${_btype}) | ||||||
|       return() # found it; exit cleanly |       return() # found it; exit cleanly | ||||||
|     endif(${_settype} STREQUAL ${_btype}) |     endif() | ||||||
|   endforeach(btype) |   endforeach() | ||||||
|   # Build type not found; error out |   # Build type not found; error out | ||||||
|   message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") |   message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") | ||||||
| endfunction(GNSSSDR_CHECK_BUILD_TYPE) | endfunction() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -86,12 +86,12 @@ if(NOT WIN32) | |||||||
|     "-W" CACHE STRING |     "-W" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during Coverage builds." FORCE) |     "Flags used by the shared lib linker during Coverage builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_COVERAGE |     CMAKE_CXX_FLAGS_COVERAGE | ||||||
|     CMAKE_C_FLAGS_COVERAGE |     CMAKE_C_FLAGS_COVERAGE | ||||||
|     CMAKE_EXE_LINKER_FLAGS_COVERAGE |     CMAKE_EXE_LINKER_FLAGS_COVERAGE | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_COVERAGE) |     CMAKE_SHARED_LINKER_FLAGS_COVERAGE) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -117,12 +117,12 @@ if(NOT WIN32) | |||||||
|     "-W" CACHE STRING |     "-W" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) |     "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_NOOPTWITHASM |     CMAKE_CXX_FLAGS_NOOPTWITHASM | ||||||
|     CMAKE_C_FLAGS_NOOPTWITHASM |     CMAKE_C_FLAGS_NOOPTWITHASM | ||||||
|     CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM |     CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) |     CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -150,12 +150,12 @@ if(NOT WIN32) | |||||||
|     "-W" CACHE STRING |     "-W" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during O2WithASM builds." FORCE) |     "Flags used by the shared lib linker during O2WithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_O2WITHASM |     CMAKE_CXX_FLAGS_O2WITHASM | ||||||
|     CMAKE_C_FLAGS_O2WITHASM |     CMAKE_C_FLAGS_O2WITHASM | ||||||
|     CMAKE_EXE_LINKER_FLAGS_O2WITHASM |     CMAKE_EXE_LINKER_FLAGS_O2WITHASM | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) |     CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -182,12 +182,12 @@ if(NOT WIN32) | |||||||
|     "-W" CACHE STRING |     "-W" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during O3WithASM builds." FORCE) |     "Flags used by the shared lib linker during O3WithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_O3WITHASM |     CMAKE_CXX_FLAGS_O3WITHASM | ||||||
|     CMAKE_C_FLAGS_O3WITHASM |     CMAKE_C_FLAGS_O3WITHASM | ||||||
|     CMAKE_EXE_LINKER_FLAGS_O3WITHASM |     CMAKE_EXE_LINKER_FLAGS_O3WITHASM | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) |     CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -211,9 +211,9 @@ if(NOT WIN32) | |||||||
|     "-W" CACHE STRING |     "-W" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during Address Sanitized builds." FORCE) |     "Flags used by the shared lib linker during Address Sanitized builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_ASAN |     CMAKE_CXX_FLAGS_ASAN | ||||||
|     CMAKE_C_FLAGS_ASAN |     CMAKE_C_FLAGS_ASAN | ||||||
|     CMAKE_EXE_LINKER_FLAGS_ASAN |     CMAKE_EXE_LINKER_FLAGS_ASAN | ||||||
|     CMAKE_SHARED_LINKER_ASAN) |     CMAKE_SHARED_LINKER_ASAN) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|   | |||||||
| @@ -36,10 +36,10 @@ macro(GNSSSDR_PYTHON_CHECK_MODULE_RAW desc python_code have) | |||||||
|         message(STATUS "Python checking for ${desc} - not found") |         message(STATUS "Python checking for ${desc} - not found") | ||||||
|         set(${have} FALSE) |         set(${have} FALSE) | ||||||
|     endif() |     endif() | ||||||
| endmacro(GNSSSDR_PYTHON_CHECK_MODULE_RAW) | endmacro() | ||||||
|  |  | ||||||
| macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have) | macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have) | ||||||
|     GNSSSDR_PYTHON_CHECK_MODULE_RAW( |     gnsssdr_python_check_module_raw( | ||||||
|         "${desc}" " |         "${desc}" " | ||||||
| ######################################### | ######################################### | ||||||
| try: | try: | ||||||
| @@ -49,7 +49,7 @@ except (ImportError, AssertionError): exit(-1) | |||||||
| except: pass | except: pass | ||||||
| #########################################" | #########################################" | ||||||
|     "${have}") |     "${have}") | ||||||
| endmacro(GNSSSDR_PYTHON_CHECK_MODULE) | endmacro() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -64,57 +64,55 @@ if(CMAKE_VERSION VERSION_LESS 3.12) | |||||||
|         string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3) |         string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3) | ||||||
|         if(IS_PYTHON3 EQUAL -1) |         if(IS_PYTHON3 EQUAL -1) | ||||||
|             find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) |             find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) | ||||||
|         else(IS_PYTHON3 EQUAL -1) |         else() | ||||||
|             find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) |             find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) | ||||||
|         endif(IS_PYTHON3 EQUAL -1) |         endif() | ||||||
|         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("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("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) |         gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) | ||||||
|     else(PYTHON_EXECUTABLE) |     else() | ||||||
|         message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2") |         message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2") | ||||||
|         message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") |         message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") | ||||||
|         find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) |         find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) | ||||||
|         if(NOT PYTHONINTERP_FOUND) |         if(NOT PYTHONINTERP_FOUND) | ||||||
|             message(STATUS "python2 not found - trying with python3") |             message(STATUS "python2 not found - trying with python3") | ||||||
|             find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) |             find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) | ||||||
|         endif(NOT PYTHONINTERP_FOUND) |         endif() | ||||||
|         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("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("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) |         gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) | ||||||
|     endif(PYTHON_EXECUTABLE) |     endif() | ||||||
|     find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) |     find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) | ||||||
| else(CMAKE_VERSION VERSION_LESS 3.12) | else() | ||||||
|     find_package(Python3 COMPONENTS Interpreter) |     find_package(Python3 COMPONENTS Interpreter) | ||||||
|     if(Python3_FOUND) |     if(Python3_FOUND) | ||||||
|         set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) |         set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) | ||||||
|         set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) |         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("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("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) |         gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) | ||||||
|     endif(Python3_FOUND) |     endif() | ||||||
|     if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) |     if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) | ||||||
|         find_package(Python2 COMPONENTS Interpreter) |         find_package(Python2 COMPONENTS Interpreter) | ||||||
|         if(Python2_FOUND) |         if(Python2_FOUND) | ||||||
|             set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) |             set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) | ||||||
|             set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR}) |             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("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("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) |             gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) | ||||||
|         endif(Python2_FOUND) |         endif() | ||||||
|     endif(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) |     endif() | ||||||
| endif(CMAKE_VERSION VERSION_LESS 3.12) | endif() | ||||||
|  |  | ||||||
| if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) | if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) | ||||||
|     set(PYTHON3 TRUE) |     set(PYTHON3 TRUE) | ||||||
| endif(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(CMAKE_CROSSCOMPILING) | if(CMAKE_CROSSCOMPILING) | ||||||
|     set(QA_PYTHON_EXECUTABLE "/usr/bin/python") |     set(QA_PYTHON_EXECUTABLE "/usr/bin/python") | ||||||
| else(CMAKE_CROSSCOMPILING) | else() | ||||||
|     set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) |     set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) | ||||||
| endif(CMAKE_CROSSCOMPILING) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| # make the path to the executable appear in the cmake gui | # make the path to the executable appear in the cmake gui | ||||||
| set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") | set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ function(check_arm_version ppdef input_string version output_var) | |||||||
|   string(REGEX MATCH "${ppdef}"  _VERSION_MATCH "${input_string}") |   string(REGEX MATCH "${ppdef}"  _VERSION_MATCH "${input_string}") | ||||||
|   if(NOT _VERSION_MATCH STREQUAL "") |   if(NOT _VERSION_MATCH STREQUAL "") | ||||||
|     set(${output_var} "${version}" PARENT_SCOPE) |     set(${output_var} "${version}" PARENT_SCOPE) | ||||||
|   endif(NOT _VERSION_MATCH STREQUAL "") |   endif() | ||||||
| endfunction() | endfunction() | ||||||
|  |  | ||||||
| message(STATUS "Checking for ARM") | message(STATUS "Checking for ARM") | ||||||
| @@ -41,7 +41,7 @@ message(STATUS "Checking for ARM") | |||||||
| set(IS_ARM NO) | set(IS_ARM NO) | ||||||
| set(ARM_VERSION "") | set(ARM_VERSION "") | ||||||
|  |  | ||||||
| if (CMAKE_COMPILER_IS_GNUCXX) | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||||||
|   execute_process(COMMAND echo "int main(){}" |   execute_process(COMMAND echo "int main(){}" | ||||||
|                   COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - |                   COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - | ||||||
|                   OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) |                   OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) | ||||||
| @@ -49,7 +49,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) | |||||||
|   string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") |   string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") | ||||||
|   if(ARM_FOUND STREQUAL "") |   if(ARM_FOUND STREQUAL "") | ||||||
|     string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") |     string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") | ||||||
|   endif(ARM_FOUND STREQUAL "") |   endif() | ||||||
|  |  | ||||||
|   if(NOT ARM_FOUND STREQUAL "") |   if(NOT ARM_FOUND STREQUAL "") | ||||||
|     set(IS_ARM YES) |     set(IS_ARM YES) | ||||||
| @@ -86,19 +86,18 @@ if (CMAKE_COMPILER_IS_GNUCXX) | |||||||
|     if(ARM_VERSION STREQUAL "") |     if(ARM_VERSION STREQUAL "") | ||||||
|       message(STATUS "Couldn't detect ARM version. Setting to 'arm'") |       message(STATUS "Couldn't detect ARM version. Setting to 'arm'") | ||||||
|       set(ARM_VERSION "arm") |       set(ARM_VERSION "arm") | ||||||
|     else (ARM_VERSION STREQUAL "") |     else() | ||||||
|       message(STATUS "ARM version ${ARM_VERSION} detected") |       message(STATUS "ARM version ${ARM_VERSION} detected") | ||||||
|     endif (ARM_VERSION STREQUAL "") |     endif() | ||||||
|      |   else() | ||||||
|   else (NOT ARM_FOUND STREQUAL "") |  | ||||||
|     message(STATUS "System is not ARM") |     message(STATUS "System is not ARM") | ||||||
|   endif(NOT ARM_FOUND STREQUAL "") |   endif() | ||||||
|  |  | ||||||
| else (CMAKE_COMPILE_IS_GNUCXX) | else() | ||||||
|   # TODO: Other compilers |   # TODO: Other compilers | ||||||
|   message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false") |   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") |   message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually") | ||||||
| endif(CMAKE_COMPILER_IS_GNUCXX) | endif() | ||||||
|  |  | ||||||
| set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") | set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") | ||||||
| set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") | set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") | ||||||
|   | |||||||
| @@ -22,7 +22,6 @@ | |||||||
| # - Anthony Arnold | # - Anthony Arnold | ||||||
| ############################################################################### | ############################################################################### | ||||||
|  |  | ||||||
|  |  | ||||||
| function(test_for_sse h_file result_var name) | function(test_for_sse h_file result_var name) | ||||||
|   if(NOT DEFINED ${result_var}) |   if(NOT DEFINED ${result_var}) | ||||||
|     execute_process(COMMAND echo "#include <${h_file}>" |     execute_process(COMMAND echo "#include <${h_file}>" | ||||||
| @@ -33,10 +32,10 @@ function (test_for_sse h_file result_var name) | |||||||
|     if(COMPILE_RESULT EQUAL 0) |     if(COMPILE_RESULT EQUAL 0) | ||||||
|       message(STATUS "Detected ${name}") |       message(STATUS "Detected ${name}") | ||||||
|       set(detected 1) |       set(detected 1) | ||||||
|     endif(COMPILE_RESULT EQUAL 0) |     endif() | ||||||
|     set(${result_var} ${detected} CACHE INTERNAL "${name} Available") |     set(${result_var} ${detected} CACHE INTERNAL "${name} Available") | ||||||
|   endif (NOT DEFINED ${result_var}) |   endif() | ||||||
| endfunction(test_for_sse) | endfunction() | ||||||
|  |  | ||||||
| message(STATUS "Testing for SIMD extensions") | message(STATUS "Testing for SIMD extensions") | ||||||
|  |  | ||||||
|   | |||||||
| @@ -16,6 +16,7 @@ Next release will have several improvements in different dimensions, addition of | |||||||
| - Redesign of the time counter for enhanced continuity. | - Redesign of the time counter for enhanced continuity. | ||||||
| - Improved flow graph in multisystem configurations: the receiver does not get stalled anymore if no signal is found from the first system. | - Improved flow graph in multisystem configurations: the receiver does not get stalled anymore if no signal is found from the first system. | ||||||
| - Improved acquisition and tracking sensitivity. | - Improved acquisition and tracking sensitivity. | ||||||
|  | - Added mechanisms for Assisted GNSS, thus shortening the Time-To-First-Fix. Provision of data via XML files or via SUPL v1.0. Documented at https://gnss-sdr.org/docs/sp-blocks/global-parameters/ | ||||||
| - Other minor bug fixes. | - Other minor bug fixes. | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -27,6 +28,7 @@ Next release will have several improvements in different dimensions, addition of | |||||||
| - New volk_gnsssdr kernels: volk_gnsssdr_16i_xn_resampler_16i_xn.h, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h, volk_gnsssdr_32f_xn_resampler_32f_xn.h, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h | - New volk_gnsssdr kernels: volk_gnsssdr_16i_xn_resampler_16i_xn.h, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h, volk_gnsssdr_32f_xn_resampler_32f_xn.h, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h | ||||||
| - Some AVX2 implementations added to the volk_gnsssdr library. | - Some AVX2 implementations added to the volk_gnsssdr library. | ||||||
| - Improvement in C++ usage: Use of const container calls when result is immediately converted to a const iterator. Using these members removes an implicit conversion from iterator to const_iterator. | - Improvement in C++ usage: Use of const container calls when result is immediately converted to a const iterator. Using these members removes an implicit conversion from iterator to const_iterator. | ||||||
|  | - Output printers can be shut down, with some savings in memory and storage requirements. | ||||||
| - A number of code optimizations here and there. | - A number of code optimizations here and there. | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -34,7 +36,8 @@ Next release will have several improvements in different dimensions, addition of | |||||||
|  |  | ||||||
| - A number of new parameters have been exposed to the configuration system. | - A number of new parameters have been exposed to the configuration system. | ||||||
| - Possibility to choose Pilot or Data component for tracking of GPS L5 and Galileo E5a signals. | - Possibility to choose Pilot or Data component for tracking of GPS L5 and Galileo E5a signals. | ||||||
| - Enabled extended coherent integration times. | - Enabled extended coherent integration times for signal tracking. | ||||||
|  | - Configurable coherent and/or non-coherent signal acquisition. | ||||||
| - Some configuration parameters can now be overridden by commandline flags for easier use in scripts. | - Some configuration parameters can now be overridden by commandline flags for easier use in scripts. | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -48,11 +51,15 @@ Next release will have several improvements in different dimensions, addition of | |||||||
| - Added five more signal sources: "Fmcomms2_Signal_Source" (requires gr-iio), "Plutosdr_Signal Source" (requires gr-iio), "Spir_GSS6450_File_Signal_Source", "Labsat_Signal_Source" and "Custom_UDP_Signal_Source" (requires libpcap). Documented in https://gnss-sdr.org/docs/sp-blocks/signal-source/ | - Added five more signal sources: "Fmcomms2_Signal_Source" (requires gr-iio), "Plutosdr_Signal Source" (requires gr-iio), "Spir_GSS6450_File_Signal_Source", "Labsat_Signal_Source" and "Custom_UDP_Signal_Source" (requires libpcap). Documented in https://gnss-sdr.org/docs/sp-blocks/signal-source/ | ||||||
| - Improved support for BladeRF, HackRF and RTL-SDR front-ends. | - Improved support for BladeRF, HackRF and RTL-SDR front-ends. | ||||||
| - Added tools for the interaction with front-ends based on the AD9361 chipset. | - Added tools for the interaction with front-ends based on the AD9361 chipset. | ||||||
| - Intermediate results are now saved in .mat binary format, readable from Matlab/Octave and from Python via h5py. | - Intermediate results are now saved in MAT-file format (.mat), readable from Matlab/Octave and from Python via h5py. | ||||||
| - Added the GPX output format. | - Added the GPX output format. | ||||||
| - Fixed a bug in the format of NMEA sentences when latitude or longitude minutes were >10. | - Improvements in the generation of KML files. | ||||||
|  | - Improvements in the NMEA output. The receiver can produce GPGGA, GPRMC, GPGSA, GPGSV, GAGSA and GAGSV sentences. | ||||||
| - Improvements in the RTCM server stability. | - Improvements in the RTCM server stability. | ||||||
| - Improvements in the correctness of generated RINEX files. | - Improvements in the correctness of generated RINEX files. | ||||||
|  | - The receiver can read and make use of Galileo almanac XML files published by the European GNSS Service Centre at https://www.gsc-europa.eu/system-status/almanac-data | ||||||
|  | - Own-defined XML schemas for navigation data published at https://github.com/gnss-sdr/gnss-sdr/tree/next/docs/xml-schemas | ||||||
|  | - Added program rinex2assist to convert RINEX navigation files into XML files usable for Assisted GNSS. Only available building from source. See https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist | ||||||
|  |  | ||||||
|  |  | ||||||
| ### Improvements in Maintainability: | ### Improvements in Maintainability: | ||||||
| @@ -64,6 +71,8 @@ Next release will have several improvements in different dimensions, addition of | |||||||
| - Improvement in C++ usage: The override special identifier is now used when overriding a virtual function. This helps the compiler to check for type changes in the base class, making the detection of errors easier. | - Improvement in C++ usage: The override special identifier is now used when overriding a virtual function. This helps the compiler to check for type changes in the base class, making the detection of errors easier. | ||||||
| - Improvement in C++ usage: A number of unused includes have been removed. Order of includes set to: local (in-source) headers, then library headers, then system headers. This helps to detect missing includes. | - Improvement in C++ usage: A number of unused includes have been removed. Order of includes set to: local (in-source) headers, then library headers, then system headers. This helps to detect missing includes. | ||||||
| - Improvement in C++ usage: Enhanced const correctness. Misuses of those variables are detected by the compiler. | - Improvement in C++ usage: Enhanced const correctness. Misuses of those variables are detected by the compiler. | ||||||
|  | - Applied some style rules to CMake scripts. | ||||||
|  | - Minimal versions of dependencies identified and detected. | ||||||
|  |  | ||||||
|  |  | ||||||
| ### Improvements in Portability: | ### Improvements in Portability: | ||||||
| @@ -76,15 +85,16 @@ Next release will have several improvements in different dimensions, addition of | |||||||
| - The Ninja build system can be used in replacement of make. | - The Ninja build system can be used in replacement of make. | ||||||
| - The volk_gnsssdr library can be built using Python 2.7 or Python 3.6. | - The volk_gnsssdr library can be built using Python 2.7 or Python 3.6. | ||||||
| - The volk_gnsssdr library is now ready for AArch64 NEON instructions. | - The volk_gnsssdr library is now ready for AArch64 NEON instructions. | ||||||
| - Ready for GNU Radio 3.8 C++ API (as per current next branch of GNU Radio upstream repository). | - Ready for GNU Radio 3.8 C++ API (as per current master branch of GNU Radio upstream repository). | ||||||
| - Improved detection of required and optional dependencies in many GNU/Linux distributions and processor architectures. | - Improved detection of required and optional dependencies in many GNU/Linux distributions and processor architectures. | ||||||
| - Improvement in C++ usage: The <ctime> library has been replaced by the more modern and portable <chrono>. | - Improvement in C++ usage: The <ctime> library has been replaced by the more modern and portable <chrono> (except for the interaction with RTKLIB). | ||||||
| - Improvement in C++ usage: The <stdio.h> library has been replaced by the more modern and portable <fstream> for file handling. | - Improvement in C++ usage: The <stdio.h> library has been replaced by the more modern and portable <fstream> for file handling. | ||||||
| - Improvement in C++ usage: C++ libraries preferred over C libraries (e.g., <cctype> instead of <ctype.h>, <cmath> instead of <math.h>). | - Improvement in C++ usage: C++ libraries preferred over C libraries (e.g., <cctype> instead of <ctype.h>, <cmath> instead of <math.h>). | ||||||
| - Fixes required by Debian packaging. | - Fixes required by Debian packaging. | ||||||
| - Fixes required by Macports packaging. | - Fixes required by Macports packaging. | ||||||
| - A downside in portability: BLAS and LAPACK libraries are now required even in ARM devices. | - A downside in portability: BLAS and LAPACK libraries are now required even in ARM devices. | ||||||
| - A downside in portability: the matio library >= 1.5.3 is a new required dependency. If not found, it is downloaded and built automatically at building time, but this requires libtool, automake and hdf5 already installed in the system. | - A downside in portability: the matio library >= 1.5.3 is a new required dependency. If not found, it is downloaded and built automatically at building time, but this requires libtool, automake and hdf5 already installed in the system. | ||||||
|  | - A downside in portability: the PugiXML library is a new required dependency. If not found, it is downloaded and built automatically at building time. | ||||||
|  |  | ||||||
|  |  | ||||||
| ### Improvements in Reliability: | ### Improvements in Reliability: | ||||||
| @@ -93,6 +103,7 @@ Next release will have several improvements in different dimensions, addition of | |||||||
| - Improved flow graph stabiliy. | - Improved flow graph stabiliy. | ||||||
| - Introduction of high-integrity C++ practices into the source code and included in the coding style guide. See https://gnss-sdr.org/coding-style/ | - Introduction of high-integrity C++ practices into the source code and included in the coding style guide. See https://gnss-sdr.org/coding-style/ | ||||||
| - Fixed a number of defects detected by Coverity Scan. | - Fixed a number of defects detected by Coverity Scan. | ||||||
|  | - Improvement of QA code and addition of a number of new tests. Documented at https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2/ | ||||||
| - Improvement in C++ usage: rand() function replaced by <random> library. | - Improvement in C++ usage: rand() function replaced by <random> library. | ||||||
| - Improvement in C++ usage: strlen and strncpy have been replaced by safer C++ counterparts. | - Improvement in C++ usage: strlen and strncpy have been replaced by safer C++ counterparts. | ||||||
| - Improvement in C++ usage: Some destructors have been fixed, avoiding segmentation faults when exiting the program. | - Improvement in C++ usage: Some destructors have been fixed, avoiding segmentation faults when exiting the program. | ||||||
| @@ -122,9 +133,10 @@ Next release will have several improvements in different dimensions, addition of | |||||||
|  |  | ||||||
| - All Observables block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. | - All Observables block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. | ||||||
| - All PVT block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. | - All PVT block implementations have been merged into a single implementation for all kinds of GNSS signals, making it easier to configure. | ||||||
| - Misleading parameter name GNSS-SDR.internal_fs_hz has been replaced by GNSS-SDR.internal_fs_sps. The old parameter name is still read. If found, a warning is provided to the user. | - Misleading parameter name GNSS-SDR.internal_fs_hz has been replaced by GNSS-SDR.internal_fs_sps. The old parameter name is still read. If found, a warning is provided to the user. The old name will be removed in future releases. | ||||||
| - Updated and improved documentation of processing blocks at https://gnss-sdr.org/docs/sp-blocks/ | - Updated and improved online documentation of processing blocks at https://gnss-sdr.org/docs/sp-blocks/ | ||||||
| - Improved documentation of required dependency packages in several GNU/Linux distributions. | - Improved documentation of required dependency packages in several GNU/Linux distributions. | ||||||
|  | - Dump and output files can now be stored anywhere. | ||||||
| - Parameter names with the same role have been harmonized within different block implementations. | - Parameter names with the same role have been harmonized within different block implementations. | ||||||
| - Added a changelog, a code of conduct, a contributing guide and a pull-request template in the source tree. | - Added a changelog, a code of conduct, a contributing guide and a pull-request template in the source tree. | ||||||
| - Added colors to the commandline user interface. | - Added colors to the commandline user interface. | ||||||
|   | |||||||
| @@ -32,3 +32,4 @@ Galileo | |||||||
|  |  | ||||||
| Please check https://gnss-sdr.org/docs/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. | Please check https://gnss-sdr.org/docs/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR. | ||||||
|  |  | ||||||
|  | You could find useful the utility program [rinex2assist](https://github.com/gnss-sdr/gnss-sdr/tree/next/src/utils/rinex2assist) for the generation of compatible XML files from recent, publicly available RINEX navigation data files. | ||||||
|   | |||||||
| @@ -15,9 +15,9 @@ | |||||||
|                       <xs:complexType mixed="true"> |                       <xs:complexType mixed="true"> | ||||||
|                         <xs:sequence> |                         <xs:sequence> | ||||||
|                           <xs:element type="xs:byte" name="i_satellite_PRN"/> |                           <xs:element type="xs:byte" name="i_satellite_PRN"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toa"/> |                           <xs:element type="xs:byte" name="i_Toa"/> | ||||||
|                           <xs:element type="xs:float" name="d_WNa"/> |                           <xs:element type="xs:byte" name="i_WNa"/> | ||||||
|                           <xs:element type="xs:float" name="d_IODa"/> |                           <xs:element type="xs:byte" name="i_IODa"/> | ||||||
|                           <xs:element type="xs:float" name="d_Delta_i"/> |                           <xs:element type="xs:float" name="d_Delta_i"/> | ||||||
|                           <xs:element type="xs:float" name="d_M_0"/> |                           <xs:element type="xs:float" name="d_M_0"/> | ||||||
|                           <xs:element type="xs:float" name="d_e_eccentricity"/> |                           <xs:element type="xs:float" name="d_e_eccentricity"/> | ||||||
| @@ -27,9 +27,9 @@ | |||||||
|                           <xs:element type="xs:float" name="d_OMEGA_DOT"/> |                           <xs:element type="xs:float" name="d_OMEGA_DOT"/> | ||||||
|                           <xs:element type="xs:float" name="d_A_f0"/> |                           <xs:element type="xs:float" name="d_A_f0"/> | ||||||
|                           <xs:element type="xs:float" name="d_A_f1"/> |                           <xs:element type="xs:float" name="d_A_f1"/> | ||||||
|                           <xs:element type="xs:float" name="E5b_HS"/> |                           <xs:element type="xs:byte" name="E5b_HS"/> | ||||||
|                           <xs:element type="xs:float" name="E1B_HS"/> |                           <xs:element type="xs:byte" name="E1B_HS"/> | ||||||
|                           <xs:element type="xs:float" name="E5a_HS"/> |                           <xs:element type="xs:byte" name="E5a_HS"/> | ||||||
|                         </xs:sequence> |                         </xs:sequence> | ||||||
|                         <xs:attribute type="xs:byte" name="class_id" use="optional"/> |                         <xs:attribute type="xs:byte" name="class_id" use="optional"/> | ||||||
|                         <xs:attribute type="xs:byte" name="tracking_level" use="optional"/> |                         <xs:attribute type="xs:byte" name="tracking_level" use="optional"/> | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | <<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||||||
|   <xs:element name="boost_serialization"> |   <xs:element name="boost_serialization"> | ||||||
|     <xs:complexType> |     <xs:complexType> | ||||||
|       <xs:sequence> |       <xs:sequence> | ||||||
| @@ -16,6 +16,7 @@ | |||||||
|                         <xs:sequence> |                         <xs:sequence> | ||||||
|                           <xs:element type="xs:byte" name="i_satellite_PRN"/> |                           <xs:element type="xs:byte" name="i_satellite_PRN"/> | ||||||
|                           <xs:element type="xs:float" name="M0_1"/> |                           <xs:element type="xs:float" name="M0_1"/> | ||||||
|  |                           <xs:element type="xs:float" name="delta_n_3"/> | ||||||
|                           <xs:element type="xs:float" name="e_1"/> |                           <xs:element type="xs:float" name="e_1"/> | ||||||
|                           <xs:element type="xs:float" name="A_1"/> |                           <xs:element type="xs:float" name="A_1"/> | ||||||
|                           <xs:element type="xs:float" name="OMEGA_0_2"/> |                           <xs:element type="xs:float" name="OMEGA_0_2"/> | ||||||
| @@ -34,6 +35,22 @@ | |||||||
|                           <xs:element type="xs:float" name="af0_4"/> |                           <xs:element type="xs:float" name="af0_4"/> | ||||||
|                           <xs:element type="xs:float" name="af1_4"/> |                           <xs:element type="xs:float" name="af1_4"/> | ||||||
|                           <xs:element type="xs:float" name="af2_4"/> |                           <xs:element type="xs:float" name="af2_4"/> | ||||||
|  |                           <xs:element type="xs:float" name="WN_5"/> | ||||||
|  |                           <xs:element type="xs:float" name="TOW_5"/> | ||||||
|  |                           <xs:element type="xs:float" name="Galileo_satClkDrift"/> | ||||||
|  |                           <xs:element type="xs:float" name="Galileo_dtr"/> | ||||||
|  |                           <xs:element type="xs:byte" name="flag_all_ephemeris"/> | ||||||
|  |                           <xs:element type="xs:byte" name="IOD_ephemeris"/> | ||||||
|  |                           <xs:element type="xs:byte" name="IOD_nav_1"/> | ||||||
|  |                           <xs:element type="xs:float" name="SISA_3"/> | ||||||
|  |                           <xs:element type="xs:byte" name="E5a_HS"/> | ||||||
|  |                           <xs:element type="xs:float" name="E5b_HS_5"/> | ||||||
|  |                           <xs:element type="xs:float" name="E1B_HS_5"/> | ||||||
|  |                           <xs:element type="xs:byte" name="E5a_DVS"/> | ||||||
|  |                           <xs:element type="xs:float" name="E5b_DVS_5"/> | ||||||
|  |                           <xs:element type="xs:float" name="E1B_DVS_5"/> | ||||||
|  |                           <xs:element type="xs:float" name="BGD_E1E5a_5"/> | ||||||
|  |                           <xs:element type="xs:float" name="BGD_E1E5b_5"/> | ||||||
|                         </xs:sequence> |                         </xs:sequence> | ||||||
|                         <xs:attribute type="xs:byte" name="class_id" use="optional"/> |                         <xs:attribute type="xs:byte" name="class_id" use="optional"/> | ||||||
|                         <xs:attribute type="xs:byte" name="tracking_level" use="optional"/> |                         <xs:attribute type="xs:byte" name="tracking_level" use="optional"/> | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ | |||||||
|                         <xs:sequence> |                         <xs:sequence> | ||||||
|                           <xs:element type="xs:byte" name="i_satellite_PRN"/> |                           <xs:element type="xs:byte" name="i_satellite_PRN"/> | ||||||
|                           <xs:element type="xs:float" name="d_Delta_i"/> |                           <xs:element type="xs:float" name="d_Delta_i"/> | ||||||
|                           <xs:element type="xs:float" name="d_Toa"/> |                           <xs:element type="xs:byte" name="i_Toa"/> | ||||||
|                           <xs:element type="xs:byte" name="i_WNa"/> |                           <xs:element type="xs:byte" name="i_WNa"/> | ||||||
|                           <xs:element type="xs:float" name="d_M_0"/> |                           <xs:element type="xs:float" name="d_M_0"/> | ||||||
|                           <xs:element type="xs:float" name="d_e_eccentricity"/> |                           <xs:element type="xs:float" name="d_e_eccentricity"/> | ||||||
|   | |||||||
| @@ -21,5 +21,5 @@ add_subdirectory(core) | |||||||
| add_subdirectory(main) | add_subdirectory(main) | ||||||
| if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) | if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) | ||||||
|     add_subdirectory(tests) |     add_subdirectory(tests) | ||||||
| endif(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) | endif() | ||||||
| add_subdirectory(utils) | add_subdirectory(utils) | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ | |||||||
|  |  | ||||||
| if(Boost_VERSION LESS 105800) | if(Boost_VERSION LESS 105800) | ||||||
|     add_definitions(-DOLD_BOOST=1) |     add_definitions(-DOLD_BOOST=1) | ||||||
| endif(Boost_VERSION LESS 105800) | endif() | ||||||
|  |  | ||||||
| set(PVT_ADAPTER_SOURCES | set(PVT_ADAPTER_SOURCES | ||||||
|     rtklib_pvt.cc |     rtklib_pvt.cc | ||||||
| @@ -46,5 +46,11 @@ include_directories( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) | add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) | source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) | ||||||
| target_link_libraries(pvt_adapters pvt_gr_blocks ${ARMADILLO_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) |  | ||||||
|  | target_link_libraries(pvt_adapters | ||||||
|  |     pvt_gr_blocks | ||||||
|  |     ${ARMADILLO_LIBRARIES} | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -48,6 +48,27 @@ namespace bc = boost::integer; | |||||||
|  |  | ||||||
| using google::LogMessage; | using google::LogMessage; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | bool RtklibPvt::get_latest_PVT(double* longitude_deg, | ||||||
|  |     double* latitude_deg, | ||||||
|  |     double* height_m, | ||||||
|  |     double* ground_speed_kmh, | ||||||
|  |     double* course_over_ground_deg, | ||||||
|  |     time_t* UTC_time) | ||||||
|  | { | ||||||
|  |     return pvt_->get_latest_PVT(longitude_deg, | ||||||
|  |         latitude_deg, | ||||||
|  |         height_m, | ||||||
|  |         ground_speed_kmh, | ||||||
|  |         course_over_ground_deg, | ||||||
|  |         UTC_time); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void RtklibPvt::clear_ephemeris() | ||||||
|  | { | ||||||
|  |     pvt_->clear_ephemeris(); | ||||||
|  | } | ||||||
|  |  | ||||||
| RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, | ||||||
|     std::string role, |     std::string role, | ||||||
|     unsigned int in_streams, |     unsigned int in_streams, | ||||||
| @@ -516,6 +537,30 @@ RtklibPvt::~RtklibPvt() | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | std::map<int, Gps_Ephemeris> RtklibPvt::get_gps_ephemeris() const | ||||||
|  | { | ||||||
|  |     return pvt_->get_gps_ephemeris_map(); | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | std::map<int, Galileo_Ephemeris> RtklibPvt::get_galileo_ephemeris() const | ||||||
|  | { | ||||||
|  |     return pvt_->get_galileo_ephemeris_map(); | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | std::map<int, Gps_Almanac> RtklibPvt::get_gps_almanac() const | ||||||
|  | { | ||||||
|  |     return pvt_->get_gps_almanac_map(); | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | std::map<int, Galileo_Almanac> RtklibPvt::get_galileo_almanac() const | ||||||
|  | { | ||||||
|  |     return pvt_->get_galileo_almanac_map(); | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void RtklibPvt::connect(gr::top_block_sptr top_block) | void RtklibPvt::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (top_block) |     if (top_block) | ||||||
|   | |||||||
| @@ -57,12 +57,18 @@ public: | |||||||
|         return role_; |         return role_; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     //!  Returns "RTKLIB_Pvt" |     //!  Returns "RTKLIB_PVT" | ||||||
|     inline std::string implementation() override |     inline std::string implementation() override | ||||||
|     { |     { | ||||||
|         return "RTKLIB_PVT"; |         return "RTKLIB_PVT"; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     void clear_ephemeris() override; | ||||||
|  |     std::map<int, Gps_Ephemeris> get_gps_ephemeris() const override; | ||||||
|  |     std::map<int, Galileo_Ephemeris> get_galileo_ephemeris() const override; | ||||||
|  |     std::map<int, Gps_Almanac> get_gps_almanac() const override; | ||||||
|  |     std::map<int, Galileo_Almanac> get_galileo_almanac() const override; | ||||||
|  |  | ||||||
|     void connect(gr::top_block_sptr top_block) override; |     void connect(gr::top_block_sptr top_block) override; | ||||||
|     void disconnect(gr::top_block_sptr top_block) override; |     void disconnect(gr::top_block_sptr top_block) override; | ||||||
|     gr::basic_block_sptr get_left_block() override; |     gr::basic_block_sptr get_left_block() override; | ||||||
| @@ -79,11 +85,16 @@ public: | |||||||
|         return sizeof(gr_complex); |         return sizeof(gr_complex); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     bool get_latest_PVT(double* longitude_deg, | ||||||
|  |         double* latitude_deg, | ||||||
|  |         double* height_m, | ||||||
|  |         double* ground_speed_kmh, | ||||||
|  |         double* course_over_ground_deg, | ||||||
|  |         time_t* UTC_time) override; | ||||||
|  |  | ||||||
| private: | private: | ||||||
|     rtklib_pvt_cc_sptr pvt_; |     rtklib_pvt_cc_sptr pvt_; | ||||||
|     rtk_t rtk; |     rtk_t rtk; | ||||||
|     bool dump_; |  | ||||||
|     std::string dump_filename_; |  | ||||||
|     std::string role_; |     std::string role_; | ||||||
|     unsigned int in_streams_; |     unsigned int in_streams_; | ||||||
|     unsigned int out_streams_; |     unsigned int out_streams_; | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ | |||||||
|  |  | ||||||
| if(Boost_VERSION LESS 105800) | if(Boost_VERSION LESS 105800) | ||||||
|     add_definitions(-DOLD_BOOST=1) |     add_definitions(-DOLD_BOOST=1) | ||||||
| endif(Boost_VERSION LESS 105800) | endif() | ||||||
|  |  | ||||||
| set(PVT_GR_BLOCKS_SOURCES | set(PVT_GR_BLOCKS_SOURCES | ||||||
|     rtklib_pvt_cc.cc |     rtklib_pvt_cc.cc | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -31,7 +31,7 @@ | |||||||
| #ifndef GNSS_SDR_RTKLIB_PVT_CC_H | #ifndef GNSS_SDR_RTKLIB_PVT_CC_H | ||||||
| #define GNSS_SDR_RTKLIB_PVT_CC_H | #define GNSS_SDR_RTKLIB_PVT_CC_H | ||||||
|  |  | ||||||
|  | #include "gps_ephemeris.h" | ||||||
| #include "nmea_printer.h" | #include "nmea_printer.h" | ||||||
| #include "kml_printer.h" | #include "kml_printer.h" | ||||||
| #include "gpx_printer.h" | #include "gpx_printer.h" | ||||||
| @@ -40,6 +40,8 @@ | |||||||
| #include "rtcm_printer.h" | #include "rtcm_printer.h" | ||||||
| #include "pvt_conf.h" | #include "pvt_conf.h" | ||||||
| #include "rtklib_solver.h" | #include "rtklib_solver.h" | ||||||
|  | #include <boost/date_time/posix_time/posix_time.hpp> | ||||||
|  | #include <boost/date_time/gregorian/gregorian.hpp> | ||||||
| #include <gnuradio/sync_block.h> | #include <gnuradio/sync_block.h> | ||||||
| #include <sys/types.h> | #include <sys/types.h> | ||||||
| #include <sys/ipc.h> | #include <sys/ipc.h> | ||||||
| @@ -60,7 +62,7 @@ rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, | |||||||
|     rtk_t& rtk); |     rtk_t& rtk); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
|  * \brief This class implements a block that computes the PVT solution with Galileo E1 signals |  * \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library | ||||||
|  */ |  */ | ||||||
| class rtklib_pvt_cc : public gr::sync_block | class rtklib_pvt_cc : public gr::sync_block | ||||||
| { | { | ||||||
| @@ -109,8 +111,9 @@ private: | |||||||
|     bool d_geojson_output_enabled; |     bool d_geojson_output_enabled; | ||||||
|     bool d_gpx_output_enabled; |     bool d_gpx_output_enabled; | ||||||
|     bool d_kml_output_enabled; |     bool d_kml_output_enabled; | ||||||
|  |     bool d_nmea_output_file_enabled; | ||||||
|  |  | ||||||
|     std::shared_ptr<rtklib_solver> d_ls_pvt; |     std::shared_ptr<rtklib_solver> d_pvt_solver; | ||||||
|  |  | ||||||
|     std::map<int, Gnss_Synchro> gnss_observables_map; |     std::map<int, Gnss_Synchro> gnss_observables_map; | ||||||
|     bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b); |     bool observables_pairCompare_min(const std::pair<int, Gnss_Synchro>& a, const std::pair<int, Gnss_Synchro>& b); | ||||||
| @@ -135,6 +138,11 @@ private: | |||||||
|     bool d_xml_storage; |     bool d_xml_storage; | ||||||
|     std::string xml_base_path; |     std::string xml_base_path; | ||||||
|  |  | ||||||
|  |     inline std::time_t to_time_t(boost::posix_time::ptime pt) | ||||||
|  |     { | ||||||
|  |         return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| public: | public: | ||||||
|     rtklib_pvt_cc(uint32_t nchannels, |     rtklib_pvt_cc(uint32_t nchannels, | ||||||
| @@ -142,11 +150,32 @@ public: | |||||||
|         rtk_t& rtk); |         rtk_t& rtk); | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Get latest set of GPS L1 ephemeris from PVT block |      * \brief Get latest set of ephemeris from PVT block | ||||||
|      * |      * | ||||||
|      * It is used to save the assistance data at the receiver shutdown |  | ||||||
|      */ |      */ | ||||||
|     std::map<int, Gps_Ephemeris> get_GPS_L1_ephemeris_map(); |     std::map<int, Gps_Ephemeris> get_gps_ephemeris_map() const; | ||||||
|  |  | ||||||
|  |     std::map<int, Gps_Almanac> get_gps_almanac_map() const; | ||||||
|  |  | ||||||
|  |     std::map<int, Galileo_Ephemeris> get_galileo_ephemeris_map() const; | ||||||
|  |  | ||||||
|  |     std::map<int, Galileo_Almanac> get_galileo_almanac_map() const; | ||||||
|  |  | ||||||
|  |     /*! | ||||||
|  |      * \brief Clear all ephemeris information and the almanacs for GPS and Galileo | ||||||
|  |      * | ||||||
|  |      */ | ||||||
|  |     void clear_ephemeris(); | ||||||
|  |  | ||||||
|  |     /*! | ||||||
|  |      * \brief Get the latest Position WGS84 [deg], Ground Velocity, Course over Ground, and UTC Time, if available | ||||||
|  |      */ | ||||||
|  |     bool get_latest_PVT(double* longitude_deg, | ||||||
|  |         double* latitude_deg, | ||||||
|  |         double* height_m, | ||||||
|  |         double* ground_speed_kmh, | ||||||
|  |         double* course_over_ground_deg, | ||||||
|  |         time_t* UTC_time); | ||||||
|  |  | ||||||
|     ~rtklib_pvt_cc();  //!< Default destructor |     ~rtklib_pvt_cc();  //!< Default destructor | ||||||
|  |  | ||||||
|   | |||||||
| @@ -46,7 +46,6 @@ set(PVT_LIB_HEADERS | |||||||
|     pvt_conf.h |     pvt_conf.h | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| include_directories( | include_directories( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR} |     ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
|     ${CMAKE_SOURCE_DIR}/src/core/system_parameters |     ${CMAKE_SOURCE_DIR}/src/core/system_parameters | ||||||
| @@ -69,15 +68,23 @@ add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) | |||||||
| source_group(Headers FILES ${PVT_LIB_HEADERS}) | source_group(Headers FILES ${PVT_LIB_HEADERS}) | ||||||
|  |  | ||||||
| if(MATIO_FOUND) | if(MATIO_FOUND) | ||||||
|     add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) |     add_dependencies(pvt_lib | ||||||
| else(MATIO_FOUND) |         glog-${glog_RELEASE} | ||||||
|     add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) |         armadillo-${armadillo_RELEASE} | ||||||
| endif(MATIO_FOUND) |     ) | ||||||
|  | else() | ||||||
|  |     add_dependencies(pvt_lib | ||||||
|  |         glog-${glog_RELEASE} | ||||||
|  |         armadillo-${armadillo_RELEASE} | ||||||
|  |         matio-${GNSSSDR_MATIO_LOCAL_VERSION} | ||||||
|  |     ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| target_link_libraries( | target_link_libraries( | ||||||
|     pvt_lib |     pvt_lib | ||||||
|     rtklib_lib |     rtklib_lib | ||||||
|     gnss_sdr_flags |     gnss_sdr_flags | ||||||
|  |     gnss_sp_libs | ||||||
|     ${Boost_LIBRARIES} |     ${Boost_LIBRARIES} | ||||||
|     ${GLOG_LIBRARIES} |     ${GLOG_LIBRARIES} | ||||||
|     ${ARMADILLO_LIBRARIES} |     ${ARMADILLO_LIBRARIES} | ||||||
|   | |||||||
| @@ -138,13 +138,15 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|             gpx_file << std::setprecision(14); |             gpx_file << std::setprecision(14); | ||||||
|             gpx_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl |             gpx_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl | ||||||
|                      << "<gpx version=\"1.1\" creator=\"GNSS-SDR\"" << std::endl |                      << "<gpx version=\"1.1\" creator=\"GNSS-SDR\"" << std::endl | ||||||
|                      << "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\"" << std::endl |                      << indent << "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 http://www.garmin.com/xmlschemas/TrackPointExtensionv2.xsd\"" << std::endl | ||||||
|                      << "xmlns=\"http://www.topografix.com/GPX/1/1\"" << std::endl |                      << indent << "xmlns=\"http://www.topografix.com/GPX/1/1\"" << std::endl | ||||||
|                      << "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" << std::endl |                      << indent << "xmlns:gpxx=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3\"" << std::endl | ||||||
|                      << "<trk>" << std::endl |                      << indent << "xmlns:gpxtpx=\"http://www.garmin.com/xmlschemas/TrackPointExtension/v2\"" << std::endl | ||||||
|                      << indent << "<name>Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "</name>" << std::endl |                      << indent << "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" << std::endl | ||||||
|                      << indent << "<desc>GNSS-SDR position log generated at " << pt << " (local time)</desc>" << std::endl |                      << indent << "<trk>" << std::endl | ||||||
|                      << indent << "<trkseg>" << std::endl; |                      << indent << indent << "<name>Position fixes computed by GNSS-SDR v" << GNSS_SDR_VERSION << "</name>" << std::endl | ||||||
|  |                      << indent << indent << "<desc>GNSS-SDR position log generated at " << pt << " (local time)</desc>" << std::endl | ||||||
|  |                      << indent << indent << "<trkseg>" << std::endl; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
| @@ -164,6 +166,9 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, | |||||||
|     positions_printed = true; |     positions_printed = true; | ||||||
|     std::shared_ptr<rtklib_solver> position_ = position; |     std::shared_ptr<rtklib_solver> position_ = position; | ||||||
|  |  | ||||||
|  |     double speed_over_ground = position_->get_speed_over_ground();    // expressed in m/s | ||||||
|  |     double course_over_ground = position_->get_course_over_ground();  // expressed in deg | ||||||
|  |  | ||||||
|     double hdop = position_->get_hdop(); |     double hdop = position_->get_hdop(); | ||||||
|     double vdop = position_->get_vdop(); |     double vdop = position_->get_vdop(); | ||||||
|     double pdop = position_->get_pdop(); |     double pdop = position_->get_pdop(); | ||||||
| @@ -187,9 +192,13 @@ bool Gpx_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, | |||||||
|  |  | ||||||
|     if (gpx_file.is_open()) |     if (gpx_file.is_open()) | ||||||
|         { |         { | ||||||
|             gpx_file << indent << indent << "<trkpt lon=\"" << longitude << "\" lat=\"" << latitude << "\"><ele>" << height << "</ele>" |             gpx_file << indent << indent << indent << "<trkpt lon=\"" << longitude << "\" lat=\"" << latitude << "\"><ele>" << height << "</ele>" | ||||||
|                      << "<time>" << utc_time << "</time>" |                      << "<time>" << utc_time << "</time>" | ||||||
|                      << "<hdop>" << hdop << "</hdop><vdop>" << vdop << "</vdop><pdop>" << pdop << "</pdop></trkpt>" << std::endl; |                      << "<hdop>" << hdop << "</hdop><vdop>" << vdop << "</vdop><pdop>" << pdop << "</pdop>" | ||||||
|  |                      << "<extensions><gpxtpx:TrackPointExtension>" | ||||||
|  |                      << "<gpxtpx:speed>" << speed_over_ground << "</gpxtpx:speed>" | ||||||
|  |                      << "<gpxtpx:course>" << course_over_ground << "</gpxtpx:course>" | ||||||
|  |                      << "</gpxtpx:TrackPointExtension></extensions></trkpt>" << std::endl; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
| @@ -203,8 +212,8 @@ bool Gpx_Printer::close_file() | |||||||
| { | { | ||||||
|     if (gpx_file.is_open()) |     if (gpx_file.is_open()) | ||||||
|         { |         { | ||||||
|             gpx_file << indent << "</trkseg>" << std::endl |             gpx_file << indent << indent << "</trkseg>" << std::endl | ||||||
|                      << "</trk>" << std::endl |                      << indent << "</trk>" << std::endl | ||||||
|                      << "</gpx>"; |                      << "</gpx>"; | ||||||
|             gpx_file.close(); |             gpx_file.close(); | ||||||
|             return true; |             return true; | ||||||
|   | |||||||
| @@ -150,8 +150,6 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do | |||||||
|                                 // 4- fill the observations vector with the corrected observables |                                 // 4- fill the observations vector with the corrected observables | ||||||
|                                 obs.resize(valid_obs + 1, 1); |                                 obs.resize(valid_obs + 1, 1); | ||||||
|                                 obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; |                                 obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; | ||||||
|                                 this->set_visible_satellites_ID(valid_obs, galileo_ephemeris_iter->second.i_satellite_PRN); |  | ||||||
|                                 this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); |  | ||||||
|  |  | ||||||
|                                 Galileo_week_number = galileo_ephemeris_iter->second.WN_5;  //for GST |                                 Galileo_week_number = galileo_ephemeris_iter->second.WN_5;  //for GST | ||||||
|                                 GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); |                                 GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); | ||||||
| @@ -213,8 +211,6 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do | |||||||
|                                         double Code_bias_m = P1_P2 / (1.0 - Gamma); |                                         double Code_bias_m = P1_P2 / (1.0 - Gamma); | ||||||
|                                         obs.resize(valid_obs + 1, 1); |                                         obs.resize(valid_obs + 1, 1); | ||||||
|                                         obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s; |                                         obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s; | ||||||
|                                         this->set_visible_satellites_ID(valid_obs, gps_ephemeris_iter->second.i_satellite_PRN); |  | ||||||
|                                         this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); |  | ||||||
|  |  | ||||||
|                                         // SV ECEF DEBUG OUTPUT |                                         // SV ECEF DEBUG OUTPUT | ||||||
|                                         LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN |                                         LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN | ||||||
| @@ -265,8 +261,6 @@ bool hybrid_ls_pvt::get_PVT(std::map<int, Gnss_Synchro> gnss_observables_map, do | |||||||
|                                         // 4- fill the observations vector with the corrected observables |                                         // 4- fill the observations vector with the corrected observables | ||||||
|                                         obs.resize(valid_obs + 1, 1); |                                         obs.resize(valid_obs + 1, 1); | ||||||
|                                         obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; |                                         obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; | ||||||
|                                         this->set_visible_satellites_ID(valid_obs, gps_cnav_ephemeris_iter->second.i_satellite_PRN); |  | ||||||
|                                         this->set_visible_satellites_CN0_dB(valid_obs, gnss_observables_iter->second.CN0_dB_hz); |  | ||||||
|  |  | ||||||
|                                         GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; |                                         GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; | ||||||
|                                         GPS_week = GPS_week % 1024;  //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) |                                         GPS_week = GPS_week % 1024;  //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ | |||||||
|  * \file kml_printer.cc |  * \file kml_printer.cc | ||||||
|  * \brief Implementation of a class that prints PVT information to a kml file |  * \brief Implementation of a class that prints PVT information to a kml file | ||||||
|  * \author Javier Arribas, 2011. jarribas(at)cttc.es |  * \author Javier Arribas, 2011. jarribas(at)cttc.es | ||||||
|  |  *         Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com | ||||||
|  * |  * | ||||||
|  * |  * | ||||||
|  * ------------------------------------------------------------------------- |  * ------------------------------------------------------------------------- | ||||||
| @@ -43,6 +44,7 @@ using google::LogMessage; | |||||||
| Kml_Printer::Kml_Printer(const std::string& base_path) | Kml_Printer::Kml_Printer(const std::string& base_path) | ||||||
| { | { | ||||||
|     positions_printed = false; |     positions_printed = false; | ||||||
|  |     indent = "  "; | ||||||
|     kml_base_path = base_path; |     kml_base_path = base_path; | ||||||
|     boost::filesystem::path full_path(boost::filesystem::current_path()); |     boost::filesystem::path full_path(boost::filesystem::current_path()); | ||||||
|     const boost::filesystem::path p(kml_base_path); |     const boost::filesystem::path p(kml_base_path); | ||||||
| @@ -74,6 +76,14 @@ Kml_Printer::Kml_Printer(const std::string& base_path) | |||||||
|         } |         } | ||||||
|  |  | ||||||
|     kml_base_path = kml_base_path + boost::filesystem::path::preferred_separator; |     kml_base_path = kml_base_path + boost::filesystem::path::preferred_separator; | ||||||
|  |  | ||||||
|  |     boost::filesystem::path tmp_base_path = boost::filesystem::temp_directory_path(); | ||||||
|  |     boost::filesystem::path tmp_filename = boost::filesystem::unique_path(); | ||||||
|  |     boost::filesystem::path tmp_file = tmp_base_path / tmp_filename; | ||||||
|  |  | ||||||
|  |     tmp_file_str = tmp_file.string(); | ||||||
|  |  | ||||||
|  |     point_id = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -127,36 +137,73 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
|     kml_filename = kml_base_path + kml_filename; |     kml_filename = kml_base_path + kml_filename; | ||||||
|     kml_file.open(kml_filename.c_str()); |     kml_file.open(kml_filename.c_str()); | ||||||
|  |  | ||||||
|     if (kml_file.is_open()) |     tmp_file.open(tmp_file_str.c_str()); | ||||||
|  |  | ||||||
|  |     if (kml_file.is_open() && tmp_file.is_open()) | ||||||
|         { |         { | ||||||
|             DLOG(INFO) << "KML printer writing on " << filename.c_str(); |             DLOG(INFO) << "KML printer writing on " << filename.c_str(); | ||||||
|             // Set iostream numeric format and precision |             // Set iostream numeric format and precision | ||||||
|             kml_file.setf(kml_file.fixed, kml_file.floatfield); |             kml_file.setf(kml_file.fixed, kml_file.floatfield); | ||||||
|             kml_file << std::setprecision(14); |             kml_file << std::setprecision(14); | ||||||
|  |  | ||||||
|  |             tmp_file.setf(tmp_file.fixed, tmp_file.floatfield); | ||||||
|  |             tmp_file << std::setprecision(14); | ||||||
|  |  | ||||||
|             kml_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl |             kml_file << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl | ||||||
|                      << "<kml xmlns=\"http://www.opengis.net/kml/2.2\">" << std::endl |                      << "<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\">" << std::endl | ||||||
|                      << "    <Document>" << std::endl |                      << indent << "<Document>" << std::endl | ||||||
|                      << "    <name>GNSS Track</name>" << std::endl |                      << indent << indent << "<name>GNSS Track</name>" << std::endl | ||||||
|                      << "    <description>GNSS-SDR Receiver position log file created at " << pt |                      << indent << indent << "<description><![CDATA[" << std::endl | ||||||
|                      << "    </description>" << std::endl |                      << indent << indent << indent << "<table>" << std::endl | ||||||
|                      << "<Style id=\"yellowLineGreenPoly\">" << std::endl |                      << indent << indent << indent << indent << "<tr><td>GNSS-SDR Receiver position log file created at " << pt << "</td></tr>" << std::endl | ||||||
|                      << " <LineStyle>" << std::endl |                      << indent << indent << indent << indent << "<tr><td>https://gnss-sdr.org/</td></tr>" << std::endl | ||||||
|                      << "     <color>7f00ffff</color>" << std::endl |                      << indent << indent << indent << "</table>" << std::endl | ||||||
|                      << "        <width>1</width>" << std::endl |                      << indent << indent << "]]></description>" << std::endl | ||||||
|                      << "    </LineStyle>" << std::endl |                      << indent << indent << "<!-- Normal track style -->" << std::endl | ||||||
|                      << "<PolyStyle>" << std::endl |                      << indent << indent << "<Style id=\"track_n\">" << std::endl | ||||||
|                      << "    <color>7f00ff00</color>" << std::endl |                      << indent << indent << indent << "<IconStyle>" << std::endl | ||||||
|                      << "</PolyStyle>" << std::endl |                      << indent << indent << indent << indent << "<color>ff00ffff</color>" << std::endl | ||||||
|                      << "</Style>" << std::endl |                      << indent << indent << indent << indent << "<scale>0.3</scale>" << std::endl | ||||||
|                      << "<Placemark>" << std::endl |                      << indent << indent << indent << indent << "<Icon>" << std::endl | ||||||
|                      << "<name>GNSS-SDR PVT</name>" << std::endl |                      << indent << indent << indent << indent << indent << "<href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</href>" << std::endl | ||||||
|                      << "<description>GNSS-SDR position log</description>" << std::endl |                      << indent << indent << indent << indent << "</Icon>" << std::endl | ||||||
|                      << "<styleUrl>#yellowLineGreenPoly</styleUrl>" << std::endl |                      << indent << indent << indent << "</IconStyle>" << std::endl | ||||||
|                      << "<LineString>" << std::endl |                      << indent << indent << indent << "<LabelStyle>" << std::endl | ||||||
|                      << "<extrude>0</extrude>" << std::endl |                      << indent << indent << indent << indent << "<scale>0</scale>" << std::endl | ||||||
|                      << "<tessellate>1</tessellate>" << std::endl |                      << indent << indent << indent << "</LabelStyle>" << std::endl | ||||||
|                      << "<altitudeMode>absolute</altitudeMode>" << std::endl |                      << indent << indent << "</Style>" << std::endl | ||||||
|                      << "<coordinates>" << std::endl; |                      << indent << indent << "<!-- Highlighted track style -->" << std::endl | ||||||
|  |                      << indent << indent << "<Style id=\"track_h\">" << std::endl | ||||||
|  |                      << indent << indent << indent << "<IconStyle>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<color>ff00ffff</color>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<scale>1</scale>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<Icon>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << "<href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</href>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "</Icon>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</IconStyle>" << std::endl | ||||||
|  |                      << indent << indent << "</Style>" << std::endl | ||||||
|  |                      << indent << indent << "<StyleMap id=\"track\">" << std::endl | ||||||
|  |                      << indent << indent << indent << "<Pair>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<key>normal</key>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<styleUrl>#track_n</styleUrl>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</Pair>" << std::endl | ||||||
|  |                      << indent << indent << indent << "<Pair>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<key>highlight</key>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<styleUrl>#track_h</styleUrl>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</Pair>" << std::endl | ||||||
|  |                      << indent << indent << "</StyleMap>" << std::endl | ||||||
|  |                      << indent << indent << "<Style id=\"yellowLineGreenPoly\">" << std::endl | ||||||
|  |                      << indent << indent << indent << "<LineStyle>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<color>7f00ffff</color>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<width>1</width>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</LineStyle>" << std::endl | ||||||
|  |                      << indent << indent << indent << "<PolyStyle>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<color>7f00ff00</color>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</PolyStyle>" << std::endl | ||||||
|  |                      << indent << indent << "</Style>" << std::endl | ||||||
|  |                      << indent << indent << "<Folder>" << std::endl | ||||||
|  |                      << indent << indent << indent << "<name>Points</name>" << std::endl; | ||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
| @@ -167,7 +214,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name) | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values) | bool Kml_Printer::print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values) | ||||||
| { | { | ||||||
|     double latitude; |     double latitude; | ||||||
|     double longitude; |     double longitude; | ||||||
| @@ -175,7 +222,18 @@ bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, | |||||||
|  |  | ||||||
|     positions_printed = true; |     positions_printed = true; | ||||||
|  |  | ||||||
|     std::shared_ptr<Pvt_Solution> position_ = position; |     std::shared_ptr<rtklib_solver> position_ = position; | ||||||
|  |  | ||||||
|  |     double speed_over_ground = position_->get_speed_over_ground();    // expressed in m/s | ||||||
|  |     double course_over_ground = position_->get_course_over_ground();  // expressed in deg | ||||||
|  |  | ||||||
|  |     double hdop = position_->get_hdop(); | ||||||
|  |     double vdop = position_->get_vdop(); | ||||||
|  |     double pdop = position_->get_pdop(); | ||||||
|  |     std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); | ||||||
|  |     if (utc_time.length() < 23) utc_time += "."; | ||||||
|  |     utc_time.resize(23, '0');  // time up to ms | ||||||
|  |     utc_time.append("Z");      // UTC time zone | ||||||
|  |  | ||||||
|     if (print_average_values == false) |     if (print_average_values == false) | ||||||
|         { |         { | ||||||
| @@ -190,9 +248,38 @@ bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, | |||||||
|             height = position_->get_avg_height(); |             height = position_->get_avg_height(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     if (kml_file.is_open()) |     if (kml_file.is_open() && tmp_file.is_open()) | ||||||
|         { |         { | ||||||
|             kml_file << longitude << "," << latitude << "," << height << std::endl; |             point_id++; | ||||||
|  |             kml_file << indent << indent << indent << "<Placemark>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<name>" << point_id << "</name>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<snippet/>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<description><![CDATA[" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << "<table>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>Time:</td><td>" << utc_time << "</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>Longitude:</td><td>" << longitude << "</td><td>deg</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>Latitude:</td><td>" << latitude << "</td><td>deg</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>Altitude:</td><td>" << height << "</td><td>m</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>Speed:</td><td>" << speed_over_ground << "</td><td>m/s</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>Course:</td><td>" << course_over_ground << "</td><td>deg</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>HDOP:</td><td>" << hdop << "</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>VDOP:</td><td>" << vdop << "</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << indent << "<tr><td>PDOP:</td><td>" << pdop << "</td></tr>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << "</table>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "]]></description>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<TimeStamp>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << "<when>" << utc_time << "</when>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "</TimeStamp>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<styleUrl>#track</styleUrl>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<Point>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << "<altitudeMode>absolute</altitudeMode>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << indent << "<coordinates>" << longitude << "," << latitude << "," << height << "</coordinates>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "</Point>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</Placemark>" << std::endl; | ||||||
|  |  | ||||||
|  |             tmp_file << indent << indent << indent << indent << indent | ||||||
|  |                      << longitude << "," << latitude << "," << height << std::endl; | ||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
| @@ -204,14 +291,32 @@ bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, | |||||||
|  |  | ||||||
| bool Kml_Printer::close_file() | bool Kml_Printer::close_file() | ||||||
| { | { | ||||||
|     if (kml_file.is_open()) |     if (kml_file.is_open() && tmp_file.is_open()) | ||||||
|         { |         { | ||||||
|             kml_file << "</coordinates>" << std::endl |             tmp_file.close(); | ||||||
|                      << "</LineString>" << std::endl |  | ||||||
|                      << "</Placemark>" << std::endl |             kml_file << indent << indent << "</Folder>" | ||||||
|                      << "</Document>" << std::endl |                      << indent << indent << "<Placemark>" << std::endl | ||||||
|  |                      << indent << indent << indent << "<name>Path</name>" << std::endl | ||||||
|  |                      << indent << indent << indent << "<styleUrl>#yellowLineGreenPoly</styleUrl>" << std::endl | ||||||
|  |                      << indent << indent << indent << "<LineString>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<extrude>0</extrude>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<tessellate>1</tessellate>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<altitudeMode>absolute</altitudeMode>" << std::endl | ||||||
|  |                      << indent << indent << indent << indent << "<coordinates>" << std::endl; | ||||||
|  |  | ||||||
|  |             // Copy the contents of tmp_file into kml_file | ||||||
|  |             std::ifstream src(tmp_file_str, std::ios::binary); | ||||||
|  |             kml_file << src.rdbuf(); | ||||||
|  |  | ||||||
|  |             kml_file << indent << indent << indent << indent << "</coordinates>" << std::endl | ||||||
|  |                      << indent << indent << indent << "</LineString>" << std::endl | ||||||
|  |                      << indent << indent << "</Placemark>" << std::endl | ||||||
|  |                      << indent << "</Document>" << std::endl | ||||||
|                      << "</kml>"; |                      << "</kml>"; | ||||||
|  |  | ||||||
|             kml_file.close(); |             kml_file.close(); | ||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|  * \file kml_printer.h |  * \file kml_printer.h | ||||||
|  * \brief Interface of a class that prints PVT information to a kml file |  * \brief Interface of a class that prints PVT information to a kml file | ||||||
|  * \author Javier Arribas, 2011. jarribas(at)cttc.es |  * \author Javier Arribas, 2011. jarribas(at)cttc.es | ||||||
|  * |  *         Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com | ||||||
|  * |  * | ||||||
|  * ------------------------------------------------------------------------- |  * ------------------------------------------------------------------------- | ||||||
|  * |  * | ||||||
| @@ -34,6 +34,7 @@ | |||||||
| #define GNSS_SDR_KML_PRINTER_H_ | #define GNSS_SDR_KML_PRINTER_H_ | ||||||
|  |  | ||||||
| #include "pvt_solution.h" | #include "pvt_solution.h" | ||||||
|  | #include "rtklib_solver.h" | ||||||
| #include <fstream> | #include <fstream> | ||||||
| #include <memory> | #include <memory> | ||||||
| #include <string> | #include <string> | ||||||
| @@ -48,15 +49,19 @@ class Kml_Printer | |||||||
| { | { | ||||||
| private: | private: | ||||||
|     std::ofstream kml_file; |     std::ofstream kml_file; | ||||||
|  |     std::ofstream tmp_file; | ||||||
|     bool positions_printed; |     bool positions_printed; | ||||||
|     std::string kml_filename; |     std::string kml_filename; | ||||||
|     std::string kml_base_path; |     std::string kml_base_path; | ||||||
|  |     std::string tmp_file_str; | ||||||
|  |     unsigned int point_id; | ||||||
|  |     std::string indent; | ||||||
|  |  | ||||||
| public: | public: | ||||||
|     Kml_Printer(const std::string& base_path = std::string(".")); |     Kml_Printer(const std::string& base_path = std::string(".")); | ||||||
|     ~Kml_Printer(); |     ~Kml_Printer(); | ||||||
|     bool set_headers(std::string filename, bool time_tag_name = true); |     bool set_headers(std::string filename, bool time_tag_name = true); | ||||||
|     bool print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values); |     bool print_position(const std::shared_ptr<rtklib_solver>& position, bool print_average_values); | ||||||
|     bool close_file(); |     bool close_file(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -31,6 +31,7 @@ | |||||||
|  |  | ||||||
| #include "ls_pvt.h" | #include "ls_pvt.h" | ||||||
| #include "GPS_L1_CA.h" | #include "GPS_L1_CA.h" | ||||||
|  | #include "geofunctions.h" | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <exception> | #include <exception> | ||||||
| #include <stdexcept> | #include <stdexcept> | ||||||
| @@ -235,15 +236,12 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, | |||||||
|                             double* azim = 0; |                             double* azim = 0; | ||||||
|                             double* elev = 0; |                             double* elev = 0; | ||||||
|                             double* dist = 0; |                             double* dist = 0; | ||||||
|                             Ls_Pvt::topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); |                             topocent(azim, elev, dist, pos.subvec(0, 2), Rot_X - pos.subvec(0, 2)); | ||||||
|                             this->set_visible_satellites_Az(i, *azim); |  | ||||||
|                             this->set_visible_satellites_El(i, *elev); |  | ||||||
|                             this->set_visible_satellites_Distance(i, *dist); |  | ||||||
|  |  | ||||||
|                             if (traveltime < 0.1 && nmbOfSatellites > 3) |                             if (traveltime < 0.1 && nmbOfSatellites > 3) | ||||||
|                                 { |                                 { | ||||||
|                                     //--- Find receiver's height |                                     //--- Find receiver's height | ||||||
|                                     Ls_Pvt::togeod(&dphi, &dlambda, &h, 6378137.0, 298.257223563, pos(0), pos(1), pos(2)); |                                     togeod(&dphi, &dlambda, &h, 6378137.0, 298.257223563, pos(0), pos(1), pos(2)); | ||||||
|                                     // Add troposphere correction if the receiver is below the troposphere |                                     // Add troposphere correction if the receiver is below the troposphere | ||||||
|                                     if (h > 15000) |                                     if (h > 15000) | ||||||
|                                         { |                                         { | ||||||
| @@ -253,7 +251,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, | |||||||
|                                     else |                                     else | ||||||
|                                         { |                                         { | ||||||
|                                             //--- Find delay due to troposphere (in meters) |                                             //--- Find delay due to troposphere (in meters) | ||||||
|                                             Ls_Pvt::tropo(&trop, sin(this->get_visible_satellites_El(i) * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); |                                             Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); | ||||||
|                                             if (trop > 5.0) trop = 0.0;  //check for erratic values |                                             if (trop > 5.0) trop = 0.0;  //check for erratic values | ||||||
|                                         } |                                         } | ||||||
|                                 } |                                 } | ||||||
| @@ -280,9 +278,6 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, | |||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     //-- compute the Dilution Of Precision values |  | ||||||
|     //this->set_Q(arma::inv(arma::htrans(A) * A)); |  | ||||||
|  |  | ||||||
|     // check the consistency of the PVT solution |     // check the consistency of the PVT solution | ||||||
|     if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2) |     if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2) | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -34,6 +34,7 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "nmea_printer.h" | #include "nmea_printer.h" | ||||||
|  | #include "rtklib_solution.h" | ||||||
| #include <boost/date_time/posix_time/posix_time.hpp> | #include <boost/date_time/posix_time/posix_time.hpp> | ||||||
| #include <boost/filesystem/operations.hpp>   // for create_directories, exists | #include <boost/filesystem/operations.hpp>   // for create_directories, exists | ||||||
| #include <boost/filesystem/path.hpp>         // for path, operator<< | #include <boost/filesystem/path.hpp>         // for path, operator<< | ||||||
| @@ -376,99 +377,10 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_ | |||||||
| std::string Nmea_Printer::get_GPRMC() | std::string Nmea_Printer::get_GPRMC() | ||||||
| { | { | ||||||
|     // Sample -> $GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10 |     // Sample -> $GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10 | ||||||
|     bool valid_fix = d_PVT_data->is_valid_position(); |  | ||||||
|  |  | ||||||
|     // ToDo: Compute speed and course over ground |  | ||||||
|     double speed_over_ground_knots = 0; |  | ||||||
|     double course_over_ground_deg = 0; |  | ||||||
|  |  | ||||||
|     // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); |  | ||||||
|  |  | ||||||
|     std::stringstream sentence_str; |     std::stringstream sentence_str; | ||||||
|  |     unsigned char buff[1024] = {0}; | ||||||
|     // GPRMC (RMC-Recommended,Minimum Specific GNSS Data) |     outnmea_rmc(buff, &d_PVT_data->pvt_sol); | ||||||
|     std::string sentence_header; |     sentence_str << buff; | ||||||
|     sentence_header = "$GPRMC,"; |  | ||||||
|     sentence_str << sentence_header; |  | ||||||
|  |  | ||||||
|     // UTC Time: hhmmss.sss |  | ||||||
|     sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time()); |  | ||||||
|  |  | ||||||
|     // Status: A: data valid, V: data NOT valid |  | ||||||
|     if (valid_fix == true) |  | ||||||
|         { |  | ||||||
|             sentence_str << ",A"; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             sentence_str << ",V"; |  | ||||||
|         }; |  | ||||||
|  |  | ||||||
|     if (print_avg_pos == true) |  | ||||||
|         { |  | ||||||
|             // Latitude ddmm.mmmm,(N or S) |  | ||||||
|             sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude()); |  | ||||||
|             // longitude dddmm.mmmm,(E or W) |  | ||||||
|             sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude()); |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             // Latitude ddmm.mmmm,(N or S) |  | ||||||
|             sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude()); |  | ||||||
|             // longitude dddmm.mmmm,(E or W) |  | ||||||
|             sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude()); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // Speed over ground (knots) |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.setf(std::ios::fixed, std::ios::floatfield); |  | ||||||
|     sentence_str.precision(2); |  | ||||||
|     sentence_str << speed_over_ground_knots; |  | ||||||
|  |  | ||||||
|     // course over ground (degrees) |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.setf(std::ios::fixed, std::ios::floatfield); |  | ||||||
|     sentence_str.precision(2); |  | ||||||
|     sentence_str << course_over_ground_deg; |  | ||||||
|  |  | ||||||
|     // Date ddmmyy |  | ||||||
|     boost::gregorian::date sentence_date = d_PVT_data->get_position_UTC_time().date(); |  | ||||||
|     unsigned int year = sentence_date.year(); |  | ||||||
|     unsigned int day = sentence_date.day(); |  | ||||||
|     unsigned int month = sentence_date.month(); |  | ||||||
|  |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << day; |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << month; |  | ||||||
|  |  | ||||||
|     std::stringstream year_strs; |  | ||||||
|     year_strs << std::dec << year; |  | ||||||
|     sentence_str << std::dec << year_strs.str().substr(2); |  | ||||||
|  |  | ||||||
|     // Magnetic Variation (degrees) |  | ||||||
|     // ToDo: Implement magnetic compass |  | ||||||
|     sentence_str << ","; |  | ||||||
|  |  | ||||||
|     // Magnetic Variation (E or W) |  | ||||||
|     // ToDo: Implement magnetic compass |  | ||||||
|     sentence_str << ","; |  | ||||||
|  |  | ||||||
|     // Checksum |  | ||||||
|     char checksum; |  | ||||||
|     std::string tmpstr; |  | ||||||
|     tmpstr = sentence_str.str(); |  | ||||||
|     checksum = checkSum(tmpstr.substr(1)); |  | ||||||
|     sentence_str << "*"; |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << std::hex << static_cast<int>(checksum); |  | ||||||
|  |  | ||||||
|     // end NMEA sentence |  | ||||||
|     sentence_str << "\r\n"; |  | ||||||
|     return sentence_str.str(); |     return sentence_str.str(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -477,82 +389,10 @@ std::string Nmea_Printer::get_GPGSA() | |||||||
| { | { | ||||||
|     // $GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33 |     // $GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33 | ||||||
|     // GSA-GNSS DOP and Active Satellites |     // GSA-GNSS DOP and Active Satellites | ||||||
|     bool valid_fix = d_PVT_data->is_valid_position(); |  | ||||||
|     int n_sats_used = d_PVT_data->get_num_valid_observations(); |  | ||||||
|     double pdop = d_PVT_data->get_pdop(); |  | ||||||
|     double hdop = d_PVT_data->get_hdop(); |  | ||||||
|     double vdop = d_PVT_data->get_vdop(); |  | ||||||
|  |  | ||||||
|     std::stringstream sentence_str; |     std::stringstream sentence_str; | ||||||
|     std::string sentence_header; |     unsigned char buff[1024] = {0}; | ||||||
|     sentence_header = "$GPGSA,"; |     outnmea_gsa(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat); | ||||||
|     sentence_str << sentence_header; |     sentence_str << buff; | ||||||
|  |  | ||||||
|     // mode1: |  | ||||||
|     // (M) Manual-forced to operate in 2D or 3D mode |  | ||||||
|     // (A) Automatic-allowed to automatically switch 2D/3D |  | ||||||
|     std::string mode1 = "M"; |  | ||||||
|     sentence_str << mode1; |  | ||||||
|  |  | ||||||
|     // mode2: |  | ||||||
|     // 1 fix not available |  | ||||||
|     // 2 fix 2D |  | ||||||
|     // 3 fix 3D |  | ||||||
|     if (valid_fix == true) |  | ||||||
|         { |  | ||||||
|             sentence_str << ",3"; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             sentence_str << ",1"; |  | ||||||
|         }; |  | ||||||
|  |  | ||||||
|     // Used satellites |  | ||||||
|     for (int i = 0; i < 12; i++) |  | ||||||
|         { |  | ||||||
|             sentence_str << ","; |  | ||||||
|             if (i < n_sats_used) |  | ||||||
|                 { |  | ||||||
|                     sentence_str.width(2); |  | ||||||
|                     sentence_str.fill('0'); |  | ||||||
|                     sentence_str << d_PVT_data->get_visible_satellites_ID(i); |  | ||||||
|                 } |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // PDOP |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.setf(std::ios::fixed, std::ios::floatfield); |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.precision(1); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << pdop; |  | ||||||
|     // HDOP |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.setf(std::ios::fixed, std::ios::floatfield); |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.precision(1); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << hdop; |  | ||||||
|     // VDOP |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.setf(std::ios::fixed, std::ios::floatfield); |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.precision(1); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << vdop; |  | ||||||
|  |  | ||||||
|     // Checksum |  | ||||||
|     char checksum; |  | ||||||
|     std::string tmpstr; |  | ||||||
|     tmpstr = sentence_str.str(); |  | ||||||
|     checksum = checkSum(tmpstr.substr(1)); |  | ||||||
|     sentence_str << "*"; |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << std::hex << static_cast<int>(checksum); |  | ||||||
|  |  | ||||||
|     // end NMEA sentence |  | ||||||
|     sentence_str << "\r\n"; |  | ||||||
|     return sentence_str.str(); |     return sentence_str.str(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -560,199 +400,22 @@ std::string Nmea_Printer::get_GPGSA() | |||||||
| std::string Nmea_Printer::get_GPGSV() | std::string Nmea_Printer::get_GPGSV() | ||||||
| { | { | ||||||
|     // GSV-GNSS Satellites in View |     // GSV-GNSS Satellites in View | ||||||
|     // Notice that NMEA 2.1 only supports 12 channels |  | ||||||
|     int n_sats_used = d_PVT_data->get_num_valid_observations(); |  | ||||||
|     std::stringstream sentence_str; |  | ||||||
|     std::stringstream frame_str; |  | ||||||
|     std::string sentence_header; |  | ||||||
|     sentence_header = "$GPGSV,"; |  | ||||||
|     char checksum; |  | ||||||
|     std::string tmpstr; |  | ||||||
|  |  | ||||||
|     // 1st step: How many GPGSV frames we need? (up to 3) |  | ||||||
|     // Each frame contains up to 4 satellites |  | ||||||
|     int n_frames; |  | ||||||
|     n_frames = std::ceil((static_cast<double>(n_sats_used)) / 4.0); |  | ||||||
|  |  | ||||||
|     // generate the frames |  | ||||||
|     int current_satellite = 0; |  | ||||||
|     for (int i = 1; i < (n_frames + 1); i++) |  | ||||||
|         { |  | ||||||
|             frame_str.str(""); |  | ||||||
|             frame_str << sentence_header; |  | ||||||
|  |  | ||||||
|             // number of messages |  | ||||||
|             frame_str << n_frames; |  | ||||||
|  |  | ||||||
|             // message number |  | ||||||
|             frame_str << ","; |  | ||||||
|             frame_str << i; |  | ||||||
|  |  | ||||||
|             // total number of satellites in view |  | ||||||
|             frame_str << ","; |  | ||||||
|             frame_str.width(2); |  | ||||||
|             frame_str.fill('0'); |  | ||||||
|             frame_str << std::dec << n_sats_used; |  | ||||||
|  |  | ||||||
|             // satellites info |  | ||||||
|             for (int j = 0; j < 4; j++) |  | ||||||
|                 { |  | ||||||
|                     // write satellite info |  | ||||||
|                     frame_str << ","; |  | ||||||
|                     frame_str.width(2); |  | ||||||
|                     frame_str.fill('0'); |  | ||||||
|                     frame_str << std::dec << d_PVT_data->get_visible_satellites_ID(current_satellite); |  | ||||||
|  |  | ||||||
|                     frame_str << ","; |  | ||||||
|                     frame_str.width(2); |  | ||||||
|                     frame_str.fill('0'); |  | ||||||
|                     frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_El(current_satellite)); |  | ||||||
|  |  | ||||||
|                     frame_str << ","; |  | ||||||
|                     frame_str.width(3); |  | ||||||
|                     frame_str.fill('0'); |  | ||||||
|                     frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_Az(current_satellite)); |  | ||||||
|  |  | ||||||
|                     frame_str << ","; |  | ||||||
|                     frame_str.width(2); |  | ||||||
|                     frame_str.fill('0'); |  | ||||||
|                     frame_str << std::dec << static_cast<int>(d_PVT_data->get_visible_satellites_CN0_dB(current_satellite)); |  | ||||||
|  |  | ||||||
|                     current_satellite++; |  | ||||||
|  |  | ||||||
|                     if (current_satellite == n_sats_used) |  | ||||||
|                         { |  | ||||||
|                             break; |  | ||||||
|                         } |  | ||||||
|                 } |  | ||||||
|  |  | ||||||
|             // frame checksum |  | ||||||
|             tmpstr = frame_str.str(); |  | ||||||
|             checksum = checkSum(tmpstr.substr(1)); |  | ||||||
|             frame_str << "*"; |  | ||||||
|             frame_str.width(2); |  | ||||||
|             frame_str.fill('0'); |  | ||||||
|             frame_str << std::hex << static_cast<int>(checksum); |  | ||||||
|  |  | ||||||
|             // end NMEA sentence |  | ||||||
|             frame_str << "\r\n"; |  | ||||||
|  |  | ||||||
|             //add frame to sentence |  | ||||||
|             sentence_str << frame_str.str(); |  | ||||||
|         } |  | ||||||
|     return sentence_str.str(); |  | ||||||
|     // $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71 |     // $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71 | ||||||
|  |     // Notice that NMEA 2.1 only supports 12 channels | ||||||
|  |     std::stringstream sentence_str; | ||||||
|  |     unsigned char buff[1024] = {0}; | ||||||
|  |     outnmea_gsv(buff, &d_PVT_data->pvt_sol, d_PVT_data->pvt_ssat); | ||||||
|  |     sentence_str << buff; | ||||||
|  |     return sentence_str.str(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| std::string Nmea_Printer::get_GPGGA() | std::string Nmea_Printer::get_GPGGA() | ||||||
| { | { | ||||||
|     // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time(); |  | ||||||
|     bool valid_fix = d_PVT_data->is_valid_position(); |  | ||||||
|     int n_channels = d_PVT_data->get_num_valid_observations();  //d_nchannels |  | ||||||
|     double hdop = d_PVT_data->get_hdop(); |  | ||||||
|     double MSL_altitude; |  | ||||||
|  |  | ||||||
|     if (d_PVT_data->is_averaging() == true) |  | ||||||
|         { |  | ||||||
|             MSL_altitude = d_PVT_data->get_avg_height(); |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             MSL_altitude = d_PVT_data->get_height(); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     std::stringstream sentence_str; |     std::stringstream sentence_str; | ||||||
|  |     unsigned char buff[1024] = {0}; | ||||||
|     // GPGGA (Global Positioning System Fixed Data) |     outnmea_gga(buff, &d_PVT_data->pvt_sol); | ||||||
|     std::string sentence_header; |     sentence_str << buff; | ||||||
|     sentence_header = "$GPGGA,"; |  | ||||||
|     sentence_str << sentence_header; |  | ||||||
|  |  | ||||||
|     // UTC Time: hhmmss.sss |  | ||||||
|     sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time()); |  | ||||||
|  |  | ||||||
|     if (d_PVT_data->is_averaging() == true) |  | ||||||
|         { |  | ||||||
|             // Latitude ddmm.mmmm,(N or S) |  | ||||||
|             sentence_str << "," << latitude_to_hm(d_PVT_data->get_avg_latitude()); |  | ||||||
|             // longitude dddmm.mmmm,(E or W) |  | ||||||
|             sentence_str << "," << longitude_to_hm(d_PVT_data->get_avg_longitude()); |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             // Latitude ddmm.mmmm,(N or S) |  | ||||||
|             sentence_str << "," << latitude_to_hm(d_PVT_data->get_latitude()); |  | ||||||
|             // longitude dddmm.mmmm,(E or W) |  | ||||||
|             sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude()); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // Position fix indicator |  | ||||||
|     // 0 - Fix not available or invalid |  | ||||||
|     // 1 - GPS SPS Mode, fix valid |  | ||||||
|     // 2 - Differential GPS, SPS Mode, fix valid |  | ||||||
|     // 3-5 - Not supported |  | ||||||
|     // 6 - Dead Reckoning Mode, fix valid |  | ||||||
|     // ToDo: Update PVT module to identify the fix mode |  | ||||||
|  |  | ||||||
|     if (valid_fix == true) |  | ||||||
|         { |  | ||||||
|             sentence_str << ",1"; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             sentence_str << ",0"; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // Number of satellites used in PVT |  | ||||||
|     sentence_str << ","; |  | ||||||
|     if (n_channels < 10) |  | ||||||
|         { |  | ||||||
|             sentence_str << '0' << n_channels; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             sentence_str << n_channels; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // HDOP |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.setf(std::ios::fixed, std::ios::floatfield); |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.precision(1); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << hdop; |  | ||||||
|  |  | ||||||
|     // MSL Altitude |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str.precision(1); |  | ||||||
|     sentence_str << MSL_altitude; |  | ||||||
|     sentence_str << ",M"; |  | ||||||
|  |  | ||||||
|     // Geoid-to-ellipsoid separation. Ellipsoid altitude = MSL Altitude + Geoid Separation. |  | ||||||
|     // ToDo: Compute this value |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str << "0.0"; |  | ||||||
|     sentence_str << ",M"; |  | ||||||
|  |  | ||||||
|     // Age of Diff. Corr.  (Seconds) Null fields when DGPS is not used |  | ||||||
|     // Diff. Ref. Station ID (0000) |  | ||||||
|     // ToDo: Implement this fields for Differential GPS |  | ||||||
|     sentence_str << ","; |  | ||||||
|     sentence_str << "0.0,0000"; |  | ||||||
|  |  | ||||||
|     // Checksum |  | ||||||
|     char checksum; |  | ||||||
|     std::string tmpstr; |  | ||||||
|     tmpstr = sentence_str.str(); |  | ||||||
|     checksum = checkSum(tmpstr.substr(1)); |  | ||||||
|     sentence_str << "*"; |  | ||||||
|     sentence_str.width(2); |  | ||||||
|     sentence_str.fill('0'); |  | ||||||
|     sentence_str << std::hex << static_cast<int>(checksum); |  | ||||||
|  |  | ||||||
|     // end NMEA sentence |  | ||||||
|     sentence_str << "\r\n"; |  | ||||||
|     return sentence_str.str(); |     return sentence_str.str(); | ||||||
|     // $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A |     // $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A | ||||||
| } | } | ||||||
|   | |||||||
| @@ -31,6 +31,7 @@ | |||||||
|  |  | ||||||
| #include "pvt_solution.h" | #include "pvt_solution.h" | ||||||
| #include "GPS_L1_CA.h" | #include "GPS_L1_CA.h" | ||||||
|  | #include "geofunctions.h" | ||||||
| #include <glog/logging.h> | #include <glog/logging.h> | ||||||
| #include <exception> | #include <exception> | ||||||
|  |  | ||||||
| @@ -43,6 +44,8 @@ Pvt_Solution::Pvt_Solution() | |||||||
|     d_latitude_d = 0.0; |     d_latitude_d = 0.0; | ||||||
|     d_longitude_d = 0.0; |     d_longitude_d = 0.0; | ||||||
|     d_height_m = 0.0; |     d_height_m = 0.0; | ||||||
|  |     d_speed_over_ground_m_s = 0.0; | ||||||
|  |     d_course_over_ground_d = 0.0; | ||||||
|     d_avg_latitude_d = 0.0; |     d_avg_latitude_d = 0.0; | ||||||
|     d_avg_longitude_d = 0.0; |     d_avg_longitude_d = 0.0; | ||||||
|     d_avg_height_m = 0.0; |     d_avg_height_m = 0.0; | ||||||
| @@ -126,125 +129,7 @@ int Pvt_Solution::cart2geo(double X, double Y, double Z, int elipsoid_selection) | |||||||
|     d_latitude_d = phi * 180.0 / GPS_PI; |     d_latitude_d = phi * 180.0 / GPS_PI; | ||||||
|     d_longitude_d = lambda * 180.0 / GPS_PI; |     d_longitude_d = lambda * 180.0 / GPS_PI; | ||||||
|     d_height_m = h; |     d_height_m = h; | ||||||
|     return 0; |     //todo: refactor this class. Mix of duplicated functions, use either RTKLIB geodetic functions or geofunctions.h | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| int Pvt_Solution::togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z) |  | ||||||
| { |  | ||||||
|     /* Subroutine to calculate geodetic coordinates latitude, longitude, |  | ||||||
|        height given Cartesian coordinates X,Y,Z, and reference ellipsoid |  | ||||||
|        values semi-major axis (a) and the inverse of flattening (finv). |  | ||||||
|  |  | ||||||
|        The output units of angular quantities will be in decimal degrees |  | ||||||
|        (15.5 degrees not 15 deg 30 min). The output units of h will be the |  | ||||||
|        same as the units of X,Y,Z,a. |  | ||||||
|  |  | ||||||
|        Inputs: |  | ||||||
|                a           - semi-major axis of the reference ellipsoid |  | ||||||
|                finv        - inverse of flattening of the reference ellipsoid |  | ||||||
|                X,Y,Z       - Cartesian coordinates |  | ||||||
|  |  | ||||||
|        Outputs: |  | ||||||
|                dphi        - latitude |  | ||||||
|                dlambda     - longitude |  | ||||||
|                h           - height above reference ellipsoid |  | ||||||
|  |  | ||||||
|        Based in a Matlab function by Kai Borre |  | ||||||
|      */ |  | ||||||
|  |  | ||||||
|     *h = 0; |  | ||||||
|     double tolsq = 1.e-10;  // tolerance to accept convergence |  | ||||||
|     int maxit = 10;         // max number of iterations |  | ||||||
|     double rtd = 180.0 / GPS_PI; |  | ||||||
|  |  | ||||||
|     // compute square of eccentricity |  | ||||||
|     double esq; |  | ||||||
|     if (finv < 1.0E-20) |  | ||||||
|         { |  | ||||||
|             esq = 0.0; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             esq = (2.0 - 1.0 / finv) / finv; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // first guess |  | ||||||
|     double P = sqrt(X * X + Y * Y);  // P is distance from spin axis |  | ||||||
|  |  | ||||||
|     //direct calculation of longitude |  | ||||||
|     if (P > 1.0E-20) |  | ||||||
|         { |  | ||||||
|             *dlambda = atan2(Y, X) * rtd; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             *dlambda = 0.0; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     // correct longitude bound |  | ||||||
|     if (*dlambda < 0) |  | ||||||
|         { |  | ||||||
|             *dlambda = *dlambda + 360.0; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     double r = sqrt(P * P + Z * Z);  // r is distance from origin (0,0,0) |  | ||||||
|  |  | ||||||
|     double sinphi; |  | ||||||
|     if (r > 1.0E-20) |  | ||||||
|         { |  | ||||||
|             sinphi = Z / r; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             sinphi = 0.0; |  | ||||||
|         } |  | ||||||
|     *dphi = asin(sinphi); |  | ||||||
|  |  | ||||||
|     // initial value of height  =  distance from origin minus |  | ||||||
|     // approximate distance from origin to surface of ellipsoid |  | ||||||
|     if (r < 1.0E-20) |  | ||||||
|         { |  | ||||||
|             *h = 0; |  | ||||||
|             return 1; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     *h = r - a * (1 - sinphi * sinphi / finv); |  | ||||||
|  |  | ||||||
|     // iterate |  | ||||||
|     double cosphi; |  | ||||||
|     double N_phi; |  | ||||||
|     double dP; |  | ||||||
|     double dZ; |  | ||||||
|     double oneesq = 1.0 - esq; |  | ||||||
|  |  | ||||||
|     for (int i = 0; i < maxit; i++) |  | ||||||
|         { |  | ||||||
|             sinphi = sin(*dphi); |  | ||||||
|             cosphi = cos(*dphi); |  | ||||||
|  |  | ||||||
|             // compute radius of curvature in prime vertical direction |  | ||||||
|             N_phi = a / sqrt(1 - esq * sinphi * sinphi); |  | ||||||
|  |  | ||||||
|             //    compute residuals in P and Z |  | ||||||
|             dP = P - (N_phi + (*h)) * cosphi; |  | ||||||
|             dZ = Z - (N_phi * oneesq + (*h)) * sinphi; |  | ||||||
|  |  | ||||||
|             //    update height and latitude |  | ||||||
|             *h = *h + (sinphi * dZ + cosphi * dP); |  | ||||||
|             *dphi = *dphi + (cosphi * dZ - sinphi * dP) / (N_phi + (*h)); |  | ||||||
|  |  | ||||||
|             //     test for convergence |  | ||||||
|             if ((dP * dP + dZ * dZ) < tolsq) |  | ||||||
|                 { |  | ||||||
|                     break; |  | ||||||
|                 } |  | ||||||
|             if (i == (maxit - 1)) |  | ||||||
|                 { |  | ||||||
|                     LOG(WARNING) << "The computation of geodetic coordinates did not converge"; |  | ||||||
|                 } |  | ||||||
|         } |  | ||||||
|     *dphi = (*dphi) * rtd; |  | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -356,73 +241,6 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec &x, const arma::vec &dx) |  | ||||||
| { |  | ||||||
|     /*  Transformation of vector dx into topocentric coordinate |  | ||||||
|       system with origin at x |  | ||||||
|          Inputs: |  | ||||||
|             x           - vector origin coordinates (in ECEF system [X; Y; Z;]) |  | ||||||
|             dx          - vector ([dX; dY; dZ;]). |  | ||||||
|  |  | ||||||
|          Outputs: |  | ||||||
|             D           - vector length. Units like the input |  | ||||||
|             Az          - azimuth from north positive clockwise, degrees |  | ||||||
|             El          - elevation angle, degrees |  | ||||||
|  |  | ||||||
|             Based on a Matlab function by Kai Borre |  | ||||||
|      */ |  | ||||||
|  |  | ||||||
|     double lambda; |  | ||||||
|     double phi; |  | ||||||
|     double h; |  | ||||||
|     double dtr = GPS_PI / 180.0; |  | ||||||
|     double a = 6378137.0;         // semi-major axis of the reference ellipsoid WGS-84 |  | ||||||
|     double finv = 298.257223563;  // inverse of flattening of the reference ellipsoid WGS-84 |  | ||||||
|  |  | ||||||
|     // Transform x into geodetic coordinates |  | ||||||
|     Pvt_Solution::togeod(&phi, &lambda, &h, a, finv, x(0), x(1), x(2)); |  | ||||||
|  |  | ||||||
|     double cl = cos(lambda * dtr); |  | ||||||
|     double sl = sin(lambda * dtr); |  | ||||||
|     double cb = cos(phi * dtr); |  | ||||||
|     double sb = sin(phi * dtr); |  | ||||||
|  |  | ||||||
|     arma::mat F = {{-sl, -sb * cl, cb * cl}, |  | ||||||
|         {cl, -sb * sl, cb * sl}, |  | ||||||
|         {0, 0, cb, sb}}; |  | ||||||
|  |  | ||||||
|     arma::vec local_vector; |  | ||||||
|  |  | ||||||
|     local_vector = arma::htrans(F) * dx; |  | ||||||
|  |  | ||||||
|     double E = local_vector(0); |  | ||||||
|     double N = local_vector(1); |  | ||||||
|     double U = local_vector(2); |  | ||||||
|  |  | ||||||
|     double hor_dis; |  | ||||||
|     hor_dis = sqrt(E * E + N * N); |  | ||||||
|  |  | ||||||
|     if (hor_dis < 1.0E-20) |  | ||||||
|         { |  | ||||||
|             *Az = 0; |  | ||||||
|             *El = 90; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             *Az = atan2(E, N) / dtr; |  | ||||||
|             *El = atan2(U, hor_dis) / dtr; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     if (*Az < 0) |  | ||||||
|         { |  | ||||||
|             *Az = *Az + 360.0; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|     *D = sqrt(dx(0) * dx(0) + dx(1) * dx(1) + dx(2) * dx(2)); |  | ||||||
|     return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void Pvt_Solution::set_averaging_depth(int depth) | void Pvt_Solution::set_averaging_depth(int depth) | ||||||
| { | { | ||||||
|     d_averaging_depth = depth; |     d_averaging_depth = depth; | ||||||
| @@ -517,6 +335,30 @@ double Pvt_Solution::get_height() const | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | double Pvt_Solution::get_speed_over_ground() const | ||||||
|  | { | ||||||
|  |     return d_speed_over_ground_m_s; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void Pvt_Solution::set_speed_over_ground(double speed_m_s) | ||||||
|  | { | ||||||
|  |     d_speed_over_ground_m_s = speed_m_s; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void Pvt_Solution::set_course_over_ground(double cog_deg) | ||||||
|  | { | ||||||
|  |     d_course_over_ground_d = cog_deg; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | double Pvt_Solution::get_course_over_ground() const | ||||||
|  | { | ||||||
|  |     return d_course_over_ground_d; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| double Pvt_Solution::get_avg_latitude() const | double Pvt_Solution::get_avg_latitude() const | ||||||
| { | { | ||||||
|     return d_avg_latitude_d; |     return d_avg_latitude_d; | ||||||
| @@ -540,6 +382,7 @@ bool Pvt_Solution::is_averaging() const | |||||||
|     return d_flag_averaging; |     return d_flag_averaging; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Pvt_Solution::is_valid_position() const | bool Pvt_Solution::is_valid_position() const | ||||||
| { | { | ||||||
|     return b_valid_position; |     return b_valid_position; | ||||||
| @@ -589,172 +432,3 @@ void Pvt_Solution::set_num_valid_observations(int num) | |||||||
| { | { | ||||||
|     d_valid_observations = num; |     d_valid_observations = num; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Pvt_Solution::set_visible_satellites_ID(size_t index, unsigned int prn) |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Setting sat ID to channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             if (prn >= PVT_MAX_PRN) |  | ||||||
|                 { |  | ||||||
|                     LOG(WARNING) << "Setting to channel " << index << " a PRN of " << prn << " (the maximum is " << PVT_MAX_PRN << ")"; |  | ||||||
|                     return false; |  | ||||||
|                 } |  | ||||||
|             else |  | ||||||
|                 { |  | ||||||
|                     d_visible_satellites_IDs[index] = prn; |  | ||||||
|                     return true; |  | ||||||
|                 } |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| unsigned int Pvt_Solution::get_visible_satellites_ID(size_t index) const |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Getting sat ID for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return 0; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             return d_visible_satellites_IDs[index]; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Pvt_Solution::set_visible_satellites_El(size_t index, double el) |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Setting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             if (el > 90.0) |  | ||||||
|                 { |  | ||||||
|                     LOG(WARNING) << "Setting a sat elevation > 90 [degrees]. Saturating to 90"; |  | ||||||
|                     d_visible_satellites_El[index] = 90.0; |  | ||||||
|                 } |  | ||||||
|             else |  | ||||||
|                 { |  | ||||||
|                     if (el < -90.0) |  | ||||||
|                         { |  | ||||||
|                             LOG(WARNING) << "Setting a sat elevation < -90 [degrees]. Saturating to -90"; |  | ||||||
|                             d_visible_satellites_El[index] = -90.0; |  | ||||||
|                         } |  | ||||||
|                     else |  | ||||||
|                         { |  | ||||||
|                             d_visible_satellites_El[index] = el; |  | ||||||
|                         } |  | ||||||
|                 } |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| double Pvt_Solution::get_visible_satellites_El(size_t index) const |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Getting sat elevation for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return 0.0; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             return d_visible_satellites_El[index]; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Pvt_Solution::set_visible_satellites_Az(size_t index, double az) |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             d_visible_satellites_Az[index] = az; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| double Pvt_Solution::get_visible_satellites_Az(size_t index) const |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Getting sat azimuth for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return 0.0; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             return d_visible_satellites_Az[index]; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Pvt_Solution::set_visible_satellites_Distance(size_t index, double dist) |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Setting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             d_visible_satellites_Distance[index] = dist; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| double Pvt_Solution::get_visible_satellites_Distance(size_t index) const |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Getting sat distance for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return 0.0; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             return d_visible_satellites_Distance[index]; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| bool Pvt_Solution::set_visible_satellites_CN0_dB(size_t index, double cn0) |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Setting sat Cn0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             d_visible_satellites_CN0_dB[index] = cn0; |  | ||||||
|             return true; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| double Pvt_Solution::get_visible_satellites_CN0_dB(size_t index) const |  | ||||||
| { |  | ||||||
|     if (index >= PVT_MAX_CHANNELS) |  | ||||||
|         { |  | ||||||
|             LOG(WARNING) << "Getting received CN0 for channel " << index << " (the maximum is " << PVT_MAX_CHANNELS << ")"; |  | ||||||
|             return 0.0; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             return d_visible_satellites_CN0_dB[index]; |  | ||||||
|         } |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -52,6 +52,8 @@ private: | |||||||
|     double d_latitude_d;             // RX position Latitude WGS84 [deg] |     double d_latitude_d;             // RX position Latitude WGS84 [deg] | ||||||
|     double d_longitude_d;            // RX position Longitude WGS84 [deg] |     double d_longitude_d;            // RX position Longitude WGS84 [deg] | ||||||
|     double d_height_m;               // RX position height WGS84 [m] |     double d_height_m;               // RX position height WGS84 [m] | ||||||
|  |     double d_speed_over_ground_m_s;  // RX speed over ground [m/s] | ||||||
|  |     double d_course_over_ground_d;   // RX course over ground [deg] | ||||||
|  |  | ||||||
|     double d_avg_latitude_d;   // Averaged latitude in degrees |     double d_avg_latitude_d;   // Averaged latitude in degrees | ||||||
|     double d_avg_longitude_d;  // Averaged longitude in degrees |     double d_avg_longitude_d;  // Averaged longitude in degrees | ||||||
| @@ -70,12 +72,6 @@ private: | |||||||
|     boost::posix_time::ptime d_position_UTC_time; |     boost::posix_time::ptime d_position_UTC_time; | ||||||
|     int d_valid_observations; |     int d_valid_observations; | ||||||
|  |  | ||||||
|     int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {};          // Array with the IDs of the valid satellites |  | ||||||
|     double d_visible_satellites_El[PVT_MAX_CHANNELS] = {};        // Array with the LOS Elevation of the valid satellites |  | ||||||
|     double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {};        // Array with the LOS Azimuth of the valid satellites |  | ||||||
|     double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {};  // Array with the LOS Distance of the valid satellites |  | ||||||
|     double d_visible_satellites_CN0_dB[PVT_MAX_CHANNELS] = {};    // Array with the IDs of the valid satellites |  | ||||||
|  |  | ||||||
| public: | public: | ||||||
|     Pvt_Solution(); |     Pvt_Solution(); | ||||||
|  |  | ||||||
| @@ -86,6 +82,12 @@ public: | |||||||
|     double get_longitude() const;  //!< Get RX position Longitude WGS84 [deg] |     double get_longitude() const;  //!< Get RX position Longitude WGS84 [deg] | ||||||
|     double get_height() const;     //!< Get RX position height WGS84 [m] |     double get_height() const;     //!< Get RX position height WGS84 [m] | ||||||
|  |  | ||||||
|  |     double get_speed_over_ground() const;          //!< Get RX speed over ground [m/s] | ||||||
|  |     void set_speed_over_ground(double speed_m_s);  //!< Set RX speed over ground [m/s] | ||||||
|  |  | ||||||
|  |     double get_course_over_ground() const;        //!< Get RX course over ground [deg] | ||||||
|  |     void set_course_over_ground(double cog_deg);  //!< Set RX course over ground [deg] | ||||||
|  |  | ||||||
|     double get_avg_latitude() const;   //!< Get RX position averaged Latitude WGS84 [deg] |     double get_avg_latitude() const;   //!< Get RX position averaged Latitude WGS84 [deg] | ||||||
|     double get_avg_longitude() const;  //!< Get RX position averaged Longitude WGS84 [deg] |     double get_avg_longitude() const;  //!< Get RX position averaged Longitude WGS84 [deg] | ||||||
|     double get_avg_height() const;     //!< Get RX position averaged height WGS84 [m] |     double get_avg_height() const;     //!< Get RX position averaged height WGS84 [m] | ||||||
| @@ -102,21 +104,6 @@ public: | |||||||
|     int get_num_valid_observations() const;    //!< Get the number of valid pseudorange observations (valid satellites) |     int get_num_valid_observations() const;    //!< Get the number of valid pseudorange observations (valid satellites) | ||||||
|     void set_num_valid_observations(int num);  //!< Set the number of valid pseudorange observations (valid satellites) |     void set_num_valid_observations(int num);  //!< Set the number of valid pseudorange observations (valid satellites) | ||||||
|  |  | ||||||
|     bool set_visible_satellites_ID(size_t index, unsigned int prn);  //!< Set the ID of the visible satellite index channel |  | ||||||
|     unsigned int get_visible_satellites_ID(size_t index) const;      //!< Get the ID of the visible satellite index channel |  | ||||||
|  |  | ||||||
|     bool set_visible_satellites_El(size_t index, double el);  //!< Set the LOS Elevation, in degrees, of the visible satellite index channel |  | ||||||
|     double get_visible_satellites_El(size_t index) const;     //!< Get the LOS Elevation, in degrees, of the visible satellite index channel |  | ||||||
|  |  | ||||||
|     bool set_visible_satellites_Az(size_t index, double az);  //!< Set the LOS Azimuth, in degrees, of the visible satellite index channel |  | ||||||
|     double get_visible_satellites_Az(size_t index) const;     //!< Get the LOS Azimuth, in degrees, of the visible satellite index channel |  | ||||||
|  |  | ||||||
|     bool set_visible_satellites_Distance(size_t index, double dist);  //!< Set the LOS Distance of the visible satellite index channel |  | ||||||
|     double get_visible_satellites_Distance(size_t index) const;       //!< Get the LOS Distance of the visible satellite index channel |  | ||||||
|  |  | ||||||
|     bool set_visible_satellites_CN0_dB(size_t index, double cn0);  //!< Set the CN0 in dB of the visible satellite index channel |  | ||||||
|     double get_visible_satellites_CN0_dB(size_t index) const;      //!< Get the CN0 in dB of the visible satellite index channel |  | ||||||
|  |  | ||||||
|     //averaging |     //averaging | ||||||
|     void perform_pos_averaging(); |     void perform_pos_averaging(); | ||||||
|     void set_averaging_depth(int depth);  //!< Set length of averaging window |     void set_averaging_depth(int depth);  //!< Set length of averaging window | ||||||
| @@ -142,41 +129,6 @@ public: | |||||||
|       */ |       */ | ||||||
|     int cart2geo(double X, double Y, double Z, int elipsoid_selection); |     int cart2geo(double X, double Y, double Z, int elipsoid_selection); | ||||||
|  |  | ||||||
|     /*! |  | ||||||
|       * \brief Transformation of vector dx into topocentric coordinate system with origin at x |  | ||||||
|       * |  | ||||||
|       * \param[in] x    Vector origin coordinates (in ECEF system [X; Y; Z;]) |  | ||||||
|       * \param[in] dx   Vector ([dX; dY; dZ;]). |  | ||||||
|       * |  | ||||||
|       * \param[out] D   Vector length. Units like the input |  | ||||||
|       * \param[out] Az  Azimuth from north positive clockwise, degrees |  | ||||||
|       * \param[out] El  Elevation angle, degrees |  | ||||||
|       * |  | ||||||
|       * Based on a Matlab function by Kai Borre |  | ||||||
|       */ |  | ||||||
|     int topocent(double *Az, double *El, double *D, const arma::vec &x, const arma::vec &dx); |  | ||||||
|  |  | ||||||
|     /*! |  | ||||||
|       * \brief Subroutine to calculate geodetic coordinates latitude, longitude, |  | ||||||
|       * height given Cartesian coordinates X,Y,Z, and reference ellipsoid |  | ||||||
|       * values semi-major axis (a) and the inverse of flattening (finv). |  | ||||||
|       * |  | ||||||
|       *  The output units of angular quantities will be in decimal degrees |  | ||||||
|       *  (15.5 degrees not 15 deg 30 min). The output units of h will be the |  | ||||||
|       *  same as the units of X,Y,Z,a. |  | ||||||
|       * |  | ||||||
|       *  \param[in] a           - semi-major axis of the reference ellipsoid |  | ||||||
|       *  \param[in] finv        - inverse of flattening of the reference ellipsoid |  | ||||||
|       *  \param[in] X,Y,Z       - Cartesian coordinates |  | ||||||
|       * |  | ||||||
|       *  \param[out] dphi        - latitude |  | ||||||
|       *  \param[out] dlambda     - longitude |  | ||||||
|       *  \param[out] h           - height above reference ellipsoid |  | ||||||
|       * |  | ||||||
|       * Based in a Matlab function by Kai Borre |  | ||||||
|       */ |  | ||||||
|     int togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); |  | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|       * \brief Tropospheric correction |       * \brief Tropospheric correction | ||||||
|       * |       * | ||||||
|   | |||||||
| @@ -3296,8 +3296,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Glo | |||||||
|     std::string line; |     std::string line; | ||||||
|     std::map<int32_t, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter; |     std::map<int32_t, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter; | ||||||
|  |  | ||||||
|     for (glonass_gnav_ephemeris_iter = eph_map.begin(); |     for (glonass_gnav_ephemeris_iter = eph_map.cbegin(); | ||||||
|          glonass_gnav_ephemeris_iter != eph_map.end(); |          glonass_gnav_ephemeris_iter != eph_map.cend(); | ||||||
|          glonass_gnav_ephemeris_iter++) |          glonass_gnav_ephemeris_iter++) | ||||||
|         { |         { | ||||||
|             // -------- SV / EPOCH / SV CLK |             // -------- SV / EPOCH / SV CLK | ||||||
| @@ -7114,15 +7114,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri | |||||||
|             //Number of satellites observed in current epoch |             //Number of satellites observed in current epoch | ||||||
|             int32_t numSatellitesObserved = 0; |             int32_t numSatellitesObserved = 0; | ||||||
|             std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; |             std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; | ||||||
|             for (observables_iter = observables.begin(); |             for (observables_iter = observables.cbegin(); | ||||||
|                  observables_iter != observables.end(); |                  observables_iter != observables.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     numSatellitesObserved++; |                     numSatellitesObserved++; | ||||||
|                 } |                 } | ||||||
|             line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3); |             line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3); | ||||||
|             for (observables_iter = observables.begin(); |             for (observables_iter = observables.cbegin(); | ||||||
|                  observables_iter != observables.end(); |                  observables_iter != observables.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     line += satelliteSystem["GLONASS"]; |                     line += satelliteSystem["GLONASS"]; | ||||||
| @@ -7135,8 +7135,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri | |||||||
|             Rinex_Printer::lengthCheck(line); |             Rinex_Printer::lengthCheck(line); | ||||||
|             out << line << std::endl; |             out << line << std::endl; | ||||||
|  |  | ||||||
|             for (observables_iter = observables.begin(); |             for (observables_iter = observables.cbegin(); | ||||||
|                  observables_iter != observables.end(); |                  observables_iter != observables.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     std::string lineObs; |                     std::string lineObs; | ||||||
| @@ -7218,8 +7218,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri | |||||||
|             //Number of satellites observed in current epoch |             //Number of satellites observed in current epoch | ||||||
|             int32_t numSatellitesObserved = 0; |             int32_t numSatellitesObserved = 0; | ||||||
|             std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; |             std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; | ||||||
|             for (observables_iter = observables.begin(); |             for (observables_iter = observables.cbegin(); | ||||||
|                  observables_iter != observables.end(); |                  observables_iter != observables.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     numSatellitesObserved++; |                     numSatellitesObserved++; | ||||||
| @@ -7233,8 +7233,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri | |||||||
|             Rinex_Printer::lengthCheck(line); |             Rinex_Printer::lengthCheck(line); | ||||||
|             out << line << std::endl; |             out << line << std::endl; | ||||||
|  |  | ||||||
|             for (observables_iter = observables.begin(); |             for (observables_iter = observables.cbegin(); | ||||||
|                  observables_iter != observables.end(); |                  observables_iter != observables.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     std::string lineObs; |                     std::string lineObs; | ||||||
| @@ -7390,8 +7390,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|     std::map<int32_t, Gnss_Synchro> observablesR2C; |     std::map<int32_t, Gnss_Synchro> observablesR2C; | ||||||
|     std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; |     std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; | ||||||
|  |  | ||||||
|     for (observables_iter = observables.begin(); |     for (observables_iter = observables.cbegin(); | ||||||
|          observables_iter != observables.end(); |          observables_iter != observables.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             std::string system_(&observables_iter->second.System, 1); |             std::string system_(&observables_iter->second.System, 1); | ||||||
| @@ -7413,8 +7413,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|     std::multimap<uint32_t, Gnss_Synchro> total_glo_map; |     std::multimap<uint32_t, Gnss_Synchro> total_glo_map; | ||||||
|     std::set<uint32_t> available_glo_prns; |     std::set<uint32_t> available_glo_prns; | ||||||
|     std::set<uint32_t>::iterator it; |     std::set<uint32_t>::iterator it; | ||||||
|     for (observables_iter = observablesR1C.begin(); |     for (observables_iter = observablesR1C.cbegin(); | ||||||
|          observables_iter != observablesR1C.end(); |          observables_iter != observablesR1C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             uint32_t prn_ = observables_iter->second.PRN; |             uint32_t prn_ = observables_iter->second.PRN; | ||||||
| @@ -7426,8 +7426,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     for (observables_iter = observablesR2C.begin(); |     for (observables_iter = observablesR2C.cbegin(); | ||||||
|          observables_iter != observablesR2C.end(); |          observables_iter != observablesR2C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             uint32_t prn_ = observables_iter->second.PRN; |             uint32_t prn_ = observables_iter->second.PRN; | ||||||
| @@ -7446,8 +7446,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|     if (version == 2) |     if (version == 2) | ||||||
|         { |         { | ||||||
|             // Add list of GPS satellites |             // Add list of GPS satellites | ||||||
|             for (observables_iter = observablesG1C.begin(); |             for (observables_iter = observablesG1C.cbegin(); | ||||||
|                  observables_iter != observablesG1C.end(); |                  observables_iter != observablesG1C.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     line += satelliteSystem["GPS"]; |                     line += satelliteSystem["GPS"]; | ||||||
| @@ -7455,8 +7455,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|                     line += boost::lexical_cast<std::string>(static_cast<int32_t>(observables_iter->second.PRN)); |                     line += boost::lexical_cast<std::string>(static_cast<int32_t>(observables_iter->second.PRN)); | ||||||
|                 } |                 } | ||||||
|             // Add list of GLONASS L1 satellites |             // Add list of GLONASS L1 satellites | ||||||
|             for (observables_iter = observablesR1C.begin(); |             for (observables_iter = observablesR1C.cbegin(); | ||||||
|                  observables_iter != observablesR1C.end(); |                  observables_iter != observablesR1C.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     line += satelliteSystem["GLONASS"]; |                     line += satelliteSystem["GLONASS"]; | ||||||
| @@ -7464,8 +7464,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|                     line += boost::lexical_cast<std::string>(static_cast<int32_t>(observables_iter->second.PRN)); |                     line += boost::lexical_cast<std::string>(static_cast<int32_t>(observables_iter->second.PRN)); | ||||||
|                 } |                 } | ||||||
|             // Add list of GLONASS L2 satellites |             // Add list of GLONASS L2 satellites | ||||||
|             for (observables_iter = observablesR2C.begin(); |             for (observables_iter = observablesR2C.cbegin(); | ||||||
|                  observables_iter != observablesR2C.end(); |                  observables_iter != observablesR2C.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     line += satelliteSystem["GLONASS"]; |                     line += satelliteSystem["GLONASS"]; | ||||||
| @@ -7480,8 +7480,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep | |||||||
|     // -------- OBSERVATION record |     // -------- OBSERVATION record | ||||||
|     std::string s; |     std::string s; | ||||||
|     std::string lineObs; |     std::string lineObs; | ||||||
|     for (observables_iter = observablesG1C.begin(); |     for (observables_iter = observablesG1C.cbegin(); | ||||||
|          observables_iter != observablesG1C.end(); |          observables_iter != observablesG1C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             lineObs.clear(); |             lineObs.clear(); | ||||||
| @@ -7664,8 +7664,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g | |||||||
|     std::map<int32_t, Gnss_Synchro> observablesR2C; |     std::map<int32_t, Gnss_Synchro> observablesR2C; | ||||||
|     std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; |     std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; | ||||||
|  |  | ||||||
|     for (observables_iter = observables.begin(); |     for (observables_iter = observables.cbegin(); | ||||||
|          observables_iter != observables.end(); |          observables_iter != observables.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             std::string system_(&observables_iter->second.System, 1); |             std::string system_(&observables_iter->second.System, 1); | ||||||
| @@ -7687,8 +7687,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g | |||||||
|     std::multimap<uint32_t, Gnss_Synchro> total_glo_map; |     std::multimap<uint32_t, Gnss_Synchro> total_glo_map; | ||||||
|     std::set<uint32_t> available_glo_prns; |     std::set<uint32_t> available_glo_prns; | ||||||
|     std::set<uint32_t>::iterator it; |     std::set<uint32_t>::iterator it; | ||||||
|     for (observables_iter = observablesR1C.begin(); |     for (observables_iter = observablesR1C.cbegin(); | ||||||
|          observables_iter != observablesR1C.end(); |          observables_iter != observablesR1C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             uint32_t prn_ = observables_iter->second.PRN; |             uint32_t prn_ = observables_iter->second.PRN; | ||||||
| @@ -7700,8 +7700,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g | |||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     for (observables_iter = observablesR2C.begin(); |     for (observables_iter = observablesR2C.cbegin(); | ||||||
|          observables_iter != observablesR2C.end(); |          observables_iter != observablesR2C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             uint32_t prn_ = observables_iter->second.PRN; |             uint32_t prn_ = observables_iter->second.PRN; | ||||||
| @@ -7725,8 +7725,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g | |||||||
|     // -------- OBSERVATION record |     // -------- OBSERVATION record | ||||||
|     std::string s; |     std::string s; | ||||||
|     std::string lineObs; |     std::string lineObs; | ||||||
|     for (observables_iter = observablesG2S.begin(); |     for (observables_iter = observablesG2S.cbegin(); | ||||||
|          observables_iter != observablesG2S.end(); |          observables_iter != observablesG2S.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             lineObs.clear(); |             lineObs.clear(); | ||||||
| @@ -7904,8 +7904,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga | |||||||
|     std::map<int32_t, Gnss_Synchro> observablesR2C; |     std::map<int32_t, Gnss_Synchro> observablesR2C; | ||||||
|     std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; |     std::map<int32_t, Gnss_Synchro>::const_iterator observables_iter; | ||||||
|  |  | ||||||
|     for (observables_iter = observables.begin(); |     for (observables_iter = observables.cbegin(); | ||||||
|          observables_iter != observables.end(); |          observables_iter != observables.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             std::string system_(&observables_iter->second.System, 1); |             std::string system_(&observables_iter->second.System, 1); | ||||||
| @@ -7927,8 +7927,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga | |||||||
|     std::multimap<uint32_t, Gnss_Synchro> total_glo_map; |     std::multimap<uint32_t, Gnss_Synchro> total_glo_map; | ||||||
|     std::set<uint32_t> available_glo_prns; |     std::set<uint32_t> available_glo_prns; | ||||||
|     std::set<uint32_t>::iterator it; |     std::set<uint32_t>::iterator it; | ||||||
|     for (observables_iter = observablesR1C.begin(); |     for (observables_iter = observablesR1C.cbegin(); | ||||||
|          observables_iter != observablesR1C.end(); |          observables_iter != observablesR1C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             uint32_t prn_ = observables_iter->second.PRN; |             uint32_t prn_ = observables_iter->second.PRN; | ||||||
| @@ -7939,8 +7939,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga | |||||||
|                     available_glo_prns.insert(prn_); |                     available_glo_prns.insert(prn_); | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|     for (observables_iter = observablesR2C.begin(); |     for (observables_iter = observablesR2C.cbegin(); | ||||||
|          observables_iter != observablesR2C.end(); |          observables_iter != observablesR2C.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             uint32_t prn_ = observables_iter->second.PRN; |             uint32_t prn_ = observables_iter->second.PRN; | ||||||
| @@ -7966,8 +7966,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga | |||||||
|  |  | ||||||
|     std::string s; |     std::string s; | ||||||
|     std::string lineObs; |     std::string lineObs; | ||||||
|     for (observables_iter = observablesE1B.begin(); |     for (observables_iter = observablesE1B.cbegin(); | ||||||
|          observables_iter != observablesE1B.end(); |          observables_iter != observablesE1B.cend(); | ||||||
|          observables_iter++) |          observables_iter++) | ||||||
|         { |         { | ||||||
|             lineObs.clear(); |             lineObs.clear(); | ||||||
| @@ -8747,8 +8747,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep | |||||||
|     std::set<uint32_t>::iterator it; |     std::set<uint32_t>::iterator it; | ||||||
|     if (found_1B != std::string::npos) |     if (found_1B != std::string::npos) | ||||||
|         { |         { | ||||||
|             for (observables_iter = observablesE1B.begin(); |             for (observables_iter = observablesE1B.cbegin(); | ||||||
|                  observables_iter != observablesE1B.end(); |                  observables_iter != observablesE1B.cend(); | ||||||
|                  observables_iter++) |                  observables_iter++) | ||||||
|                 { |                 { | ||||||
|                     uint32_t prn_ = observables_iter->second.PRN; |                     uint32_t prn_ = observables_iter->second.PRN; | ||||||
|   | |||||||
| @@ -53,6 +53,7 @@ | |||||||
|  |  | ||||||
| #include "rtklib_solver.h" | #include "rtklib_solver.h" | ||||||
| #include "rtklib_conversions.h" | #include "rtklib_conversions.h" | ||||||
|  | #include "rtklib_solution.h" | ||||||
| #include "GPS_L1_CA.h" | #include "GPS_L1_CA.h" | ||||||
| #include "Galileo_E1.h" | #include "Galileo_E1.h" | ||||||
| #include "GLONASS_L1_L2_CA.h" | #include "GLONASS_L1_L2_CA.h" | ||||||
| @@ -74,7 +75,11 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag | |||||||
|     rtk_ = rtk; |     rtk_ = rtk; | ||||||
|     for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0; |     for (unsigned int i = 0; i < 4; i++) dop_[i] = 0.0; | ||||||
|     pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; |     pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; | ||||||
|  |     ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}}; | ||||||
|  |     for (unsigned int i = 0; i < MAXSAT; i++) | ||||||
|  |         { | ||||||
|  |             pvt_ssat[i] = ssat0; | ||||||
|  |         } | ||||||
|     // ############# ENABLE DATA FILE LOG ################# |     // ############# ENABLE DATA FILE LOG ################# | ||||||
|     if (d_flag_dump_enabled == true) |     if (d_flag_dump_enabled == true) | ||||||
|         { |         { | ||||||
| @@ -772,9 +777,9 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|  |  | ||||||
|             for (int i = 0; i < MAXSAT; i++) |             for (int i = 0; i < MAXSAT; i++) | ||||||
|                 { |                 { | ||||||
|                     nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1; /* L1/E1 */ |                     nav_data.lam[i][0] = SPEED_OF_LIGHT / FREQ1;  // L1/E1 | ||||||
|                     nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2; /* L2 */ |                     nav_data.lam[i][1] = SPEED_OF_LIGHT / FREQ2;  // L2 | ||||||
|                     nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5; /* L5/E5 */ |                     nav_data.lam[i][2] = SPEED_OF_LIGHT / FREQ5;  // L5/E5 | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|             result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data); |             result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data); | ||||||
| @@ -794,7 +799,11 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                     unsigned int used_sats = 0; |                     unsigned int used_sats = 0; | ||||||
|                     for (unsigned int i = 0; i < MAXSAT; i++) |                     for (unsigned int i = 0; i < MAXSAT; i++) | ||||||
|                         { |                         { | ||||||
|                             if (rtk_.ssat[i].vs == 1) used_sats++; |                             pvt_ssat[i] = rtk_.ssat[i]; | ||||||
|  |                             if (rtk_.ssat[i].vs == 1) | ||||||
|  |                                 { | ||||||
|  |                                     used_sats++; | ||||||
|  |                                 } | ||||||
|                         } |                         } | ||||||
|  |  | ||||||
|                     std::vector<double> azel; |                     std::vector<double> azel; | ||||||
| @@ -809,8 +818,8 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                                     index_aux++; |                                     index_aux++; | ||||||
|                                 } |                                 } | ||||||
|                         } |                         } | ||||||
|                     if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); |  | ||||||
|  |  | ||||||
|  |                     if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); | ||||||
|                     this->set_valid_position(true); |                     this->set_valid_position(true); | ||||||
|                     arma::vec rx_position_and_time(4); |                     arma::vec rx_position_and_time(4); | ||||||
|                     rx_position_and_time(0) = pvt_sol.rr[0];  // [m] |                     rx_position_and_time(0) = pvt_sol.rr[0];  // [m] | ||||||
| @@ -827,6 +836,22 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_ | |||||||
|                             rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s;  // the receiver clock offset is expressed in [meters], so we convert it into [s] |                             rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s;  // the receiver clock offset is expressed in [meters], so we convert it into [s] | ||||||
|                         } |                         } | ||||||
|                     this->set_rx_pos(rx_position_and_time.rows(0, 2));  // save ECEF position for the next iteration |                     this->set_rx_pos(rx_position_and_time.rows(0, 2));  // save ECEF position for the next iteration | ||||||
|  |  | ||||||
|  |                     //compute Ground speed and COG | ||||||
|  |                     double ground_speed_ms = 0.0; | ||||||
|  |                     double pos[3]; | ||||||
|  |                     double enuv[3]; | ||||||
|  |                     ecef2pos(pvt_sol.rr, pos); | ||||||
|  |                     ecef2enu(pos, &pvt_sol.rr[3], enuv); | ||||||
|  |                     this->set_speed_over_ground(norm_rtk(enuv, 2)); | ||||||
|  |                     double new_cog; | ||||||
|  |                     if (ground_speed_ms >= 1.0) | ||||||
|  |                         { | ||||||
|  |                             new_cog = atan2(enuv[0], enuv[1]) * R2D; | ||||||
|  |                             if (new_cog < 0.0) new_cog += 360.0; | ||||||
|  |                             this->set_course_over_ground(new_cog); | ||||||
|  |                         } | ||||||
|  |  | ||||||
|                     //observable fix: |                     //observable fix: | ||||||
|                     //double offset_s = this->get_time_offset_s(); |                     //double offset_s = this->get_time_offset_s(); | ||||||
|                     //this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s));  // accumulate the rx time error for the next iteration [meters]->[seconds] |                     //this->set_time_offset_s(offset_s + (rx_position_and_time(3) / GPS_C_m_s));  // accumulate the rx time error for the next iteration [meters]->[seconds] | ||||||
|   | |||||||
| @@ -86,6 +86,7 @@ private: | |||||||
|  |  | ||||||
| public: | public: | ||||||
|     sol_t pvt_sol; |     sol_t pvt_sol; | ||||||
|  |     ssat_t pvt_ssat[MAXSAT]; | ||||||
|     rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); |     rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, rtk_t& rtk); | ||||||
|     ~rtklib_solver(); |     ~rtklib_solver(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,4 +19,3 @@ | |||||||
| add_subdirectory(adapters) | add_subdirectory(adapters) | ||||||
| add_subdirectory(gnuradio_blocks) | add_subdirectory(gnuradio_blocks) | ||||||
| add_subdirectory(libs) | add_subdirectory(libs) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -55,25 +55,32 @@ set(ACQ_ADAPTER_HEADERS | |||||||
|     glonass_l2_ca_pcps_acquisition.h |     glonass_l2_ca_pcps_acquisition.h | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_FPGA) | if(ENABLE_FPGA) | ||||||
|     set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_acquisition_fpga.cc  |     set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} | ||||||
|  |         gps_l1_ca_pcps_acquisition_fpga.cc | ||||||
|         gps_l2_m_pcps_acquisition_fpga.cc |         gps_l2_m_pcps_acquisition_fpga.cc | ||||||
|         galileo_e1_pcps_ambiguous_acquisition_fpga.cc |         galileo_e1_pcps_ambiguous_acquisition_fpga.cc | ||||||
|         galileo_e5a_pcps_acquisition_fpga.cc |         galileo_e5a_pcps_acquisition_fpga.cc | ||||||
|                                                    gps_l5i_pcps_acquisition_fpga.cc) |         gps_l5i_pcps_acquisition_fpga.cc | ||||||
|  |     ) | ||||||
|     set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_acquisition_fpga.h  |     set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} | ||||||
|  |         gps_l1_ca_pcps_acquisition_fpga.h | ||||||
|         gps_l2_m_pcps_acquisition_fpga.h |         gps_l2_m_pcps_acquisition_fpga.h | ||||||
|         galileo_e1_pcps_ambiguous_acquisition_fpga.h |         galileo_e1_pcps_ambiguous_acquisition_fpga.h | ||||||
|         galileo_e5a_pcps_acquisition_fpga.h |         galileo_e5a_pcps_acquisition_fpga.h | ||||||
|                                                    gps_l5i_pcps_acquisition_fpga.h)                                                    |         gps_l5i_pcps_acquisition_fpga.h | ||||||
| endif(ENABLE_FPGA) |     ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| if(OPENCL_FOUND) | if(OPENCL_FOUND) | ||||||
|     set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_opencl_acquisition.cc) |     set(ACQ_ADAPTER_SOURCES | ||||||
|     set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} gps_l1_ca_pcps_opencl_acquisition.h) |         ${ACQ_ADAPTER_SOURCES} | ||||||
| endif(OPENCL_FOUND) |         gps_l1_ca_pcps_opencl_acquisition.cc | ||||||
|  |     ) | ||||||
|  |     set(ACQ_ADAPTER_HEADERS ${ACQ_ADAPTER_HEADERS} | ||||||
|  |         gps_l1_ca_pcps_opencl_acquisition.h | ||||||
|  |     ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| include_directories( | include_directories( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR} |     ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
| @@ -96,4 +103,12 @@ list(SORT ACQ_ADAPTER_HEADERS) | |||||||
| list(SORT ACQ_ADAPTER_SOURCES) | list(SORT ACQ_ADAPTER_SOURCES) | ||||||
| add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) | add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) | ||||||
| source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) | source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) | ||||||
| target_link_libraries(acq_adapters acquisition_lib gnss_sp_libs gnss_sdr_flags acq_gr_blocks ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}) | target_link_libraries(acq_adapters | ||||||
|  |     acquisition_lib | ||||||
|  |     gnss_sp_libs | ||||||
|  |     gnss_sdr_flags | ||||||
|  |     acq_gr_blocks | ||||||
|  |     ${Boost_LIBRARIES} | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${GNURADIO_BLOCKS_LIBRARIES} | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -42,12 +42,12 @@ set(ACQ_GR_BLOCKS_HEADERS | |||||||
| if(ENABLE_FPGA) | if(ENABLE_FPGA) | ||||||
|     set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) |     set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) | ||||||
|     set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_acquisition_fpga.h) |     set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_acquisition_fpga.h) | ||||||
| endif(ENABLE_FPGA) | endif() | ||||||
|  |  | ||||||
| if(OPENCL_FOUND) | if(OPENCL_FOUND) | ||||||
|     set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_opencl_acquisition_cc.cc) |     set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_opencl_acquisition_cc.cc) | ||||||
|     set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) |     set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) | ||||||
| endif(OPENCL_FOUND) | endif() | ||||||
|  |  | ||||||
| include_directories( | include_directories( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR} |     ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
| @@ -65,15 +65,14 @@ include_directories( | |||||||
|     ${MATIO_INCLUDE_DIRS} |     ${MATIO_INCLUDE_DIRS} | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| if(OPENCL_FOUND) | if(OPENCL_FOUND) | ||||||
|     include_directories(${OPENCL_INCLUDE_DIRS}) |     include_directories(${OPENCL_INCLUDE_DIRS}) | ||||||
|     if(OS_IS_MACOSX) |     if(OS_IS_MACOSX) | ||||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") |         set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") | ||||||
|     else(OS_IS_MACOSX) |     else() | ||||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) |         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) | ||||||
|     endif(OS_IS_MACOSX) |     endif() | ||||||
| endif(OPENCL_FOUND) | endif() | ||||||
|  |  | ||||||
| list(SORT ACQ_GR_BLOCKS_HEADERS) | list(SORT ACQ_GR_BLOCKS_HEADERS) | ||||||
| list(SORT ACQ_GR_BLOCKS_SOURCES) | list(SORT ACQ_GR_BLOCKS_SOURCES) | ||||||
| @@ -81,11 +80,31 @@ add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) | |||||||
| source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) | source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) | ||||||
|  |  | ||||||
| if(ENABLE_FPGA) | if(ENABLE_FPGA) | ||||||
| 	target_link_libraries(acq_gr_blocks acquisition_lib gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES}) |     target_link_libraries(acq_gr_blocks | ||||||
| else(ENABLE_FPGA) |         acquisition_lib | ||||||
| 	target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${OPT_LIBRARIES} ${OPT_ACQUISITION_LIBRARIES} ${MATIO_LIBRARIES}) |         gnss_sp_libs | ||||||
| endif(ENABLE_FPGA) |         gnss_system_parameters | ||||||
|  |         ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |         ${GNURADIO_FFT_LIBRARIES} | ||||||
|  |         ${VOLK_LIBRARIES} | ||||||
|  |         ${VOLK_GNSSSDR_LIBRARIES} | ||||||
|  |         ${OPT_LIBRARIES} | ||||||
|  |         ${OPT_ACQUISITION_LIBRARIES} | ||||||
|  |     ) | ||||||
|  | else() | ||||||
|  |     target_link_libraries(acq_gr_blocks | ||||||
|  |         gnss_sp_libs | ||||||
|  |         gnss_system_parameters | ||||||
|  |         ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |         ${GNURADIO_FFT_LIBRARIES} | ||||||
|  |         ${VOLK_LIBRARIES} | ||||||
|  |         ${VOLK_GNSSSDR_LIBRARIES} | ||||||
|  |         ${OPT_LIBRARIES} | ||||||
|  |         ${MATIO_LIBRARIES} | ||||||
|  |         ${OPT_ACQUISITION_LIBRARIES} | ||||||
|  |     ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| if(NOT VOLK_GNSSSDR_FOUND) | if(NOT VOLKGNSSSDR_FOUND) | ||||||
|     add_dependencies(acq_gr_blocks volk_gnsssdr_module) |     add_dependencies(acq_gr_blocks volk_gnsssdr_module) | ||||||
| endif(NOT VOLK_GNSSSDR_FOUND) | endif() | ||||||
|   | |||||||
| @@ -30,7 +30,7 @@ if(ENABLE_FPGA) | |||||||
|         ${GFlags_INCLUDE_DIRS} |         ${GFlags_INCLUDE_DIRS} | ||||||
|         ${VOLK_GNSSSDR_INCLUDE_DIRS} |         ${VOLK_GNSSSDR_INCLUDE_DIRS} | ||||||
|     ) |     ) | ||||||
| endif(ENABLE_FPGA) | endif() | ||||||
|  |  | ||||||
| set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) | set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) | ||||||
| set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) | set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) | ||||||
| @@ -38,11 +38,21 @@ set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) | |||||||
| list(SORT ACQUISITION_LIB_HEADERS) | list(SORT ACQUISITION_LIB_HEADERS) | ||||||
| list(SORT ACQUISITION_LIB_SOURCES) | list(SORT ACQUISITION_LIB_SOURCES) | ||||||
|  |  | ||||||
| add_library(acquisition_lib ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS}) | add_library(acquisition_lib | ||||||
|  |     ${ACQUISITION_LIB_SOURCES} | ||||||
|  |     ${ACQUISITION_LIB_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) | source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) | ||||||
| target_link_libraries(acquisition_lib ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) |  | ||||||
| if(VOLK_GNSSSDR_FOUND) | target_link_libraries(acquisition_lib | ||||||
|  |     ${VOLK_LIBRARIES} | ||||||
|  |     ${VOLK_GNSSSDR_LIBRARIES} | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | if(VOLKGNSSSDR_FOUND) | ||||||
|     add_dependencies(acquisition_lib glog-${glog_RELEASE}) |     add_dependencies(acquisition_lib glog-${glog_RELEASE}) | ||||||
| else(VOLK_GNSSSDR_FOUND) | else() | ||||||
|     add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) |     add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) | ||||||
| endif() | endif() | ||||||
|   | |||||||
| @@ -32,6 +32,16 @@ include_directories( | |||||||
|     ${GNURADIO_RUNTIME_INCLUDE_DIRS} |     ${GNURADIO_RUNTIME_INCLUDE_DIRS} | ||||||
| ) | ) | ||||||
|  |  | ||||||
| add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_HEADERS}) | add_library(channel_adapters | ||||||
|  |     ${CHANNEL_ADAPTER_SOURCES} | ||||||
|  |     ${CHANNEL_ADAPTER_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) | source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) | ||||||
| target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} gnss_sdr_flags) |  | ||||||
|  | target_link_libraries(channel_adapters | ||||||
|  |     channel_fsm | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${Boost_LIBRARIES} | ||||||
|  |     gnss_sdr_flags | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -46,4 +46,3 @@ source_group(Headers FILES ${CHANNEL_FSM_HEADERS}) | |||||||
| add_dependencies(channel_fsm glog-${glog_RELEASE}) | add_dependencies(channel_fsm glog-${glog_RELEASE}) | ||||||
|  |  | ||||||
| target_link_libraries(channel_fsm gnss_rx) | target_link_libraries(channel_fsm gnss_rx) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -59,7 +59,6 @@ bool ChannelFsm::Event_stop_channel() | |||||||
|     switch (d_state) |     switch (d_state) | ||||||
|         { |         { | ||||||
|         case 0:  //already in stanby |         case 0:  //already in stanby | ||||||
|             return true; |  | ||||||
|             break; |             break; | ||||||
|         case 1:  //acquisition |         case 1:  //acquisition | ||||||
|             d_state = 0; |             d_state = 0; | ||||||
| @@ -70,8 +69,9 @@ bool ChannelFsm::Event_stop_channel() | |||||||
|             stop_tracking(); |             stop_tracking(); | ||||||
|             break; |             break; | ||||||
|         default: |         default: | ||||||
|             return true; |             break; | ||||||
|         } |         } | ||||||
|  |     return true; | ||||||
| } | } | ||||||
|  |  | ||||||
| bool ChannelFsm::Event_start_acquisition() | bool ChannelFsm::Event_start_acquisition() | ||||||
|   | |||||||
| @@ -17,4 +17,3 @@ | |||||||
| # | # | ||||||
|  |  | ||||||
| add_subdirectory(adapters) | add_subdirectory(adapters) | ||||||
| #add_subdirectory(gnuradio_blocks) |  | ||||||
| @@ -19,4 +19,3 @@ | |||||||
|  |  | ||||||
| add_subdirectory(adapters) | add_subdirectory(adapters) | ||||||
| add_subdirectory(gnuradio_blocks) | add_subdirectory(gnuradio_blocks) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -50,7 +50,15 @@ include_directories( | |||||||
| list(SORT DATATYPE_ADAPTER_HEADERS) | list(SORT DATATYPE_ADAPTER_HEADERS) | ||||||
| list(SORT DATATYPE_ADAPTER_SOURCES) | list(SORT DATATYPE_ADAPTER_SOURCES) | ||||||
|  |  | ||||||
| add_library(datatype_adapters ${DATATYPE_ADAPTER_SOURCES} ${DATATYPE_ADAPTER_HEADERS}) | add_library(datatype_adapters | ||||||
|  |     ${DATATYPE_ADAPTER_SOURCES} | ||||||
|  |     ${DATATYPE_ADAPTER_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) | source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) | ||||||
| add_dependencies(datatype_adapters glog-${glog_RELEASE}) | add_dependencies(datatype_adapters glog-${glog_RELEASE}) | ||||||
| target_link_libraries(datatype_adapters data_type_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES}) | target_link_libraries(datatype_adapters | ||||||
|  |     data_type_gr_blocks | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${GNURADIO_BLOCKS_LIBRARIES} | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -38,6 +38,14 @@ include_directories( | |||||||
| list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) | list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) | ||||||
| list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) | list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) | ||||||
|  |  | ||||||
| add_library(data_type_gr_blocks ${DATA_TYPE_GR_BLOCKS_SOURCES} ${DATA_TYPE_GR_BLOCKS_HEADERS}) | add_library(data_type_gr_blocks | ||||||
|  |     ${DATA_TYPE_GR_BLOCKS_SOURCES} | ||||||
|  |     ${DATA_TYPE_GR_BLOCKS_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) | source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) | ||||||
| target_link_libraries(data_type_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES}) |  | ||||||
|  | target_link_libraries(data_type_gr_blocks | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${VOLK_LIBRARIES} | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -48,12 +48,22 @@ include_directories( | |||||||
|  |  | ||||||
| if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") | if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") | ||||||
|     add_definitions(-DGR_GREATER_38=1) |     add_definitions(-DGR_GREATER_38=1) | ||||||
| endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) | endif() | ||||||
|  |  | ||||||
| list(SORT INPUT_FILTER_ADAPTER_HEADERS) | list(SORT INPUT_FILTER_ADAPTER_HEADERS) | ||||||
| list(SORT INPUT_FILTER_ADAPTER_SOURCES) | list(SORT INPUT_FILTER_ADAPTER_SOURCES) | ||||||
|  |  | ||||||
| add_library(input_filter_adapters ${INPUT_FILTER_ADAPTER_SOURCES} ${INPUT_FILTER_ADAPTER_HEADERS}) | add_library(input_filter_adapters | ||||||
|  |     ${INPUT_FILTER_ADAPTER_SOURCES} | ||||||
|  |     ${INPUT_FILTER_ADAPTER_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) | source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) | ||||||
| add_dependencies(input_filter_adapters glog-${glog_RELEASE} gnss_sp_libs) | add_dependencies(input_filter_adapters glog-${glog_RELEASE} gnss_sp_libs) | ||||||
| target_link_libraries(input_filter_adapters input_filter_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} gnss_sp_libs) | target_link_libraries(input_filter_adapters | ||||||
|  |     input_filter_gr_blocks | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${GNURADIO_BLOCKS_LIBRARIES} | ||||||
|  |     ${GNURADIO_FILTER_LIBRARIES} | ||||||
|  |     gnss_sp_libs | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -43,13 +43,19 @@ include_directories( | |||||||
| list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) | list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) | ||||||
| list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) | list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) | ||||||
|  |  | ||||||
| add_library(input_filter_gr_blocks ${INPUT_FILTER_GR_BLOCKS_SOURCES} ${INPUT_FILTER_GR_BLOCKS_HEADERS}) | add_library(input_filter_gr_blocks | ||||||
|  |     ${INPUT_FILTER_GR_BLOCKS_SOURCES} | ||||||
|  |     ${INPUT_FILTER_GR_BLOCKS_HEADERS}) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) | source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) | ||||||
|  |  | ||||||
| target_link_libraries(input_filter_gr_blocks ${GNURADIO_FILTER_LIBRARIES}  ${VOLK_GNSSSDR_LIBRARIES} ${LOG4CPP_LIBRARIES}) | target_link_libraries(input_filter_gr_blocks | ||||||
|  |     ${GNURADIO_FILTER_LIBRARIES} | ||||||
|  |     ${VOLK_GNSSSDR_LIBRARIES} | ||||||
|  |     ${LOG4CPP_LIBRARIES}) | ||||||
|  |  | ||||||
| if(NOT VOLK_GNSSSDR_FOUND) | if(NOT VOLKGNSSSDR_FOUND) | ||||||
|     add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) |     add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) | ||||||
| else(NOT VOLK_GNSSSDR_FOUND) | else() | ||||||
|     add_dependencies(input_filter_gr_blocks glog-${glog_RELEASE}) |     add_dependencies(input_filter_gr_blocks glog-${glog_RELEASE}) | ||||||
| endif(NOT VOLK_GNSSSDR_FOUND) | endif() | ||||||
|   | |||||||
| @@ -39,6 +39,7 @@ set(GNSS_SPLIBS_SOURCES | |||||||
|     conjugate_sc.cc |     conjugate_sc.cc | ||||||
|     conjugate_ic.cc |     conjugate_ic.cc | ||||||
|     gnss_sdr_create_directory.cc |     gnss_sdr_create_directory.cc | ||||||
|  |     geofunctions.cc | ||||||
| ) | ) | ||||||
|  |  | ||||||
| set(GNSS_SPLIBS_HEADERS | set(GNSS_SPLIBS_HEADERS | ||||||
| @@ -63,21 +64,21 @@ set(GNSS_SPLIBS_HEADERS | |||||||
|     conjugate_ic.h |     conjugate_ic.h | ||||||
|     gnss_sdr_create_directory.h |     gnss_sdr_create_directory.h | ||||||
|     gnss_circular_deque.h |     gnss_circular_deque.h | ||||||
|  |     geofunctions.h | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_FPGA) | if(ENABLE_FPGA) | ||||||
|     set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} |     set(GNSS_SPLIBS_SOURCES | ||||||
|  |         ${GNSS_SPLIBS_SOURCES} | ||||||
|         gnss_sdr_time_counter.cc |         gnss_sdr_time_counter.cc | ||||||
|         gnss_sdr_fpga_sample_counter.cc |         gnss_sdr_fpga_sample_counter.cc | ||||||
|     ) |     ) | ||||||
|  |     set(GNSS_SPLIBS_HEADERS | ||||||
|     set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} |         ${GNSS_SPLIBS_HEADERS} | ||||||
|         gnss_sdr_time_counter.h |         gnss_sdr_time_counter.h | ||||||
|         gnss_sdr_fpga_sample_counter.h |         gnss_sdr_fpga_sample_counter.h | ||||||
|     ) |     ) | ||||||
|  | endif() | ||||||
| endif(ENABLE_FPGA) |  | ||||||
|  |  | ||||||
| if(OPENCL_FOUND) | if(OPENCL_FOUND) | ||||||
|     set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} |     set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} | ||||||
| @@ -85,13 +86,12 @@ if(OPENCL_FOUND) | |||||||
|         opencl/fft_setup.cc # Needs OpenCL |         opencl/fft_setup.cc # Needs OpenCL | ||||||
|         opencl/fft_kernelstring.cc # Needs OpenCL |         opencl/fft_kernelstring.cc # Needs OpenCL | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|     set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} |     set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} | ||||||
|         opencl/fft_execute.h # Needs OpenCL |         opencl/fft_execute.h # Needs OpenCL | ||||||
|         opencl/fft_setup.h # Needs OpenCL |         opencl/fft_setup.h # Needs OpenCL | ||||||
|         opencl/fft_kernelstring.h # Needs OpenCL |         opencl/fft_kernelstring.h # Needs OpenCL | ||||||
|     ) |     ) | ||||||
| endif(OPENCL_FOUND) | endif() | ||||||
|  |  | ||||||
| include_directories( | include_directories( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR} |     ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
| @@ -101,6 +101,7 @@ include_directories( | |||||||
|     ${Boost_INCLUDE_DIRS} |     ${Boost_INCLUDE_DIRS} | ||||||
|     ${GLOG_INCLUDE_DIRS} |     ${GLOG_INCLUDE_DIRS} | ||||||
|     ${GFlags_INCLUDE_DIRS} |     ${GFlags_INCLUDE_DIRS} | ||||||
|  |     ${ARMADILLO_INCLUDE_DIRS} | ||||||
|     ${GNURADIO_RUNTIME_INCLUDE_DIRS} |     ${GNURADIO_RUNTIME_INCLUDE_DIRS} | ||||||
|     ${GNURADIO_BLOCKS_INCLUDE_DIRS} |     ${GNURADIO_BLOCKS_INCLUDE_DIRS} | ||||||
|     ${VOLK_INCLUDE_DIRS} |     ${VOLK_INCLUDE_DIRS} | ||||||
| @@ -111,10 +112,10 @@ if(OPENCL_FOUND) | |||||||
|     include_directories(${OPENCL_INCLUDE_DIRS}) |     include_directories(${OPENCL_INCLUDE_DIRS}) | ||||||
|     if(OS_IS_MACOSX) |     if(OS_IS_MACOSX) | ||||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") |         set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") | ||||||
|     else(OS_IS_MACOSX) |     else() | ||||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) |         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) | ||||||
|     endif(OS_IS_MACOSX) |     endif() | ||||||
| endif(OPENCL_FOUND) | endif() | ||||||
|  |  | ||||||
| add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") | add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") | ||||||
|  |  | ||||||
| @@ -124,10 +125,12 @@ list(SORT GNSS_SPLIBS_SOURCES) | |||||||
| add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) | add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) | ||||||
| source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) | source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) | ||||||
|  |  | ||||||
| target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} | target_link_libraries(gnss_sp_libs | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|     ${VOLK_LIBRARIES} ${ORC_LIBRARIES} |     ${VOLK_LIBRARIES} ${ORC_LIBRARIES} | ||||||
|     ${VOLK_GNSSSDR_LIBRARIES}  ${ORC_LIBRARIES} |     ${VOLK_GNSSSDR_LIBRARIES}  ${ORC_LIBRARIES} | ||||||
|     ${GFlags_LIBS} |     ${GFlags_LIBS} | ||||||
|  |     ${ARMADILLO_LIBRARIES} | ||||||
|     ${GNURADIO_BLOCKS_LIBRARIES} |     ${GNURADIO_BLOCKS_LIBRARIES} | ||||||
|     ${GNURADIO_FFT_LIBRARIES} |     ${GNURADIO_FFT_LIBRARIES} | ||||||
|     ${GNURADIO_FILTER_LIBRARIES} |     ${GNURADIO_FILTER_LIBRARIES} | ||||||
| @@ -135,13 +138,16 @@ target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} | |||||||
|     gnss_rx |     gnss_rx | ||||||
| ) | ) | ||||||
|  |  | ||||||
| if(NOT VOLK_GNSSSDR_FOUND) | if(NOT VOLKGNSSSDR_FOUND) | ||||||
|     add_dependencies(gnss_sp_libs volk_gnsssdr_module) |     add_dependencies(gnss_sp_libs volk_gnsssdr_module | ||||||
| endif(NOT VOLK_GNSSSDR_FOUND) |         armadillo-${armadillo_RELEASE}) | ||||||
|  | else() | ||||||
|  |     add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) | ||||||
|  | endif() | ||||||
|  |  | ||||||
| if(${GFLAGS_GREATER_20}) | if(${GFLAGS_GREATER_20}) | ||||||
|     add_definitions(-DGFLAGS_GREATER_2_0=1) |     add_definitions(-DGFLAGS_GREATER_2_0=1) | ||||||
| endif(${GFLAGS_GREATER_20}) | endif() | ||||||
|  |  | ||||||
| add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) | add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) | ||||||
| source_group(Headers FILES gnss_sdr_flags.h) | source_group(Headers FILES gnss_sdr_flags.h) | ||||||
|   | |||||||
| @@ -126,8 +126,8 @@ void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3]) | |||||||
|     const float alpha = sqrt(10.0 / 11.0); |     const float alpha = sqrt(10.0 / 11.0); | ||||||
|     const float beta = sqrt(1.0 / 11.0); |     const float beta = sqrt(1.0 / 11.0); | ||||||
|  |  | ||||||
|     int32_t sinboc_11[12 * 4092];  //  _codeLength not accepted by Clang |     int32_t sinboc_11[12 * 4092] = {0};  //  _codeLength not accepted by Clang | ||||||
|     int32_t sinboc_61[12 * 4092]; |     int32_t sinboc_61[12 * 4092] = {0}; | ||||||
|  |  | ||||||
|     galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength);  //generate sinboc(1,1) 12 samples per chip |     galileo_e1_sinboc_11_gen_int(sinboc_11, _prn, _codeLength);  //generate sinboc(1,1) 12 samples per chip | ||||||
|     galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength);  //generate sinboc(6,1) 12 samples per chip |     galileo_e1_sinboc_61_gen_int(sinboc_61, _prn, _codeLength);  //generate sinboc(6,1) 12 samples per chip | ||||||
|   | |||||||
| @@ -131,12 +131,6 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Sig | |||||||
|         { |         { | ||||||
|             _dest[(i + delay) % _samplesPerCode] = _code[i]; |             _dest[(i + delay) % _samplesPerCode] = _code[i]; | ||||||
|         } |         } | ||||||
|     if (_fs != _codeFreqBasis) |  | ||||||
|         { |  | ||||||
|             free(_code); |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|     delete[] _code; |     delete[] _code; | ||||||
| } | } | ||||||
| } |  | ||||||
|   | |||||||
| @@ -301,7 +301,7 @@ double mstokph(double MetersPerSeconds) | |||||||
| arma::vec CTM_to_Euler(const arma::mat &C) | arma::vec CTM_to_Euler(const arma::mat &C) | ||||||
| { | { | ||||||
|     // Calculate Euler angles using (2.23)
 |     // Calculate Euler angles using (2.23)
 | ||||||
|     arma::mat CTM = C; |     arma::mat CTM(C); | ||||||
|     arma::vec eul = arma::zeros(3, 1); |     arma::vec eul = arma::zeros(3, 1); | ||||||
|     eul(0) = atan2(CTM(1, 2), CTM(2, 2));  // roll
 |     eul(0) = atan2(CTM(1, 2), CTM(2, 2));  // roll
 | ||||||
|     if (CTM(0, 2) < -1.0) CTM(0, 2) = -1.0; |     if (CTM(0, 2) < -1.0) CTM(0, 2) = -1.0; | ||||||
| @@ -2,6 +2,7 @@ | |||||||
|  * \file gnss_sdr_valve.cc |  * \file gnss_sdr_valve.cc | ||||||
|  * \brief Implementation of a GNU Radio block that sends a STOP message to the |  * \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. |  * 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 |  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com | ||||||
|  * |  * | ||||||
|  * |  * | ||||||
| @@ -39,26 +40,44 @@ | |||||||
|  |  | ||||||
| gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, | gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, | ||||||
|     unsigned long long nitems, |     unsigned long long nitems, | ||||||
|     gr::msg_queue::sptr queue) : gr::sync_block("valve", |     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), | ||||||
|                                gr::io_signature::make(1, 1, sizeof_stream_item)), |                                gr::io_signature::make(1, 1, sizeof_stream_item)), | ||||||
|                            d_nitems(nitems), |                            d_nitems(nitems), | ||||||
|                            d_ncopied_items(0), |                            d_ncopied_items(0), | ||||||
|                                  d_queue(queue) |                            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, bool stop_flowgraph) | ||||||
|  | { | ||||||
|  |     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<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)); |     boost::shared_ptr<gnss_sdr_valve> valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, queue, true)); | ||||||
|     return valve_; |     return valve_; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | void gnss_sdr_valve::open_valve() | ||||||
|  | { | ||||||
|  |     d_open_valve = true; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| int gnss_sdr_valve::work(int noutput_items, | int gnss_sdr_valve::work(int noutput_items, | ||||||
|     gr_vector_const_void_star &input_items, |     gr_vector_const_void_star &input_items, | ||||||
|     gr_vector_void_star &output_items) |     gr_vector_void_star &output_items) | ||||||
|  | { | ||||||
|  |     if (d_open_valve == false) | ||||||
|         { |         { | ||||||
|             if (d_ncopied_items >= d_nitems) |             if (d_ncopied_items >= d_nitems) | ||||||
|                 { |                 { | ||||||
| @@ -66,15 +85,25 @@ int gnss_sdr_valve::work(int noutput_items, | |||||||
|                     d_queue->handle(cmf->GetQueueMessage(200, 0)); |                     d_queue->handle(cmf->GetQueueMessage(200, 0)); | ||||||
|                     LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed"; |                     LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed"; | ||||||
|                     delete cmf; |                     delete cmf; | ||||||
|  |                     if (d_stop_flowgraph) | ||||||
|  |                         { | ||||||
|                             return -1;  // Done! |                             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)); |             unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast<long long unsigned int>(noutput_items)); | ||||||
|             if (n == 0) return 0; |             if (n == 0) return 0; | ||||||
|             memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(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; |             d_ncopied_items += n; | ||||||
|             return n; |             return n; | ||||||
|         } |         } | ||||||
|  |     else | ||||||
|  |         { | ||||||
|  |             memcpy(output_items[0], input_items[0], noutput_items * input_signature()->sizeof_stream_item(0)); | ||||||
|  |             return noutput_items; | ||||||
|  |         } | ||||||
|  | } | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ | |||||||
|  * \file gnss_sdr_valve.h |  * \file gnss_sdr_valve.h | ||||||
|  * \brief  Interface of a GNU Radio block that sends a STOP message to the |  * \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. |  * 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 |  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com | ||||||
|  * |  * | ||||||
|  * ------------------------------------------------------------------------- |  * ------------------------------------------------------------------------- | ||||||
| @@ -37,10 +38,15 @@ | |||||||
| #include <gnuradio/msg_queue.h> | #include <gnuradio/msg_queue.h> | ||||||
| #include <boost/shared_ptr.hpp> | #include <boost/shared_ptr.hpp> | ||||||
|  |  | ||||||
|  |  | ||||||
| boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, | boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, | ||||||
|     unsigned long long nitems, |     unsigned long long nitems, | ||||||
|     gr::msg_queue::sptr queue); |     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 |  * \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. |  * control queue right after a specific number of samples have passed through it. | ||||||
| @@ -50,14 +56,23 @@ class gnss_sdr_valve : public gr::sync_block | |||||||
|     friend boost::shared_ptr<gr::block> gnss_sdr_make_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, |         unsigned long long nitems, | ||||||
|         gr::msg_queue::sptr queue); |         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, |         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_nitems; | ||||||
|     unsigned long long d_ncopied_items; |     unsigned long long d_ncopied_items; | ||||||
|     gr::msg_queue::sptr d_queue; |     gr::msg_queue::sptr d_queue; | ||||||
|  |     bool d_stop_flowgraph; | ||||||
|  |     bool d_open_valve; | ||||||
|  |  | ||||||
| public: | 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, |     int work(int noutput_items, | ||||||
|         gr_vector_const_void_star &input_items, |         gr_vector_const_void_star &input_items, | ||||||
|         gr_vector_void_star &output_items); |         gr_vector_void_star &output_items); | ||||||
|   | |||||||
| @@ -131,7 +131,7 @@ void gps_l1_ca_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift) | |||||||
| void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, int32_t _prn, uint32_t _chip_shift) | void gps_l1_ca_code_gen_complex(std::complex<float>* _dest, int32_t _prn, uint32_t _chip_shift) | ||||||
| { | { | ||||||
|     const uint32_t _code_length = 1023; |     const uint32_t _code_length = 1023; | ||||||
|     int32_t ca_code_int[_code_length]; |     int32_t ca_code_int[_code_length] = {0}; | ||||||
|  |  | ||||||
|     gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift); |     gps_l1_ca_code_gen_int(ca_code_int, _prn, _chip_shift); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -69,7 +69,6 @@ include_directories( | |||||||
|     ${GLOG_INCLUDE_DIRS} |     ${GLOG_INCLUDE_DIRS} | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| list(SORT RTKLIB_LIB_HEADERS) | list(SORT RTKLIB_LIB_HEADERS) | ||||||
| list(SORT RTKLIB_LIB_SOURCES) | list(SORT RTKLIB_LIB_SOURCES) | ||||||
|  |  | ||||||
| @@ -79,7 +78,7 @@ add_dependencies(rtklib_lib glog-${glog_RELEASE}) | |||||||
|  |  | ||||||
| if(OS_IS_MACOSX) | if(OS_IS_MACOSX) | ||||||
|     set(MAC_LIBRARIES "-framework Accelerate") |     set(MAC_LIBRARIES "-framework Accelerate") | ||||||
| endif(OS_IS_MACOSX) | endif() | ||||||
|  |  | ||||||
| target_link_libraries( | target_link_libraries( | ||||||
|     rtklib_lib |     rtklib_lib | ||||||
|   | |||||||
| @@ -291,3 +291,59 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph) | |||||||
|  |  | ||||||
|     return rtklib_sat; |     return rtklib_sat; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) | ||||||
|  | { | ||||||
|  |     alm_t rtklib_alm; | ||||||
|  |  | ||||||
|  |     rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | ||||||
|  |  | ||||||
|  |     rtklib_alm.sat = gps_alm.i_satellite_PRN; | ||||||
|  |     rtklib_alm.svh = gps_alm.i_SV_health; | ||||||
|  |     rtklib_alm.svconf = gps_alm.i_AS_status; | ||||||
|  |     rtklib_alm.week = gps_alm.i_WNa; | ||||||
|  |     gtime_t toa; | ||||||
|  |     toa.time = gps_alm.i_Toa; | ||||||
|  |     rtklib_alm.toa = toa; | ||||||
|  |     rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; | ||||||
|  |     rtklib_alm.e = gps_alm.d_e_eccentricity; | ||||||
|  |     rtklib_alm.i0 = (gps_alm.d_Delta_i + 0.3) * PI; | ||||||
|  |     rtklib_alm.OMG0 = gps_alm.d_OMEGA0 * PI; | ||||||
|  |     rtklib_alm.OMGd = gps_alm.d_OMEGA_DOT * PI; | ||||||
|  |     rtklib_alm.omg = gps_alm.d_OMEGA * PI; | ||||||
|  |     rtklib_alm.M0 = gps_alm.d_M_0 * PI; | ||||||
|  |     rtklib_alm.f0 = gps_alm.d_A_f0; | ||||||
|  |     rtklib_alm.f1 = gps_alm.d_A_f1; | ||||||
|  |     rtklib_alm.toas = gps_alm.i_Toa; | ||||||
|  |  | ||||||
|  |     return rtklib_alm; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) | ||||||
|  | { | ||||||
|  |     alm_t rtklib_alm; | ||||||
|  |  | ||||||
|  |     rtklib_alm = {0, 0, 0, 0, {0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | ||||||
|  |  | ||||||
|  |     rtklib_alm.sat = gal_alm.i_satellite_PRN + NSATGPS + NSATGLO; | ||||||
|  |     rtklib_alm.svh = gal_alm.E1B_HS; | ||||||
|  |     rtklib_alm.svconf = gal_alm.E1B_HS; | ||||||
|  |     rtklib_alm.week = gal_alm.i_WNa; | ||||||
|  |     gtime_t toa; | ||||||
|  |     toa.time = gal_alm.i_Toa; | ||||||
|  |     rtklib_alm.toa = toa; | ||||||
|  |     rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; | ||||||
|  |     rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; | ||||||
|  |     rtklib_alm.e = gal_alm.d_e_eccentricity; | ||||||
|  |     rtklib_alm.i0 = (gal_alm.d_Delta_i + 56.0 / 180.0) * PI; | ||||||
|  |     rtklib_alm.OMG0 = gal_alm.d_OMEGA0 * PI; | ||||||
|  |     rtklib_alm.OMGd = gal_alm.d_OMEGA_DOT * PI; | ||||||
|  |     rtklib_alm.omg = gal_alm.d_OMEGA * PI; | ||||||
|  |     rtklib_alm.M0 = gal_alm.d_M_0 * PI; | ||||||
|  |     rtklib_alm.f0 = gal_alm.d_A_f0; | ||||||
|  |     rtklib_alm.f1 = gal_alm.d_A_f1; | ||||||
|  |     rtklib_alm.toas = gal_alm.i_Toa; | ||||||
|  |  | ||||||
|  |     return rtklib_alm; | ||||||
|  | } | ||||||
|   | |||||||
| @@ -38,10 +38,16 @@ | |||||||
| #include "gps_cnav_ephemeris.h" | #include "gps_cnav_ephemeris.h" | ||||||
| #include "glonass_gnav_ephemeris.h" | #include "glonass_gnav_ephemeris.h" | ||||||
| #include "glonass_gnav_utc_model.h" | #include "glonass_gnav_utc_model.h" | ||||||
|  | #include "gps_almanac.h" | ||||||
|  | #include "galileo_almanac.h" | ||||||
|  |  | ||||||
| eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); | eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); | ||||||
| eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph); | eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph); | ||||||
| eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph); | eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph); | ||||||
|  |  | ||||||
|  | alm_t alm_to_rtklib(const Gps_Almanac& gps_alm); | ||||||
|  | alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm); | ||||||
|  |  | ||||||
| /*! | /*! | ||||||
|  * \brief Transforms a Glonass_Gnav_Ephemeris to its RTKLIB counterpart |  * \brief Transforms a Glonass_Gnav_Ephemeris to its RTKLIB counterpart | ||||||
|  * \param glonass_gnav_eph GLONASS GNAV Ephemeris structure |  * \param glonass_gnav_eph GLONASS GNAV Ephemeris structure | ||||||
|   | |||||||
| @@ -44,37 +44,37 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |||||||
|             # retrieve the compiler's version from it |             # retrieve the compiler's version from it | ||||||
|             string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) |             string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err}) | ||||||
|             string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) |             string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION}) | ||||||
|         else("${IS_APPLE}" STREQUAL "") |         else() | ||||||
|             set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) |             set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION}) | ||||||
|             set(APPLE_STR "Apple ") |             set(APPLE_STR "Apple ") | ||||||
|             # retrieve the compiler's version from it |             # retrieve the compiler's version from it | ||||||
|             string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) |             string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err}) | ||||||
|             string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) |             string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION}) | ||||||
|         endif("${IS_APPLE}" STREQUAL "") |         endif() | ||||||
|         if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") |         if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") | ||||||
|             message(WARNING "\nThe compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") |             message(WARNING "\nThe compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") | ||||||
|         endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}") |         endif() | ||||||
|     else(${_res} STREQUAL "0") |     else() | ||||||
|         message(WARNING "\nCannot determine the version of the compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") |         message(WARNING "\nCannot determine the version of the compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.") | ||||||
|     endif(${_res} STREQUAL "0") |     endif() | ||||||
| endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | endif() | ||||||
|  |  | ||||||
| # Enable C++17 support in GCC >= 8.0.0 | # Enable C++17 support in GCC >= 8.0.0 | ||||||
| # Enable C++14 support in 8.0.0 > GCC >= 6.1.1 | # Enable C++14 support in 8.0.0 > GCC >= 6.1.1 | ||||||
| # Fallback to C++11 when using 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") |     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") | ||||||
|         set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") |         set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") | ||||||
|     else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") |     else() | ||||||
|         if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") |         if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") | ||||||
|             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") |             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") | ||||||
|         else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") |         else() | ||||||
|             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") |             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") | ||||||
|         endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") |         endif() | ||||||
|     endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") |     endif() | ||||||
|     set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra")  #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html |     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() | ||||||
|  |  | ||||||
| # Enable C++17 support in Clang >= 6.0.0 | # Enable C++17 support in Clang >= 6.0.0 | ||||||
| # Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600 | # Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600 | ||||||
| @@ -84,28 +84,28 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |||||||
|         # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences |         # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences | ||||||
|         if(CLANG_VERSION VERSION_LESS "600") |         if(CLANG_VERSION VERSION_LESS "600") | ||||||
|             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") |             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") | ||||||
|         else(CLANG_VERSION VERSION_LESS "600") |         else() | ||||||
|             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") |             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") | ||||||
|         endif(CLANG_VERSION VERSION_LESS "600") |         endif() | ||||||
|     else(CMAKE_SYSTEM_NAME MATCHES "Darwin") |     else() | ||||||
|         if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") |         if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") | ||||||
|             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") |             set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") | ||||||
|         else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") |         else() | ||||||
|             if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") |             if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") | ||||||
|                 set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") |                 set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") | ||||||
|             else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") |             else() | ||||||
|                 set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") |                 set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") | ||||||
|             endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") |             endif() | ||||||
|         endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") |         endif() | ||||||
|     endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") |     endif() | ||||||
| endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | endif() | ||||||
|  |  | ||||||
| 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")) |     if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) | ||||||
|         set(CMAKE_C_STANDARD 11) |         set(CMAKE_C_STANDARD 11) | ||||||
|         set(CMAKE_CXX_STANDARD 11) |         set(CMAKE_CXX_STANDARD 11) | ||||||
|     endif(NOT (CMAKE_VERSION VERSION_LESS "3.1")) |     endif() | ||||||
| endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) | endif() | ||||||
|  |  | ||||||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall") | ||||||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") | ||||||
| @@ -114,8 +114,8 @@ if(CMAKE_VERSION VERSION_GREATER "3.0") | |||||||
|     cmake_policy(SET CMP0042 NEW) |     cmake_policy(SET CMP0042 NEW) | ||||||
|     if(CMAKE_VERSION VERSION_GREATER "3.9") |     if(CMAKE_VERSION VERSION_GREATER "3.9") | ||||||
|         cmake_policy(SET CMP0068 NEW) |         cmake_policy(SET CMP0068 NEW) | ||||||
|     endif(CMAKE_VERSION VERSION_GREATER "3.9") |     endif() | ||||||
| endif(CMAKE_VERSION VERSION_GREATER "3.0") | endif() | ||||||
|  |  | ||||||
| option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF) | option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF) | ||||||
|  |  | ||||||
| @@ -129,7 +129,7 @@ if(NOT CMAKE_BUILD_TYPE) | |||||||
|     set(CMAKE_BUILD_TYPE "Release") |     set(CMAKE_BUILD_TYPE "Release") | ||||||
|     message(STATUS "Build type not specified: defaulting to release.") |     message(STATUS "Build type not specified: defaulting to release.") | ||||||
| endif() | endif() | ||||||
| VOLK_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE}) | volk_check_build_type(${CMAKE_BUILD_TYPE}) | ||||||
| set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") | set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") | ||||||
| message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") | message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") | ||||||
|  |  | ||||||
| @@ -144,14 +144,14 @@ include(VolkVersion) #setup version info | |||||||
| ######################################################################## | ######################################################################## | ||||||
| # Environment setup | # Environment setup | ||||||
| ######################################################################## | ######################################################################## | ||||||
| IF(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) | if(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) | ||||||
|     SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) |     set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) | ||||||
| ENDIF() | endif() | ||||||
|  |  | ||||||
| IF(NOT DEFINED CROSSCOMPILE_MULTILIB) | if(NOT DEFINED CROSSCOMPILE_MULTILIB) | ||||||
|     SET(CROSSCOMPILE_MULTILIB "") |     set(CROSSCOMPILE_MULTILIB "") | ||||||
| ENDIF() | endif() | ||||||
| SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile") | set(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile") | ||||||
|  |  | ||||||
| if(MSVC) | if(MSVC) | ||||||
|     add_definitions(-D_USE_MATH_DEFINES) #enables math constants on all supported versions of MSVC |     add_definitions(-D_USE_MATH_DEFINES) #enables math constants on all supported versions of MSVC | ||||||
| @@ -160,7 +160,7 @@ if(MSVC) | |||||||
|     add_compile_options(/wd4752) |     add_compile_options(/wd4752) | ||||||
|     add_compile_options(/wo4273) |     add_compile_options(/wo4273) | ||||||
|     add_compile_options(/wo4838) |     add_compile_options(/wo4838) | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| # allow 'large' files in 32 bit builds | # allow 'large' files in 32 bit builds | ||||||
| if(UNIX) | if(UNIX) | ||||||
| @@ -169,7 +169,7 @@ if(UNIX) | |||||||
|         -D_LARGE_FILES |         -D_LARGE_FILES | ||||||
|         -D_FORTIFY_SOURCE=2 |         -D_FORTIFY_SOURCE=2 | ||||||
|     ) |     ) | ||||||
| endif(UNIX) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -178,9 +178,9 @@ endif(UNIX) | |||||||
|  |  | ||||||
| # Python | # Python | ||||||
| include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B | include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B | ||||||
| VOLK_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) | volk_python_check_module("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) | ||||||
| VOLK_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) | volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) | ||||||
| VOLK_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) | volk_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) | ||||||
|  |  | ||||||
|  |  | ||||||
| if(NOT PYTHON_MIN_VER_FOUND) | if(NOT PYTHON_MIN_VER_FOUND) | ||||||
| @@ -205,10 +205,10 @@ if(MSVC) | |||||||
|     set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") |     set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") | ||||||
|     if(BOOST_ALL_DYN_LINK) |     if(BOOST_ALL_DYN_LINK) | ||||||
|         add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc |         add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc | ||||||
|     else(BOOST_ALL_DYN_LINK) |     else() | ||||||
|         unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link |         unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link | ||||||
|     endif(BOOST_ALL_DYN_LINK) |     endif() | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| include(VolkBoost) | include(VolkBoost) | ||||||
|  |  | ||||||
| @@ -220,9 +220,9 @@ endif() | |||||||
| option(ENABLE_ORC "Enable Orc" True) | option(ENABLE_ORC "Enable Orc" True) | ||||||
| if(ENABLE_ORC) | if(ENABLE_ORC) | ||||||
|   find_package(ORC) |   find_package(ORC) | ||||||
| else(ENABLE_ORC) | else() | ||||||
|   message(STATUS "Disabling use of ORC") |   message(STATUS "Disabling use of ORC") | ||||||
| endif(ENABLE_ORC) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -240,7 +240,7 @@ if(DOXYGEN_FOUND) | |||||||
|         WORKING_DIRECTORY ${PROJECT_BINARY_DIR} |         WORKING_DIRECTORY ${PROJECT_BINARY_DIR} | ||||||
|         COMMENT "Generating documentation with Doxygen" VERBATIM |         COMMENT "Generating documentation with Doxygen" VERBATIM | ||||||
|     ) |     ) | ||||||
| endif(DOXYGEN_FOUND) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -255,7 +255,8 @@ set(includedir "\${prefix}/include") | |||||||
| configure_file( | configure_file( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr.pc.in |     ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr.pc.in | ||||||
|     ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc |     ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc | ||||||
| @ONLY) |     @ONLY | ||||||
|  | ) | ||||||
|  |  | ||||||
| install( | install( | ||||||
|     FILES ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc |     FILES ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc | ||||||
| @@ -304,17 +305,17 @@ if(APPLE) | |||||||
|         set(CMAKE_INSTALL_NAME_DIR |         set(CMAKE_INSTALL_NAME_DIR | ||||||
|             ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE |             ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE | ||||||
|             PATH "Library Install Name Destination Directory" FORCE) |             PATH "Library Install Name Destination Directory" FORCE) | ||||||
|     endif(NOT CMAKE_INSTALL_NAME_DIR) |     endif() | ||||||
|     if(NOT CMAKE_INSTALL_RPATH) |     if(NOT CMAKE_INSTALL_RPATH) | ||||||
|         set(CMAKE_INSTALL_RPATH |         set(CMAKE_INSTALL_RPATH | ||||||
|             ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE |             ${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE | ||||||
|             PATH "Library Install RPath" FORCE) |             PATH "Library Install RPath" FORCE) | ||||||
|     endif(NOT CMAKE_INSTALL_RPATH) |     endif() | ||||||
|     if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) |     if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) | ||||||
|         set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE |         set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE | ||||||
|             BOOL "Do Build Using Library Install RPath" FORCE) |             BOOL "Do Build Using Library Install RPath" FORCE) | ||||||
|     endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) |     endif() | ||||||
| endif(APPLE) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -358,7 +359,7 @@ configure_file( | |||||||
|  |  | ||||||
| if(NOT CMAKE_MODULES_DIR) | if(NOT CMAKE_MODULES_DIR) | ||||||
|     set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake) |     set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake) | ||||||
| endif(NOT CMAKE_MODULES_DIR) | endif() | ||||||
|  |  | ||||||
| install( | install( | ||||||
|     FILES |     FILES | ||||||
| @@ -371,7 +372,7 @@ install( | |||||||
| ######################################################################## | ######################################################################## | ||||||
| # Option to enable QA testing, on by default | # Option to enable QA testing, on by default | ||||||
| ######################################################################## | ######################################################################## | ||||||
| OPTION(ENABLE_TESTING "Enable QA testing" ON) | option(ENABLE_TESTING "Enable QA testing" ON) | ||||||
| if(ENABLE_TESTING) | if(ENABLE_TESTING) | ||||||
|   message(STATUS "QA Testing is enabled.") |   message(STATUS "QA Testing is enabled.") | ||||||
| else() | else() | ||||||
| @@ -383,7 +384,7 @@ message(STATUS "  Modify using: -DENABLE_TESTING=ON/OFF") | |||||||
| ######################################################################## | ######################################################################## | ||||||
| # Option to enable post-build profiling using volk_profile, off by default | # Option to enable post-build profiling using volk_profile, off by default | ||||||
| ######################################################################## | ######################################################################## | ||||||
| OPTION(ENABLE_PROFILING "Launch system profiler after build" OFF) | option(ENABLE_PROFILING "Launch system profiler after build" OFF) | ||||||
| if(ENABLE_PROFILING) | if(ENABLE_PROFILING) | ||||||
|   set(ENABLE_STATIC_LIBS ON) |   set(ENABLE_STATIC_LIBS ON) | ||||||
|   if(DEFINED VOLK_CONFIGPATH) |   if(DEFINED VOLK_CONFIGPATH) | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ | |||||||
| ######################################################################## | ######################################################################## | ||||||
| if(MSVC) | if(MSVC) | ||||||
|     include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc) |     include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc) | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| include_directories( | include_directories( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR} |     ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
| @@ -39,15 +39,15 @@ set(Clang_required_link "") | |||||||
| if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||||||
|     if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |     if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||||||
|         set(Clang_required_link "c++") |         set(Clang_required_link "c++") | ||||||
|    endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |     endif() | ||||||
| endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ORC_FOUND) | if(ORC_FOUND) | ||||||
|     set(orc_lib ${ORC_LIBRARIES}) |     set(orc_lib ${ORC_LIBRARIES}) | ||||||
| elseif(ORC_FOUND) | else() | ||||||
|     set(orc_lib "") |     set(orc_lib "") | ||||||
| endif(ORC_FOUND) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| # allow 'large' files in 32 bit builds | # allow 'large' files in 32 bit builds | ||||||
| @@ -56,7 +56,7 @@ if(UNIX) | |||||||
|         -D_FILE_OFFSET_BITS=64 |         -D_FILE_OFFSET_BITS=64 | ||||||
|         -D_LARGE_FILES |         -D_LARGE_FILES | ||||||
|     ) |     ) | ||||||
| endif(UNIX) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| # MAKE volk_gnsssdr_profile | # MAKE volk_gnsssdr_profile | ||||||
| @@ -68,18 +68,18 @@ add_executable(volk_gnsssdr_profile | |||||||
|  |  | ||||||
| if(ENABLE_STATIC_LIBS) | if(ENABLE_STATIC_LIBS) | ||||||
|     target_link_libraries(volk_gnsssdr_profile volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) |     target_link_libraries(volk_gnsssdr_profile volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) | ||||||
| else(ENABLE_STATIC_LIBS) | else() | ||||||
|     target_link_libraries(volk_gnsssdr_profile volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) |     target_link_libraries(volk_gnsssdr_profile volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) | ||||||
|     add_dependencies(volk_gnsssdr_profile volk_gnsssdr) |     add_dependencies(volk_gnsssdr_profile volk_gnsssdr) | ||||||
| endif(ENABLE_STATIC_LIBS) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_STRIP) | 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 |         set_target_properties(volk_gnsssdr_profile | ||||||
|             PROPERTIES LINK_FLAGS "-s") |             PROPERTIES LINK_FLAGS "-s") | ||||||
|     endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) |     endif() | ||||||
| endif(ENABLE_STRIP) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| install( | install( | ||||||
| @@ -93,17 +93,17 @@ install( | |||||||
| add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_option_helpers.cc) | add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_option_helpers.cc) | ||||||
| if(ENABLE_STATIC_LIBS) | if(ENABLE_STATIC_LIBS) | ||||||
|     target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib}) |     target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib}) | ||||||
| else(ENABLE_STATIC_LIBS) | else() | ||||||
|     target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib}) |     target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib}) | ||||||
|     add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) |     add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) | ||||||
| endif(ENABLE_STATIC_LIBS) | endif() | ||||||
|  |  | ||||||
| if(ENABLE_STRIP) | 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 |         set_target_properties(volk_gnsssdr-config-info | ||||||
|             PROPERTIES LINK_FLAGS "-s") |             PROPERTIES LINK_FLAGS "-s") | ||||||
|     endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) |     endif() | ||||||
| endif(ENABLE_STRIP) | endif() | ||||||
|  |  | ||||||
| install( | install( | ||||||
|     TARGETS volk_gnsssdr-config-info |     TARGETS volk_gnsssdr-config-info | ||||||
| @@ -125,6 +125,3 @@ if(ENABLE_PROFILING) | |||||||
|     ) |     ) | ||||||
|     add_custom_target(volk-gnsssdr-profile-run ALL DEPENDS ${VOLK_CONFIG}) |     add_custom_target(volk-gnsssdr-profile-run ALL DEPENDS ${VOLK_CONFIG}) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -16,19 +16,22 @@ | |||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
|  |  | ||||||
|  |  | ||||||
| FIND_PACKAGE(PkgConfig) | find_package(PkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") | pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") | ||||||
|  |  | ||||||
| FIND_PROGRAM(ORCC_EXECUTABLE orcc | find_program(ORCC_EXECUTABLE orcc | ||||||
|     HINTS ${PC_ORC_TOOLSDIR} |     HINTS ${PC_ORC_TOOLSDIR} | ||||||
| 	     PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) |     PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin | ||||||
|  | ) | ||||||
|  |  | ||||||
| FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h | find_path(ORC_INCLUDE_DIR NAMES orc/orc.h | ||||||
|     HINTS ${PC_ORC_INCLUDEDIR} |     HINTS ${PC_ORC_INCLUDEDIR} | ||||||
| 	  PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) |     PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 | ||||||
|  | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} | find_path(ORC_LIBRARY_DIR | ||||||
|  |     NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} | ||||||
|     HINTS ${PC_ORC_LIBDIR} |     HINTS ${PC_ORC_LIBDIR} | ||||||
|         /usr/local/lib |         /usr/local/lib | ||||||
|         /usr/lib/x86_64-linux-gnu |         /usr/lib/x86_64-linux-gnu | ||||||
| @@ -46,22 +49,23 @@ FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHA | |||||||
|         /usr/lib/s390x-linux-gnu |         /usr/lib/s390x-linux-gnu | ||||||
|         /usr/lib64 |         /usr/lib64 | ||||||
|         /usr/lib |         /usr/lib | ||||||
| 	  PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) |     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} | ||||||
|  | ) | ||||||
|  |  | ||||||
| FIND_LIBRARY(ORC_LIB orc-0.4 | find_library(ORC_LIB orc-0.4 | ||||||
|     HINTS ${PC_ORC_LIBRARY_DIRS} |     HINTS ${PC_ORC_LIBRARY_DIRS} | ||||||
|     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) |     PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) | ||||||
|  |  | ||||||
| LIST(APPEND ORC_LIBRARY | list(APPEND ORC_LIBRARY | ||||||
|     ${ORC_LIB} |     ${ORC_LIB} | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) | set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) | ||||||
| SET(ORC_LIBRARIES ${ORC_LIBRARY}) | set(ORC_LIBRARIES ${ORC_LIBRARY}) | ||||||
| SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) | set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) | ||||||
|  |  | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) | find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) | ||||||
|  |  | ||||||
| mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) | mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) | ||||||
|   | |||||||
| @@ -30,7 +30,7 @@ set(__INCLUDED_VOLK_ADD_TEST TRUE) | |||||||
|  |  | ||||||
| function(VOLK_GEN_TEST executable_name) | function(VOLK_GEN_TEST executable_name) | ||||||
|     include(CMakeParseArgumentsCopy) |     include(CMakeParseArgumentsCopy) | ||||||
|     CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) |     cmake_parse_arguments(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) | ||||||
|     add_executable(${executable_name} ${VOLK_TEST_SOURCES}) |     add_executable(${executable_name} ${VOLK_TEST_SOURCES}) | ||||||
|     target_link_libraries(${executable_name} ${VOLK_TEST_TARGET_DEPS}) |     target_link_libraries(${executable_name} ${VOLK_TEST_TARGET_DEPS}) | ||||||
| endfunction() | endfunction() | ||||||
| @@ -53,7 +53,7 @@ function(VOLK_ADD_TEST test_name executable_name) | |||||||
|  |  | ||||||
|   #parse the arguments for component names |   #parse the arguments for component names | ||||||
|   include(CMakeParseArgumentsCopy) |   include(CMakeParseArgumentsCopy) | ||||||
|   CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) |   cmake_parse_arguments(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN}) | ||||||
|  |  | ||||||
|   #set the initial environs to use |   #set the initial environs to use | ||||||
|   set(environs ${VOLK_TEST_ENVIRONS}) |   set(environs ${VOLK_TEST_ENVIRONS}) | ||||||
| @@ -146,7 +146,7 @@ function(VOLK_ADD_TEST test_name executable_name) | |||||||
|     #each line sets an environment variable |     #each line sets an environment variable | ||||||
|     foreach(environ ${environs}) |     foreach(environ ${environs}) | ||||||
|       file(APPEND ${sh_file} "export ${environ}\n") |       file(APPEND ${sh_file} "export ${environ}\n") | ||||||
|     endforeach(environ) |     endforeach() | ||||||
|  |  | ||||||
|     set(VOLK_TEST_ARGS "${test_name}") |     set(VOLK_TEST_ARGS "${test_name}") | ||||||
|  |  | ||||||
| @@ -166,7 +166,7 @@ function(VOLK_ADD_TEST test_name executable_name) | |||||||
|       COMMAND ${SHELL} ${sh_file} ${TARGET_DIR_LIST} |       COMMAND ${SHELL} ${sh_file} ${TARGET_DIR_LIST} | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|   endif(UNIX) |   endif() | ||||||
|  |  | ||||||
|   if(WIN32) |   if(WIN32) | ||||||
|     #In the land of windows, all libraries must be in the PATH.  Since |     #In the land of windows, all libraries must be in the PATH.  Since | ||||||
| @@ -199,7 +199,7 @@ function(VOLK_ADD_TEST test_name executable_name) | |||||||
|     #each line sets an environment variable |     #each line sets an environment variable | ||||||
|     foreach(environ ${environs}) |     foreach(environ ${environs}) | ||||||
|       file(APPEND ${bat_file} "SET ${environ}\n") |       file(APPEND ${bat_file} "SET ${environ}\n") | ||||||
|     endforeach(environ) |     endforeach() | ||||||
|  |  | ||||||
|     set(VOLK_TEST_ARGS "${test_name}") |     set(VOLK_TEST_ARGS "${test_name}") | ||||||
|  |  | ||||||
| @@ -213,7 +213,7 @@ function(VOLK_ADD_TEST test_name executable_name) | |||||||
|     add_test(NAME qa_${test_name} |     add_test(NAME qa_${test_name} | ||||||
|         COMMAND ${bat_file} ${TARGET_DIR_LIST} |         COMMAND ${bat_file} ${TARGET_DIR_LIST} | ||||||
|     ) |     ) | ||||||
|   endif(WIN32) |   endif() | ||||||
|  |  | ||||||
| endfunction(VOLK_ADD_TEST) | endfunction() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -31,7 +31,7 @@ set(BOOST_REQUIRED_COMPONENTS | |||||||
|  |  | ||||||
| if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") | if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") | ||||||
|     list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix |     list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix | ||||||
| endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") | endif() | ||||||
|  |  | ||||||
| if(MSVC) | if(MSVC) | ||||||
|     set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono) |     set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono) | ||||||
| @@ -42,10 +42,10 @@ if(MSVC) | |||||||
|     set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") |     set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") | ||||||
|     if(BOOST_ALL_DYN_LINK) |     if(BOOST_ALL_DYN_LINK) | ||||||
|         add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc |         add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc | ||||||
|     else(BOOST_ALL_DYN_LINK) |     else() | ||||||
|         unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link |         unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link | ||||||
|     endif(BOOST_ALL_DYN_LINK) |     endif() | ||||||
| endif(MSVC) | endif() | ||||||
|  |  | ||||||
| find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) | find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) | ||||||
|  |  | ||||||
| @@ -68,10 +68,10 @@ set(Boost_ADDITIONAL_VERSIONS | |||||||
| # Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669 | # Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669 | ||||||
| # Similar problems with Boost 1.46 and 1.47. | # Similar problems with Boost 1.46 and 1.47. | ||||||
|  |  | ||||||
| OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF) | option(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF) | ||||||
| if(ENABLE_BAD_BOOST) | if(ENABLE_BAD_BOOST) | ||||||
|   MESSAGE(STATUS "Enabling use of known bad versions of Boost.") |     message(STATUS "Enabling use of known bad versions of Boost.") | ||||||
| endif(ENABLE_BAD_BOOST) | endif() | ||||||
|  |  | ||||||
| # For any unsuitable Boost version, add the version number below in | # For any unsuitable Boost version, add the version number below in | ||||||
| # the following format: XXYYZZ | # the following format: XXYYZZ | ||||||
| @@ -86,11 +86,11 @@ set(Boost_NOGO_VERSIONS | |||||||
| foreach(ver ${Boost_NOGO_VERSIONS}) | foreach(ver ${Boost_NOGO_VERSIONS}) | ||||||
|     if("${Boost_VERSION}" STREQUAL "${ver}") |     if("${Boost_VERSION}" STREQUAL "${ver}") | ||||||
|         if(NOT ENABLE_BAD_BOOST) |         if(NOT ENABLE_BAD_BOOST) | ||||||
|       MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.") |             message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.") | ||||||
|             set(Boost_FOUND FALSE) |             set(Boost_FOUND FALSE) | ||||||
|     else(NOT ENABLE_BAD_BOOST) |         else() | ||||||
|       MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.") |             message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.") | ||||||
|             set(Boost_FOUND TRUE) |             set(Boost_FOUND TRUE) | ||||||
|     endif(NOT ENABLE_BAD_BOOST) |         endif() | ||||||
|   endif("${Boost_VERSION}" STREQUAL "${ver}") |   endif() | ||||||
| endforeach(ver) | endforeach() | ||||||
|   | |||||||
| @@ -53,16 +53,16 @@ list(APPEND AVAIL_BUILDTYPES | |||||||
| # the avialable build types. | # the avialable build types. | ||||||
| ######################################################################## | ######################################################################## | ||||||
| function(VOLK_CHECK_BUILD_TYPE settype) | function(VOLK_CHECK_BUILD_TYPE settype) | ||||||
|   STRING(TOUPPER ${settype} _settype) |   string(TOUPPER ${settype} _settype) | ||||||
|   foreach(btype ${AVAIL_BUILDTYPES}) |   foreach(btype ${AVAIL_BUILDTYPES}) | ||||||
|     STRING(TOUPPER ${btype} _btype) |     string(TOUPPER ${btype} _btype) | ||||||
|     if(${_settype} STREQUAL ${_btype}) |     if(${_settype} STREQUAL ${_btype}) | ||||||
|       return() # found it; exit cleanly |       return() # found it; exit cleanly | ||||||
|     endif(${_settype} STREQUAL ${_btype}) |     endif() | ||||||
|   endforeach(btype) |   endforeach() | ||||||
|   # Build type not found; error out |   # Build type not found; error out | ||||||
|   message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") |   message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") | ||||||
| endfunction(VOLK_CHECK_BUILD_TYPE) | endfunction() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # For GCC and Clang, we can set a build type: | # For GCC and Clang, we can set a build type: | ||||||
| @@ -74,23 +74,23 @@ endfunction(VOLK_CHECK_BUILD_TYPE) | |||||||
| # NOTE: This is not defined on Windows systems. | # NOTE: This is not defined on Windows systems. | ||||||
| ######################################################################## | ######################################################################## | ||||||
| if(NOT WIN32) | if(NOT WIN32) | ||||||
|   SET(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING |   set(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING | ||||||
|     "Flags used by the C++ compiler during DebugParanoid builds." FORCE) |     "Flags used by the C++ compiler during DebugParanoid builds." FORCE) | ||||||
|   SET(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING |   set(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING | ||||||
|     "Flags used by the C compiler during DebugParanoid builds." FORCE) |     "Flags used by the C compiler during DebugParanoid builds." FORCE) | ||||||
|   SET(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID |   set(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used for linking binaries during NoOptWithASM builds." FORCE) |     "Flags used for linking binaries during NoOptWithASM builds." FORCE) | ||||||
|   SET(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID |   set(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) |     "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_DEBUGPARANOID |     CMAKE_CXX_FLAGS_DEBUGPARANOID | ||||||
|     CMAKE_C_FLAGS_DEBUGPARANOID |     CMAKE_C_FLAGS_DEBUGPARANOID | ||||||
|     CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID |     CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID | ||||||
|     CMAKE_SHARED_LINKER_DEBUGPARANOID) |     CMAKE_SHARED_LINKER_DEBUGPARANOID) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -105,23 +105,23 @@ endif(NOT WIN32) | |||||||
| # NOTE: This is not defined on Windows systems. | # NOTE: This is not defined on Windows systems. | ||||||
| ######################################################################## | ######################################################################## | ||||||
| if(NOT WIN32) | if(NOT WIN32) | ||||||
|   SET(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING |   set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING | ||||||
|     "Flags used by the C++ compiler during NoOptWithASM builds." FORCE) |     "Flags used by the C++ compiler during NoOptWithASM builds." FORCE) | ||||||
|   SET(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING |   set(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING | ||||||
|     "Flags used by the C compiler during NoOptWithASM builds." FORCE) |     "Flags used by the C compiler during NoOptWithASM builds." FORCE) | ||||||
|   SET(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM |   set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used for linking binaries during NoOptWithASM builds." FORCE) |     "Flags used for linking binaries during NoOptWithASM builds." FORCE) | ||||||
|   SET(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM |   set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) |     "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_NOOPTWITHASM |     CMAKE_CXX_FLAGS_NOOPTWITHASM | ||||||
|     CMAKE_C_FLAGS_NOOPTWITHASM |     CMAKE_C_FLAGS_NOOPTWITHASM | ||||||
|     CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM |     CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) |     CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -137,23 +137,23 @@ endif(NOT WIN32) | |||||||
| ######################################################################## | ######################################################################## | ||||||
|  |  | ||||||
| if(NOT WIN32) | if(NOT WIN32) | ||||||
|   SET(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING |   set(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING | ||||||
|     "Flags used by the C++ compiler during O2WithASM builds." FORCE) |     "Flags used by the C++ compiler during O2WithASM builds." FORCE) | ||||||
|   SET(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING |   set(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING | ||||||
|     "Flags used by the C compiler during O2WithASM builds." FORCE) |     "Flags used by the C compiler during O2WithASM builds." FORCE) | ||||||
|   SET(CMAKE_EXE_LINKER_FLAGS_O2WITHASM |   set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used for linking binaries during O2WithASM builds." FORCE) |     "Flags used for linking binaries during O2WithASM builds." FORCE) | ||||||
|   SET(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM |   set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during O2WithASM builds." FORCE) |     "Flags used by the shared lib linker during O2WithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_O2WITHASM |     CMAKE_CXX_FLAGS_O2WITHASM | ||||||
|     CMAKE_C_FLAGS_O2WITHASM |     CMAKE_C_FLAGS_O2WITHASM | ||||||
|     CMAKE_EXE_LINKER_FLAGS_O2WITHASM |     CMAKE_EXE_LINKER_FLAGS_O2WITHASM | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) |     CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -169,23 +169,23 @@ endif(NOT WIN32) | |||||||
| ######################################################################## | ######################################################################## | ||||||
|  |  | ||||||
| if(NOT WIN32) | if(NOT WIN32) | ||||||
|   SET(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING |   set(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING | ||||||
|     "Flags used by the C++ compiler during O3WithASM builds." FORCE) |     "Flags used by the C++ compiler during O3WithASM builds." FORCE) | ||||||
|   SET(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING |   set(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING | ||||||
|     "Flags used by the C compiler during O3WithASM builds." FORCE) |     "Flags used by the C compiler during O3WithASM builds." FORCE) | ||||||
|   SET(CMAKE_EXE_LINKER_FLAGS_O3WITHASM |   set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used for linking binaries during O3WithASM builds." FORCE) |     "Flags used for linking binaries during O3WithASM builds." FORCE) | ||||||
|   SET(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM |   set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM | ||||||
|     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING |     "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING | ||||||
|     "Flags used by the shared lib linker during O3WithASM builds." FORCE) |     "Flags used by the shared lib linker during O3WithASM builds." FORCE) | ||||||
|  |  | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_O3WITHASM |     CMAKE_CXX_FLAGS_O3WITHASM | ||||||
|     CMAKE_C_FLAGS_O3WITHASM |     CMAKE_C_FLAGS_O3WITHASM | ||||||
|     CMAKE_EXE_LINKER_FLAGS_O3WITHASM |     CMAKE_EXE_LINKER_FLAGS_O3WITHASM | ||||||
|     CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) |     CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # For GCC and Clang, we can set a build type: | # For GCC and Clang, we can set a build type: | ||||||
| @@ -197,14 +197,14 @@ endif(NOT WIN32) | |||||||
| # NOTE: This is not defined on Windows systems. | # NOTE: This is not defined on Windows systems. | ||||||
| ######################################################################## | ######################################################################## | ||||||
| if(NOT WIN32) | if(NOT WIN32) | ||||||
|   SET(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING |   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) |     "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 |   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) |     "Flags used by the C compiler during Address Sanitized builds." FORCE) | ||||||
|   MARK_AS_ADVANCED( |   mark_as_advanced( | ||||||
|     CMAKE_CXX_FLAGS_ASAN |     CMAKE_CXX_FLAGS_ASAN | ||||||
|     CMAKE_C_FLAGS_ASAN |     CMAKE_C_FLAGS_ASAN | ||||||
|     CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID |     CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID | ||||||
|     CMAKE_SHARED_LINKER_DEBUGPARANOID) |     CMAKE_SHARED_LINKER_DEBUGPARANOID) | ||||||
| endif(NOT WIN32) | endif() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -15,10 +15,10 @@ | |||||||
| # You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
|  |  | ||||||
| INCLUDE(FindPkgConfig) | include(FindPkgConfig) | ||||||
| PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) | pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) | ||||||
|  |  | ||||||
| FIND_PATH( | find_path( | ||||||
|     VOLK_GNSSSDR_INCLUDE_DIRS |     VOLK_GNSSSDR_INCLUDE_DIRS | ||||||
|     NAMES volk_gnsssdr/volk_gnsssdr.h |     NAMES volk_gnsssdr/volk_gnsssdr.h | ||||||
|     HINTS $ENV{VOLK_DIR}/include |     HINTS $ENV{VOLK_DIR}/include | ||||||
| @@ -29,7 +29,7 @@ FIND_PATH( | |||||||
|         "@CMAKE_INSTALL_PREFIX@/include" |         "@CMAKE_INSTALL_PREFIX@/include" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| FIND_LIBRARY( | find_library( | ||||||
|     VOLK_GNSSSDR_LIBRARIES |     VOLK_GNSSSDR_LIBRARIES | ||||||
|     NAMES volk_gnsssdr |     NAMES volk_gnsssdr | ||||||
|     HINTS $ENV{VOLK_DIR}/lib |     HINTS $ENV{VOLK_DIR}/lib | ||||||
| @@ -42,6 +42,6 @@ FIND_LIBRARY( | |||||||
|         "@CMAKE_INSTALL_PREFIX@/lib" |         "@CMAKE_INSTALL_PREFIX@/lib" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| INCLUDE(FindPackageHandleStandardArgs) | include(FindPackageHandleStandardArgs) | ||||||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | ||||||
| MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) | ||||||
|   | |||||||
| @@ -27,6 +27,6 @@ if(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION}) | |||||||
|     if(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) |     if(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) | ||||||
|       set(PACKAGE_VERSION_EXACT 1)    # exact match for API version |       set(PACKAGE_VERSION_EXACT 1)    # exact match for API version | ||||||
|       set(PACKAGE_VERSION_COMPATIBLE 1)  # compat for minor/patch version |       set(PACKAGE_VERSION_COMPATIBLE 1)  # compat for minor/patch version | ||||||
|     endif(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION}) |     endif() | ||||||
|   endif(${PACKAGE_FIND_VERSION_MINOR} EQUAL ${MINOR_VERSION}) |   endif() | ||||||
| endif(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION}) | endif() | ||||||
|   | |||||||
| @@ -32,26 +32,26 @@ if(CMAKE_VERSION VERSION_LESS 3.12) | |||||||
|     if(PYTHON_EXECUTABLE) |     if(PYTHON_EXECUTABLE) | ||||||
|         message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") |         message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") | ||||||
|         find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) |         find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) | ||||||
|     else(PYTHON_EXECUTABLE) |     else() | ||||||
|         message(STATUS "PYTHON_EXECUTABLE not set - using default python2") |         message(STATUS "PYTHON_EXECUTABLE not set - using default python2") | ||||||
|         message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") |         message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") | ||||||
|         find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION}) |         find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION}) | ||||||
|         if(NOT PYTHONINTERP_FOUND) |         if(NOT PYTHONINTERP_FOUND) | ||||||
|             message(STATUS "python2 not found - using python3") |             message(STATUS "python2 not found - using python3") | ||||||
|             find_package(PythonInterp ${VOLK_PYTHON3_MIN_VERSION} REQUIRED) |             find_package(PythonInterp ${VOLK_PYTHON3_MIN_VERSION} REQUIRED) | ||||||
|          endif(NOT PYTHONINTERP_FOUND) |         endif() | ||||||
|     endif(PYTHON_EXECUTABLE) |     endif() | ||||||
|     find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) |     find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) | ||||||
| else(CMAKE_VERSION VERSION_LESS 3.12) | else() | ||||||
|     if(PYTHON_EXECUTABLE) |     if(PYTHON_EXECUTABLE) | ||||||
|         message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") |         message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") | ||||||
|         find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) |         find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED) | ||||||
|     else(PYTHON_EXECUTABLE) |     else() | ||||||
|         find_package(Python COMPONENTS Interpreter) |         find_package(Python COMPONENTS Interpreter) | ||||||
|         set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR}) |         set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR}) | ||||||
|         set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) |         set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) | ||||||
|     endif(PYTHON_EXECUTABLE) |     endif() | ||||||
| endif(CMAKE_VERSION VERSION_LESS 3.12) | endif() | ||||||
|  |  | ||||||
| if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) | if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) | ||||||
|     set(PYTHON3 TRUE) |     set(PYTHON3 TRUE) | ||||||
| @@ -79,7 +79,7 @@ macro(VOLK_PYTHON_CHECK_MODULE_RAW desc python_code have) | |||||||
|         message(STATUS "Python checking for ${desc} - not found") |         message(STATUS "Python checking for ${desc} - not found") | ||||||
|         set(${have} FALSE) |         set(${have} FALSE) | ||||||
|     endif() |     endif() | ||||||
| endmacro(VOLK_PYTHON_CHECK_MODULE_RAW) | endmacro() | ||||||
|  |  | ||||||
| macro(VOLK_PYTHON_CHECK_MODULE desc mod cmd have) | macro(VOLK_PYTHON_CHECK_MODULE desc mod cmd have) | ||||||
|     VOLK_PYTHON_CHECK_MODULE_RAW( |     VOLK_PYTHON_CHECK_MODULE_RAW( | ||||||
| @@ -92,7 +92,7 @@ except (ImportError, AssertionError): exit(-1) | |||||||
| except: pass | except: pass | ||||||
| #########################################" | #########################################" | ||||||
|     "${have}") |     "${have}") | ||||||
| endmacro(VOLK_PYTHON_CHECK_MODULE) | endmacro() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Sets the python installation directory VOLK_PYTHON_DIR | # Sets the python installation directory VOLK_PYTHON_DIR | ||||||
| @@ -121,14 +121,14 @@ unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5] | |||||||
| print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" | print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" | ||||||
|     OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) |     OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) | ||||||
|     add_custom_target(${_target} ALL DEPENDS ${ARGN}) |     add_custom_target(${_target} ALL DEPENDS ${ARGN}) | ||||||
| endfunction(VOLK_UNIQUE_TARGET) | endfunction() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Install python sources (also builds and installs byte-compiled python) | # Install python sources (also builds and installs byte-compiled python) | ||||||
| ######################################################################## | ######################################################################## | ||||||
| function(VOLK_PYTHON_INSTALL) | function(VOLK_PYTHON_INSTALL) | ||||||
|     include(CMakeParseArgumentsCopy) |     include(CMakeParseArgumentsCopy) | ||||||
|     CMAKE_PARSE_ARGUMENTS(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) |     cmake_parse_arguments(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) | ||||||
|  |  | ||||||
|     #################################################################### |     #################################################################### | ||||||
|     if(VOLK_PYTHON_INSTALL_FILES) |     if(VOLK_PYTHON_INSTALL_FILES) | ||||||
| @@ -162,7 +162,7 @@ function(VOLK_PYTHON_INSTALL) | |||||||
|             get_filename_component(pygen_path ${pygenfile} PATH) |             get_filename_component(pygen_path ${pygenfile} PATH) | ||||||
|             file(MAKE_DIRECTORY ${pygen_path}) |             file(MAKE_DIRECTORY ${pygen_path}) | ||||||
|  |  | ||||||
|         endforeach(pyfile) |         endforeach() | ||||||
|  |  | ||||||
|         #the command to generate the pyc files |         #the command to generate the pyc files | ||||||
|         add_custom_command( |         add_custom_command( | ||||||
| @@ -220,13 +220,13 @@ function(VOLK_PYTHON_INSTALL) | |||||||
|                 DESTINATION ${VOLK_PYTHON_INSTALL_DESTINATION} |                 DESTINATION ${VOLK_PYTHON_INSTALL_DESTINATION} | ||||||
|                 COMPONENT ${VOLK_PYTHON_INSTALL_COMPONENT} |                 COMPONENT ${VOLK_PYTHON_INSTALL_COMPONENT} | ||||||
|             ) |             ) | ||||||
|         endforeach(pyfile) |         endforeach() | ||||||
|  |  | ||||||
|     endif() |     endif() | ||||||
|  |  | ||||||
|     VOLK_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) |     volk_unique_target("pygen" ${python_install_gen_targets}) | ||||||
|  |  | ||||||
| endfunction(VOLK_PYTHON_INSTALL) | endfunction() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Write the python helper script that generates byte code files | # Write the python helper script that generates byte code files | ||||||
|   | |||||||
| @@ -22,22 +22,22 @@ | |||||||
| # header file detection | # header file detection | ||||||
| ######################################################################## | ######################################################################## | ||||||
| include(CheckIncludeFile) | include(CheckIncludeFile) | ||||||
| CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H) | check_include_file(cpuid.h HAVE_CPUID_H) | ||||||
| if(HAVE_CPUID_H) | if(HAVE_CPUID_H) | ||||||
|     add_definitions(-DHAVE_CPUID_H) |     add_definitions(-DHAVE_CPUID_H) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| CHECK_INCLUDE_FILE(intrin.h HAVE_INTRIN_H) | check_include_file(intrin.h HAVE_INTRIN_H) | ||||||
| if(HAVE_INTRIN_H) | if(HAVE_INTRIN_H) | ||||||
|     add_definitions(-DHAVE_INTRIN_H) |     add_definitions(-DHAVE_INTRIN_H) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H) | check_include_file(fenv.h HAVE_FENV_H) | ||||||
| if(HAVE_FENV_H) | if(HAVE_FENV_H) | ||||||
|     add_definitions(-DHAVE_FENV_H) |     add_definitions(-DHAVE_FENV_H) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H) | check_include_file(dlfcn.h HAVE_DLFCN_H) | ||||||
| if(HAVE_DLFCN_H) | if(HAVE_DLFCN_H) | ||||||
|     add_definitions(-DHAVE_DLFCN_H) |     add_definitions(-DHAVE_DLFCN_H) | ||||||
|     list(APPEND volk_gnsssdr_libraries ${CMAKE_DL_LIBS}) |     list(APPEND volk_gnsssdr_libraries ${CMAKE_DL_LIBS}) | ||||||
| @@ -62,7 +62,7 @@ endif() | |||||||
| ######################################################################## | ######################################################################## | ||||||
| if(COMPILER_NAME MATCHES "GNU") | if(COMPILER_NAME MATCHES "GNU") | ||||||
|     include(CheckCXXCompilerFlag) |     include(CheckCXXCompilerFlag) | ||||||
|     CHECK_CXX_COMPILER_FLAG("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) |     check_cxx_compiler_flag("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG) | ||||||
|     if(HAVE_WERROR_UNUSED_CMD_LINE_ARG) |     if(HAVE_WERROR_UNUSED_CMD_LINE_ARG) | ||||||
|         set(VOLK_FLAG_CHECK_FLAGS "-Werror=unused-command-line-argument") |         set(VOLK_FLAG_CHECK_FLAGS "-Werror=unused-command-line-argument") | ||||||
|     endif() |     endif() | ||||||
| @@ -74,15 +74,15 @@ endif() | |||||||
| ######################################################################## | ######################################################################## | ||||||
|  |  | ||||||
| include(CheckSymbolExists) | include(CheckSymbolExists) | ||||||
| CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) | check_symbol_exists(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) | ||||||
|  |  | ||||||
| if(HAVE_POSIX_MEMALIGN) | if(HAVE_POSIX_MEMALIGN) | ||||||
|       add_definitions(-DHAVE_POSIX_MEMALIGN) |       add_definitions(-DHAVE_POSIX_MEMALIGN) | ||||||
| endif(HAVE_POSIX_MEMALIGN) | endif() | ||||||
|  |  | ||||||
| if(NOT DEFINED _XOPEN_SOURCE) | if(NOT DEFINED _XOPEN_SOURCE) | ||||||
|       add_definitions(-D_XOPEN_SOURCE=700) |       add_definitions(-D_XOPEN_SOURCE=700) | ||||||
| endif(NOT DEFINED _XOPEN_SOURCE) | endif() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # detect x86 flavor of CPU | # detect x86 flavor of CPU | ||||||
| @@ -119,7 +119,7 @@ macro(check_arch arch_name) | |||||||
|             if(VOLK_FLAG_CHECK_FLAGS) |             if(VOLK_FLAG_CHECK_FLAGS) | ||||||
|                 set(CMAKE_REQUIRED_FLAGS ${VOLK_FLAG_CHECK_FLAGS}) |                 set(CMAKE_REQUIRED_FLAGS ${VOLK_FLAG_CHECK_FLAGS}) | ||||||
|             endif() |             endif() | ||||||
|             CHECK_CXX_COMPILER_FLAG(${flag} ${have_flag}) |             check_cxx_compiler_flag(${flag} ${have_flag}) | ||||||
|             unset(CMAKE_REQUIRED_FLAGS) |             unset(CMAKE_REQUIRED_FLAGS) | ||||||
|             if(NOT ${have_flag}) |             if(NOT ${have_flag}) | ||||||
|                 set(have_${arch_name} FALSE) |                 set(have_${arch_name} FALSE) | ||||||
| @@ -129,17 +129,17 @@ macro(check_arch arch_name) | |||||||
|     if(have_${arch_name}) |     if(have_${arch_name}) | ||||||
|         list(APPEND available_archs ${arch_name}) |         list(APPEND available_archs ${arch_name}) | ||||||
|     endif() |     endif() | ||||||
| endmacro(check_arch) | endmacro() | ||||||
|  |  | ||||||
| foreach(line ${arch_flag_lines}) | foreach(line ${arch_flag_lines}) | ||||||
|     string(REGEX REPLACE "," ";" arch_flags ${line}) |     string(REGEX REPLACE "," ";" arch_flags ${line}) | ||||||
|     check_arch(${arch_flags}) |     check_arch(${arch_flags}) | ||||||
| endforeach(line) | endforeach() | ||||||
|  |  | ||||||
| macro(OVERRULE_ARCH arch reason) | macro(OVERRULE_ARCH arch reason) | ||||||
|     message(STATUS "${reason}, Overruled arch ${arch}") |     message(STATUS "${reason}, Overruled arch ${arch}") | ||||||
|     list(REMOVE_ITEM available_archs ${arch}) |     list(REMOVE_ITEM available_archs ${arch}) | ||||||
| endmacro(OVERRULE_ARCH) | endmacro() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # eliminate AVX on if not on x86, or if the compiler does not accept | # eliminate AVX on if not on x86, or if the compiler does not accept | ||||||
| @@ -152,23 +152,23 @@ if(CPU_IS_x86) | |||||||
|     # check to see if the compiler/linker works with xgetb instruction |     # check to see if the compiler/linker works with xgetb instruction | ||||||
|     if(NOT MSVC) |     if(NOT MSVC) | ||||||
|         file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "unsigned long long _xgetbv(unsigned int index) { unsigned int eax, edx; __asm__ __volatile__(\"xgetbv\" : \"=a\"(eax), \"=d\"(edx) : \"c\"(index)); return ((unsigned long long)edx << 32) | eax; } int main (void) { (void) _xgetbv(0); return (0); }") |         file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "unsigned long long _xgetbv(unsigned int index) { unsigned int eax, edx; __asm__ __volatile__(\"xgetbv\" : \"=a\"(eax), \"=d\"(edx) : \"c\"(index)); return ((unsigned long long)edx << 32) | eax; } int main (void) { (void) _xgetbv(0); return (0); }") | ||||||
|     else (NOT MSVC) |     else() | ||||||
|         #MSVC defines an intrinsic |         #MSVC defines an intrinsic | ||||||
|         file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "#include <stdio.h> \n #include <intrin.h> \n int main() { int avxSupported = 0; \n#if (_MSC_FULL_VER >= 160040219) \nint cpuInfo[4]; __cpuid(cpuInfo, 1);\nif ((cpuInfo[2] & (1 << 27) || 0) && (cpuInfo[2] & (1 << 28) || 0)) \n{\nunsigned long long xcrFeatureMask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);\n   avxSupported = (xcrFeatureMask & 0x6) == 6;}\n#endif \n return 1- avxSupported; }") |         file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "#include <stdio.h> \n #include <intrin.h> \n int main() { int avxSupported = 0; \n#if (_MSC_FULL_VER >= 160040219) \nint cpuInfo[4]; __cpuid(cpuInfo, 1);\nif ((cpuInfo[2] & (1 << 27) || 0) && (cpuInfo[2] & (1 << 28) || 0)) \n{\nunsigned long long xcrFeatureMask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);\n   avxSupported = (xcrFeatureMask & 0x6) == 6;}\n#endif \n return 1- avxSupported; }") | ||||||
|     endif(NOT MSVC) |     endif() | ||||||
|     execute_process(COMMAND ${CMAKE_C_COMPILER} -o |     execute_process(COMMAND ${CMAKE_C_COMPILER} -o | ||||||
|         ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv |         ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv | ||||||
|         ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c |         ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c | ||||||
|         OUTPUT_QUIET ERROR_QUIET |         OUTPUT_QUIET ERROR_QUIET | ||||||
|         RESULT_VARIABLE avx_compile_result) |         RESULT_VARIABLE avx_compile_result) | ||||||
|     if(NOT ${avx_compile_result} EQUAL 0) |     if(NOT ${avx_compile_result} EQUAL 0) | ||||||
|         OVERRULE_ARCH(avx "Compiler or linker missing xgetbv instruction") |         overrule_arch(avx "Compiler or linker missing xgetbv instruction") | ||||||
|     elseif(NOT CROSSCOMPILE_MULTILIB) |     elseif(NOT CROSSCOMPILE_MULTILIB) | ||||||
|         execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv |         execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv | ||||||
|             OUTPUT_QUIET ERROR_QUIET |             OUTPUT_QUIET ERROR_QUIET | ||||||
|             RESULT_VARIABLE avx_exe_result) |             RESULT_VARIABLE avx_exe_result) | ||||||
|         if(NOT ${avx_exe_result} EQUAL 0) |         if(NOT ${avx_exe_result} EQUAL 0) | ||||||
|             OVERRULE_ARCH(avx "CPU missing xgetbv") |             overrule_arch(avx "CPU missing xgetbv") | ||||||
|         else() |         else() | ||||||
|             set(HAVE_XGETBV 1) |             set(HAVE_XGETBV 1) | ||||||
|         endif() |         endif() | ||||||
| @@ -192,13 +192,13 @@ if(CPU_IS_x86) | |||||||
|           OUTPUT_QUIET ERROR_QUIET |           OUTPUT_QUIET ERROR_QUIET | ||||||
|           RESULT_VARIABLE avx_compile_result) |           RESULT_VARIABLE avx_compile_result) | ||||||
|         if(NOT ${avx_compile_result} EQUAL 0) |         if(NOT ${avx_compile_result} EQUAL 0) | ||||||
|           OVERRULE_ARCH(avx "Compiler missing cvtpi32_ps instrinsic") |           overrule_arch(avx "Compiler missing cvtpi32_ps instrinsic") | ||||||
|         elseif(NOT CROSSCOMPILE_MULTILIB) |         elseif(NOT CROSSCOMPILE_MULTILIB) | ||||||
|           execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps |           execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps | ||||||
|             OUTPUT_QUIET ERROR_QUIET |             OUTPUT_QUIET ERROR_QUIET | ||||||
|             RESULT_VARIABLE avx_exe_result) |             RESULT_VARIABLE avx_exe_result) | ||||||
|           if(NOT ${avx_exe_result} EQUAL 0) |           if(NOT ${avx_exe_result} EQUAL 0) | ||||||
|             OVERRULE_ARCH(avx "CPU missing cvtpi32_ps") |             overrule_arch(avx "CPU missing cvtpi32_ps") | ||||||
|           else() |           else() | ||||||
|             set(HAVE_AVX_CVTPI32_PS 1) |             set(HAVE_AVX_CVTPI32_PS 1) | ||||||
|           endif() |           endif() | ||||||
| @@ -207,13 +207,13 @@ if(CPU_IS_x86) | |||||||
|         endif() |         endif() | ||||||
|         file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps |         file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps | ||||||
|           ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c) |           ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c) | ||||||
|     else(CMAKE_SIZEOF_VOID_P EQUAL 4) |     else() | ||||||
|         # 64-bit compilations won't need this command so don't overrule AVX |         # 64-bit compilations won't need this command so don't overrule AVX | ||||||
|         set(HAVE_AVX_CVTPI32_PS 0) |         set(HAVE_AVX_CVTPI32_PS 0) | ||||||
|     endif(CMAKE_SIZEOF_VOID_P EQUAL 4) |     endif() | ||||||
|  |  | ||||||
|     # Disable SSE4a if Clang is less than version 3.2 |     # 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 |       # Figure out the version of Clang | ||||||
|       if(CMAKE_VERSION VERSION_LESS "2.8.10") |       if(CMAKE_VERSION VERSION_LESS "2.8.10") | ||||||
|         # Exctract the Clang version from the --version string. |         # Exctract the Clang version from the --version string. | ||||||
| @@ -222,14 +222,14 @@ if(CPU_IS_x86) | |||||||
|         execute_process(COMMAND ${CMAKE_C_COMPILER} --version |         execute_process(COMMAND ${CMAKE_C_COMPILER} --version | ||||||
|           OUTPUT_VARIABLE clang_version) |           OUTPUT_VARIABLE clang_version) | ||||||
|         string(REGEX MATCH "[0-9].[0-9]" CMAKE_C_COMPILER_VERSION ${clang_version}) |         string(REGEX MATCH "[0-9].[0-9]" CMAKE_C_COMPILER_VERSION ${clang_version}) | ||||||
|       endif(CMAKE_VERSION VERSION_LESS "2.8.10") |       endif() | ||||||
|  |  | ||||||
|       if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") |       if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") | ||||||
|         OVERRULE_ARCH(sse4_a "Clang >= 3.2 required for SSE4a") |         overrule_arch(sse4_a "Clang >= 3.2 required for SSE4a") | ||||||
|       endif(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2") |       endif() | ||||||
|     endif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") |     endif() | ||||||
|  |  | ||||||
| endif(CPU_IS_x86) | endif() | ||||||
|  |  | ||||||
| if(${HAVE_XGETBV}) | if(${HAVE_XGETBV}) | ||||||
|     add_definitions(-DHAVE_XGETBV) |     add_definitions(-DHAVE_XGETBV) | ||||||
| @@ -244,17 +244,17 @@ endif() | |||||||
| ######################################################################## | ######################################################################## | ||||||
|  |  | ||||||
| if(NOT CPU_IS_x86) | if(NOT CPU_IS_x86) | ||||||
|     OVERRULE_ARCH(3dnow "Architecture is not x86 or x86_64") |     overrule_arch(3dnow "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(mmx "Architecture is not x86 or x86_64") |     overrule_arch(mmx "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(sse "Architecture is not x86 or x86_64") |     overrule_arch(sse "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(sse2 "Architecture is not x86 or x86_64") |     overrule_arch(sse2 "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(sse3 "Architecture is not x86 or x86_64") |     overrule_arch(sse3 "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(ssse3 "Architecture is not x86 or x86_64") |     overrule_arch(ssse3 "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(sse4_a "Architecture is not x86 or x86_64") |     overrule_arch(sse4_a "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(sse4_1 "Architecture is not x86 or x86_64") |     overrule_arch(sse4_1 "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(sse4_2 "Architecture is not x86 or x86_64") |     overrule_arch(sse4_2 "Architecture is not x86 or x86_64") | ||||||
|     OVERRULE_ARCH(avx "Architecture is not x86 or x86_64") |     overrule_arch(avx "Architecture is not x86 or x86_64") | ||||||
| endif(NOT CPU_IS_x86) | endif() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Select neon based on ARM ISA version | # Select neon based on ARM ISA version | ||||||
| @@ -274,24 +274,24 @@ if(neon_compile_result) | |||||||
|         have_neonv8_result) |         have_neonv8_result) | ||||||
|  |  | ||||||
|     if(have_neonv7_result) |     if(have_neonv7_result) | ||||||
|         OVERRULE_ARCH(neonv8 "CPU is armv7") |         overrule_arch(neonv8 "CPU is armv7") | ||||||
|     endif() |     endif() | ||||||
|  |  | ||||||
|     if(have_neonv8_result) |     if(have_neonv8_result) | ||||||
|         OVERRULE_ARCH(neonv7 "CPU is armv8") |         overrule_arch(neonv7 "CPU is armv8") | ||||||
|  |     endif() | ||||||
|  | else() | ||||||
|  |     overrule_arch(neon "Compiler doesn't support NEON") | ||||||
|  |     overrule_arch(neonv7 "Compiler doesn't support NEON") | ||||||
|  |     overrule_arch(neonv8 "Compiler doesn't support NEON") | ||||||
| endif() | endif() | ||||||
| else(neon_compile_result) |  | ||||||
|     OVERRULE_ARCH(neon "Compiler doesn't support NEON") |  | ||||||
|     OVERRULE_ARCH(neonv7 "Compiler doesn't support NEON") |  | ||||||
|     OVERRULE_ARCH(neonv8 "Compiler doesn't support NEON") |  | ||||||
| endif(neon_compile_result) |  | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # implement overruling in the ORC case, | # implement overruling in the ORC case, | ||||||
| # since ORC always passes flag detection | # since ORC always passes flag detection | ||||||
| ######################################################################## | ######################################################################## | ||||||
| if(NOT ORC_FOUND) | if(NOT ORC_FOUND) | ||||||
|     OVERRULE_ARCH(orc "ORC support not found") |     overrule_arch(orc "ORC support not found") | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -302,15 +302,15 @@ if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86) | |||||||
|     include(CheckTypeSize) |     include(CheckTypeSize) | ||||||
|     check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY) |     check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY) | ||||||
|     if(${SIZEOF_CPU} EQUAL 64) |     if(${SIZEOF_CPU} EQUAL 64) | ||||||
|         OVERRULE_ARCH(32 "CPU width is 64 bits") |         overrule_arch(32 "CPU width is 64 bits") | ||||||
|     endif() |     endif() | ||||||
|     if(${SIZEOF_CPU} EQUAL 32) |     if(${SIZEOF_CPU} EQUAL 32) | ||||||
|         OVERRULE_ARCH(64 "CPU width is 32 bits") |         overrule_arch(64 "CPU width is 32 bits") | ||||||
|     endif() |     endif() | ||||||
|  |  | ||||||
|     #MSVC 64 bit does not have MMX, overrule it |     #MSVC 64 bit does not have MMX, overrule it | ||||||
|     if(${SIZEOF_CPU} EQUAL 64 AND MSVC) |     if(${SIZEOF_CPU} EQUAL 64 AND MSVC) | ||||||
|         OVERRULE_ARCH(mmx "No MMX for Win64") |         overrule_arch(mmx "No MMX for Win64") | ||||||
|     endif() |     endif() | ||||||
|  |  | ||||||
| endif() | endif() | ||||||
| @@ -344,8 +344,8 @@ foreach(arch mmx orc 64 32) | |||||||
|         else() |         else() | ||||||
|             list(REMOVE_ITEM available_machines ${machine_name_no_arch}) |             list(REMOVE_ITEM available_machines ${machine_name_no_arch}) | ||||||
|         endif() |         endif() | ||||||
|     endforeach(machine_name) |     endforeach() | ||||||
| endforeach(arch) | endforeach() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # done overrules! print the result | # done overrules! print the result | ||||||
| @@ -373,7 +373,7 @@ macro(gen_template tmpl output) | |||||||
|         ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py |         ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py | ||||||
|         --input ${tmpl} --output ${output} ${ARGN} |         --input ${tmpl} --output ${output} ${ARGN} | ||||||
|     ) |     ) | ||||||
| endmacro(gen_template) | endmacro() | ||||||
|  |  | ||||||
| file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/volk_gnsssdr) | file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/volk_gnsssdr) | ||||||
|  |  | ||||||
| @@ -399,12 +399,12 @@ if(MSVC) | |||||||
|     elseif(MSVC11) #Visual Studio 11 |     elseif(MSVC11) #Visual Studio 11 | ||||||
|         set(cmake_c_compiler_version "Microsoft Visual Studio 11.0") |         set(cmake_c_compiler_version "Microsoft Visual Studio 11.0") | ||||||
|     elseif(MSVC12) #Visual Studio 12 |     elseif(MSVC12) #Visual Studio 12 | ||||||
|         SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0") |         set(cmake_c_compiler_version "Microsoft Visual Studio 12.0") | ||||||
|     endif() |     endif() | ||||||
| else() | else() | ||||||
|     execute_process(COMMAND ${CMAKE_C_COMPILER} --version |     execute_process(COMMAND ${CMAKE_C_COMPILER} --version | ||||||
|             OUTPUT_VARIABLE cmake_c_compiler_version) |             OUTPUT_VARIABLE cmake_c_compiler_version) | ||||||
| endif(MSVC) | endif() | ||||||
| set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n") | set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n") | ||||||
|  |  | ||||||
| foreach(machine_name ${available_machines}) | foreach(machine_name ${available_machines}) | ||||||
| @@ -419,7 +419,7 @@ foreach(machine_name ${available_machines}) | |||||||
|         --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" |         --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" | ||||||
|         OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE |         OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE | ||||||
|     ) |     ) | ||||||
|     MESSAGE(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") |     message(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") | ||||||
|     set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n") |     set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n") | ||||||
|     if(${machine_name}_flags AND NOT MSVC) |     if(${machine_name}_flags AND NOT MSVC) | ||||||
|         set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}") |         set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}") | ||||||
| @@ -428,12 +428,12 @@ foreach(machine_name ${available_machines}) | |||||||
|     #add to available machine defs |     #add to available machine defs | ||||||
|     string(TOUPPER LV_MACHINE_${machine_name} machine_def) |     string(TOUPPER LV_MACHINE_${machine_name} machine_def) | ||||||
|     list(APPEND machine_defs ${machine_def}) |     list(APPEND machine_defs ${machine_def}) | ||||||
| endforeach(machine_name) | endforeach() | ||||||
|  |  | ||||||
| # Convert to a C string to compile and display properly | # Convert to a C string to compile and display properly | ||||||
| string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version) | string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version) | ||||||
| string(STRIP ${COMPILER_INFO} COMPILER_INFO) | string(STRIP ${COMPILER_INFO} COMPILER_INFO) | ||||||
| MESSAGE(STATUS "Compiler Version: ${cmake_c_compiler_version}") | message(STATUS "Compiler Version: ${cmake_c_compiler_version}") | ||||||
| string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version}) | string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version}) | ||||||
| string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO}) | string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO}) | ||||||
|  |  | ||||||
| @@ -474,15 +474,15 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") | |||||||
|       foreach(asm_file ${asm_files}) |       foreach(asm_file ${asm_files}) | ||||||
|         list(APPEND volk_gnsssdr_sources ${asm_file}) |         list(APPEND volk_gnsssdr_sources ${asm_file}) | ||||||
|         message(STATUS "Adding source file: ${asm_file}") |         message(STATUS "Adding source file: ${asm_file}") | ||||||
|       endforeach(asm_file) |       endforeach() | ||||||
|     endif() |     endif() | ||||||
|     enable_language(ASM) |     enable_language(ASM) | ||||||
|     set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) |     set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) | ||||||
|     message(STATUS "c flags: ${FULL_C_FLAGS}") |     message(STATUS "c flags: ${FULL_C_FLAGS}") | ||||||
|     message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") |     message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") | ||||||
|   endforeach(ARCH) |   endforeach() | ||||||
|  |  | ||||||
| else(${CMAKE_VERSION} VERSION_GREATER "2.8.9") | else() | ||||||
|   message(STATUS "Not enabling ASM support. CMake >= 2.8.10 required.") |   message(STATUS "Not enabling ASM support. CMake >= 2.8.10 required.") | ||||||
|   foreach(machine_name ${available_machines}) |   foreach(machine_name ${available_machines}) | ||||||
|     string(REGEX MATCH "neon" NEON_MACHINE ${machine_name}) |     string(REGEX MATCH "neon" NEON_MACHINE ${machine_name}) | ||||||
| @@ -490,7 +490,7 @@ else(${CMAKE_VERSION} VERSION_GREATER "2.8.9") | |||||||
|       message(FATAL_ERROR "CMake >= 2.8.10 is required for ARM NEON support") |       message(FATAL_ERROR "CMake >= 2.8.10 is required for ARM NEON support") | ||||||
|     endif() |     endif() | ||||||
|   endforeach() |   endforeach() | ||||||
| endif(${CMAKE_VERSION} VERSION_GREATER "2.8.9") | endif() | ||||||
|  |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Handle orc support | # Handle orc support | ||||||
| @@ -517,7 +517,7 @@ if(ORC_FOUND) | |||||||
|         ) |         ) | ||||||
|         list(APPEND volk_gnsssdr_sources ${orcc_gen}) |         list(APPEND volk_gnsssdr_sources ${orcc_gen}) | ||||||
|  |  | ||||||
|     endforeach(orc_file) |     endforeach() | ||||||
| else() | else() | ||||||
|     message(STATUS "Did not find liborc and orcc, disabling orc support...") |     message(STATUS "Did not find liborc and orcc, disabling orc support...") | ||||||
| endif() | endif() | ||||||
| @@ -597,7 +597,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7") | |||||||
|         install(TARGETS volk_gnsssdr_static |         install(TARGETS volk_gnsssdr_static | ||||||
|             ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" |             ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" | ||||||
|         ) |         ) | ||||||
|     endif(ENABLE_STATIC_LIBS) |     endif() | ||||||
|  |  | ||||||
| #Older cmake versions (slower to build when building dynamic/static libs) | #Older cmake versions (slower to build when building dynamic/static libs) | ||||||
| else() | else() | ||||||
| @@ -619,14 +619,14 @@ else() | |||||||
|         if(NOT WIN32) |         if(NOT WIN32) | ||||||
|             set_target_properties(volk_gnsssdr_static |             set_target_properties(volk_gnsssdr_static | ||||||
|                 PROPERTIES OUTPUT_NAME volk_gnsssdr) |                 PROPERTIES OUTPUT_NAME volk_gnsssdr) | ||||||
|         endif(NOT WIN32) |         endif() | ||||||
|  |  | ||||||
|         install(TARGETS volk_gnsssdr_static |         install(TARGETS volk_gnsssdr_static | ||||||
|             ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel"   # .lib file |             ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel"   # .lib file | ||||||
|         ) |         ) | ||||||
|     endif(ENABLE_STATIC_LIBS) |     endif() | ||||||
|  | endif() | ||||||
|  |  | ||||||
| endif(CMAKE_VERSION VERSION_GREATER "2.8.7") |  | ||||||
| ######################################################################## | ######################################################################## | ||||||
| # Build the QA test application | # Build the QA test application | ||||||
| ######################################################################## | ######################################################################## | ||||||
| @@ -641,7 +641,7 @@ if(ENABLE_TESTING) | |||||||
|     ) |     ) | ||||||
|  |  | ||||||
|     include(VolkAddTest) |     include(VolkAddTest) | ||||||
|     VOLK_GEN_TEST("volk_gnsssdr_test_all" |     volk_gen_test("volk_gnsssdr_test_all" | ||||||
|         SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc |         SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc | ||||||
|         ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc |         ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc | ||||||
|         TARGET_DEPS volk_gnsssdr |         TARGET_DEPS volk_gnsssdr | ||||||
| @@ -649,7 +649,7 @@ if(ENABLE_TESTING) | |||||||
|     foreach(kernel ${h_files}) |     foreach(kernel ${h_files}) | ||||||
|       get_filename_component(kernel ${kernel} NAME) |       get_filename_component(kernel ${kernel} NAME) | ||||||
|       string(REPLACE ".h" "" kernel ${kernel}) |       string(REPLACE ".h" "" kernel ${kernel}) | ||||||
|       VOLK_ADD_TEST(${kernel} "volk_gnsssdr_test_all") |       volk_add_test(${kernel} "volk_gnsssdr_test_all") | ||||||
|     endforeach() |     endforeach() | ||||||
|  |  | ||||||
| endif(ENABLE_TESTING) | endif() | ||||||
|   | |||||||
| @@ -39,10 +39,27 @@ include_directories( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) | add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) | source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) | ||||||
|  |  | ||||||
| if(MATIO_FOUND) | if(MATIO_FOUND) | ||||||
|     add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) |     add_dependencies(obs_gr_blocks | ||||||
| else(MATIO_FOUND) |         gnss_sp_libs | ||||||
|     add_dependencies(obs_gr_blocks gnss_sp_libs glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) |         glog-${glog_RELEASE} | ||||||
| endif(MATIO_FOUND) |         armadillo-${armadillo_RELEASE} | ||||||
| target_link_libraries(obs_gr_blocks gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES} ${ARMADILLO_LIBRARIES} ${MATIO_LIBRARIES}) |     ) | ||||||
|  | else() | ||||||
|  |     add_dependencies(obs_gr_blocks | ||||||
|  |         gnss_sp_libs | ||||||
|  |         glog-${glog_RELEASE} | ||||||
|  |         armadillo-${armadillo_RELEASE} | ||||||
|  |         matio-${GNSSSDR_MATIO_LOCAL_VERSION} | ||||||
|  |     ) | ||||||
|  | endif() | ||||||
|  |  | ||||||
|  | target_link_libraries(obs_gr_blocks | ||||||
|  |     gnss_sp_libs | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${ARMADILLO_LIBRARIES} | ||||||
|  |     ${MATIO_LIBRARIES} | ||||||
|  | ) | ||||||
|   | |||||||
| @@ -16,12 +16,12 @@ | |||||||
| # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. | ||||||
| # | # | ||||||
|  |  | ||||||
|  |  | ||||||
| set(RESAMPLER_ADAPTER_SOURCES | set(RESAMPLER_ADAPTER_SOURCES | ||||||
|     direct_resampler_conditioner.cc |     direct_resampler_conditioner.cc | ||||||
|     mmse_resampler_conditioner.cc |     mmse_resampler_conditioner.cc | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| set(RESAMPLER_ADAPTER_HEADERS | set(RESAMPLER_ADAPTER_HEADERS | ||||||
|     direct_resampler_conditioner.h |     direct_resampler_conditioner.h | ||||||
|     mmse_resampler_conditioner.h |     mmse_resampler_conditioner.h | ||||||
| @@ -37,14 +37,18 @@ include_directories( | |||||||
|     ${VOLK_INCLUDE_DIRS} |     ${VOLK_INCLUDE_DIRS} | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") | if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") | ||||||
|     add_definitions(-DGR_GREATER_38=1) |     add_definitions(-DGR_GREATER_38=1) | ||||||
| endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4" ) | endif() | ||||||
|  |  | ||||||
| list(SORT RESAMPLER_ADAPTER_HEADERS) | list(SORT RESAMPLER_ADAPTER_HEADERS) | ||||||
| list(SORT RESAMPLER_ADAPTER_SOURCES) | list(SORT RESAMPLER_ADAPTER_SOURCES) | ||||||
|  |  | ||||||
| add_library(resampler_adapters ${RESAMPLER_ADAPTER_SOURCES} ${RESAMPLER_ADAPTER_HEADERS}) | add_library(resampler_adapters | ||||||
|  |     ${RESAMPLER_ADAPTER_SOURCES} | ||||||
|  |     ${RESAMPLER_ADAPTER_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) | source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) | ||||||
|  |  | ||||||
| target_link_libraries(resampler_adapters resampler_gr_blocks) | target_link_libraries(resampler_adapters resampler_gr_blocks) | ||||||
|   | |||||||
| @@ -63,6 +63,17 @@ MmseResamplerConditioner::MmseResamplerConditioner( | |||||||
|     if (item_type_.compare("gr_complex") == 0) |     if (item_type_.compare("gr_complex") == 0) | ||||||
|         { |         { | ||||||
|             item_size_ = sizeof(gr_complex); |             item_size_ = sizeof(gr_complex); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |             //create a FIR low pass filter | ||||||
|  |             std::vector<float> taps = gr::filter::firdes::low_pass(1.0, | ||||||
|  |                 sample_freq_in_, | ||||||
|  |                 sample_freq_out_ / 2.1, | ||||||
|  |                 sample_freq_out_ / 10, | ||||||
|  |                 gr::filter::firdes::win_type::WIN_HAMMING); | ||||||
|  |             std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps" << std::endl; | ||||||
|  |             fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); | ||||||
|  |  | ||||||
| #ifdef GR_GREATER_38 | #ifdef GR_GREATER_38 | ||||||
|             resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); |             resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); | ||||||
| #else | #else | ||||||
| @@ -96,18 +107,17 @@ MmseResamplerConditioner::MmseResamplerConditioner( | |||||||
|  |  | ||||||
|  |  | ||||||
| MmseResamplerConditioner::~MmseResamplerConditioner() {} | MmseResamplerConditioner::~MmseResamplerConditioner() {} | ||||||
|  |  | ||||||
|  |  | ||||||
| void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) | void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) | ||||||
| { | { | ||||||
|     if (dump_) |     if (dump_) | ||||||
|         { |         { | ||||||
|  |             top_block->connect(fir_filter_ccf_, 0, resampler_, 0); | ||||||
|             top_block->connect(resampler_, 0, file_sink_, 0); |             top_block->connect(resampler_, 0, file_sink_, 0); | ||||||
|             DLOG(INFO) << "connected resampler to file sink"; |             DLOG(INFO) << "connected resampler to file sink"; | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
|         { |         { | ||||||
|             DLOG(INFO) << "nothing to connect internally"; |             top_block->connect(fir_filter_ccf_, 0, resampler_, 0); | ||||||
|         } |         } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -116,14 +126,19 @@ void MmseResamplerConditioner::disconnect(gr::top_block_sptr top_block) | |||||||
| { | { | ||||||
|     if (dump_) |     if (dump_) | ||||||
|         { |         { | ||||||
|  |             top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0); | ||||||
|             top_block->disconnect(resampler_, 0, file_sink_, 0); |             top_block->disconnect(resampler_, 0, file_sink_, 0); | ||||||
|         } |         } | ||||||
|  |     else | ||||||
|  |         { | ||||||
|  |             top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0); | ||||||
|  |         } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| gr::basic_block_sptr MmseResamplerConditioner::get_left_block() | gr::basic_block_sptr MmseResamplerConditioner::get_left_block() | ||||||
| { | { | ||||||
|     return resampler_; |     return fir_filter_ccf_; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,9 +36,13 @@ | |||||||
| #include "gnss_block_interface.h" | #include "gnss_block_interface.h" | ||||||
| #ifdef GR_GREATER_38 | #ifdef GR_GREATER_38 | ||||||
| #include <gnuradio/filter/mmse_resampler_cc.h> | #include <gnuradio/filter/mmse_resampler_cc.h> | ||||||
|  | #include <gnuradio/filter/fir_filter_blk.h> | ||||||
| #else | #else | ||||||
| #include <gnuradio/filter/fractional_resampler_cc.h> | #include <gnuradio/filter/fractional_resampler_cc.h> | ||||||
|  | #include <gnuradio/filter/fir_filter_ccf.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | #include <gnuradio/filter/firdes.h> | ||||||
| #include <string> | #include <string> | ||||||
|  |  | ||||||
| class ConfigurationInterface; | class ConfigurationInterface; | ||||||
| @@ -91,6 +95,7 @@ private: | |||||||
| #else | #else | ||||||
|     gr::filter::fractional_resampler_cc::sptr resampler_; |     gr::filter::fractional_resampler_cc::sptr resampler_; | ||||||
| #endif | #endif | ||||||
|  |     gr::filter::fir_filter_ccf::sptr fir_filter_ccf_; | ||||||
|     gr::block_sptr file_sink_; |     gr::block_sptr file_sink_; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -40,6 +40,11 @@ include_directories( | |||||||
| list(SORT RESAMPLER_GR_BLOCKS_HEADERS) | list(SORT RESAMPLER_GR_BLOCKS_HEADERS) | ||||||
| list(SORT RESAMPLER_GR_BLOCKS_SOURCES) | list(SORT RESAMPLER_GR_BLOCKS_SOURCES) | ||||||
|  |  | ||||||
| add_library(resampler_gr_blocks ${RESAMPLER_GR_BLOCKS_SOURCES} ${RESAMPLER_GR_BLOCKS_HEADERS}) | add_library(resampler_gr_blocks | ||||||
|  |     ${RESAMPLER_GR_BLOCKS_SOURCES} | ||||||
|  |     ${RESAMPLER_GR_BLOCKS_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) | source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) | ||||||
|  |  | ||||||
| add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) | add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) | ||||||
| @@ -31,9 +31,15 @@ include_directories( | |||||||
|     ${GNURADIO_RUNTIME_INCLUDE_DIRS} |     ${GNURADIO_RUNTIME_INCLUDE_DIRS} | ||||||
| ) | ) | ||||||
|  |  | ||||||
| add_library(signal_generator_adapters ${SIGNAL_GENERATOR_ADAPTER_SOURCES} ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) | add_library(signal_generator_adapters | ||||||
|  |     ${SIGNAL_GENERATOR_ADAPTER_SOURCES} | ||||||
|  |     ${SIGNAL_GENERATOR_ADAPTER_HEADERS} | ||||||
|  | ) | ||||||
|  |  | ||||||
| source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) | source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) | ||||||
| target_link_libraries(signal_generator_adapters gnss_sp_libs  |  | ||||||
|  | target_link_libraries(signal_generator_adapters | ||||||
|  |     gnss_sp_libs | ||||||
|     signal_generator_blocks |     signal_generator_blocks | ||||||
|     ${GNURADIO_RUNTIME_LIBRARIES} |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|     ${GNURADIO_BLOCKS_LIBRARIES} |     ${GNURADIO_BLOCKS_LIBRARIES} | ||||||
|   | |||||||
| @@ -31,16 +31,24 @@ include_directories( | |||||||
|     ${VOLK_GNSSSDR_INCLUDE_DIRS} |     ${VOLK_GNSSSDR_INCLUDE_DIRS} | ||||||
| ) | ) | ||||||
|  |  | ||||||
| add_library(signal_generator_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS}) | add_library(signal_generator_blocks | ||||||
| source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) |     ${SIGNAL_GENERATOR_BLOCK_SOURCES} | ||||||
| target_link_libraries(signal_generator_blocks gnss_system_parameters gnss_sp_libs |     ${SIGNAL_GENERATOR_BLOCK_HEADERS} | ||||||
|                                               ${GNURADIO_RUNTIME_LIBRARIES} |  | ||||||
|                                               ${GNURADIO_FFT_LIBRARIES} |  | ||||||
|                                               ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} |  | ||||||
| ) | ) | ||||||
|  |  | ||||||
| if(VOLK_GNSSSDR_FOUND) | source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) | ||||||
|  |  | ||||||
|  | target_link_libraries(signal_generator_blocks | ||||||
|  |     gnss_system_parameters | ||||||
|  |     gnss_sp_libs | ||||||
|  |     ${GNURADIO_RUNTIME_LIBRARIES} | ||||||
|  |     ${GNURADIO_FFT_LIBRARIES} | ||||||
|  |     ${VOLK_GNSSSDR_LIBRARIES} | ||||||
|  |     ${ORC_LIBRARIES} | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | if(VOLKGNSSSDR_FOUND) | ||||||
|     # add_dependencies(signal_generator_blocks glog-${glog_RELEASE}) |     # add_dependencies(signal_generator_blocks glog-${glog_RELEASE}) | ||||||
| else(VOLK_GNSSSDR_FOUND) | else() | ||||||
|     add_dependencies(signal_generator_blocks volk_gnsssdr_module) |     add_dependencies(signal_generator_blocks volk_gnsssdr_module) | ||||||
| endif(VOLK_GNSSSDR_FOUND) | endif() | ||||||
|   | |||||||
| @@ -23,30 +23,30 @@ if(ENABLE_RAW_UDP) | |||||||
|     find_package(PCAP) |     find_package(PCAP) | ||||||
|     if(NOT PCAP_FOUND) |     if(NOT PCAP_FOUND) | ||||||
|         message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") |         message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") | ||||||
|     endif(NOT PCAP_FOUND) |     endif() | ||||||
|     get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) |     get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) | ||||||
|     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) |     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) | ||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) | ||||||
|     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) |     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) | ||||||
|     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h) |     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h) | ||||||
| endif(ENABLE_RAW_UDP) | endif() | ||||||
|  |  | ||||||
| if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) | if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) | ||||||
|     find_package(Griio REQUIRED) |     find_package(GRIIO REQUIRED) | ||||||
|     if(NOT IIO_FOUND) |     if(NOT GRIIO_FOUND) | ||||||
|         message(STATUS "gnuradio-iio not found, its installation is required.") |         message(STATUS "gnuradio-iio not found, its installation is required.") | ||||||
|         message(STATUS "Please build and install the following projects:") |         message(STATUS "Please build and install the following projects:") | ||||||
|         message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") |         message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") | ||||||
|         message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") |         message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") | ||||||
|         message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") |         message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") | ||||||
|         message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") |         message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") | ||||||
|     endif(NOT IIO_FOUND) |     endif() | ||||||
|     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) |     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) | ||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) | ||||||
| endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) | endif() | ||||||
|  |  | ||||||
| if(ENABLE_AD9361) | if(ENABLE_AD9361) | ||||||
|     find_package(libiio REQUIRED) |     find_package(LIBIIO REQUIRED) | ||||||
|     if(NOT LIBIIO_FOUND) |     if(NOT LIBIIO_FOUND) | ||||||
|         message(STATUS "libiio not found, its installation is required.") |         message(STATUS "libiio not found, its installation is required.") | ||||||
|         message(STATUS "Please build and install the following projects:") |         message(STATUS "Please build and install the following projects:") | ||||||
| @@ -54,32 +54,33 @@ if(ENABLE_AD9361) | |||||||
|         message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") |         message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") | ||||||
|         message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") |         message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") | ||||||
|         message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") |         message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") | ||||||
|     endif(NOT LIBIIO_FOUND) |     endif() | ||||||
|     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) |     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) | ||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) | ||||||
| endif(ENABLE_AD9361) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_PLUTOSDR) | if(ENABLE_PLUTOSDR) | ||||||
|     ############################################## |     ############################################## | ||||||
|     # ADALM-PLUTO (Analog Devices Inc.) |     # ADALM-PLUTO (Analog Devices Inc.) | ||||||
|     ############################################## |     ############################################## | ||||||
|     if(IIO_FOUND) |     if(GRIIO_FOUND) | ||||||
|         set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) |         set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) | ||||||
|         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h) |         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h) | ||||||
|     endif(IIO_FOUND) |     endif() | ||||||
| endif(ENABLE_PLUTOSDR) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_FMCOMMS2) | if(ENABLE_FMCOMMS2) | ||||||
|     ############################################### |     ############################################### | ||||||
|     # FMCOMMS2 based SDR Hardware |     # FMCOMMS2 based SDR Hardware | ||||||
|     ############################################### |     ############################################### | ||||||
|     if(IIO_FOUND) |     if(GRIIO_FOUND) | ||||||
|         set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) |         set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) | ||||||
|         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h) |         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h) | ||||||
|     endif(IIO_FOUND) |     endif() | ||||||
| endif(ENABLE_FMCOMMS2) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_AD9361) | if(ENABLE_AD9361) | ||||||
|     ############################################### |     ############################################### | ||||||
| @@ -88,36 +89,34 @@ if(ENABLE_AD9361) | |||||||
|     if(LIBIIO_FOUND) |     if(LIBIIO_FOUND) | ||||||
|         set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc) |         set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc) | ||||||
|         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h) |         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h) | ||||||
|     endif(LIBIIO_FOUND) |     endif() | ||||||
| endif(ENABLE_AD9361) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_GN3S) | if(ENABLE_GN3S) | ||||||
|     ############################################## |     ############################################## | ||||||
|     # GN3S (USB dongle) |     # GN3S (USB dongle) | ||||||
|     ############################################## |     ############################################## | ||||||
|      find_package(GrGN3S REQUIRED) |     find_package(GRGN3S REQUIRED) | ||||||
|      if(NOT GR_GN3S_FOUND) |     if(NOT GRGN3S_FOUND) | ||||||
|         message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") |         message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") | ||||||
|         message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") |         message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") | ||||||
|      endif(NOT GR_GN3S_FOUND) |     endif() | ||||||
|     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) |     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) | ||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) | ||||||
|     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) |     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) | ||||||
|     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) |     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) | ||||||
| endif(ENABLE_GN3S) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_FLEXIBAND) | if(ENABLE_FLEXIBAND) | ||||||
|     ############################################## |     ############################################## | ||||||
|     # TELEORBIT FLEXIBAND FRONTEND ADAPTER |     # TELEORBIT FLEXIBAND FRONTEND ADAPTER | ||||||
|     ############################################## |     ############################################## | ||||||
|      find_package(Teleorbit REQUIRED) |     find_package(TELEORBIT REQUIRED) | ||||||
|     if(NOT TELEORBIT_FOUND) |     if(NOT TELEORBIT_FOUND) | ||||||
|         message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") |         message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") | ||||||
|      endif(NOT TELEORBIT_FOUND) |     endif() | ||||||
|  |  | ||||||
|     # Set up variables |     # Set up variables | ||||||
|     set(FLEXIBAND_DRIVER_INCLUDE_DIRS |     set(FLEXIBAND_DRIVER_INCLUDE_DIRS | ||||||
|         ${OPT_DRIVER_INCLUDE_DIRS} |         ${OPT_DRIVER_INCLUDE_DIRS} | ||||||
| @@ -127,23 +126,23 @@ if(ENABLE_FLEXIBAND) | |||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) | ||||||
|     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) |     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) | ||||||
|     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) |     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) | ||||||
| endif(ENABLE_FLEXIBAND) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_ARRAY) | if(ENABLE_ARRAY) | ||||||
|     ############################################## |     ############################################## | ||||||
|     # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE |     # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE | ||||||
|     ############################################## |     ############################################## | ||||||
|      find_package(GrDbfcttc REQUIRED) |     find_package(GRDBFCTTC REQUIRED) | ||||||
|      if(NOT GR_DBFCTTC_FOUND) |     if(NOT GRDBFCTTC_FOUND) | ||||||
|         message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") |         message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") | ||||||
|         message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") |         message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") | ||||||
|      endif(NOT GR_DBFCTTC_FOUND) |     endif() | ||||||
|     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) |     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) | ||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) | ||||||
|     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) |     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) | ||||||
|     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) |     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h) | ||||||
| endif(ENABLE_ARRAY) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_OSMOSDR) | if(ENABLE_OSMOSDR) | ||||||
| @@ -153,8 +152,8 @@ if(ENABLE_OSMOSDR) | |||||||
|     if(NOT GROSMOSDR_FOUND) |     if(NOT GROSMOSDR_FOUND) | ||||||
|         if(ENABLE_PACKAGING) |         if(ENABLE_PACKAGING) | ||||||
|             list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h) |             list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h) | ||||||
|         endif(ENABLE_PACKAGING) |         endif() | ||||||
|     else(NOT GROSMOSDR_FOUND) |     else() | ||||||
|         # set OSMO include dirs |         # set OSMO include dirs | ||||||
|         set(OSMO_DRIVER_INCLUDE_DIRS |         set(OSMO_DRIVER_INCLUDE_DIRS | ||||||
|             ${OPT_DRIVER_INCLUDE_DIRS} |             ${OPT_DRIVER_INCLUDE_DIRS} | ||||||
| @@ -164,18 +163,20 @@ if(ENABLE_OSMOSDR) | |||||||
|         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h) |         set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h) | ||||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES}) |         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES}) | ||||||
|         set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS}) |         set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS}) | ||||||
|     endif(NOT GROSMOSDR_FOUND) |     endif() | ||||||
| endif(ENABLE_OSMOSDR) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) | if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) | ||||||
|     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc) |     set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc) | ||||||
|     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) |     set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) | ||||||
|     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) |     set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) | ||||||
|     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS}) |     set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS}) | ||||||
| endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) | endif() | ||||||
|  |  | ||||||
|  |  | ||||||
| set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc | set(SIGNAL_SOURCE_ADAPTER_SOURCES | ||||||
|  |     file_signal_source.cc | ||||||
|     gen_signal_source.cc |     gen_signal_source.cc | ||||||
|     nsr_file_signal_source.cc |     nsr_file_signal_source.cc | ||||||
|     spir_file_signal_source.cc |     spir_file_signal_source.cc | ||||||
| @@ -185,7 +186,8 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc | |||||||
|     ${OPT_DRIVER_SOURCES} |     ${OPT_DRIVER_SOURCES} | ||||||
| ) | ) | ||||||
|  |  | ||||||
| set(SIGNAL_SOURCE_ADAPTER_HEADERS file_signal_source.h | set(SIGNAL_SOURCE_ADAPTER_HEADERS | ||||||
|  |     file_signal_source.h | ||||||
|     gen_signal_source.h |     gen_signal_source.h | ||||||
|     nsr_file_signal_source.h |     nsr_file_signal_source.h | ||||||
|     spir_file_signal_source.h |     spir_file_signal_source.h | ||||||
| @@ -203,7 +205,7 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) | |||||||
|     set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} |     set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS} | ||||||
|         two_bit_cpx_file_signal_source.h |         two_bit_cpx_file_signal_source.h | ||||||
|         two_bit_packed_file_signal_source.h) |         two_bit_packed_file_signal_source.h) | ||||||
| endif(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) | endif() | ||||||
|  |  | ||||||
| include_directories( | include_directories( | ||||||
|     ${CMAKE_CURRENT_SOURCE_DIR} |     ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
| @@ -222,7 +224,7 @@ include_directories( | |||||||
|  |  | ||||||
| if(ARCH_64BITS) | if(ARCH_64BITS) | ||||||
|     add_definitions(-DARCH_64BITS=1) |     add_definitions(-DARCH_64BITS=1) | ||||||
| endif(ARCH_64BITS) | endif() | ||||||
|  |  | ||||||
| add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") | add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") | ||||||
|  |  | ||||||
|   | |||||||
| @@ -59,7 +59,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* | |||||||
|     adc_bits_ = configuration->property(role + ".adc_bits", 4); |     adc_bits_ = configuration->property(role + ".adc_bits", 4); | ||||||
|     n_channels_ = configuration->property(role + ".total_channels", 1); |     n_channels_ = configuration->property(role + ".total_channels", 1); | ||||||
|     sel_ch_ = configuration->property(role + ".sel_ch", 1); |     sel_ch_ = configuration->property(role + ".sel_ch", 1); | ||||||
|     item_size_ = sizeof(int); |     item_size_ = sizeof(int32_t); | ||||||
|     int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", 65536); |     int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", 65536); | ||||||
|     double sample_size_byte = static_cast<double>(adc_bits_) / 4.0; |     double sample_size_byte = static_cast<double>(adc_bits_) / 4.0; | ||||||
|  |  | ||||||
| @@ -69,17 +69,22 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* | |||||||
|         } |         } | ||||||
|     if (n_channels_ > 1) |     if (n_channels_ > 1) | ||||||
|         { |         { | ||||||
|             for (uint32_t i = 0; i < (n_channels_ - 1); i++) |             for (uint32_t i = 0; i < n_channels_; i++) | ||||||
|                 { |                 { | ||||||
|                     null_sinks_.push_back(gr::blocks::null_sink::make(item_size_)); |                     null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex))); | ||||||
|  |                     unpack_spir_vec_.push_back(make_unpack_spir_gss6450_samples(adc_bits_)); | ||||||
|  |                     if (endian_swap_) | ||||||
|  |                         { | ||||||
|  |                             endian_vec_.push_back(gr::blocks::endian_swap::make(item_size_)); | ||||||
|  |                         } | ||||||
|                 } |                 } | ||||||
|             DLOG(INFO) << "NUMBER OF NULL SINKS = " << null_sinks_.size(); |  | ||||||
|         } |         } | ||||||
|     try |     try | ||||||
|         { |         { | ||||||
|             file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); |             file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_); | ||||||
|             file_source_->seek(bytes_seek / item_size_, SEEK_SET); |             file_source_->seek(bytes_seek / item_size_, SEEK_SET); | ||||||
|             unpack_spir_ = make_unpack_spir_gss6450_samples(adc_bits_); |  | ||||||
|  |  | ||||||
|             deint_ = gr::blocks::deinterleave::make(item_size_); |             deint_ = gr::blocks::deinterleave::make(item_size_); | ||||||
|         } |         } | ||||||
|     catch (const std::exception& e) |     catch (const std::exception& e) | ||||||
| @@ -143,22 +148,19 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* | |||||||
|     LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; |     LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; | ||||||
|     std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; |     std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl; | ||||||
|  |  | ||||||
|     valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_); |     for (uint32_t i = 0; i < (n_channels_); i++) | ||||||
|     DLOG(INFO) << "valve(" << valve_->unique_id() << ")"; |         { | ||||||
|  |             valve_vec_.push_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_)); | ||||||
|             if (dump_) |             if (dump_) | ||||||
|                 { |                 { | ||||||
|             sink_ = gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str()); |                     sink_vec_.push_back(gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str())); | ||||||
|             DLOG(INFO) << "file_sink(" << sink_->unique_id() << ")"; |  | ||||||
|                 } |                 } | ||||||
|             if (enable_throttle_control_) |             if (enable_throttle_control_) | ||||||
|                 { |                 { | ||||||
|             throttle_ = gr::blocks::throttle::make(sizeof(gr_complex), sampling_frequency_); |                     throttle_vec_.push_back(gr::blocks::throttle::make(sizeof(gr_complex), sampling_frequency_)); | ||||||
|                 } |                 } | ||||||
|     if (endian_swap_) |  | ||||||
|         { |  | ||||||
|             endian_ = gr::blocks::endian_swap::make(item_size_); |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     DLOG(INFO) << "File source filename " << filename_; |     DLOG(INFO) << "File source filename " << filename_; | ||||||
|     DLOG(INFO) << "Samples " << samples_; |     DLOG(INFO) << "Samples " << samples_; | ||||||
|     DLOG(INFO) << "Sampling frequency " << sampling_frequency_; |     DLOG(INFO) << "Sampling frequency " << sampling_frequency_; | ||||||
| @@ -188,15 +190,17 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) | |||||||
|     if (samples_ > 0) |     if (samples_ > 0) | ||||||
|         { |         { | ||||||
|             top_block->connect(file_source_, 0, deint_, 0); |             top_block->connect(file_source_, 0, deint_, 0); | ||||||
|  |  | ||||||
|             if (endian_swap_) |             if (endian_swap_) | ||||||
|                 { |                 { | ||||||
|                     top_block->connect(deint_, sel_ch_ - 1, endian_, 0); |                     top_block->connect(deint_, sel_ch_ - 1, endian_vec_.at(sel_ch_ - 1), 0); | ||||||
|                     top_block->connect(endian_, 0, unpack_spir_, 0); |                     top_block->connect(endian_vec_.at(sel_ch_ - 1), 0, unpack_spir_vec_.at(sel_ch_ - 1), 0); | ||||||
|                 } |                 } | ||||||
|             else |             else | ||||||
|                 { |                 { | ||||||
|                     top_block->connect(deint_, sel_ch_ - 1, unpack_spir_, 0); |                     top_block->connect(deint_, sel_ch_ - 1, unpack_spir_vec_.at(sel_ch_ - 1), 0); | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|             if (n_channels_ > 1) |             if (n_channels_ > 1) | ||||||
|                 { |                 { | ||||||
|                     uint32_t aux = 0; |                     uint32_t aux = 0; | ||||||
| @@ -204,23 +208,37 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) | |||||||
|                         { |                         { | ||||||
|                             if (i != (sel_ch_ - 1)) |                             if (i != (sel_ch_ - 1)) | ||||||
|                                 { |                                 { | ||||||
|                                     top_block->connect(deint_, i, null_sinks_.at(aux), 0); |                                     if (endian_swap_) | ||||||
|  |                                         { | ||||||
|  |                                             top_block->connect(deint_, i, endian_vec_.at(i), 0); | ||||||
|  |                                             top_block->connect(endian_vec_.at(i), 0, unpack_spir_vec_.at(i), 0); | ||||||
|  |                                         } | ||||||
|  |                                     else | ||||||
|  |                                         { | ||||||
|  |                                             top_block->connect(deint_, i, unpack_spir_vec_.at(i), 0); | ||||||
|  |                                         } | ||||||
|  |  | ||||||
|                                     aux++; |                                     aux++; | ||||||
|                                 } |                                 } | ||||||
|                         } |                         } | ||||||
|                 } |                 } | ||||||
|  |             for (uint32_t i = 0; i < n_channels_; i++) | ||||||
|  |                 { | ||||||
|                     if (enable_throttle_control_) |                     if (enable_throttle_control_) | ||||||
|                         { |                         { | ||||||
|                     top_block->connect(unpack_spir_, 0, throttle_, 0); |                             top_block->connect(unpack_spir_vec_.at(i), 0, throttle_vec_.at(i), 0); | ||||||
|                     top_block->connect(throttle_, 0, valve_, 0); |                             top_block->connect(throttle_vec_.at(i), 0, valve_vec_.at(i), 0); | ||||||
|                         } |                         } | ||||||
|                     else |                     else | ||||||
|                         { |                         { | ||||||
|                     top_block->connect(unpack_spir_, 0, valve_, 0); |                             top_block->connect(unpack_spir_vec_.at(i), 0, valve_vec_.at(i), 0); | ||||||
|                         } |                         } | ||||||
|                     if (dump_) |                     if (dump_) | ||||||
|                         { |                         { | ||||||
|                     top_block->connect(valve_, 0, sink_, 0); |                             top_block->connect(valve_vec_.at(i), 0, sink_vec_.at(i), 0); | ||||||
|  |                         } | ||||||
|  |  | ||||||
|  |                     top_block->connect(valve_vec_.at(i), 0, null_sinks_.at(i), 0); | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
| @@ -237,12 +255,12 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) | |||||||
|             top_block->disconnect(file_source_, 0, deint_, 0); |             top_block->disconnect(file_source_, 0, deint_, 0); | ||||||
|             if (endian_swap_) |             if (endian_swap_) | ||||||
|                 { |                 { | ||||||
|                     top_block->disconnect(deint_, sel_ch_ - 1, endian_, 0); |                     top_block->disconnect(deint_, sel_ch_ - 1, endian_vec_.at(sel_ch_ - 1), 0); | ||||||
|                     top_block->disconnect(endian_, 0, unpack_spir_, 0); |                     top_block->disconnect(endian_vec_.at(sel_ch_ - 1), 0, unpack_spir_vec_.at(sel_ch_ - 1), 0); | ||||||
|                 } |                 } | ||||||
|             else |             else | ||||||
|                 { |                 { | ||||||
|                     top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_, 0); |                     top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_vec_.at(sel_ch_ - 1), 0); | ||||||
|                 } |                 } | ||||||
|             if (n_channels_ > 1) |             if (n_channels_ > 1) | ||||||
|                 { |                 { | ||||||
| @@ -251,23 +269,38 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) | |||||||
|                         { |                         { | ||||||
|                             if (i != (sel_ch_ - 1)) |                             if (i != (sel_ch_ - 1)) | ||||||
|                                 { |                                 { | ||||||
|                                     top_block->disconnect(deint_, i, null_sinks_.at(aux), 0); |                                     if (endian_swap_) | ||||||
|  |                                         { | ||||||
|  |                                             top_block->disconnect(deint_, i, endian_vec_.at(i), 0); | ||||||
|  |                                             top_block->disconnect(endian_vec_.at(i), 0, unpack_spir_vec_.at(i), 0); | ||||||
|  |                                         } | ||||||
|  |                                     else | ||||||
|  |                                         { | ||||||
|  |                                             top_block->disconnect(deint_, i, unpack_spir_vec_.at(i), 0); | ||||||
|  |                                         } | ||||||
|  |  | ||||||
|                                     aux++; |                                     aux++; | ||||||
|                                 } |                                 } | ||||||
|                         } |                         } | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|  |             for (uint32_t i = 0; i < (n_channels_); i++) | ||||||
|  |                 { | ||||||
|                     if (enable_throttle_control_) |                     if (enable_throttle_control_) | ||||||
|                         { |                         { | ||||||
|                     top_block->disconnect(unpack_spir_, 0, throttle_, 0); |                             top_block->disconnect(unpack_spir_vec_.at(i), 0, throttle_vec_.at(i), 0); | ||||||
|                     top_block->disconnect(throttle_, 0, valve_, 0); |                             top_block->disconnect(throttle_vec_.at(i), 0, valve_vec_.at(i), 0); | ||||||
|                         } |                         } | ||||||
|                     else |                     else | ||||||
|                         { |                         { | ||||||
|                     top_block->disconnect(unpack_spir_, 0, valve_, 0); |                             top_block->disconnect(unpack_spir_vec_.at(i), 0, valve_vec_.at(i), 0); | ||||||
|                         } |                         } | ||||||
|                     if (dump_) |                     if (dump_) | ||||||
|                         { |                         { | ||||||
|                     top_block->disconnect(valve_, 0, sink_, 0); |                             top_block->disconnect(valve_vec_.at(i), 0, sink_vec_.at(i), 0); | ||||||
|  |                         } | ||||||
|  |  | ||||||
|  |                     top_block->disconnect(valve_vec_.at(i), 0, null_sinks_.at(i), 0); | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|     else |     else | ||||||
| @@ -283,22 +316,12 @@ gr::basic_block_sptr SpirGSS6450FileSignalSource::get_left_block() | |||||||
|     return gr::blocks::file_source::sptr(); |     return gr::blocks::file_source::sptr(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block(int RF_channel) | ||||||
|  | { | ||||||
|  |     return valve_vec_.at(RF_channel); | ||||||
|  | } | ||||||
|  |  | ||||||
| gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block() | gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block() | ||||||
| { | { | ||||||
|     if (samples_ > 0) |     return valve_vec_.at(0); | ||||||
|         { |  | ||||||
|             return valve_; |  | ||||||
|         } |  | ||||||
|     else |  | ||||||
|         { |  | ||||||
|             if (enable_throttle_control_) |  | ||||||
|                 { |  | ||||||
|                     return throttle_; |  | ||||||
|                 } |  | ||||||
|             else |  | ||||||
|                 { |  | ||||||
|                     return unpack_spir_; |  | ||||||
|                 } |  | ||||||
|         } |  | ||||||
| } | } | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	 Damian Miralles
					Damian Miralles