1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50:34 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into glonass

This commit is contained in:
Carles Fernandez 2017-11-04 21:19:21 +01:00
commit 7f452c34d2
9 changed files with 136 additions and 118 deletions

View File

@ -317,6 +317,18 @@ set(GNSSSDR_ARMADILLO_MIN_VERSION "4.200.0")
################################################################################
# Versions to download and build (but not installed) if not found
################################################################################
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1")
set(GNSSSDR_GLOG_LOCAL_VERSION "0.3.5")
set(GNSSSDR_ARMADILLO_LOCAL_VERSION "unstable")
set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.0")
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10")
################################################################################
# Check cmake version
################################################################################
@ -668,7 +680,6 @@ endif(NOT VOLK_GNSSSDR_FOUND)
# gflags - https://github.com/gflags/gflags
################################################################################
set(LOCAL_GFLAGS false)
set(gflags_RELEASE 2.2.1)
find_package(GFlags)
if (NOT GFlags_FOUND)
message (STATUS " gflags library has not been found.")
@ -677,12 +688,12 @@ if (NOT GFlags_FOUND)
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gflags-${gflags_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
GIT_REPOSITORY git://github.com/gflags/gflags.git
GIT_TAG v${gflags_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
UPDATE_COMMAND ""
@ -691,15 +702,15 @@ if (NOT GFlags_FOUND)
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gflags-${gflags_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
GIT_REPOSITORY git://github.com/gflags/gflags.git
GIT_TAG v${gflags_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
@ -707,16 +718,16 @@ if (NOT GFlags_FOUND)
endif(CMAKE_VERSION VERSION_LESS 3.2)
set(GFlags_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/include CACHE PATH "Local Gflags headers"
${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers"
)
add_library(gflags UNKNOWN IMPORTED)
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX})
add_dependencies(gflags gflags-${gflags_RELEASE})
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX})
add_dependencies(gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
set(GFlags_LIBS gflags)
file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*")
set(GFlags_LIBRARY gflags-${gflags_RELEASE})
set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib )
file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*")
set(GFlags_LIBRARY gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib )
link_directories(${GFlags_LIBRARY_PATH})
set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library")
set(GFlags_LIBRARY_PATH ${GFlags_LIBS})
@ -734,7 +745,7 @@ if(NOT ${ENABLE_OWN_GLOG})
set(GLOG_FOUND ON)
endif(GLOG_INCLUDE_DIRS)
endif(NOT ${ENABLE_OWN_GLOG})
set(glog_RELEASE 0.3.5)
set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION})
if (NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
message (STATUS " glog library has not been found")
if(NOT GFlags_FOUND)
@ -743,20 +754,20 @@ if (NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
message (STATUS " glog will be downloaded and built automatically ")
message (STATUS " when doing 'make'. ")
if(NOT ${LOCAL_GFLAGS})
add_library(gflags-${gflags_RELEASE} UNKNOWN IMPORTED)
set_property(TARGET gflags-${gflags_RELEASE} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}")
add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED)
set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}")
endif(NOT ${LOCAL_GFLAGS})
set(TARGET_GFLAGS gflags-${gflags_RELEASE})
set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
if(${LOCAL_GFLAGS})
set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS})
set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib)
set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib)
else(${LOCAL_GFLAGS})
set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS})
set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS})
endif(${LOCAL_GFLAGS})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
"#!/bin/sh
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
export LDFLAGS=-L${GFLAGS_LIBRARY_DIR_TO_LINK}
@ -764,34 +775,34 @@ export LIBS=\"${GFLAGS_LIBRARIES_TO_LINK} -lc++\"
export CXXFLAGS=\"-stdlib=libc++\"
export CC=clang
export CXX=clang++
cd ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/
cd ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/
aclocal
automake --add-missing
autoreconf -vfi
cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure")
else("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
"#!/bin/sh
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
export LDFLAGS=-L${GFLAGS_LIBRARY_DIR_TO_LINK}
export LIBS=${GFLAGS_LIBRARIES_TO_LINK}
cd ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/
cd ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/
aclocal
automake --add-missing
autoreconf -vfi
cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
cd ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure")
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/configure_with_gflags)
set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags)
# Ensure that aclocal and libtool are present
if(OS_IS_LINUX)
@ -826,13 +837,13 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
glog-${glog_RELEASE}
glog-${GNSSSDR_GLOG_LOCAL_VERSION}
DEPENDS ${TARGET_GFLAGS}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/glog/
GIT_TAG v${glog_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}"
UPDATE_COMMAND ""
@ -841,16 +852,16 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
glog-${glog_RELEASE}
glog-${GNSSSDR_GLOG_LOCAL_VERSION}
DEPENDS ${TARGET_GFLAGS}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/glog/
GIT_TAG v${glog_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}"
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
PATCH_COMMAND ""
INSTALL_COMMAND ""
@ -859,16 +870,16 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
# Set up variables
set(GLOG_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/src/
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/src
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src/
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src
)
set(GLOG_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
)
set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE)
else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
add_library(glog-${glog_RELEASE} UNKNOWN IMPORTED)
set_property(TARGET glog-${glog_RELEASE} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}")
add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED)
set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}")
endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
if(NOT ENABLE_LOG)
@ -1051,7 +1062,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO)
message(STATUS " Armadillo has not been found.")
message(STATUS " Armadillo will be downloaded and built automatically")
message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'. ")
set(armadillo_BRANCH unstable)
set(armadillo_BRANCH ${GNSSSDR_ARMADILLO_LOCAL_VERSION})
set(armadillo_RELEASE ${armadillo_BRANCH})
if(CMAKE_VERSION VERSION_LESS 3.2)

