Update to gnsstk 13.4.0

This commit is contained in:
Carles Fernandez 2022-07-10 19:19:37 +02:00
parent 5ecfcc773b
commit fa821a52a4
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
10 changed files with 114 additions and 71 deletions

View File

@ -338,7 +338,7 @@ else()
set(GNSSSDR_GTEST_LOCAL_VERSION "1.12.1")
endif()
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GNSSTK_LOCAL_VERSION "12.1.0")
set(GNSSSDR_GNSSTK_LOCAL_VERSION "13.4.0")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.23")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.12")
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.1")

View File

@ -83,10 +83,16 @@ if(GNSSTK_LIBRARY AND GNSSTK_INCLUDE_DIR)
endif()
if(GNSSTK_VERSION)
if(GNSSTK_VERSION VERSION_GREATER ${GNSSSDR_GNSSTK_LOCAL_VERSION})
unset(GNSSTK_LIBRARY CACHE)
unset(GNSSTK_INCLUDE_DIR CACHE)
if(GNSSTK_VERSION VERSION_LESS "9.0.0")
set(GNSSTK_OLDER_THAN_9 TRUE)
endif()
if(GNSSTK_VERSION VERSION_LESS "13.0.0")
set(GNSSTK_OLDER_THAN_13 TRUE)
endif()
endif()
if(NOT EXISTS ${GNSSTK_INCLUDE_DIR}/gnsstk/GPSEphemerisStore.hpp)
set(GNSSTK_OLDER_THAN_13 TRUE)
endif()
# handle the QUIET and REQUIRED arguments and set GNSSTK_FOUND to TRUE if
@ -136,4 +142,6 @@ mark_as_advanced(GNSSTK_LIBRARY
GNSSTK_INCLUDE_DIR
GNSSTK_USES_GPSTK_NAMESPACE
GNSSTK_OLDER_THAN_8
GNSSTK_OLDER_THAN_9
GNSSTK_OLDER_THAN_13
)

View File

@ -359,7 +359,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
endif()
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_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gnsstk_static13.patch
)
# Patch only once
if(EXISTS ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt)
@ -561,6 +561,9 @@ if(ENABLE_UNIT_TESTING)
if(GNSSTK_USES_GPSTK_NAMESPACE)
target_compile_definitions(run_tests PRIVATE -DGNSSTK_USES_GPSTK_NAMESPACE=1)
endif()
if(GNSSTK_OLDER_THAN_9)
target_compile_definitions(run_tests PRIVATE -DGNSSTK_OLDER_THAN_9=1)
endif()
endif()
if(ENABLE_STRIP)
set_target_properties(run_tests PROPERTIES LINK_FLAGS "-s")

View File

@ -1,39 +0,0 @@
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

@ -0,0 +1,36 @@
--- CMakeLists_old.txt 2022-07-10 09:58:33.000000000 +0200
+++ CMakeLists.txt 2022-07-10 10:02:36.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 "13" )
@@ -21,6 +21,15 @@
# This sets up variables contining GNU standard installation locations.
include( GNUInstallDirs )
+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()
# Set a filename for collecting exported targets.
set( EXPORT_TARGETS_FILENAME "GNSSTKTargets" )
@@ -177,7 +186,7 @@
elseif( WIN32 )
add_library( gnsstk ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} )
else()
- add_library( gnsstk SHARED ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} )
+ add_library( gnsstk STATIC ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} )
endif()
# always generate the header because it's an include file whose

View File

