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

Add work on gnsstk transition

This commit is contained in:
Carles Fernandez 2022-07-04 10:05:54 +02:00
parent f2ae0ddb33
commit d9c4eba5fe
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
8 changed files with 298 additions and 171 deletions

View File

@ -111,7 +111,7 @@ if(ENABLE_SYSTEM_TESTING_EXTRA)
set(ENABLE_SYSTEM_TESTING ON)
endif()
option(ENABLE_OWN_GPSTK "Force to download, build and link GPSTk for system tests, even if it is already installed" OFF)
option(ENABLE_OWN_GNSSTK "Force to download, build and link gnsstk for system tests, even if it is already installed" OFF)
option(ENABLE_INSTALL_TESTS "Install QA code system-wide" OFF)
if(ENABLE_FPGA)
@ -330,7 +330,7 @@ else()
set(GNSSSDR_GTEST_LOCAL_VERSION "1.12.1")
endif()
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "11.2.3")
set(GNSSSDR_GNSSTK_LOCAL_VERSION "12.1.0")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.23")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.12")
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.1")
@ -654,16 +654,16 @@ endif()
# Detect availability of std::filesystem and set C++ standard accordingly
################################################################################
set(FILESYSTEM_FOUND FALSE)
if(NOT ENABLE_OWN_GPSTK)
find_package(GPSTK)
set_package_properties(GPSTK PROPERTIES
if(NOT ENABLE_OWN_GNSSTK)
find_package(GNSSTK)
set_package_properties(GNSSTK PROPERTIES
PURPOSE "Used in some Extra Tests."
)
endif()
if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND (LOG4CPP_READY_FOR_CXX17 OR GNURADIO_USES_SPDLOG))
# Check if we have std::filesystem
if(NOT (CMAKE_VERSION VERSION_LESS 3.8))
if(NOT GPSTK_FOUND OR NOT (GPSTK_FOUND AND GPSTK_OLDER_THAN_8)) # Fix for GPSTk < 8.0.0
#if(NOT GPSTK_FOUND OR NOT (GPSTK_FOUND AND GPSTK_OLDER_THAN_8)) # Fix for GPSTk < 8.0.0
find_package(FILESYSTEM COMPONENTS Final Experimental)
set_package_properties(FILESYSTEM PROPERTIES
URL "https://en.cppreference.com/w/cpp/filesystem"
@ -671,7 +671,7 @@ if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND (LOG4CPP_READY_FOR_CXX17 OR GNURA
PURPOSE "Work with paths, regular files, and directories."
TYPE OPTIONAL
)
endif()
#endif()
if(FILESYSTEM_FOUND)
set(CMAKE_CXX_STANDARD 17)
# if(CMAKE_VERSION VERSION_GREATER 3.13)
@ -3361,7 +3361,7 @@ add_feature_info(ENABLE_UNIT_TESTING_MINIMAL ENABLE_UNIT_TESTING_MINIMAL "Enable
add_feature_info(ENABLE_UNIT_TESTING_EXTRA ENABLE_UNIT_TESTING_EXTRA "Enables building of Extra Unit Tests and downloading of external data files.")
add_feature_info(ENABLE_SYSTEM_TESTING ENABLE_SYSTEM_TESTING "Enables building of System Tests.")
add_feature_info(ENABLE_SYSTEM_TESTING_EXTRA ENABLE_SYSTEM_TESTING_EXTRA "Enables building of Extra System Tests and downloading of external tools.")
add_feature_info(ENABLE_OWN_GPSTK ENABLE_OWN_GPSTK "Forces the downloading and building of GPSTk for system tests.")
add_feature_info(ENABLE_OWN_GNSSTK ENABLE_OWN_GNSSTK "Forces the downloading and building of gnsstk for system tests.")
add_feature_info(ENABLE_GNSS_SIM_INSTALL ENABLE_GNSS_SIM_INSTALL "Enables downloading and building of gnss-sim.")
add_feature_info(ENABLE_INSTALL_TESTS ENABLE_INSTALL_TESTS "Install test binaries when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} install'.")
add_feature_info(ENABLE_BENCHMARKS ENABLE_BENCHMARKS "Enables building of code snippet benchmarks.")

View File

@ -0,0 +1,99 @@
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
# This file is part of GNSS-SDR.
#
# SPDX-FileCopyrightText: 2022 C. Fernandez-Prades cfernandez(at)cttc.es
# SPDX-License-Identifier: BSD-3-Clause
# - Find gnsstk library
# Find the native gnsstk includes and library
# This module defines
# GNSSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
# GNSSTK_FOUND, If false, do not try to use GNSSTK.
# GNSSTK_LIBRARY, where to find the GNSSTK library.
#
# Provides the following imported target:
# Gnsstk::gnsstk
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
if(NOT GNSSTK_ROOT)
set(GNSSTK_ROOT_USER_DEFINED /usr/local)
else()
set(GNSSTK_ROOT_USER_DEFINED ${GNSSTK_ROOT})
endif()
if(DEFINED ENV{GNSSTK_ROOT})
set(GNSSTK_ROOT_USER_DEFINED
${GNSSTK_ROOT_USER_DEFINED}
$ENV{GNSSTK_ROOT}
)
endif()
find_path(GNSSTK_INCLUDE_DIR gnsstk/Rinex3ObsBase.hpp
PATHS ${GNSSTK_ROOT_USER_DEFINED}/include
/usr/include
/usr/local/include
/opt/local/include
)
set(GNSSTK_NAMES gnsstk libgnsstk)
include(GNUInstallDirs)
find_library(GNSSTK_LIBRARY NAMES ${GNSSTK_NAMES}
PATHS ${GNSSTK_ROOT_USER_DEFINED}/lib
${GNSSTK_ROOT_USER_DEFINED}/${CMAKE_INSTALL_LIBDIR}
/usr/local/lib
/usr/${CMAKE_INSTALL_LIBDIR}
/usr/local/${CMAKE_INSTALL_LIBDIR}
/opt/local/lib
)
# handle the QUIET and REQUIRED arguments and set GNSSTK_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GNSSTK DEFAULT_MSG GNSSTK_LIBRARY GNSSTK_INCLUDE_DIR)
if(GNSSTK_FOUND)
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
unset(PACKAGE_VERSION)
if(EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/cmake/GNSSTK/GNSSTKConfigVersion.cmake)
include(${CMAKE_INSTALL_FULL_DATADIR}/cmake/GNSSTK/GNSSTKConfigVersion.cmake)
endif()
if(PACKAGE_VERSION)
set(GNSSTK_VERSION ${PACKAGE_VERSION})
endif()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
endif()
if(GNSSTK_FOUND AND GNSSTK_VERSION)
set_package_properties(GNSSTK PROPERTIES
DESCRIPTION "Library and suite of applications for satellite navigation (found: v${GNSSTK_VERSION})"
)
else()
set_package_properties(GNSSTK PROPERTIES
DESCRIPTION "Library and suite of applications for satellite navigation"
)
endif()
#if(GNSSTK_FOUND AND NOT EXISTS ${GNSSTK_INCLUDE_DIR}/gnsstk/SatelliteSystem.hpp)
# set(GNSSTK_OLDER_THAN_8 TRUE)
#endif()
set_package_properties(GNSSTK PROPERTIES
URL "https://github.com/SGL-UT/gnsstk/"
)
if(GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK AND NOT TARGET Gnsstk::gnsstk)
add_library(Gnsstk::gnsstk SHARED IMPORTED)
set_target_properties(Gnsstk::gnsstk PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gnsstk"
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
)
endif()
mark_as_advanced(GNSSTK_LIBRARY GNSSTK_INCLUDE_DIR)

View File

@ -68,8 +68,8 @@ if(NOT GOOGLETEST_FOUND)
if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR
(CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator
set(GOOGLETEST_BUILD_BYPRODUCTS
${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_maind${CMAKE_STATIC_LIBRARY_SUFFIX}
#${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX}
#${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_maind${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION}
@ -105,12 +105,12 @@ if(NOT GOOGLETEST_FOUND)
MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo
MAP_IMPORTED_CONFIG_ASAN Debug
IMPORTED_LOCATION_NONE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/gtest$<$<CONFIG:Debug>:d>${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC)
set_target_properties(GTest::GTest PROPERTIES
@ -118,7 +118,7 @@ if(NOT GOOGLETEST_FOUND)
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>gtest$<$<CONFIG:Debug>:d>${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
set_target_properties(GTest::GTest PROPERTIES
@ -137,12 +137,12 @@ if(NOT GOOGLETEST_FOUND)
MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo
MAP_IMPORTED_CONFIG_ASAN Debug
IMPORTED_LOCATION_NONE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_maind${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main$<$<CONFIG:Debug>:d>${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC)
set_target_properties(GTest::Main PROPERTIES
@ -150,7 +150,7 @@ if(NOT GOOGLETEST_FOUND)
IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main$<$<CONFIG:Debug>:d>${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
endif()
@ -273,7 +273,7 @@ endif()
################################################################################
# GPSTk and optional generator
# gnsstk and optional generator
################################################################################
if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
@ -332,42 +332,42 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
endif()
############################################################################
# Local installation of GPSTk https://github.com/SGL-UT/GPSTk
# Local installation of gnsstk https://github.com/SGL-UT/gnsstk
############################################################################
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
set_package_properties(GPSTK PROPERTIES
PURPOSE "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
set_package_properties(GNSSTK PROPERTIES
PURPOSE "gnsstk v${GNSSSDR_GNSSTK_LOCAL_VERSION} will be automatically downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
)
if("${TOOLCHAIN_ARG}" STREQUAL "")
set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=-Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
endif()
set(GPSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
set(GNSSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
if(CMAKE_GENERATOR STREQUAL Xcode)
set(GPSTK_BUILD_COMMAND "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
set(GNSSTK_BUILD_COMMAND "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
endif()
include(GNUInstallDirs)
find_program(Patch_EXECUTABLE NAME patch PATHS ENV PATH)
if(NOT Patch_EXECUTABLE)
message(FATAL_ERROR "The patch command is not found. It is required to build GPSTk. Please check your OS documentation and install the patch command.")
endif()
set(GPSTK_PATCH_COMMAND
cd ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} &&
${Patch_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gpstk_static.patch
set(GNSSTK_PATCH_COMMAND
cd ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} &&
${Patch_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gnsstk_static.patch
)
# Patch only once
if(EXISTS ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/CMakeLists.txt)
set(GPSTK_PATCH_COMMAND "")
if(EXISTS ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt)
set(GNSSTK_PATCH_COMMAND "")
endif()
if(CMAKE_VERSION VERSION_LESS 3.2)
ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
PATCH_COMMAND ${GPSTK_PATCH_COMMAND}
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
BINARY_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
-DBUILD_EXT=ON
-DBUILD_PYTHON=OFF
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@ -375,7 +375,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_C_STANDARD=11
-DCMAKE_C_EXTENSIONS=ON
BUILD_COMMAND ${GPSTK_BUILD_COMMAND}
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND}
UPDATE_COMMAND ""
)
else()
@ -383,18 +383,18 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
include(ProcessorCount)
ProcessorCount(NUMBER_OF_PROCESSORS)
if(NUMBER_OF_PROCESSORS GREATER 1)
set(GPSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}")
set(GNSSTK_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}")
endif()
endif()
ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
GIT_REPOSITORY https://github.com/SGL-UT/gnsstk
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
BINARY_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
PATCH_COMMAND ${GPSTK_PATCH_COMMAND}
GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION}
SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
BINARY_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}
PATCH_COMMAND ${GNSSTK_PATCH_COMMAND}
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install
-DBUILD_EXT=ON
-DBUILD_PYTHON=OFF
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@ -402,28 +402,28 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_C_STANDARD=11
-DCMAKE_C_EXTENSIONS=ON
BUILD_COMMAND ${GPSTK_BUILD_COMMAND} ${GPSTK_PARALLEL_BUILD}
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX}
BUILD_COMMAND ${GNSSTK_BUILD_COMMAND} ${GNSSTK_PARALLEL_BUILD}
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}
UPDATE_COMMAND ""
)
endif()
set(GPSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers")
set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GPSTK_BINDIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/)
add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}")
add_library(Gpstk::gpstk STATIC IMPORTED)
add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS})
file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS}/gpstk)
set_target_properties(Gpstk::gpstk PROPERTIES
set(GNSSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GNSSTK headers")
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GNSSTK_BINDIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/bin/)
add_definitions(-DGNSSTK_BINDIR="${GNSSTK_BINDIR}")
add_library(Gnsstk::gnsstk STATIC IMPORTED)
add_dependencies(Gnsstk::gnsstk gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIRS})
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIRS}/gnsstk)
set_target_properties(Gnsstk::gnsstk PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIRS};${GPSTK_INCLUDE_DIRS}/gpstk"
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIRS};${GNSSTK_INCLUDE_DIRS}/gnsstk"
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
)
else()
set(GPSTK_BINDIR ${GPSTK_INCLUDE_DIR}/../bin/)
add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}")
set(GNSSTK_BINDIR ${GNSSTK_INCLUDE_DIR}/../bin/)
add_definitions(-DGNSSTK_BINDIR="${GNSSTK_BINDIR}")
endif()
endif()
@ -548,10 +548,10 @@ if(ENABLE_UNIT_TESTING)
)
endif()
if(ENABLE_UNIT_TESTING_EXTRA)
target_link_libraries(run_tests PRIVATE Gpstk::gpstk)
if(GPSTK_OLDER_THAN_8)
target_compile_definitions(run_tests PRIVATE -DOLD_GPSTK=1)
endif()
target_link_libraries(run_tests PRIVATE Gnsstk::gnsstk)
#if(GNSSTK_OLDER_THAN_8)
# target_compile_definitions(run_tests PRIVATE -DOLD_GPSTK=1)
#endif()
endif()
if(ENABLE_STRIP)
set_target_properties(run_tests PROPERTIES LINK_FLAGS "-s")

