mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-27 01:14:51 +00:00
Merge branch 'cross-compile' of
https://github.com/anthony-arnold/gnss-sdr into anthony-cross-compile # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
This commit is contained in:
commit
ce5783ca61
@ -21,7 +21,7 @@
|
||||
# Project setup
|
||||
########################################################################
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
message(FATAL_ERROR "Prevented in-tree build. This is bad practice. Try 'cd build && cmake ../' ")
|
||||
message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ")
|
||||
endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(gnss-sdr CXX C)
|
||||
@ -724,7 +724,7 @@ if(OS_IS_LINUX)
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install gfortran")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(FATAL_ERROR "gfortran is required to build gnss-sdr")
|
||||
#message(FATAL_ERROR "gfortran is required to build gnss-sdr")
|
||||
endif(NOT GFORTRAN)
|
||||
endif(OS_IS_LINUX)
|
||||
|
||||
@ -1080,5 +1080,3 @@ add_subdirectory(src)
|
||||
if(ENABLE_PACKAGING)
|
||||
include(GnssSdrPackaging)
|
||||
endif(ENABLE_PACKAGING)
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ set (ARM_VERSION "")
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
execute_process(COMMAND echo "int main(){}"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -dM -E -
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E -
|
||||
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
|
||||
|
||||
string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
|
||||
|
@ -8,7 +8,7 @@
|
||||
function (test_for_sse h_file result_var name)
|
||||
if (NOT DEFINED ${result_var})
|
||||
execute_process(COMMAND echo "#include <${h_file}>"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -c -x c++ -
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ -
|
||||
RESULT_VARIABLE COMPILE_RESULT
|
||||
OUTPUT_QUIET ERROR_QUIET)
|
||||
set(detected 0)
|
||||
|
@ -29,10 +29,12 @@ GNSS-SDR.SUPL_CI=0x31b0
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
;SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
SignalSource.filename=../../../Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=short
|
||||
;SignalSource.item_type=short
|
||||
SignalSource.item_type=byte
|
||||
|
||||
;#sampling_frequency: Original Signal sampling frequency in [Hz]
|
||||
SignalSource.sampling_frequency=4000000
|
||||
@ -75,7 +77,10 @@ SignalConditioner.implementation=Signal_Conditioner
|
||||
;######### DATA_TYPE_ADAPTER CONFIG ############
|
||||
;## Changes the type of input data. Please disable it in this version.
|
||||
;#implementation: [Pass_Through] disables this block
|
||||
DataTypeAdapter.implementation=Ishort_To_Complex
|
||||
;DataTypeAdapter.implementation=Ishort_To_Complex
|
||||
;DataTypeAdapter.implementation=Ibyte_To_Cbyte
|
||||
DataTypeAdapter.implementation=Pass_Through
|
||||
DataTypeAdapter.item_type=byte
|
||||
|
||||
;######### INPUT_FILTER CONFIG ############
|
||||
;## Filter the input data. Can be combined with frequency translation for IF signals
|
||||
@ -86,8 +91,8 @@ DataTypeAdapter.implementation=Ishort_To_Complex
|
||||
;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz.
|
||||
|
||||
;InputFilter.implementation=Fir_Filter
|
||||
;InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
InputFilter.implementation=Pass_Through
|
||||
InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
;InputFilter.implementation=Pass_Through
|
||||
|
||||
;#dump: Dump the filtered data to a file.
|
||||
InputFilter.dump=false
|
||||
@ -100,7 +105,7 @@ InputFilter.dump_filename=../data/input_filter.dat
|
||||
;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse reponse given a set of band edges, the desired reponse on those bands, and the weight given to the error in those bands.
|
||||
|
||||
;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
|
||||
InputFilter.input_item_type=gr_complex
|
||||
InputFilter.input_item_type=byte
|
||||
|
||||
;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
|
||||
InputFilter.output_item_type=gr_complex
|
||||
@ -167,6 +172,7 @@ Resampler.dump_filename=../data/resampler.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Resampler.item_type=gr_complex
|
||||
;Resampler.item_type=cbyte
|
||||
|
||||
;#sample_freq_in: the sample frequency of the input signal
|
||||
Resampler.sample_freq_in=8000000
|
||||
|
@ -17,7 +17,7 @@ ControlThread.wait_for_flowgraph=false
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
SignalSource.filename=../../../Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=short
|
||||
@ -166,7 +166,7 @@ Resampler.sample_freq_out=4000000
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_GPS.count=0
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_Galileo.count=4
|
||||
Channels_Galileo.count=8
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
|
||||
@ -193,7 +193,7 @@ Acquisition_Galileo.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
;#threshold: Acquisition threshold
|
||||
;Acquisition_Galileo.threshold=0
|
||||
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_Galileo.pfa=0.0000002
|
||||
Acquisition_Galileo.pfa=0.000002
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_Galileo.doppler_max=15000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
|
@ -17,7 +17,7 @@ ControlThread.wait_for_flowgraph=false
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
SignalSource.filename=../../../Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=short
|
||||
@ -164,9 +164,9 @@ Resampler.sample_freq_out=4000000
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_GPS.count=2
|
||||
Channels_GPS.count=4
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_Galileo.count=2
|
||||
Channels_Galileo.count=4
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
|
||||
|
@ -38,6 +38,7 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-proje
|
||||
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) #location for custom "Modules"
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
########################################################################
|
||||
# Environment setup
|
||||
|
@ -20,8 +20,7 @@
|
||||
#include "volk_gnsssdr/volk_gnsssdr_malloc.h"
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* For #defines used to determine support for allocation functions,
|
||||
@ -52,12 +51,20 @@
|
||||
//#else // _ISOC11_SOURCE
|
||||
|
||||
// Otherwise, test if we are a POSIX or X/Open system
|
||||
// This only has a restriction that alignment be a power of 2.
|
||||
// This only has a restriction that alignment be a power of 2and a
|
||||
// multiple of sizeof(void *).
|
||||
#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN
|
||||
|
||||
void *volk_gnsssdr_malloc(size_t size, size_t alignment)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
// quoting posix_memalign() man page:
|
||||
// "alignment must be a power of two and a multiple of sizeof(void *)"
|
||||
// volk_get_alignment() could return 1 for some machines (e.g. generic_orc)
|
||||
if (alignment == 1)
|
||||
return malloc(size);
|
||||
|
||||
int err = posix_memalign(&ptr, alignment, size);
|
||||
if(err == 0)
|
||||
{
|
||||
@ -65,7 +72,9 @@ void *volk_gnsssdr_malloc(size_t size, size_t alignment)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "VOLK: Error allocating memory (posix_memalign: %d)\n", err);
|
||||
fprintf(stderr,
|
||||
"VOLK: Error allocating memory "
|
||||
"(posix_memalign: error %d: %s)\n", err, strerror(err));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user