@ -66,6 +66,7 @@
#include <unistd.h>
#include <utility>
#if GNSSTK_USES_GPSTK_NAMESPACE
#include <gpstk/GPSWeekSecond.hpp>
#include <gpstk/Rinex3ObsBase.hpp>
#include <gpstk/Rinex3ObsData.hpp>
#include <gpstk/Rinex3ObsHeader.hpp>
@ -73,6 +74,7 @@
#include <gpstk/RinexUtilities.hpp>
namespace gnsstk = gpstk;
#else
#include <gnsstk/GPSWeekSecond.hpp>
#include <gnsstk/Rinex3ObsBase.hpp>
#include <gnsstk/Rinex3ObsData.hpp>
#include <gnsstk/Rinex3ObsHeader.hpp>
@ -1612,8 +1614,12 @@ bool HybridObservablesTest::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_S
}
gnsstk::CommonTime time = r_ref_data.time;
#if GNSSTK_OLDER_THAN_9
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
#else
gnsstk::GPSWeekSecond gws(time);
double sow(gws.getSOW());
#endif
auto pointer = r_ref_data.obs.find(prn);
if (pointer == r_ref_data.obs.end())
{

View File

@ -67,6 +67,7 @@
#include <utility>
#if GNSSTK_USES_GPSTK_NAMESPACE
#include <gpstk/GPSWeekSecond.hpp>
#include <gpstk/Rinex3ObsBase.hpp>
#include <gpstk/Rinex3ObsData.hpp>
#include <gpstk/Rinex3ObsHeader.hpp>
@ -74,6 +75,7 @@
#include <gpstk/RinexUtilities.hpp>
namespace gnsstk = gpstk;
#else
#include <gnsstk/GPSWeekSecond.hpp>
#include <gnsstk/Rinex3ObsBase.hpp>
#include <gnsstk/Rinex3ObsData.hpp>
#include <gnsstk/Rinex3ObsHeader.hpp>
@ -1705,7 +1707,12 @@ bool HybridObservablesTestFpga::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gn
}
gnsstk::CommonTime time = r_ref_data.time;
#if GNSSTK_OLDER_THAN_9
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
#else
gnsstk::GPSWeekSecond gws(time);
double sow(gws.getSOW());
#endif
auto pointer = r_ref_data.obs.find(prn);
if (pointer == r_ref_data.obs.end())

View File

@ -7,7 +7,7 @@
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}'")
if(NOT GNSSTK_FOUND)
if(NOT GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK)
find_package(GNSSTK)
endif()
if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK)
@ -67,8 +67,8 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND
if(GNSSTK_OLDER_THAN_8)
target_compile_definitions(obsdiff PRIVATE -DOLD_GPSTK=1)
endif()
if(GNSSTK_OLDER_THAN_9)
target_compile_definitions(obsdiff PRIVATE -DGNSSTK_OLDER_THAN_9=1)
if(GNSSTK_OLDER_THAN_13)
target_compile_definitions(obsdiff PRIVATE -DGNSSTK_OLDER_THAN_13=1)
endif()
if(NOT TARGET Gnsstk::gnsstk)
if(GNSSTK_USES_GPSTK_NAMESPACE)

View File