View File

@ -0,0 +1,39 @@
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2022 Carles Fernandez-Prades <carles.fernandez@cttc.es>
--- CMakeLists.txt 2022-07-02 20:14:59.000000000 +0200
+++ CMakeLists.txt 2022-07-02 20:16:55.000000000 +0200
@@ -6,7 +6,7 @@
# Is dependend on by $GNSSTK/build.sh
#============================================================
-cmake_minimum_required( VERSION 2.8.5 )
+cmake_minimum_required( VERSION 2.8.12 )
project( GNSSTK )
set( GNSSTK_VERSION_MAJOR "12" )
@@ -77,6 +77,16 @@
include( BuildSetup.cmake )
+set(STADYN "STATIC")
+if(POLICY CMP0063)
+ cmake_policy(SET CMP0063 NEW)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+else()
+ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
+ add_definitions(-fvisibility=hidden)
+ endif()
+endif()
#============================================================
# Core Library Target Files
@@ -161,7 +171,7 @@
add_library( gnsstk ${STADYN} ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} )
# GNSSTk library install target
-install( TARGETS gnsstk DESTINATION "${CMAKE_INSTALL_LIBDIR}" EXPORT "${EXPORT_TARGETS_FILENAME}" )
+install( TARGETS gnsstk DESTINATION lib EXPORT "${EXPORT_TARGETS_FILENAME}" )
# GNSSTk header file install target (whether it is version dependent changes based on user flag)
install( FILES ${GNSSTK_INC_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )

View File

@ -7,11 +7,11 @@
if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND) OR ENABLE_OWN_ARMADILLO) # requires back(), introduced in Armadillo 9.800
message(STATUS "The obsdiff utility tool will be built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
find_package(GPSTK QUIET)
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
find_package(GNSSTK QUIET)
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
include(GNUInstallDirs)
set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include)
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
endif()
if(USE_CMAKE_TARGET_SOURCES)
@ -48,22 +48,22 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND
if(NOT GFLAGS_FOUND)
add_dependencies(obsdiff gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
endif()
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
add_dependencies(obsdiff gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
add_dependencies(obsdiff gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
endif()
if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERSION})
add_dependencies(obsdiff matio-${GNSSSDR_MATIO_LOCAL_VERSION})
endif()
if(NOT TARGET Gpstk::gpstk)
file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIR}/gpstk)
add_library(Gpstk::gpstk STATIC IMPORTED)
add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
set_target_properties(Gpstk::gpstk PROPERTIES
if(NOT TARGET Gnsstk::gnsstk)
file(MAKE_DIRECTORY ${GNSSTK_INCLUDE_DIR}/gnsstk)
add_library(Gnsstk::gnsstk STATIC IMPORTED)
add_dependencies(Gnsstk::gnsstk gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
set_target_properties(Gnsstk::gnsstk PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk"
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gnsstk"
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
)
endif()
@ -73,13 +73,9 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND
Threads::Threads
Gflags::gflags
Matio::matio
Gpstk::gpstk
Gnsstk::gnsstk
)
if(GPSTK_OLDER_THAN_8)
target_compile_definitions(obsdiff PUBLIC -DOLD_GPSTK=1)
endif()
if(ENABLE_STRIP)
set_target_properties(obsdiff PROPERTIES LINK_FLAGS "-s")
endif()

View File

@ -22,33 +22,33 @@
#include "obsdiff_flags.h"
#include <armadillo>
// Classes for handling observations RINEX files (data)
#include <gpstk/Rinex3ObsData.hpp>
#include <gpstk/Rinex3ObsHeader.hpp>
#include <gpstk/Rinex3ObsStream.hpp>
#include <gnsstk/Rinex3ObsData.hpp>
#include <gnsstk/Rinex3ObsHeader.hpp>
#include <gnsstk/Rinex3ObsStream.hpp>
// Classes for handling satellite navigation parameters RINEX
// files (ephemerides)
#include <gpstk/Rinex3NavData.hpp>
#include <gpstk/Rinex3NavHeader.hpp>
#include <gpstk/Rinex3NavStream.hpp>
#include <gnsstk/Rinex3NavData.hpp>
#include <gnsstk/Rinex3NavHeader.hpp>
#include <gnsstk/Rinex3NavStream.hpp>
// Classes for handling RINEX files with meteorological parameters
#include <gpstk/RinexMetBase.hpp>
#include <gpstk/RinexMetData.hpp>
#include <gpstk/RinexMetHeader.hpp>
#include <gpstk/RinexMetStream.hpp>
#include <gnsstk/RinexMetBase.hpp>
#include <gnsstk/RinexMetData.hpp>
#include <gnsstk/RinexMetHeader.hpp>
#include <gnsstk/RinexMetStream.hpp>
// Class for handling tropospheric model
#include <gpstk/GGTropModel.hpp>
#include <gnsstk/GGTropModel.hpp>
// Class for storing >broadcast-type> ephemerides
#include <gpstk/GPSEphemerisStore.hpp>
#include <gnsstk/GPSEphemerisStore.hpp>
// Class for handling RAIM
#include <gpstk/PRSolution.hpp>
#include <gnsstk/PRSolution.hpp>
// Class defining GPS system constants
#include <gpstk/GNSSconstants.hpp>
#include <gnsstk/GNSSconstants.hpp>
#include <matio.h>
#include <algorithm>
#include <array>
@ -97,41 +97,29 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
// Open and read _baseerence RINEX observables file
try
{
gpstk::Rinex3ObsStream r_base(rinex_file);
gnsstk::Rinex3ObsStream r_base(rinex_file);
gpstk::Rinex3ObsData r_base_data;
gpstk::Rinex3ObsHeader r_base_header;
gnsstk::Rinex3ObsData r_base_data;
gnsstk::Rinex3ObsHeader r_base_header;
gpstk::RinexDatum dataobj;
gnsstk::RinexDatum dataobj;
r_base >> r_base_header;
std::set<int> PRN_set;
gpstk::SatID prn;
gnsstk::SatID prn;
switch (system)
{
case 'G':
#if OLD_GPSTK
prn.system = gpstk::SatID::systemGPS;
#else
prn.system = gpstk::SatelliteSystem::GPS;
#endif
prn.system = gnsstk::SatelliteSystem::GPS;
PRN_set = available_gps_prn;
break;
case 'E':
#if OLD_GPSTK
prn.system = gpstk::SatID::systemGalileo;
#else
prn.system = gpstk::SatelliteSystem::Galileo;
#endif
prn.system = gnsstk::SatelliteSystem::Galileo;
PRN_set = available_galileo_prn;
break;
default:
#if OLD_GPSTK
prn.system = gpstk::SatID::systemGPS;
#else
prn.system = gpstk::SatelliteSystem::GPS;
#endif
prn.system = gnsstk::SatelliteSystem::GPS;
PRN_set = available_gps_prn;
}
@ -141,8 +129,8 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
for (const auto& prn_it : PRN_set)
{
prn.id = prn_it;
gpstk::CommonTime time = r_base_data.time;
double sow(static_cast<gpstk::GPSWeekSecond>(time).sow);
gnsstk::CommonTime time = r_base_data.time;
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
auto pointer = r_base_data.obs.find(prn);
@ -220,12 +208,12 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
}
} // end while
} // End of 'try' block
catch (const gpstk::FFStreamError& e)
catch (const gnsstk::FFStreamError& e)
{
std::cout << e;
return obs_map;
}
catch (const gpstk::Exception& e)
catch (const gnsstk::Exception& e)
{
std::cout << e;
return obs_map;
@ -906,7 +894,7 @@ void coderate_phaserate_consistence(
arma::vec prange = measured_ch0.col(1);
// todo: This code is only valid for L1/E1 carrier frequency.
arma::vec phase = measured_ch0.col(3) * (gpstk::C_MPS / gpstk::L1_FREQ_GPS);
arma::vec phase = measured_ch0.col(3) * (gnsstk::C_MPS / gnsstk::L1_FREQ_GPS);
double mincodeval = 5000000.0;
double maxcodeval = 40000000.0;
@ -1051,7 +1039,7 @@ void code_phase_diff(
arma::interp1(measured_ch1.col(0), measured_ch1.col(3), measurement_time, carrier_phase_ch1_obs_interp);
// generate Code - Phase vector
arma::vec code_minus_phase = (measured_ch0.col(1) - code_range_ch1_obs_interp) - (measured_ch0.col(3) - carrier_phase_ch1_obs_interp) * (gpstk::C_MPS / gpstk::L1_FREQ_GPS);
arma::vec code_minus_phase = (measured_ch0.col(1) - code_range_ch1_obs_interp) - (measured_ch0.col(3) - carrier_phase_ch1_obs_interp) * (gnsstk::C_MPS / gnsstk::L1_FREQ_GPS);
// remove NaN
arma::uvec NaN_in_measured_data = arma::find_nonfinite(code_minus_phase);
@ -1135,28 +1123,28 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
return 0.0;
}
// Declaration of objects for storing ephemerides and handling RAIM
gpstk::GPSEphemerisStore bcestore;
gpstk::PRSolution raimSolver;
gnsstk::GPSEphemerisStore bcestore;
gnsstk::PRSolution raimSolver;
// Object for void-type tropospheric model (in case no meteorological
// RINEX is available)
gpstk::ZeroTropModel noTropModel;
gnsstk::ZeroTropModel noTropModel;
// Object for GG-type tropospheric model (Goad and Goodman, 1974)
// Default constructor => default values for model
gpstk::GGTropModel ggTropModel;
gnsstk::GGTropModel ggTropModel;
// Pointer to one of the two available tropospheric models. It points
// to the void model by default
gpstk::TropModel* tropModelPtr = &noTropModel;
gnsstk::TropModel* tropModelPtr = &noTropModel;
double rx_clock_error_s = 0.0;
try
{
// Read nav file and store unique list of ephemerides
gpstk::Rinex3NavStream rnffs(rinex_nav_filename.c_str()); // Open ephemerides data file
gpstk::Rinex3NavData rne;
gpstk::Rinex3NavHeader hdr;
gnsstk::Rinex3NavStream rnffs(rinex_nav_filename.c_str()); // Open ephemerides data file
gnsstk::Rinex3NavData rne;
gnsstk::Rinex3NavHeader hdr;
// Let's read the header (may be skipped)
rnffs >> hdr;
@ -1172,10 +1160,10 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
// Open and read the observation file one epoch at a time.
// For each epoch, compute and print a position solution
gpstk::Rinex3ObsStream roffs(rinex_obs_file.c_str()); // Open observations data file
gnsstk::Rinex3ObsStream roffs(rinex_obs_file.c_str()); // Open observations data file
gpstk::Rinex3ObsHeader roh;
gpstk::Rinex3ObsData rod;
gnsstk::Rinex3ObsHeader roh;
gnsstk::Rinex3ObsData rod;
// Let's read the header
roffs >> roh;
@ -1197,14 +1185,14 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
// Apply editing criteria
if (rod.epochFlag == 0 || rod.epochFlag == 1) // Begin usable data
{
std::vector<gpstk::SatID> prnVec;
std::vector<gnsstk::SatID> prnVec;
std::vector<double> rangeVec;
// Define the "it" iterator to visit the observations PRN map.
// Rinex3ObsData::DataMap is a map from RinexSatID to
// vector<RinexDatum>:
// std::map<RinexSatID, vector<RinexDatum> >
gpstk::Rinex3ObsData::DataMap::const_iterator it;
gnsstk::Rinex3ObsData::DataMap::const_iterator it;
// This part gets the PRN numbers and ionosphere-corrected
// pseudoranges for the current epoch. They are correspondly fed
@ -1251,19 +1239,12 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
// pointer to the tropospheric model to be applied
try
{
#if OLD_GPSTK
std::vector<gpstk::SatID::SatelliteSystem> Syss;
#endif
gpstk::Matrix<double> invMC;
gnsstk::Matrix<double> invMC;
int iret;
// Call RAIMCompute
#if OLD_GPSTK
iret = raimSolver.RAIMCompute(rod.time, prnVec, Syss, rangeVec, invMC,
&bcestore, tropModelPtr);
#else
iret = raimSolver.RAIMCompute(rod.time, prnVec, rangeVec, invMC,
&bcestore, tropModelPtr);
#endif
switch (iret)
{
/// @return Return values:
@ -1294,7 +1275,7 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
}
// return iret;
}
catch (const gpstk::Exception& e)
catch (const gnsstk::Exception& e)
{
}
@ -1307,14 +1288,14 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
<< std::setw(12) << raimSolver.Solution(2) << "\n";
std::cout << "RX CLK " << std::fixed << std::setprecision(16)
<< raimSolver.Solution(3) / gpstk::C_MPS << " [s] \n";
<< raimSolver.Solution(3) / gnsstk::C_MPS << " [s] \n";
std::cout << "NSATS, DOPs " << std::setw(2) << raimSolver.Nsvs << std::fixed
<< std::setprecision(2) << " "
<< std::setw(4) << raimSolver.PDOP << " " << std::setw(4) << raimSolver.GDOP
<< " " << std::setw(8) << raimSolver.RMSResidual << "\n";
gpstk::Position rx_pos;
rx_pos.setECEF(gpstk::Triple(raimSolver.Solution(0), raimSolver.Solution(1), raimSolver.Solution(2)));
gnsstk::Position rx_pos;
rx_pos.setECEF(gnsstk::Triple(raimSolver.Solution(0), raimSolver.Solution(1), raimSolver.Solution(2)));
double lat_deg = rx_pos.geodeticLatitude();
double lon_deg = rx_pos.longitude();
@ -1325,17 +1306,17 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
<< std::setw(12) << Alt_m << " [deg],[deg],[m]\n";
// set computed RX clock error and stop iterating obs epochs
rx_clock_error_s = raimSolver.Solution(3) / gpstk::C_MPS;
rx_clock_error_s = raimSolver.Solution(3) / gnsstk::C_MPS;
break;
} // End of 'if( raimSolver.isValid() )'
} // End of 'if( rod.epochFlag == 0 || rod.epochFlag == 1 )'
} // End of 'while( roffs >> rod )'
}
catch (const gpstk::FFStreamError& e)
catch (const gnsstk::FFStreamError& e)
{
std::cout << "GPSTK exception: " << e << '\n';
}
catch (const gpstk::Exception& e)
catch (const gnsstk::Exception& e)
{
std::cout << "GPSTK exception: " << e << '\n';
}