View File

@ -31,6 +31,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1)
if(CMAKE_VERSION VERSION_GREATER "3.0")
cmake_policy(SET CMP0042 NEW)
if(CMAKE_VERSION VERSION_GREATER "3.9")
cmake_policy(SET CMP0068 NEW)
endif(CMAKE_VERSION VERSION_GREATER "3.9")
endif(CMAKE_VERSION VERSION_GREATER "3.0")
option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project
@ -84,6 +91,7 @@ if(UNIX)
)
endif(UNIX)
########################################################################
# Dependencies setup
########################################################################

View File

@ -50,6 +50,15 @@ elseif(ORC_FOUND)
endif(ORC_FOUND)
# allow 'large' files in 32 bit builds
if(UNIX)
add_definitions( -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
-D_LARGE_FILES
)
endif(UNIX)
# MAKE volk_gnsssdr_profile
add_executable(volk_gnsssdr_profile
${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_profile.cc

View File

@ -213,7 +213,6 @@ int main(int argc, char *argv[]) {
}
if(!dry_run) {
write_results(&results, false);
if(vm.count("path")) write_results(&results, false, config_file);
else write_results(&results, false);
}

View File

@ -30,11 +30,8 @@
*/
#include "fmcomms2_signal_source.h"
#include <cstdio>
#include <iostream>
#include <boost/format.hpp>
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include "configuration_interface.h"
#include "gnss_sdr_valve.h"
#include "GPS_L1_CA.h"
@ -75,8 +72,8 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
item_size_ = sizeof(gr_complex);
std::cout << "device address: " << uri_ << std::endl;
std::cout << "LO frequency : " << freq_ << "Hz" << std::endl;
std::cout << "sample rate: " << sample_rate_ << "Hz" << std::endl;
std::cout << "LO frequency : " << freq_ << " Hz" << std::endl;
std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl;
if(item_type_.compare("gr_complex") == 0)
{
@ -92,7 +89,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
}
else
{
LOG(FATAL) << "Exception: item type " << item_type_ << " not supported!";
LOG(FATAL) << "Configuration error: item type " << item_type_ << " not supported!";
}
if (samples_ != 0)
@ -153,7 +150,7 @@ void Fmcomms2SignalSource::disconnect(gr::top_block_sptr top_block)
{
if (dump_)
{
top_block->disconnect(fmcomms2_source_f32c_, 0, file_sink_, 0);
top_block->disconnect(fmcomms2_source_f32c_, 0, file_sink_, 0);
}
}
}

View File

@ -57,7 +57,7 @@ public:
}
/*!
* \brief Returns "fmcomms2_Signal_Source"
* \brief Returns "Fmcomms2_Signal_Source"
*/
inline std::string implementation() override
{

View File

@ -30,9 +30,7 @@
#include "plutosdr_signal_source.h"
#include <iostream>
#include <boost/format.hpp>
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include "configuration_interface.h"
#include "gnss_sdr_valve.h"
#include "GPS_L1_CA.h"
@ -70,15 +68,15 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
if(item_type_.compare("gr_complex") != 0)
{
std::cout << "bad item_type!!" << std::endl;
LOG(FATAL) << "Exception: item type must be gr_complex!";
std::cout << "Configuration error: item_type must be gr_complex" << std::endl;
LOG(FATAL) << "Configuration error: item_type must be gr_complex!";
}
item_size_ = sizeof(gr_complex);
std::cout << "device address: " << uri_ << std::endl;
std::cout << "frequency : " << freq_ << "Hz" << std::endl;
std::cout << "sample rate: " << sample_rate_ << "Hz" << std::endl;
std::cout << "frequency : " << freq_ << " Hz" << std::endl;
std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl;
std::cout << "gain mode: " << gain_mode_ << std::endl;
std::cout << "item type: " << item_type_ << std::endl;

View File

@ -47,15 +47,13 @@ endif(EXISTS $ENV{OECORE_TARGET_SYSROOT})
if(NOT ${GTEST_DIR_LOCAL})
# if GTEST_DIR is not defined, we download and build it
set(gtest_RELEASE 1.8.0)
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gtest-${gtest_RELEASE}
gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG release-${gtest_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}
GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
CMAKE_ARGS ${GTEST_COMPILER} -DBUILD_GTEST=ON -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
@ -63,41 +61,41 @@ if(NOT ${GTEST_DIR_LOCAL})
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gtest-${gtest_RELEASE}
gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG release-${gtest_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}
GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
CMAKE_ARGS ${GTEST_COMPILER} -DBUILD_GTEST=ON -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INSTALL_COMMAND ""
)
endif(CMAKE_VERSION VERSION_LESS 3.2)
# Set up variables
# Set recently downloaded and build Googletest root folder
set(GTEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE}/googletest")
set(GTEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest")
# Source code
ExternalProject_Get_Property(gtest-${gtest_RELEASE} source_dir)
ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} source_dir)
set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include)
set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src)
# Library
ExternalProject_Get_Property(gtest-${gtest_RELEASE} binary_dir)
ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir)
if(OS_IS_MACOSX)
if(CMAKE_GENERATOR STREQUAL Xcode)
set(binary_dir "${binary_dir}/Debug")
endif(CMAKE_GENERATOR STREQUAL Xcode)
endif(OS_IS_MACOSX)
set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GTEST_LIBRARY gtest-${gtest_RELEASE})
set(GTEST_LIBRARY gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
set(GTEST_LIBRARIES
${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}/googletest")
set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest")
else(NOT ${GTEST_DIR_LOCAL})
if(GTEST_INCLUDE_DIRS)
set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR})
@ -178,7 +176,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
ExternalProject_Add(
gnss-sim
GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator
GIT_TAG master
GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gnss-sim
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gnss-sim
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR}
@ -207,38 +205,36 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
find_package(GPSTK)
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
if(NOT ENABLE_FPGA)
set(gpstk_RELEASE "2.9")
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gpstk-${gpstk_RELEASE}
gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
GIT_TAG v${gpstk_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${gpstk_RELEASE}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${gpstk_RELEASE}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
UPDATE_COMMAND ""
PATCH_COMMAND ""
)
else(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(
gpstk-${gpstk_RELEASE}
gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/GPSTk
GIT_TAG v${gpstk_RELEASE}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${gpstk_RELEASE}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${gpstk_RELEASE}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${gpstk_RELEASE}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
PATCH_COMMAND ""
)
endif(CMAKE_VERSION VERSION_LESS 3.2)
set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}/install/include CACHE PATH "Local GPSTK headers")
set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers")
add_library(gpstk UNKNOWN IMPORTED)
set_property(TARGET gpstk PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX})
add_dependencies(gpstk gpstk-${gpstk_RELEASE})
set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${gpstk_RELEASE}/install/bin/ )
set_property(TARGET gpstk PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX})
add_dependencies(gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/ )
add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}")
set(gpstk_libs gpstk)
set(OWN_GPSTK True)
@ -364,7 +360,7 @@ if(ENABLE_UNIT_TESTING)
${GNSS_SDR_TEST_OPTIONAL_LIBS}
)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(run_tests gtest-${gtest_RELEASE})
add_dependencies(run_tests gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
endif(NOT ${GTEST_DIR_LOCAL})
if(ENABLE_INSTALL_TESTS)
@ -421,7 +417,7 @@ if(ENABLE_SYSTEM_TESTING)
add_executable(ttff
${CMAKE_CURRENT_SOURCE_DIR}/system-tests/ttff_gps_l1.cc )
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(ttff gtest-${gtest_RELEASE})
add_dependencies(ttff gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(ttff gtest)
endif(NOT ${GTEST_DIR_LOCAL})
@ -455,7 +451,7 @@ if(ENABLE_SYSTEM_TESTING)
add_executable(position_test
${CMAKE_CURRENT_SOURCE_DIR}/system-tests/position_test.cc )
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(position_test gtest-${gtest_RELEASE})
add_dependencies(position_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(position_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})
@ -488,11 +484,11 @@ if(ENABLE_SYSTEM_TESTING)
if(GPSTK_FOUND OR OWN_GPSTK)
add_executable(obs_gps_l1_system_test ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/obs_gps_l1_system_test.cc)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(obs_gps_l1_system_test gtest-${gtest_RELEASE} )
add_dependencies(obs_gps_l1_system_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} )
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(obs_gps_l1_system_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})
include_directories(${GPSTK_INCLUDE_DIRS})
include_directories(${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk)
target_link_libraries(obs_gps_l1_system_test ${GFlags_LIBS}
${GLOG_LIBRARIES}
${GTEST_LIBRARIES}
@ -538,7 +534,7 @@ if(NOT ${ENABLE_PACKAGING})
)
add_test(control_thread_test control_thread_test)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(control_thread_test gtest-${gtest_RELEASE})
add_dependencies(control_thread_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(control_thread_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})
@ -560,7 +556,7 @@ if(NOT ${ENABLE_PACKAGING})
${VOLK_GNSSSDR_LIBRARIES} )
add_test(flowgraph_test flowgraph_test)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(flowgraph_test gtest-${gtest_RELEASE})
add_dependencies(flowgraph_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(flowgraph_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})
@ -595,7 +591,7 @@ if(NOT ${ENABLE_PACKAGING})
)
add_test(gnss_block_test gnss_block_test)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(gnss_block_test gtest-${gtest_RELEASE})
add_dependencies(gnss_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(gnss_block_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})
@ -620,7 +616,7 @@ target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES}
)
add_test(gnuradio_block_test gnuradio_block_test)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(gnuradio_block_test gtest-${gtest_RELEASE})
add_dependencies(gnuradio_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(gnuradio_block_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})
@ -666,7 +662,7 @@ target_link_libraries(trk_test ${Boost_LIBRARIES}
)
add_test(trk_test trk_test)
if(NOT ${GTEST_DIR_LOCAL})
add_dependencies(trk_test gtest-${gtest_RELEASE})
add_dependencies(trk_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION})
else(NOT ${GTEST_DIR_LOCAL})
add_dependencies(trk_test gtest)
endif(NOT ${GTEST_DIR_LOCAL})