@ -36,6 +36,7 @@
#include <gpstk/GGTropModel.hpp>
#include <gpstk/GNSSconstants.hpp>
#include <gpstk/GPSEphemerisStore.hpp>
#include <gpstk/GPSWeekSecond.hpp>
#include <gpstk/PRSolution.hpp>
#include <gpstk/Rinex3NavData.hpp>
#include <gpstk/Rinex3NavHeader.hpp>
@ -54,12 +55,6 @@ namespace gnsstk = gpstk;
#include <gnsstk/Rinex3ObsHeader.hpp>
#include <gnsstk/Rinex3ObsStream.hpp>
// Classes for handling satellite navigation parameters RINEX
// files (ephemerides)
#include <gnsstk/Rinex3NavData.hpp>
#include <gnsstk/Rinex3NavHeader.hpp>
#include <gnsstk/Rinex3NavStream.hpp>
// Classes for handling RINEX files with meteorological parameters
#include <gnsstk/RinexMetBase.hpp>
#include <gnsstk/RinexMetData.hpp>
@ -68,15 +63,20 @@ namespace gnsstk = gpstk;
// Class for handling tropospheric model
#include <gnsstk/GGTropModel.hpp>
// Class for storing >broadcast-type> ephemerides
#include <gnsstk/GPSEphemerisStore.hpp>
// Class for handling RAIM
#include <gnsstk/GNSSconstants.hpp>
#include <gnsstk/PRSolution.hpp>
// Class defining GPS system constants
#include <gnsstk/GNSSconstants.hpp>
// Class for storing <broadcast-type> ephemeris
#include <gnsstk/GPSWeekSecond.hpp>
#if GNSSTK_OLDER_THAN_13
#include <gnsstk/GPSEphemerisStore.hpp>
#include <gnsstk/Rinex3NavData.hpp>
#include <gnsstk/Rinex3NavHeader.hpp>
#include <gnsstk/Rinex3NavStream.hpp>
#else
#include <gnsstk/MultiFormatNavDataFactory.hpp>
#include <gnsstk/NavLibrary.hpp>
#endif
#endif
#if GFLAGS_OLD_NAMESPACE
@ -161,7 +161,13 @@ std::map<int, arma::mat> ReadRinexObs(const std::string& rinex_file, char system
{
prn.id = prn_it;
gnsstk::CommonTime time = r_base_data.time;
#if GNSSTK_OLDER_THAN_9
double sow(static_cast<gnsstk::GPSWeekSecond>(time).sow);
#else
gnsstk::GPSWeekSecond gws(time);
double sow(gws.getSOW());
#endif
auto pointer = r_base_data.obs.find(prn);
@ -1153,8 +1159,17 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
std::cout << "Warning: RINEX Nav file " << rinex_nav_filename << " does not exist, receiver's clock error could not be computed!\n";
return 0.0;
}
// Declaration of objects for storing ephemerides and handling RAIM
// Declaration of objects for storing ephemerides and handling RAIM
#if GNSSTK_OLDER_THAN_13
gnsstk::GPSEphemerisStore bcestore;
#else
gnsstk::NavLibrary navLib;
// Construct a NavDataFactory object
gnsstk::NavDataFactoryPtr ndfp(
std::make_shared<gnsstk::MultiFormatNavDataFactory>());
// Add the NavDataFactory to the NavLibrary
navLib.addFactory(ndfp);
#endif
gnsstk::PRSolution raimSolver;
// Object for void-type tropospheric model (in case no meteorological
@ -1172,22 +1187,26 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
double rx_clock_error_s = 0.0;
try
{
#if GNSSTK_OLDER_THAN_13
// Read nav file and store unique list of ephemerides
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;
// Storing the ephemeris in "bcstore"
while (rnffs >> rne)
{
bcestore.addEphemeris(rne);
}
// Setting the criteria for looking up ephemeris
bcestore.SearchNear();
#else
if (!ndfp->addDataSource(rinex_nav_filename))
{
std::cerr << "Unable to load " << rinex_nav_filename << '\n';
return 0.0;
}
#endif
// Open and read the observation file one epoch at a time.
// For each epoch, compute and print a position solution
@ -1280,8 +1299,13 @@ double compute_rx_clock_error(const std::string& rinex_nav_filename, const std::
iret = raimSolver.RAIMCompute(rod.time, prnVec, Syss, rangeVec, invMC,
&bcestore, tropModelPtr);
#else
#if GNSSTK_OLDER_THAN_13
iret = raimSolver.RAIMCompute(rod.time, prnVec, rangeVec, invMC,
&bcestore, tropModelPtr);
#else
iret = raimSolver.RAIMCompute(rod.time, prnVec, rangeVec, invMC,
navLib, tropModelPtr);
#endif
#endif
switch (iret)
{

View File

@ -4,7 +4,7 @@
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
# SPDX-License-Identifier: BSD-3-Clause
if(NOT GNSSTK_FOUND)
if(NOT GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK)
find_package(GNSSTK)
endif()
@ -98,10 +98,8 @@ if(Boost_FOUND)
${GNSSTK_INCLUDE_DIR}
)
endif()
if(GNSSTK_VERSION)
if(GNSSTK_VERSION VERSION_LESS "9.0.0")
target_compile_definitions(rinex2assist PRIVATE -DGNSSTK_OLDER_THAN_9=1)
endif()
if(GNSSTK_OLDER_THAN_9)
target_compile_definitions(rinex2assist PRIVATE -DGNSSTK_OLDER_THAN_9=1)
endif()
if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND)