mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-09 19:53:04 +00:00
bds_b31: Getting new changes from upstream
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
|
||||
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
|
||||
#
|
||||
# This file is part of GNSS-SDR.
|
||||
#
|
||||
@@ -92,20 +92,6 @@ if(OPENCL_FOUND)
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${ARMADILLO_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
${VOLK_INCLUDE_DIRS}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
include_directories(${OPENCL_INCLUDE_DIRS})
|
||||
@@ -116,38 +102,63 @@ if(OPENCL_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
list(SORT GNSS_SPLIBS_HEADERS)
|
||||
list(SORT GNSS_SPLIBS_SOURCES)
|
||||
|
||||
add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
target_link_libraries(gnss_sp_libs
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${VOLK_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FFT_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
${OPT_LIBRARIES}
|
||||
gnss_rx
|
||||
PUBLIC
|
||||
Boost::boost
|
||||
Gflags::gflags
|
||||
Armadillo::armadillo
|
||||
Gnuradio::runtime
|
||||
Gnuradio::blocks
|
||||
Volk::volk ${ORC_LIBRARIES}
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
gnss_system_parameters
|
||||
${OPT_LIBRARIES}
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
if(NOT VOLKGNSSSDR_FOUND)
|
||||
add_dependencies(gnss_sp_libs volk_gnsssdr_module
|
||||
armadillo-${armadillo_RELEASE})
|
||||
else()
|
||||
add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE})
|
||||
endif()
|
||||
target_compile_definitions(gnss_sp_libs
|
||||
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
||||
)
|
||||
|
||||
if(${GFLAGS_GREATER_20})
|
||||
add_definitions(-DGFLAGS_GREATER_2_0=1)
|
||||
endif()
|
||||
set_property(TARGET gnss_sp_libs
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
source_group(Headers FILES 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)
|
||||
target_link_libraries(gnss_sdr_flags ${GFlags_LIBS})
|
||||
|
||||
target_link_libraries(gnss_sdr_flags
|
||||
PUBLIC
|
||||
Gflags::gflags
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
)
|
||||
|
||||
if(${GFLAGS_GREATER_20})
|
||||
target_compile_definitions(gnss_sdr_flags PRIVATE -DGFLAGS_GREATER_2_0=1)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(gnss_sdr_flags
|
||||
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
||||
)
|
||||
|
||||
set_property(TARGET gnss_sdr_flags
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -39,8 +39,8 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi
|
||||
const unsigned int _code_length = 2046;
|
||||
bool G1[_code_length];
|
||||
bool G2[_code_length];
|
||||
bool G1_register[11] = {0,1,0,1,0,1,0,1,0,1,0};
|
||||
bool G2_register[11] = {0,1,0,1,0,1,0,1,0,1,0};
|
||||
bool G1_register[11] = {false, true, false, true, false, true, false, true, false, true, false};
|
||||
bool G2_register[11] = {false, true, false, true, false, true, false, true, false, true, false};
|
||||
bool feedback1, feedback2;
|
||||
bool aux;
|
||||
unsigned int lcv, lcv2;
|
||||
@@ -70,7 +70,7 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[0];
|
||||
G2[lcv] = G2_register[-(phase1[prn_idx] - 11) ] ^ G2_register[-(phase2[prn_idx] - 11) ];
|
||||
G2[lcv] = G2_register[-(phase1[prn_idx] - 11)] ^ G2_register[-(phase2[prn_idx] - 11)];
|
||||
|
||||
feedback1 = (G1_register[0] + G1_register[1] + G1_register[2] + G1_register[3] + G1_register[4] + G1_register[10]) & 0x1;
|
||||
feedback2 = (G2_register[0] + G2_register[2] + G2_register[3] + G2_register[6] + G2_register[7] + G2_register[8] + G2_register[9] + G2_register[10]) & 0x1;
|
||||
@@ -86,7 +86,7 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi
|
||||
}
|
||||
|
||||
/* Set the delay */
|
||||
delay = _code_length - delays[prn_idx]*0; //**********************************
|
||||
delay = _code_length - delays[prn_idx] * 0; //**********************************
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
|
||||
@@ -104,7 +104,7 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi
|
||||
}
|
||||
|
||||
delay++;
|
||||
//std::cout << _dest[lcv] << " ";
|
||||
//std::cout << _dest[lcv] << " ";
|
||||
delay %= _code_length;
|
||||
}
|
||||
}
|
||||
@@ -156,8 +156,8 @@ void beidou_b1i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned in
|
||||
_samplesPerCode = static_cast<signed int>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
beidou_b1i_code_gen_complex(_code, _prn, _chip_shift); //generate C/A code 1 sample per chip
|
||||
|
||||
for (signed int i = 0; i < _samplesPerCode; i++)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
add_definitions(-DGNSS_SDR_VERSION="${VERSION}")
|
||||
|
||||
set(RTKLIB_LIB_SOURCES
|
||||
rtklib_rtkcmn.cc
|
||||
@@ -59,33 +58,30 @@ set(RTKLIB_LIB_HEADERS
|
||||
rtklib.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(SORT RTKLIB_LIB_HEADERS)
|
||||
list(SORT RTKLIB_LIB_SOURCES)
|
||||
|
||||
add_library(rtklib_lib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS})
|
||||
source_group(Headers FILES ${RTKLIB_LIB_HEADERS})
|
||||
add_dependencies(rtklib_lib glog-${glog_RELEASE})
|
||||
|
||||
add_library(rtklib_lib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS})
|
||||
|
||||
if(OS_IS_MACOSX)
|
||||
set(MAC_LIBRARIES "-framework Accelerate")
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
rtklib_lib
|
||||
${Boost_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${BLAS}
|
||||
${LAPACK}
|
||||
${MAC_LIBRARIES}
|
||||
target_link_libraries(rtklib_lib
|
||||
PUBLIC
|
||||
gnss_rx
|
||||
gnss_system_parameters
|
||||
PRIVATE
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
${BLAS}
|
||||
${LAPACK}
|
||||
${MAC_LIBRARIES}
|
||||
)
|
||||
|
||||
set_property(TARGET rtklib_lib
|
||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
@@ -223,8 +223,8 @@ const int NSYSQZS = 0;
|
||||
|
||||
#define ENABDS
|
||||
#ifdef ENABDS
|
||||
const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou
|
||||
const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou
|
||||
const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou
|
||||
const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou
|
||||
const int NSATBDS = (MAXPRNBDS - MINPRNBDS + 1); //!< number of BeiDou satellites
|
||||
const int NSYSBDS = 1;
|
||||
#else
|
||||
|
||||
@@ -75,15 +75,15 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro
|
||||
|
||||
// Mote that BeiDou week numbers do not need adjustment for foreseeable future. Consider change
|
||||
// to more elegant solution
|
||||
// if(gnss_synchro.System == 'C')
|
||||
// {
|
||||
// rtklib_obs.time = bdt2gpst(bdt2time(week, gnss_synchro.RX_time));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time);
|
||||
// }
|
||||
//
|
||||
// if(gnss_synchro.System == 'C')
|
||||
// {
|
||||
// rtklib_obs.time = bdt2gpst(bdt2time(week, gnss_synchro.RX_time));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time);
|
||||
// }
|
||||
//
|
||||
rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time);
|
||||
rtklib_obs.rcv = 1;
|
||||
return rtklib_obs;
|
||||
@@ -245,8 +245,8 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph)
|
||||
eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
|
||||
{
|
||||
eph_t rtklib_sat = {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, 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, 0.0, {}, {}, 0.0, 0.0 };
|
||||
rtklib_sat.sat = bei_eph.i_satellite_PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS ;
|
||||
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, 0.0, 0.0, {}, {}, 0.0, 0.0};
|
||||
rtklib_sat.sat = bei_eph.i_satellite_PRN + NSATGPS + NSATGLO + NSATGAL + NSATQZS;
|
||||
rtklib_sat.A = bei_eph.d_sqrt_A * bei_eph.d_sqrt_A;
|
||||
rtklib_sat.M0 = bei_eph.d_M_0;
|
||||
rtklib_sat.deln = bei_eph.d_Delta_n;
|
||||
@@ -259,10 +259,10 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
|
||||
rtklib_sat.Adot = 0; //only in CNAV;
|
||||
rtklib_sat.ndot = 0; //only in CNAV;
|
||||
|
||||
rtklib_sat.code = bei_eph.i_sig_type; /*B1I data*/
|
||||
rtklib_sat.flag = bei_eph.i_nav_type; /*MEO/IGSO satellite*/
|
||||
rtklib_sat.iode=(int32_t)bei_eph.d_AODE; /* AODE */
|
||||
rtklib_sat.iodc=(int32_t)bei_eph.d_AODC; /* AODC */
|
||||
rtklib_sat.code = bei_eph.i_sig_type; /*B1I data*/
|
||||
rtklib_sat.flag = bei_eph.i_nav_type; /*MEO/IGSO satellite*/
|
||||
rtklib_sat.iode = static_cast<int32_t>(bei_eph.d_AODE); /* AODE */
|
||||
rtklib_sat.iodc = static_cast<int32_t>(bei_eph.d_AODC); /* AODC */
|
||||
|
||||
rtklib_sat.week = bei_eph.i_BEIDOU_week; /* week of tow */
|
||||
rtklib_sat.cic = bei_eph.d_Cic;
|
||||
@@ -285,8 +285,8 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
|
||||
/* adjustment for week handover */
|
||||
double tow, toc, toe;
|
||||
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
|
||||
toc = time2gpst(rtklib_sat.toc, NULL);
|
||||
toe = time2gpst(rtklib_sat.toe, NULL);
|
||||
toc = time2gpst(rtklib_sat.toc, nullptr);
|
||||
toe = time2gpst(rtklib_sat.toe, nullptr);
|
||||
|
||||
if (rtklib_sat.toes < tow - 302400.0)
|
||||
{
|
||||
@@ -306,7 +306,6 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
|
||||
}
|
||||
|
||||
|
||||
|
||||
eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph)
|
||||
{
|
||||
eph_t rtklib_sat = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#ifndef GNSS_SDR_RTKLIB_CONVERSIONS_H_
|
||||
#define GNSS_SDR_RTKLIB_CONVERSIONS_H_
|
||||
|
||||
#include "beidou_dnav_ephemeris.h"
|
||||
#include "galileo_almanac.h"
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
@@ -39,7 +40,6 @@
|
||||
#include "gps_almanac.h"
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
#include "gps_ephemeris.h"
|
||||
#include "beidou_dnav_ephemeris.h"
|
||||
#include "rtklib.h"
|
||||
|
||||
eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph);
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
|
||||
#include "rtklib_ionex.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* get index -----------------------------------------------------------------*/
|
||||
int getindex(double value, const double *range)
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "rtklib_lambda.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/
|
||||
int LD(int n, const double *Q, double *L, double *D)
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "rtklib_ephemeris.h"
|
||||
#include "rtklib_ionex.h"
|
||||
#include "rtklib_sbas.h"
|
||||
#include <cstring>
|
||||
|
||||
/* pseudorange measurement error variance ------------------------------------*/
|
||||
double varerr(const prcopt_t *opt, double el, int sys)
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include "rtklib_sbas.h"
|
||||
#include "rtklib_tides.h"
|
||||
#include <cstring>
|
||||
|
||||
/* wave length of LC (m) -----------------------------------------------------*/
|
||||
double lam_LC(int i, int j, int k)
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
|
||||
#include "rtklib_preceph.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* satellite code to satellite system ----------------------------------------*/
|
||||
int code2sys(char code)
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
|
||||
#include "rtklib_rtcm3.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
|
||||
/* msm signal id table -------------------------------------------------------*/
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "rtklib_rtkcmn.h"
|
||||
//#include <cstdio>
|
||||
#include <glog/logging.h>
|
||||
#include <dirent.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
#define GNSS_SDR_RTKLIB_RTKCMN_H_
|
||||
|
||||
#include "rtklib.h"
|
||||
#include <glog/logging.h>
|
||||
//#include <glog/logging.h>
|
||||
|
||||
/* coordinate rotation matrix ------------------------------------------------*/
|
||||
#define Rx(t, X) \
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "rtklib_pntpos.h"
|
||||
#include "rtklib_ppp.h"
|
||||
#include "rtklib_tides.h"
|
||||
#include <cstring>
|
||||
|
||||
static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)),
|
||||
const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)),
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "rtklib_sbas.h"
|
||||
#include "rtklib_solution.h"
|
||||
#include "rtklib_stream.h"
|
||||
#include <cstring>
|
||||
|
||||
/* write solution header to output stream ------------------------------------*/
|
||||
void writesolhead(stream_t *stream, const solopt_t *solopt)
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
|
||||
#include "rtklib_sbas.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include <cstring>
|
||||
|
||||
/* extract field from line ---------------------------------------------------*/
|
||||
char *getfield(char *p, int pos)
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include "rtklib_rtksvr.h"
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
/* constants and macros ------------------------------------------------------*/
|
||||
|
||||
@@ -50,15 +50,16 @@
|
||||
*
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "rtklib_stream.h"
|
||||
#include "rtklib_rtkcmn.h"
|
||||
#include "rtklib_solution.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <cctype>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <rtklib_rtkcmn.h>
|
||||
#include <rtklib_solution.h>
|
||||
#include <rtklib_stream.h>
|
||||
#include <string>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
########################################################################
|
||||
# Project setup
|
||||
########################################################################
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel")
|
||||
project(volk_gnsssdr)
|
||||
enable_language(CXX)
|
||||
@@ -135,7 +135,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.")
|
||||
|
||||
set(VERSION_INFO_MAJOR_VERSION 0)
|
||||
set(VERSION_INFO_MINOR_VERSION 0)
|
||||
set(VERSION_INFO_MAINT_VERSION 10)
|
||||
set(VERSION_INFO_MAINT_VERSION 10.git)
|
||||
include(VolkVersion) #setup version info
|
||||
|
||||
|
||||
@@ -369,6 +369,10 @@ install(
|
||||
COMPONENT "volk_gnsssdr_devel"
|
||||
)
|
||||
|
||||
install(EXPORT VOLK_GNSSSDR-export FILE VolkGnsssdrTargets.cmake
|
||||
NAMESPACE VolkGnsssdr:: DESTINATION ${CMAKE_MODULES_DIR}/volk_gnsssdr
|
||||
)
|
||||
|
||||
########################################################################
|
||||
# Option to enable QA testing, on by default
|
||||
########################################################################
|
||||
|
||||
@@ -15,33 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr)
|
||||
get_filename_component(VOLK_GNSSSDR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
find_path(
|
||||
VOLK_GNSSSDR_INCLUDE_DIRS
|
||||
NAMES volk_gnsssdr/volk_gnsssdr.h
|
||||
HINTS $ENV{VOLK_DIR}/include
|
||||
${PC_VOLK_INCLUDEDIR}
|
||||
PATHS /usr/local/include
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
"@CMAKE_INSTALL_PREFIX@/include"
|
||||
)
|
||||
|
||||
find_library(
|
||||
VOLK_GNSSSDR_LIBRARIES
|
||||
NAMES volk_gnsssdr
|
||||
HINTS $ENV{VOLK_DIR}/lib
|
||||
${PC_VOLK_LIBDIR}
|
||||
PATHS /usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
"@CMAKE_INSTALL_PREFIX@/lib"
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
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)
|
||||
if(NOT TARGET VolkGnsssdr::volkgnsssdr)
|
||||
include("${VOLK_GNSSSDR_CMAKE_DIR}/VolkGnsssdrTargets.cmake")
|
||||
endif()
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
|
||||
<arch name="softfp">
|
||||
<flag compiler="gnu">-mfloat-abi=softfp</flag>
|
||||
<flag compiler="clang">-mfloat-abi=softfp</flag>
|
||||
</arch>
|
||||
|
||||
<arch name="hardfp">
|
||||
<flag compiler="gnu">-mfloat-abi=hard</flag>
|
||||
<flag compiler="clang">-mfloat-abi=hard</flag>
|
||||
</arch>
|
||||
|
||||
<arch name="neon">
|
||||
<flag compiler="gnu">-funsafe-math-optimizations</flag>
|
||||
<flag compiler="clang">-funsafe-math-optimizations</flag>
|
||||
<alignment>16</alignment>
|
||||
<check name="has_neon"></check>
|
||||
</arch>
|
||||
@@ -21,18 +24,22 @@
|
||||
<arch name="neonv7">
|
||||
<flag compiler="gnu">-mfpu=neon</flag>
|
||||
<flag compiler="gnu">-funsafe-math-optimizations</flag>
|
||||
<flag compiler="clang">-mfpu=neon</flag>
|
||||
<flag compiler="clang">-funsafe-math-optimizations</flag>
|
||||
<alignment>16</alignment>
|
||||
<check name="has_neonv7"></check>
|
||||
</arch>
|
||||
|
||||
<arch name="neonv8">
|
||||
<flag compiler="gnu">-funsafe-math-optimizations</flag>
|
||||
<flag compiler="clang">-funsafe-math-optimizations</flag>
|
||||
<alignment>16</alignment>
|
||||
<check name="has_neonv8"></check>
|
||||
</arch>
|
||||
|
||||
<arch name="32">
|
||||
<flag compiler="gnu">-m32</flag>
|
||||
<flag compiler="clang">-m32</flag>
|
||||
</arch>
|
||||
|
||||
<arch name="64">
|
||||
|
||||
@@ -53,7 +53,7 @@ def split_into_nested_ifdef_sections(code):
|
||||
header = 'text'
|
||||
in_section_depth = 0
|
||||
for i, line in enumerate(code.splitlines()):
|
||||
m = re.match('^(\s*)#(\s*)(\w+)(.*)$', line)
|
||||
m = re.match(r'^(\s*)#(\s*)(\w+)(.*)$', line)
|
||||
line_is = 'normal'
|
||||
if m:
|
||||
p0, p1, fcn, stuff = m.groups()
|
||||
@@ -121,11 +121,11 @@ def flatten_section_text(sections):
|
||||
class impl_class(object):
|
||||
def __init__(self, kern_name, header, body):
|
||||
#extract LV_HAVE_*
|
||||
self.deps = set(res.lower() for res in re.findall('LV_HAVE_(\w+)', header))
|
||||
self.deps = set(res.lower() for res in re.findall(r'LV_HAVE_(\w+)', header))
|
||||
#extract function suffix and args
|
||||
body = flatten_section_text(body)
|
||||
try:
|
||||
fcn_matcher = re.compile('^.*(%s\\w*)\\s*\\((.*)$'%kern_name, re.DOTALL | re.MULTILINE)
|
||||
fcn_matcher = re.compile(r'^.*(%s\w*)\s*\((.*)$'%kern_name, re.DOTALL | re.MULTILINE)
|
||||
body = body.split('{')[0].rsplit(')', 1)[0] #get the part before the open ){ bracket
|
||||
m = fcn_matcher.match(body)
|
||||
impl_name, the_rest = m.groups()
|
||||
@@ -133,7 +133,7 @@ class impl_class(object):
|
||||
self.args = list()
|
||||
fcn_args = the_rest.split(',')
|
||||
for fcn_arg in fcn_args:
|
||||
arg_matcher = re.compile('^\s*(.*\\W)\s*(\w+)\s*$', re.DOTALL | re.MULTILINE)
|
||||
arg_matcher = re.compile(r'^\s*(.*\W)\s*(\w+)\s*$', re.DOTALL | re.MULTILINE)
|
||||
m = arg_matcher.match(fcn_arg)
|
||||
arg_type, arg_name = m.groups()
|
||||
self.args.append((arg_type, arg_name))
|
||||
@@ -153,7 +153,7 @@ def extract_lv_haves(code):
|
||||
haves = list()
|
||||
for line in code.splitlines():
|
||||
if not line.strip().startswith('#'): continue
|
||||
have_set = set(res.lower() for res in re.findall('LV_HAVE_(\w+)', line))
|
||||
have_set = set(res.lower() for res in re.findall(r'LV_HAVE_(\w+)', line))
|
||||
if have_set: haves.append(have_set)
|
||||
return haves
|
||||
|
||||
|
||||
@@ -254,6 +254,8 @@ if(NOT CPU_IS_x86)
|
||||
overrule_arch(sse4_1 "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(avx512f "Architecture is not x86 or x86_64")
|
||||
overrule_arch(avx512cd "Architecture is not x86 or x86_64")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
@@ -477,7 +479,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
|
||||
endforeach()
|
||||
endif()
|
||||
enable_language(ASM)
|
||||
set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS})
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${ARCH_ASM_FLAGS}")
|
||||
message(STATUS "c flags: ${FULL_C_FLAGS}")
|
||||
message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}")
|
||||
endforeach()
|
||||
@@ -567,71 +569,67 @@ if(MSVC)
|
||||
set_source_files_properties(${volk_gnsssdr_sources} PROPERTIES LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
#Use object library for faster overall build in newer versions of cmake
|
||||
if(CMAKE_VERSION VERSION_GREATER "2.8.7")
|
||||
#Create a volk_gnsssdr object library (requires cmake >= 2.8.8)
|
||||
add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources})
|
||||
#Create a volk_gnsssdr object library
|
||||
add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources})
|
||||
target_include_directories(volk_gnsssdr_obj
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
PUBLIC $<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${PROJECT_SOURCE_DIR}/kernels
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
#Add dynamic library
|
||||
add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj>)
|
||||
target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES})
|
||||
#Add dynamic library
|
||||
add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj>)
|
||||
target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} m)
|
||||
target_include_directories(volk_gnsssdr
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
PUBLIC $<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${PROJECT_SOURCE_DIR}/kernels
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
#Configure target properties
|
||||
set_target_properties(volk_gnsssdr_obj PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER})
|
||||
set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS")
|
||||
#Configure target properties
|
||||
set_target_properties(volk_gnsssdr_obj PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER})
|
||||
set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS")
|
||||
|
||||
#Install locations
|
||||
install(TARGETS volk_gnsssdr
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
|
||||
RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file
|
||||
#Install locations
|
||||
install(TARGETS volk_gnsssdr
|
||||
EXPORT VOLK_GNSSSDR-export
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
|
||||
RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file
|
||||
)
|
||||
|
||||
#Configure static library
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
add_library(volk_gnsssdr_static STATIC $<TARGET_OBJECTS:volk_gnsssdr_obj>)
|
||||
target_link_libraries(volk_gnsssdr_static ${volk_gnsssdr_libraries} pthread m)
|
||||
target_include_directories(volk_gnsssdr_static
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
PUBLIC $<INSTALL_INTERFACE:include>
|
||||
PRIVATE ${PROJECT_SOURCE_DIR}/kernels
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
#Configure static library
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
add_library(volk_gnsssdr_static STATIC $<TARGET_OBJECTS:volk_gnsssdr_obj>)
|
||||
|
||||
set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr)
|
||||
|
||||
install(TARGETS volk_gnsssdr_static
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel"
|
||||
)
|
||||
endif()
|
||||
|
||||
#Older cmake versions (slower to build when building dynamic/static libs)
|
||||
else()
|
||||
#create the volk_gnsssdr runtime library
|
||||
add_library(volk_gnsssdr SHARED ${volk_gnsssdr_sources})
|
||||
target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries})
|
||||
set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER})
|
||||
set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS")
|
||||
|
||||
install(TARGETS volk_gnsssdr
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
|
||||
RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file
|
||||
install(TARGETS volk_gnsssdr_static
|
||||
EXPORT VOLK_GNSSSDR-export
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel"
|
||||
)
|
||||
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
add_library(volk_gnsssdr_static STATIC ${volk_gnsssdr_sources})
|
||||
|
||||
if(NOT WIN32)
|
||||
set_target_properties(volk_gnsssdr_static
|
||||
PROPERTIES OUTPUT_NAME volk_gnsssdr)
|
||||
endif()
|
||||
|
||||
install(TARGETS volk_gnsssdr_static
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
|
||||
)
|
||||
endif()
|
||||
set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr)
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Build the QA test application
|
||||
########################################################################
|
||||
if(ENABLE_TESTING)
|
||||
|
||||
#include Boost headers
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.unittest)
|
||||
@@ -645,11 +643,11 @@ if(ENABLE_TESTING)
|
||||
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc
|
||||
TARGET_DEPS volk_gnsssdr
|
||||
)
|
||||
)
|
||||
|
||||
foreach(kernel ${h_files})
|
||||
get_filename_component(kernel ${kernel} NAME)
|
||||
string(REPLACE ".h" "" kernel ${kernel})
|
||||
volk_add_test(${kernel} "volk_gnsssdr_test_all")
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -29,7 +29,7 @@ from six.moves import configparser, input
|
||||
|
||||
class volk_gnsssdr_modtool_config(object):
|
||||
def key_val_sub(self, num, stuff, section):
|
||||
return re.sub('\$' + 'k' + str(num), stuff[num][0], (re.sub('\$' + str(num), stuff[num][1], section[1][num])));
|
||||
return re.sub(r'\$' + 'k' + str(num), stuff[num][0], (re.sub(r'\$' + str(num), stuff[num][1], section[1][num])));
|
||||
|
||||
def verify(self):
|
||||
for i in self.verification:
|
||||
@@ -95,4 +95,3 @@ class volk_gnsssdr_modtool_config(object):
|
||||
for i in stuff:
|
||||
retval[i[0]] = i[1]
|
||||
return retval
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ class volk_gnsssdr_modtool(object):
|
||||
def __init__(self, cfg):
|
||||
self.volk_gnsssdr = re.compile('volk_gnsssdr');
|
||||
self.remove_after_underscore = re.compile("_.*");
|
||||
self.volk_gnsssdr_run_tests = re.compile('^\s*VOLK_RUN_TESTS.*\n', re.MULTILINE);
|
||||
self.volk_gnsssdr_profile = re.compile('^\s*(VOLK_PROFILE|VOLK_PUPPET_PROFILE).*\n', re.MULTILINE);
|
||||
self.volk_gnsssdr_run_tests = re.compile(r'^\s*VOLK_RUN_TESTS.*\n', re.MULTILINE);
|
||||
self.volk_gnsssdr_profile = re.compile(r'^\s*(VOLK_PROFILE|VOLK_PUPPET_PROFILE).*\n', re.MULTILINE);
|
||||
self.my_dict = cfg;
|
||||
self.lastline = re.compile('\s*char path\[1024\];.*');
|
||||
self.badassert = re.compile('^\s*assert\(toked\[0\] == "volk_gnsssdr_.*\n', re.MULTILINE);
|
||||
self.lastline = re.compile(r'\s*char path\[1024\];.*');
|
||||
self.badassert = re.compile(r'^\s*assert\(toked\[0\] == "volk_gnsssdr_.*\n', re.MULTILINE);
|
||||
self.goodassert = ' assert(toked[0] == "volk_gnsssdr");\n'
|
||||
self.baderase = re.compile('^\s*toked.erase\(toked.begin\(\)\);.*\n', re.MULTILINE);
|
||||
self.baderase = re.compile(r'^\s*toked.erase\(toked.begin\(\)\);.*\n', re.MULTILINE);
|
||||
self.gooderase = ' toked.erase(toked.begin());\n toked.erase(toked.begin());\n';
|
||||
|
||||
def get_basename(self, base=None):
|
||||
@@ -65,7 +65,7 @@ class volk_gnsssdr_modtool(object):
|
||||
|
||||
for line in hdr_files:
|
||||
|
||||
subline = re.search(".*\.h.*", os.path.basename(line))
|
||||
subline = re.search(r".*\.h.*", os.path.basename(line))
|
||||
if subline:
|
||||
subsubline = begins.search(subline.group(0));
|
||||
if subsubline:
|
||||
@@ -81,7 +81,7 @@ class volk_gnsssdr_modtool(object):
|
||||
for dt in datatypes:
|
||||
if dt in line:
|
||||
#subline = re.search("(?<=volk_gnsssdr_)" + dt + ".*(?=\.h)", line);
|
||||
subline = re.search(begins.pattern[:-2] + dt + ".*(?=\.h)", line);
|
||||
subline = re.search(begins.pattern[:-2] + dt + r".*(?=\.h)", line);
|
||||
if subline:
|
||||
functions.append(subline.group(0));
|
||||
|
||||
@@ -188,8 +188,8 @@ class volk_gnsssdr_modtool(object):
|
||||
inpath = os.path.abspath(base);
|
||||
kernel = re.compile(name)
|
||||
search_kernels = set([kernel])
|
||||
profile = re.compile('^\s*VOLK_PROFILE')
|
||||
puppet = re.compile('^\s*VOLK_PUPPET')
|
||||
profile = re.compile(r'^\s*VOLK_PROFILE')
|
||||
puppet = re.compile(r'^\s*VOLK_PUPPET')
|
||||
src_dest = os.path.join(inpath, 'apps/', top[:-1] + '_profile.cc');
|
||||
infile = open(src_dest);
|
||||
otherlines = infile.readlines();
|
||||
@@ -257,8 +257,8 @@ class volk_gnsssdr_modtool(object):
|
||||
kernel = re.compile(name)
|
||||
search_kernels = set([kernel])
|
||||
|
||||
profile = re.compile('^\s*VOLK_PROFILE')
|
||||
puppet = re.compile('^\s*VOLK_PUPPET')
|
||||
profile = re.compile(r'^\s*VOLK_PROFILE')
|
||||
puppet = re.compile(r'^\s*VOLK_PUPPET')
|
||||
infile = open(os.path.join(inpath, 'apps/', oldvolk_gnsssdr.pattern + '_profile.cc'));
|
||||
otherinfile = open(os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'apps/volk_gnsssdr_' + self.my_dict['name'] + '_profile.cc'));
|
||||
dest = os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'apps/volk_gnsssdr_' + self.my_dict['name'] + '_profile.cc');
|
||||
|
||||
Reference in New Issue
Block a user