View File

@ -41,11 +41,11 @@
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include "RinexUtilities.hpp"
#include "Rinex3ObsBase.hpp"
#include "Rinex3ObsData.hpp"
#include "Rinex3ObsHeader.hpp"
#include "Rinex3ObsStream.hpp"
#include <gpstk/RinexUtilities.hpp>
#include <gpstk/Rinex3ObsBase.hpp>
#include <gpstk/Rinex3ObsData.hpp>
#include <gpstk/Rinex3ObsHeader.hpp>
#include <gpstk/Rinex3ObsStream.hpp>
#include "concurrent_map.h"
#include "concurrent_queue.h"
#include "control_thread.h"
@ -513,7 +513,7 @@ void ObsGpsL1SystemTest::check_results()
// If a measure exists for this sow, store it
for(it2 = pseudorange_meas.at(prn_id).begin(); it2 != pseudorange_meas.at(prn_id).end(); it2++)
{
if(std::abs(it->first - it2->first) < 0.01) // store measures closer than 10 ms.
if(std::abs(it->first - it2->first) < 0.1) // store measures closer than 10 ms.
{
pseudorange_ref_aligned.at(prn_id).push_back(*it);
pr_diff.at(prn_id).push_back(it->second - it2->second );
@ -532,7 +532,7 @@ void ObsGpsL1SystemTest::check_results()
// If a measure exists for this sow, store it
for(it2 = carrierphase_meas.at(prn_id).begin(); it2 != carrierphase_meas.at(prn_id).end(); it2++)
{
if(std::abs(it->first - it2->first) < 0.01) // store measures closer than 10 ms.
if(std::abs(it->first - it2->first) < 0.1) // store measures closer than 10 ms.
{
carrierphase_ref_aligned.at(prn_id).push_back(*it);
cp_diff.at(prn_id).push_back(it->second - it2->second );