View File

@ -5,11 +5,11 @@
# SPDX-License-Identifier: BSD-3-Clause
find_package(GPSTK QUIET)
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
find_package(GNSSTK QUIET)
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
include(GNUInstallDirs)
set(GPSTK_LIBRARY ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GPSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include)
set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX})
set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include)
endif()
@ -73,7 +73,7 @@ if(Boost_FOUND)
PRIVATE
Boost::iostreams
Boost::serialization
${GPSTK_LIBRARY}
${GNSSTK_LIBRARY}
Gflags::gflags
Threads::Threads
core_system_parameters
@ -81,8 +81,8 @@ if(Boost_FOUND)
target_include_directories(rinex2assist
PRIVATE
${GPSTK_INCLUDE_DIR}/gpstk
${GPSTK_INCLUDE_DIR}
${GNSSTK_INCLUDE_DIR}/gnsstk
${GNSSTK_INCLUDE_DIR}
)
if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND)
@ -91,8 +91,8 @@ if(Boost_FOUND)
target_compile_definitions(rinex2assist PRIVATE -DUNCOMPRESS_EXECUTABLE="")
endif()
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
add_dependencies(rinex2assist gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION})
endif()
if(ENABLE_STRIP)

View File

@ -28,11 +28,11 @@
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/serialization/map.hpp>
#include <gflags/gflags.h>
#include <gpstk/GALWeekSecond.hpp>
#include <gpstk/GPSWeekSecond.hpp>
#include <gpstk/Rinex3NavData.hpp>
#include <gpstk/Rinex3NavHeader.hpp>
#include <gpstk/Rinex3NavStream.hpp>
#include <gnsstk/GALWeekSecond.hpp>
#include <gnsstk/GPSWeekSecond.hpp>
#include <gnsstk/Rinex3NavData.hpp>
#include <gnsstk/Rinex3NavHeader.hpp>
#include <gnsstk/Rinex3NavStream.hpp>
#include <cstddef> // for size_t
#include <cstdlib>
#include <iostream>
@ -157,9 +157,9 @@ int main(int argc, char** argv)
try
{
// Read nav file
gpstk::Rinex3NavStream rnffs(input_filename.c_str()); // Open navigation data file
gpstk::Rinex3NavData rne;
gpstk::Rinex3NavHeader hdr;
gnsstk::Rinex3NavStream rnffs(input_filename.c_str()); // Open navigation data file
gnsstk::Rinex3NavData rne;
gnsstk::Rinex3NavHeader hdr;
// Read header
rnffs >> hdr;
@ -178,8 +178,14 @@ int main(int argc, char** argv)
gps_utc_model.valid = (hdr.valid > 2147483648) ? true : false;
gps_utc_model.A1 = hdr.mapTimeCorr["GPUT"].A0;
gps_utc_model.A0 = hdr.mapTimeCorr["GPUT"].A1;
gps_utc_model.tot = static_cast<gpstk::GPSWeekSecond>(hdr.mapTimeCorr["GPUT"].refTime).sow;
gps_utc_model.WN_T = static_cast<gpstk::GPSWeekSecond>(hdr.mapTimeCorr["GPUT"].refTime).week;
if (std::find(hdr.commentList.begin(), hdr.commentList.end(), "GPUT") != hdr.commentList.end())
{
gnsstk::GPSWeekSecond ct;
ct = gnsstk::GPSWeekSecond(hdr.mapTimeCorr["GPUT"].refTime);
// std::cout << "gps sow: " << ct.sow << '\n';
gps_utc_model.tot = ct.sow;
gps_utc_model.WN_T = ct.week;
}
gps_utc_model.DeltaT_LS = hdr.leapSeconds;
gps_utc_model.WN_LSF = hdr.leapWeek;
gps_utc_model.DN = hdr.leapDay;
@ -201,8 +207,14 @@ int main(int argc, char** argv)
gal_utc_model.A0 = hdr.mapTimeCorr["GAUT"].A0;
gal_utc_model.A1 = hdr.mapTimeCorr["GAUT"].A1;
gal_utc_model.Delta_tLS = hdr.leapSeconds;
gal_utc_model.tot = static_cast<gpstk::GALWeekSecond>(hdr.mapTimeCorr["GAUT"].refTime).sow;
gal_utc_model.WNot = static_cast<gpstk::GALWeekSecond>(hdr.mapTimeCorr["GAUT"].refTime).week;
if (std::find(hdr.commentList.begin(), hdr.commentList.end(), "GAUT") != hdr.commentList.end())
{
gnsstk::GALWeekSecond ct;
ct = gnsstk::GALWeekSecond(hdr.mapTimeCorr["GAUT"].refTime);
// std::cout << "gal sow: " << ct.sow << '\n';
gal_utc_model.tot = ct.sow;
gal_utc_model.WNot = ct.week;
}
gal_utc_model.WN_LSF = hdr.leapWeek;
gal_utc_model.DN = hdr.leapDay;
gal_utc_model.Delta_tLSF = hdr.leapDelta;