Fixes compilation issues on Mac OS X. Now it builds successfully against gnuradio installed by Macports and using gcc 4.8. Upgrade version of Gtest. Some fixes and updates in documentation and code cleaning.

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@423 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2013-10-18 18:26:06 +00:00
parent 806af3e98f
commit 2972272b3e
23 changed files with 12691 additions and 387 deletions

View File

@ -418,6 +418,14 @@ if(NOT ARMADILLO_FOUND)
endif(NOT ARMADILLO_FOUND) endif(NOT ARMADILLO_FOUND)
########################################################################
# OpenCL
########################################################################
find_package(OpenCL)
################################################################################ ################################################################################
# Setup of optional drivers # Setup of optional drivers
################################################################################ ################################################################################
@ -441,6 +449,8 @@ if( $ENV{RTLSDR_DRIVER} )
endif($ENV{RTLSDR_DRIVER} ) endif($ENV{RTLSDR_DRIVER} )
######################################################################## ########################################################################
# Setup the include paths # Setup the include paths
######################################################################## ########################################################################
@ -460,6 +470,8 @@ endif($ENV{RTLSDR_DRIVER} )
#) #)
######################################################################## ########################################################################
# Set compiler flags # Set compiler flags
######################################################################## ########################################################################
@ -470,7 +482,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++0x") set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++0x")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing") #set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing")
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Add warning flags # Add warning flags

37
README
View File

@ -5,7 +5,7 @@ This document describes how to set up the compilation environment and build GNSS
GNU/Linux GNU/Linux
----------------------------------------------------------- -----------------------------------------------------------
Tested distributions: Ubuntu 12.04 (32 and 64 bits), Debian 6.0.6, Fedora 18 Tested distributions: Ubuntu 12.04 (32 and 64 bits), Debian 6.0.6, Fedora 18 (newer versions should work, too)
* Install GNU Radio: * Install GNU Radio:
@ -29,9 +29,9 @@ In order to avoid defining these variables each time you enter a session, you ma
- Download, compile, and install the Armadillo linear algebra library - Download, compile, and install the Armadillo linear algebra library
$ sudo apt-get install libatlas-dev $ sudo apt-get install libatlas-dev
$ wget http://sourceforge.net/projects/arma/files/armadillo-3.6.1.tar.gz $ wget http://sourceforge.net/projects/arma/files/armadillo-3.900.7.tar.gz
$ tar xvfz armadillo-3.6.1.tar.gz $ tar xvfz armadillo-3.900.7.tar.gz
$ cd armadillo-3.6.1 $ cd armadillo-3.900.7
$ cmake . $ cmake .
$ make $ make
$ sudo make install $ sudo make install
@ -41,9 +41,9 @@ The full stop separated from "cmake" by a space is important. CMake will figure
- Download, unzip, configure, build and install gperftools, a set of performance analysis tools: - Download, unzip, configure, build and install gperftools, a set of performance analysis tools:
$ wget http://gperftools.googlecode.com/files/gperftools-2.0.tar.gz $ wget http://gperftools.googlecode.com/files/gperftools-2.1.tar.gz
$ tar xvfz gperftools-2.0.tar.gz $ tar xvfz gperftools-2.1.tar.gz
$ cd gperftools-2.0 $ cd gperftools-2.1
$ ./configure --enable-frame-pointers $ ./configure --enable-frame-pointers
$ make $ make
$ sudo make install $ sudo make install
@ -51,17 +51,17 @@ $ sudo make install
- Download, unzip, configure, and build Google C++ Testing Framework (also known as Google Test): - Download, unzip, configure, and build Google C++ Testing Framework (also known as Google Test):
$ wget http://googletest.googlecode.com/files/gtest-1.6.0.zip $ wget http://googletest.googlecode.com/files/gtest-1.7.0.zip
$ unzip gtest-1.6.0.zip $ unzip gtest-1.7.0.zip
$ cd gtest-1.6.0 $ cd gtest-1.7.0
$ ./configure $ ./configure
$ make $ make
Please DO NOT install gtest (do not do "sudo make install"). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of #if in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of gtest its own tests; it is only required that you tell the system where the gtest folder that you downloaded resides. Just add to your $HOME/.bashrc file the following line: Please DO NOT install gtest (do not do "sudo make install"). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of #if in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of gtest its own tests; it is only required that you tell the system where the gtest folder that you downloaded resides. Just add to your $HOME/.bashrc file the following line:
$ export GTEST_DIR=/home/username/gtest-1.6.0 $ export GTEST_DIR=/home/username/gtest-1.7.0
changing /home/username/gtest-1.6.0 by the actual directory where you downloaded gtest. Again, it is recommended to add this line to your $HOME/.bashrc file. changing /home/username/gtest-1.7.0 by the actual directory where you downloaded gtest. Again, it is recommended to add this line to your $HOME/.bashrc file.
- Download, unzip, configure, build and install Google's gflags package, a commandline flags processing module for C++: - Download, unzip, configure, build and install Google's gflags package, a commandline flags processing module for C++:
@ -245,8 +245,8 @@ If you have still not installed Apple's Xcode Developer Tools and MacPorts, plea
Once MacPorts is properly installed on your system, open a terminal and type: Once MacPorts is properly installed on your system, open a terminal and type:
$ sudo port install gcc47 $ sudo port install gcc48
$ sudo port select --set gcc mp-gcc47 $ sudo port select --set gcc mp-gcc48
$ sudo port install gnuradio +full $ sudo port install gnuradio +full
$ sudo port install subversion $ sudo port install subversion
$ svn co http://svn.code.sf.net/p/gnss-sdr/code/trunk gnss-sdr $ svn co http://svn.code.sf.net/p/gnss-sdr/code/trunk gnss-sdr
@ -263,16 +263,7 @@ and can be viewed doing:
$ open ../docs/html/index.html $ open ../docs/html/index.html
WARNING: GNU Radio's VOLK component (which handles vector optimized instructions and routines) compiles best when using GCC.
The default compiler for macports is CLANG, which will result in a fully functioning GNU Radio install but the VOLK component will not utilize the CPU's capabilities.
In order to take advantage of VOLK, compile it with the (rather old) GCC 4.2:
$ sudo port install gnuradio-devel +grc +python27 +uhd +orc +swig +qtgui +wxgui configure.compiler=llvm-gcc-4.2
However, GNSS-SDR cannot be compiled by GCC 4.2. It has been succesfully built with GCC 4.6 and 4.7, and (could) work in 4.5. If you compile GNU Radio with clang, apart from neglecting the benefits of VOLK, then the problem for building GNSS-SDR is Armadillo.
Check out http://llvm.org/bugs/show_bug.cgi?id=14768 in order to see the status of this bottleneck.
GETTING STARTED GETTING STARTED

View File

@ -56,11 +56,19 @@ gps_l1_ca_make_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> q
} }
gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname) : gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
gr::block("gps_l1_ca_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), boost::shared_ptr<gr::msg_queue> queue,
gr::io_signature::make(1, 1, sizeof(gr_complex))) bool dump, std::string dump_filename,
int averaging_depth,
bool flag_averaging,
int output_rate_ms,
int display_rate_ms,
bool flag_nmea_tty_port,
std::string nmea_dump_filename,
std::string nmea_dump_devname) :
gr::block("gps_l1_ca_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(1, 1, sizeof(gr_complex)) )
{ {
d_output_rate_ms = output_rate_ms; d_output_rate_ms = output_rate_ms;
d_display_rate_ms = display_rate_ms; d_display_rate_ms = display_rate_ms;
d_queue = queue; d_queue = queue;
@ -186,7 +194,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
{ {
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second,d_rx_time); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second,d_rx_time);
rp->rinex_nav_header(rp->navFile,d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model); rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
b_rinex_header_writen = true; // do not write header anymore b_rinex_header_writen = true; // do not write header anymore
} }
} }
@ -194,10 +202,10 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
{ {
// Limit the RINEX navigation output rate to 1/6 seg // Limit the RINEX navigation output rate to 1/6 seg
// Notice that d_sample_counter period is 1ms (for GPS correlators) // Notice that d_sample_counter period is 1ms (for GPS correlators)
if ((d_sample_counter-d_last_sample_nav_output)>=6000) if ((d_sample_counter - d_last_sample_nav_output) >= 6000)
{ {
rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map); rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
d_last_sample_nav_output=d_sample_counter; d_last_sample_nav_output = d_sample_counter;
} }
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter; std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
@ -219,7 +227,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time) std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
<< " is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = " << << " is HDOP = " << d_ls_pvt->d_HDOP << " VDOP = " <<
d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP << d_ls_pvt->d_VDOP <<" TDOP = " << d_ls_pvt->d_TDOP <<
" GDOP = " << d_ls_pvt->d_GDOP <<std::endl; " GDOP = " << d_ls_pvt->d_GDOP << std::endl;
} }
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file
if(d_dump == true) if(d_dump == true)

View File

@ -50,11 +50,17 @@ include_directories(
${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
if(OPENCL_FOUND) if(OPENCL_FOUND)
include_directories( ${OPENCL_INCLUDE_DIRS} ) include_directories( ${OPENCL_INCLUDE_DIRS} )
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) if(OS_IS_MACOSX)
set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL")
else(OS_IS_MACOSX)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES})
endif(OS_IS_MACOSX)
endif(OPENCL_FOUND) endif(OPENCL_FOUND)
add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES}) add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES})
target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${OPT_LIBRARIES}) target_link_libraries(acq_gr_blocks gnss_sp_libs gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${VOLK_LIBRARIES} ${OPT_LIBRARIES})

View File

@ -103,7 +103,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
d_well_count = 0; d_well_count = 0;
d_doppler_max = doppler_max; d_doppler_max = doppler_max;
d_fft_size = d_sampled_ms * d_samples_per_ms; d_fft_size = d_sampled_ms * d_samples_per_ms;
d_fft_size_pow2 = pow(2,ceil(log2(2*d_fft_size))); d_fft_size_pow2 = pow(2, ceil(log2(2*d_fft_size)));
d_mag = 0; d_mag = 0;
d_input_power = 0.0; d_input_power = 0.0;
d_num_doppler_bins = 0; d_num_doppler_bins = 0;
@ -235,7 +235,7 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filen
(std::istreambuf_iterator<char>())); (std::istreambuf_iterator<char>()));
kernel_file.close(); kernel_file.close();
// std::cout << "Kernel code: \n" << kernel_code << std::endl; // std::cout << "Kernel code: \n" << kernel_code << std::endl;
cl::Program::Sources sources; cl::Program::Sources sources;
@ -308,22 +308,22 @@ void pcps_opencl_acquisition_cc::init()
d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer*[d_num_doppler_bins]; d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer*[d_num_doppler_bins];
} }
for (unsigned int doppler_index=0;doppler_index<d_num_doppler_bins;doppler_index++) for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
if (posix_memalign((void**)&(d_grid_doppler_wipeoffs[doppler_index]), 16, if (posix_memalign((void**)&(d_grid_doppler_wipeoffs[doppler_index]), 16,
d_fft_size * sizeof(gr_complex)) == 0){}; d_fft_size * sizeof(gr_complex)) == 0){};
int doppler=-(int)d_doppler_max+d_doppler_step*doppler_index; int doppler= -(int)d_doppler_max + d_doppler_step*doppler_index;
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index],
d_freq + doppler, d_fs_in, d_fft_size); d_freq + doppler, d_fs_in, d_fft_size);
if (d_opencl == 0) if (d_opencl == 0)
{ {
d_cl_buffer_grid_doppler_wipeoffs[doppler_index] = d_cl_buffer_grid_doppler_wipeoffs[doppler_index] =
new cl::Buffer(d_cl_context,CL_MEM_READ_WRITE,sizeof(gr_complex)*d_fft_size); new cl::Buffer(d_cl_context, CL_MEM_READ_WRITE, sizeof(gr_complex)*d_fft_size);
d_cl_queue->enqueueWriteBuffer(*(d_cl_buffer_grid_doppler_wipeoffs[doppler_index]), d_cl_queue->enqueueWriteBuffer(*(d_cl_buffer_grid_doppler_wipeoffs[doppler_index]),
CL_TRUE,0,sizeof(gr_complex)*d_fft_size, CL_TRUE, 0, sizeof(gr_complex)*d_fft_size,
d_grid_doppler_wipeoffs[doppler_index]); d_grid_doppler_wipeoffs[doppler_index]);
} }
} }
@ -331,8 +331,8 @@ void pcps_opencl_acquisition_cc::init()
// zero padding in buffer_1 (FFT input) // zero padding in buffer_1 (FFT input)
if (d_opencl == 0) if (d_opencl == 0)
{ {
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_1,CL_TRUE,sizeof(gr_complex)*d_fft_size, d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_1, CL_TRUE, sizeof(gr_complex)*d_fft_size,
sizeof(gr_complex)*(d_fft_size_pow2-d_fft_size),d_zero_vector); sizeof(gr_complex)*(d_fft_size_pow2 - d_fft_size), d_zero_vector);
} }
} }
@ -340,14 +340,14 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> * code)
{ {
if(d_opencl == 0) if(d_opencl == 0)
{ {
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2,CL_TRUE,0, d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, 0,
sizeof(gr_complex)*d_fft_size, code); sizeof(gr_complex)*d_fft_size, code);
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2,CL_TRUE,sizeof(gr_complex)*d_fft_size, d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex)*d_fft_size,
sizeof(gr_complex)*(d_fft_size_pow2 - 2*d_fft_size), sizeof(gr_complex)*(d_fft_size_pow2 - 2*d_fft_size),
d_zero_vector); d_zero_vector);
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2,CL_TRUE,sizeof(gr_complex) d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex)
*(d_fft_size_pow2 - d_fft_size), *(d_fft_size_pow2 - d_fft_size),
sizeof(gr_complex)*d_fft_size, code); sizeof(gr_complex)*d_fft_size, code);
@ -356,10 +356,10 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> * code)
0, NULL, NULL); 0, NULL, NULL);
//Conjucate the local code //Conjucate the local code
cl::Kernel kernel=cl::Kernel(d_cl_program,"conj_vector"); cl::Kernel kernel = cl::Kernel(d_cl_program, "conj_vector");
kernel.setArg(0,*d_cl_buffer_2); //input kernel.setArg(0, *d_cl_buffer_2); //input
kernel.setArg(1,*d_cl_buffer_fft_codes); //output kernel.setArg(1, *d_cl_buffer_fft_codes); //output
d_cl_queue->enqueueNDRangeKernel(kernel,cl::NullRange,cl::NDRange(d_fft_size_pow2),cl::NullRange); d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size_pow2), cl::NullRange);
} }
else else
{ {
@ -370,11 +370,11 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> * code)
//Conjugate the local code //Conjugate the local code
if (is_unaligned()) if (is_unaligned())
{ {
volk_32fc_conjugate_32fc_u(d_fft_codes,d_fft_if->get_outbuf(),d_fft_size); volk_32fc_conjugate_32fc_u(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
} }
else else
{ {
volk_32fc_conjugate_32fc_a(d_fft_codes,d_fft_if->get_outbuf(),d_fft_size); volk_32fc_conjugate_32fc_a(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
} }
} }
} }
@ -406,11 +406,11 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk()
d_input_power /= (float)d_fft_size; d_input_power /= (float)d_fft_size;
// 2- Doppler frequency search loop // 2- Doppler frequency search loop
for (unsigned int doppler_index=0;doppler_index<d_num_doppler_bins;doppler_index++) for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
// doppler search steps // doppler search steps
doppler=-(int)d_doppler_max+d_doppler_step*doppler_index; doppler = -(int)d_doppler_max + d_doppler_step*doppler_index;
volk_32fc_x2_multiply_32fc_a(d_fft_if->get_inbuf(), in, volk_32fc_x2_multiply_32fc_a(d_fft_if->get_inbuf(), in,
@ -517,7 +517,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
d_mag = 0.0; d_mag = 0.0;
// write input vector in buffer of OpenCL device // write input vector in buffer of OpenCL device
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_in,CL_TRUE,0,sizeof(gr_complex)*d_fft_size,in); d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_in, CL_TRUE, 0, sizeof(gr_complex)*d_fft_size, in);
d_well_count++; d_well_count++;
@ -529,7 +529,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
// begin = tv.tv_sec *1e6 + tv.tv_usec; // begin = tv.tv_sec *1e6 + tv.tv_usec;
DLOG(INFO) << "Channel: " << d_channel DLOG(INFO) << "Channel: " << d_channel
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
<< " ,sample stamp: " << d_sample_counter << ", threshold: " << " ,sample stamp: " << d_sample_counter << ", threshold: "
<< d_threshold << ", doppler_max: " << d_doppler_max << d_threshold << ", doppler_max: " << d_doppler_max
<< ", doppler_step: " << d_doppler_step; << ", doppler_step: " << d_doppler_step;
@ -542,17 +542,17 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
cl::Kernel kernel; cl::Kernel kernel;
// 2- Doppler frequency search loop // 2- Doppler frequency search loop
for (unsigned int doppler_index=0;doppler_index<d_num_doppler_bins;doppler_index++) for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{ {
// doppler search steps // doppler search steps
doppler=-(int)d_doppler_max+d_doppler_step*doppler_index; doppler = -(int)d_doppler_max + d_doppler_step*doppler_index;
//Multiply input signal with doppler wipe-off //Multiply input signal with doppler wipe-off
kernel = cl::Kernel(d_cl_program,"mult_vectors"); kernel = cl::Kernel(d_cl_program, "mult_vectors");
kernel.setArg(0,*d_cl_buffer_in); //input 1 kernel.setArg(0, *d_cl_buffer_in); //input 1
kernel.setArg(1,*d_cl_buffer_grid_doppler_wipeoffs[doppler_index]); //input 2 kernel.setArg(1, *d_cl_buffer_grid_doppler_wipeoffs[doppler_index]); //input 2
kernel.setArg(2,*d_cl_buffer_1); //output kernel.setArg(2, *d_cl_buffer_1); //output
d_cl_queue->enqueueNDRangeKernel(kernel,cl::NullRange, cl::NDRange(d_fft_size), d_cl_queue->enqueueNDRangeKernel(kernel,cl::NullRange, cl::NDRange(d_fft_size),
cl::NullRange); cl::NullRange);
@ -566,10 +566,10 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
// Multiply carrier wiped--off, Fourier transformed incoming signal // Multiply carrier wiped--off, Fourier transformed incoming signal
// with the local FFT'd code reference // with the local FFT'd code reference
kernel = cl::Kernel(d_cl_program,"mult_vectors"); kernel = cl::Kernel(d_cl_program, "mult_vectors");
kernel.setArg(0,*d_cl_buffer_2); //input 1 kernel.setArg(0, *d_cl_buffer_2); //input 1
kernel.setArg(1,*d_cl_buffer_fft_codes); //input 2 kernel.setArg(1, *d_cl_buffer_fft_codes); //input 2
kernel.setArg(2,*d_cl_buffer_2); //output kernel.setArg(2, *d_cl_buffer_2); //output
d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size_pow2), d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size_pow2),
cl::NullRange); cl::NullRange);
@ -579,9 +579,9 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
0, NULL, NULL); 0, NULL, NULL);
// Compute magnitude // Compute magnitude
kernel = cl::Kernel(d_cl_program,"magnitude_squared"); kernel = cl::Kernel(d_cl_program, "magnitude_squared");
kernel.setArg(0,*d_cl_buffer_2); //input 1 kernel.setArg(0, *d_cl_buffer_2); //input 1
kernel.setArg(1,*d_cl_buffer_magnitude); //output kernel.setArg(1, *d_cl_buffer_magnitude); //output
d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size), d_cl_queue->enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(d_fft_size),
cl::NullRange); cl::NullRange);
@ -628,7 +628,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
filename.str(""); filename.str("");
filename << "../data/test_statistics_" << d_gnss_synchro->System filename << "../data/test_statistics_" << d_gnss_synchro->System
<<"_" << d_gnss_synchro->Signal << "_sat_" << "_" << d_gnss_synchro->Signal << "_sat_"
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.write((char*)d_ifft->get_outbuf(), n); //write directly |abs(x)|^2 in this Doppler bin?

View File

@ -63,8 +63,8 @@
#include "fft_internal.h" #include "fft_internal.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
#ifdef APPLE #ifdef __APPLE__
#include <OpenCL/cl.hpp> #include "cl.hpp"
#else #else
#include <CL/cl.hpp> #include <CL/cl.hpp>
#endif #endif

View File

@ -16,17 +16,6 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
#if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#set(GNSS_SPLIBS_SOURCES
# galileo_e1_signal_processing.cc
# gnss_sdr_valve.cc
# gnss_signal_processing.cc
# gps_sdr_signal_processing.cc
# pass_through.cc
#)
#else(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(OPENCL_FOUND) if(OPENCL_FOUND)
set(GNSS_SPLIBS_SOURCES set(GNSS_SPLIBS_SOURCES
galileo_e1_signal_processing.cc galileo_e1_signal_processing.cc
@ -62,7 +51,11 @@ include_directories(
if(OPENCL_FOUND) if(OPENCL_FOUND)
include_directories( ${OPENCL_INCLUDE_DIRS} ) include_directories( ${OPENCL_INCLUDE_DIRS} )
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) if(OS_IS_MACOSX)
set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL")
else(OS_IS_MACOSX)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES})
endif(OS_IS_MACOSX)
endif(OPENCL_FOUND) endif(OPENCL_FOUND)
add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES}) add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES})

12305
src/algorithms/libs/cl.hpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -55,8 +55,8 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#ifdef APPLE #ifdef __APPLE__
#include <OpenCL/cl.h> #include <OpenCL/opencl.h>
#else #else
#include <CL/cl.h> #include <CL/cl.h>
#endif #endif

View File

@ -77,7 +77,6 @@ public:
gr::basic_block_sptr get_right_block(); gr::basic_block_sptr get_right_block();
private: private:
//gr_block_sptr sink_;
gr::blocks::null_sink::sptr sink_; gr::blocks::null_sink::sptr sink_;
size_t item_size_; size_t item_size_;
std::string item_type_; std::string item_type_;

View File

@ -157,7 +157,6 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
if (dump_) if (dump_)
{ {
//sink_ = gr_make_file_sink(item_size_, dump_filename_.c_str());
sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
DLOG(INFO) << "file_sink(" << sink_->unique_id() << ")"; DLOG(INFO) << "file_sink(" << sink_->unique_id() << ")";
} }
@ -298,7 +297,6 @@ void FileSignalSource::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr FileSignalSource::get_left_block() gr::basic_block_sptr FileSignalSource::get_left_block()
{ {
LOG_AT_LEVEL(WARNING) << "Left block of a signal source should not be retrieved"; LOG_AT_LEVEL(WARNING) << "Left block of a signal source should not be retrieved";
//return gr_block_sptr();
return gr::blocks::file_source::sptr(); return gr::blocks::file_source::sptr();
} }

View File

@ -46,8 +46,9 @@
#include "gnss_synchro.h" #include "gnss_synchro.h"
#ifndef _lrotl
#define _lrotl(X,N) ((X << N) ^ (X >> (32-N))) // Used in the parity check algorithm #define _lrotl(X,N) ((X << N) ^ (X >> (32-N))) // Used in the parity check algorithm
#endif
using google::LogMessage; using google::LogMessage;
/*! /*!

View File

@ -1,5 +1,5 @@
/*! /*!
* \file supl_client.h * \file gnss_sdr_supl_client.h
* \brief class that implements a C++ interface to external Secure User Location Protocol (SUPL) client library. * \brief class that implements a C++ interface to external Secure User Location Protocol (SUPL) client library.
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *

View File

@ -1,11 +1,11 @@
/*! /*!
* \file concurrent_queue.h * \file concurrent_map.h
* \brief Interface of a thread-safe std::map * \brief Interface of a thread-safe std::map
* \author Javier Arribas, 2011. jarribas(at)cttc.es * \author Javier Arribas, 2011. jarribas(at)cttc.es
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) * Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
* *
* GNSS-SDR is a software defined Global Navigation * GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver * Satellite Systems receiver

View File

@ -663,26 +663,26 @@ void ControlThread::galileo_utc_model_data_collector()
void ControlThread::gps_ephemeris_data_write_to_XML() void ControlThread::gps_ephemeris_data_write_to_XML()
{ {
//Save ephemeris to XML file //Save ephemeris to XML file
std::string eph_xml_filename="gps_ephemeris_rx.xml"; std::string eph_xml_filename ="gps_ephemeris_rx.xml";
std::map<int,Gps_Ephemeris> eph_copy; std::map<int,Gps_Ephemeris> eph_copy;
eph_copy=global_gps_ephemeris_map.get_map_copy(); eph_copy = global_gps_ephemeris_map.get_map_copy();
if (eph_copy.size()>0) if (eph_copy.size() > 0)
{ {
try try
{ {
std::ofstream ofs(eph_xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out); std::ofstream ofs(eph_xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs); boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", eph_copy); xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", eph_copy);
ofs.close(); ofs.close();
std::cout<<"Saved Ephemeris data"<<std::endl; std::cout << "Saved Ephemeris data" << std::endl;
} }
catch (std::exception& e) catch (std::exception& e)
{ {
LOG_AT_LEVEL(ERROR) << e.what(); LOG_AT_LEVEL(ERROR) << e.what();
} }
} }
} }
void ControlThread::gps_utc_model_data_write_to_XML() void ControlThread::gps_utc_model_data_write_to_XML()

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gps_almanac.h * \file galileo_almanac.h
* \brief Interface of a GPS ALMANAC storage * \brief Interface of a Galileo ALMANAC storage
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* \author Mara Branzanti 2013. mara.branzanti(at)gmail.com * \author Mara Branzanti 2013. mara.branzanti(at)gmail.com
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
@ -41,58 +41,58 @@ class Galileo_Almanac
{ {
public: public:
/*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/ /*Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number*/
int IOD_a_7; int IOD_a_7;
double WN_a_7; double WN_a_7;
double t0a_7; double t0a_7;
int SVID1_7; int SVID1_7;
double DELTA_A_7; double DELTA_A_7;
double e_7; double e_7;
double omega_7; double omega_7;
double delta_i_7; double delta_i_7;
double Omega0_7; double Omega0_7;
double Omega_dot_7; double Omega_dot_7;
double M0_7; double M0_7;
/*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/ /*Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/
int IOD_a_8; int IOD_a_8;
double af0_8; double af0_8;
double af1_8; double af1_8;
double E5b_HS_8; double E5b_HS_8;
double E1B_HS_8; double E1B_HS_8;
int SVID2_8; int SVID2_8;
double DELTA_A_8; double DELTA_A_8;
double e_8; double e_8;
double omega_8; double omega_8;
double delta_i_8; double delta_i_8;
double Omega0_8; double Omega0_8;
double Omega_dot_8; double Omega_dot_8;
/*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/ /*Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2)*/
int IOD_a_9; int IOD_a_9;
double WN_a_9; double WN_a_9;
double t0a_9; double t0a_9;
double M0_9; double M0_9;
double af0_9; double af0_9;
double af1_9; double af1_9;
double E5b_HS_9; double E5b_HS_9;
double E1B_HS_9; double E1B_HS_9;
int SVID3_9; int SVID3_9;
double DELTA_A_9; double DELTA_A_9;
double e_9; double e_9;
double omega_9; double omega_9;
double delta_i_9; double delta_i_9;
/*Word type 10: Almanac for SVID3 (2/2)*/ /*Word type 10: Almanac for SVID3 (2/2)*/
int IOD_a_10; int IOD_a_10;
double Omega0_10; double Omega0_10;
double Omega_dot_10; double Omega_dot_10;
double M0_10; double M0_10;
double af0_10; double af0_10;
double af1_10; double af1_10;
double E5b_HS_10; double E5b_HS_10;
double E1B_HS_10; double E1B_HS_10;
/*! /*!
* Default constructor * Default constructor
*/ */

View File

@ -1,5 +1,5 @@
/*! /*!
* \file gps_ephemeris.cc * \file galileo_ephemeris.cc
* \brief Interface of a GPS EPHEMERIS storage and orbital model functions * \brief Interface of a GPS EPHEMERIS storage and orbital model functions
* *
* See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II * See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II
@ -35,45 +35,45 @@
Galileo_Ephemeris::Galileo_Ephemeris() Galileo_Ephemeris::Galileo_Ephemeris()
{ {
flag_all_ephemeris = false; flag_all_ephemeris = false;
IOD_ephemeris = 0; IOD_ephemeris = 0;
IOD_nav_1 = 0; IOD_nav_1 = 0;
SV_ID_PRN_4 = 0; SV_ID_PRN_4 = 0;
M0_1 = 0; // Mean anomaly at reference time [semi-circles] M0_1 = 0; // Mean anomaly at reference time [semi-circles]
delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec] delta_n_3 = 0; // Mean motion difference from computed value [semi-circles/sec]
e_1 = 0; // Eccentricity e_1 = 0; // Eccentricity
A_1 = 0; // Square root of the semi-major axis [metres^1/2] A_1 = 0; // Square root of the semi-major axis [metres^1/2]
OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles] OMEGA_0_2 = 0; // Longitude of ascending node of orbital plane at weekly epoch [semi-circles]
i_0_2 = 0; // Inclination angle at reference time [semi-circles] i_0_2 = 0; // Inclination angle at reference time [semi-circles]
omega_2 = 0; // Argument of perigee [semi-circles] omega_2 = 0; // Argument of perigee [semi-circles]
OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec] OMEGA_dot_3 = 0; // Rate of right ascension [semi-circles/sec]
iDot_2 = 0; // Rate of inclination angle [semi-circles/sec] iDot_2 = 0; // Rate of inclination angle [semi-circles/sec]
C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians] C_uc_3 = 0; // Amplitude of the cosine harmonic correction term to the argument of latitude [radians]
C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] C_us_3 = 0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians]
C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] C_rc_3 = 0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters]
C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] C_rs_3 = 0; // Amplitude of the sine harmonic correction term to the orbit radius [meters]
C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] C_ic_4 = 0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians]
C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] C_is_4 = 0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians]
t0e_1 = 0; // Ephemeris reference time [s] t0e_1 = 0; // Ephemeris reference time [s]
/*Clock correction parameters*/ /*Clock correction parameters*/
t0c_4 = 0; //Clock correction data reference Time of Week [sec] t0c_4 = 0; // Clock correction data reference Time of Week [sec]
af0_4 = 0; //SV clock bias correction coefficient [s] af0_4 = 0; // SV clock bias correction coefficient [s]
af1_4 = 0; //SV clock drift correction coefficient [s/s] af1_4 = 0; // SV clock drift correction coefficient [s/s]
af2_4 = 0; //SV clock drift rate correction coefficient [s/s^2] af2_4 = 0; //SV clock drift rate correction coefficient [s/s^2]
/*GST*/ /*GST*/
WN_5 = 0; WN_5 = 0;
TOW_5 = 0; TOW_5 = 0;
} }
double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW){ double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW){
/* GALIELO SYSTEM TIME, ICD 5.1.2 /* GALIELO SYSTEM TIME, ICD 5.1.2
* input parameter: * input parameter:
* WN: The Week Number is an integer counter that gives the sequential week number * WN: The Week Number is an integer counter that gives the sequential week number
from the origin of the Galileo time. It covers 4096 weeks (about 78 years). from the origin of the Galileo time. It covers 4096 weeks (about 78 years).
Then the counter is reset to zero to cover additional period modulo 4096 Then the counter is reset to zero to cover additional period modulo 4096
@ -95,23 +95,22 @@ double Galileo_Ephemeris::Galileo_System_Time(double WN, double TOW){
will be measured relative to the leading edge of the first chip of the will be measured relative to the leading edge of the first chip of the
first code sequence of the first page symbol. The transmission timing of the navigation first code sequence of the first page symbol. The transmission timing of the navigation
message provided through the TOW is synchronised to each satellites version of Galileo System Time (GST). message provided through the TOW is synchronised to each satellites version of Galileo System Time (GST).
* *
*/ */
double t=0; double t = 0;
double sec_in_day = 86400; double sec_in_day = 86400;
double day_in_week = 7; double day_in_week = 7;
t = WN*sec_in_day*day_in_week+ TOW; // second from the origin of the Galileo time t = WN*sec_in_day*day_in_week + TOW; // second from the origin of the Galileo time
return t;
return t;
} }
double Galileo_Ephemeris::sv_clock_drift(double transmitTime){ double Galileo_Ephemeris::sv_clock_drift(double transmitTime){
/* Satellite Time Correction Algorithm, ICD 5.1.4 /* Satellite Time Correction Algorithm, ICD 5.1.4
* *
*/ */
double dt; double dt;
dt = transmitTime - t0c_4; dt = transmitTime - t0c_4;
Galileo_satClkDrift = af0_4 + af1_4*dt + (af2_4 * dt)*(af2_4 * dt) + Galileo_dtr; Galileo_satClkDrift = af0_4 + af1_4*dt + (af2_4 * dt)*(af2_4 * dt) + Galileo_dtr;
@ -130,40 +129,40 @@ double Galileo_Ephemeris::sv_clock_relativistic_term(double transmitTime) //Sate
double dE; double dE;
double M; double M;
// Restore semi-major axis // Restore semi-major axis
a = A_1*A_1; a = A_1*A_1;
n0 = sqrt(GALILEO_GM / (a*a*a)); n0 = sqrt(GALILEO_GM / (a*a*a));
// Time from ephemeris reference epoch // Time from ephemeris reference epoch
//tk = check_t(transmitTime - d_Toe); this is tk for GPS; for Galileo it is different //tk = check_t(transmitTime - d_Toe); this is tk for GPS; for Galileo it is different
//t = WN_5*86400*7 + TOW_5; //WN_5*86400*7 are the second from the origin of the Galileo time //t = WN_5*86400*7 + TOW_5; //WN_5*86400*7 are the second from the origin of the Galileo time
tk = transmitTime - t0e_1; tk = transmitTime - t0e_1;
// Corrected mean motion // Corrected mean motion
n = n0 + delta_n_3; n = n0 + delta_n_3;
// Mean anomaly // Mean anomaly
M = M0_1 + n * tk; M = M0_1 + n * tk;
// Reduce mean anomaly to between 0 and 2pi // Reduce mean anomaly to between 0 and 2pi
M = fmod((M + 2* GALILEO_PI), (2* GALILEO_PI)); M = fmod((M + 2* GALILEO_PI), (2* GALILEO_PI));
// Initial guess of eccentric anomaly // Initial guess of eccentric anomaly
E = M; E = M;
// --- Iteratively compute eccentric anomaly ---------------------------- // --- Iteratively compute eccentric anomaly ----------------------------
for (int ii = 1; ii<20; ii++) for (int ii = 1; ii<20; ii++)
{ {
E_old = E; E_old = E;
E = M + e_1 * sin(E); E = M + e_1 * sin(E);
dE = fmod(E - E_old, 2*GALILEO_PI); dE = fmod(E - E_old, 2*GALILEO_PI);
if (fabs(dE) < 1e-12) if (fabs(dE) < 1e-12)
{ {
//Necessary precision is reached, exit from the loop //Necessary precision is reached, exit from the loop
break; break;
} }
} }
// Compute relativistic correction term // Compute relativistic correction term
@ -268,6 +267,4 @@ void Galileo_Ephemeris::satellitePosition(double transmitTime) //when this funct
galileo_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + galileo_satpos_X * cos(Omega) - galileo_satpos_Y * cos(i) * sin(Omega); galileo_satvel_X = - Omega_dot * (cos(u) * r + sin(u) * r * cos(i)) + galileo_satpos_X * cos(Omega) - galileo_satpos_Y * cos(i) * sin(Omega);
galileo_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + galileo_satpos_X * sin(Omega) + galileo_satpos_Y * cos(i) * cos(Omega); galileo_satvel_Y = Omega_dot * (cos(u) * r * cos(Omega) - sin(u) * r * cos(i) * sin(Omega)) + galileo_satpos_X * sin(Omega) + galileo_satpos_Y * cos(i) * cos(Omega);
galileo_satvel_Z = galileo_satpos_Y * sin(i); galileo_satvel_Z = galileo_satpos_Y * sin(i);
} }

View File

@ -1,8 +1,7 @@
/*! /*!
* \file gps_iono.cc * \file galileo_iono.cc
* \brief Interface of a GPS IONOSPHERIC MODEL storage * \brief Interface of a GPS IONOSPHERIC MODEL storage
* *
* See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
@ -35,21 +34,21 @@
Galileo_Iono::Galileo_Iono() Galileo_Iono::Galileo_Iono()
{ {
//valid = false; //valid = false;
/*Ionospheric correction*/ /* Ionospheric correction */
/*Az*/ /* Az */
ai0_5 = 0; //Effective Ionisation Level 1st order parameter [sfu] ai0_5 = 0; //Effective Ionisation Level 1st order parameter [sfu]
ai1_5 = 0; //Effective Ionisation Level 2st order parameter [sfu/degree] ai1_5 = 0; //Effective Ionisation Level 2st order parameter [sfu/degree]
ai2_5 = 0; //Effective Ionisation Level 3st order parameter [sfu/degree] ai2_5 = 0; //Effective Ionisation Level 3st order parameter [sfu/degree]
/*Ionospheric disturbance flag*/ /* Ionospheric disturbance flag */
Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1 Region1_flag_5 = false; // Ionospheric Disturbance Flag for region 1
Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2 Region2_flag_5 = false; // Ionospheric Disturbance Flag for region 2
Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3 Region3_flag_5 = false; // Ionospheric Disturbance Flag for region 3
Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4
Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5
t0t_6 = 0; t0t_6 = 0;
WNot_6 = 0; WNot_6 = 0;
} }

View File

@ -1,6 +1,6 @@
/* /*
* \file gps_utc_model.h * \file galileo_utc_model.h
* \brief Interface of a GPS UTC MODEL storage * \brief Interface of a Galileo UTC MODEL storage
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
@ -32,84 +32,83 @@
Galileo_Utc_Model::Galileo_Utc_Model() Galileo_Utc_Model::Galileo_Utc_Model()
{ {
//valid = false; //valid = false;
/*Word type 6: GST-UTC conversion parameters*/ /*Word type 6: GST-UTC conversion parameters*/
A0_6 = 0; A0_6 = 0;
A1_6 = 0; A1_6 = 0;
Delta_tLS_6 = 0; Delta_tLS_6 = 0;
t0t_6 = 0; t0t_6 = 0;
WNot_6 = 0; WNot_6 = 0;
WN_LSF_6 = 0; WN_LSF_6 = 0;
DN_6 = 0; DN_6 = 0;
Delta_tLSF_6 = 0; Delta_tLSF_6 = 0;
flag_utc_model = false; flag_utc_model = false;
} }
double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN) double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN)
{ {
double t_Utc; double t_Utc;
double t_Utc_daytime; double t_Utc_daytime;
double Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * (double)(WN - WNot_6)); double Delta_t_Utc = Delta_tLS_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * (double)(WN - WNot_6));
// Determine if the effectivity time of the leap second event is in the past // Determine if the effectivity time of the leap second event is in the past
int weeksToLeapSecondEvent = WN_LSF_6 - WN; int weeksToLeapSecondEvent = WN_LSF_6 - WN;
if ((weeksToLeapSecondEvent) >= 0) // is not in the past if ((weeksToLeapSecondEvent) >= 0) // is not in the past
{ {
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60; int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60;
if (weeksToLeapSecondEvent > 0) if (weeksToLeapSecondEvent > 0)
{ {
t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400); t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400);
} }
else //we are in the same week than the leap second event else //we are in the same week than the leap second event
{ {
if (abs(t_e - secondOfLeapSecondEvent) > 21600) if (abs(t_e - secondOfLeapSecondEvent) > 21600)
{ {
/* 5.1.7a /* 5.1.7a
* Whenever the leap second adjusted time indicated by the WN_LSF and the DN values * Whenever the leap second adjusted time indicated by the WN_LSF and the DN values
* is not in the past (relative to the user's present time), and the user's * is not in the past (relative to the user's present time), and the user's
* present time does not fall in the time span which starts at six hours prior * present time does not fall in the time span which starts at six hours prior
* to the effective time and ends at six hours after the effective time, * to the effective time and ends at six hours after the effective time,
* the GST/Utc relationship is given by * the GST/Utc relationship is given by
*/ */
t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400); t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400);
} }
else else
{ {
/* 5.1.7b /* 5.1.7b
* Whenever the user's current time falls within the time span of six hours * Whenever the user's current time falls within the time span of six hours
* prior to the leap second adjustment to six hours after the adjustment time, , * prior to the leap second adjustment to six hours after the adjustment time, ,
* the effective time is computed according to the following equations: * the effective time is computed according to the following equations:
*/ */
int W = fmod(t_e - Delta_t_Utc - 43200, 86400) + 43200; int W = fmod(t_e - Delta_t_Utc - 43200, 86400) + 43200;
t_Utc_daytime = fmod(W, 86400 + Delta_tLSF_6 - Delta_tLS_6); t_Utc_daytime = fmod(W, 86400 + Delta_tLSF_6 - Delta_tLS_6);
//implement something to handle a leap second event! //implement something to handle a leap second event!
} }
if ( (t_e - secondOfLeapSecondEvent) > 21600) if ( (t_e - secondOfLeapSecondEvent) > 21600)
{ {
Delta_t_Utc = Delta_tLSF_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800*(double)(WN - WNot_6)); Delta_t_Utc = Delta_tLSF_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800*(double)(WN - WNot_6));
t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400); t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400);
} }
} }
} }
else // the effectivity time is in the past else // the effectivity time is in the past
{ {
/* 5.1.7c /* 5.1.7c
* Whenever the leap second adjustment time, as indicated by the WN_LSF and DN values, * Whenever the leap second adjustment time, as indicated by the WN_LSF and DN values,
* is in the past (relative to the users current time) and the users present time does not * is in the past (relative to the users current time) and the users present time does not
* fall in the time span which starts six hours prior to the leap second adjustment time and * fall in the time span which starts six hours prior to the leap second adjustment time and
* ends six hours after the adjustment time, the effective time is computed according to * ends six hours after the adjustment time, the effective time is computed according to
* the following equation: * the following equation:
*/ */
Delta_t_Utc = Delta_tLSF_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * (double)(WN - WNot_6)); Delta_t_Utc = Delta_tLSF_6 + A0_6 + A1_6 * (t_e - t0t_6 + 604800 * (double)(WN - WNot_6));
t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400); t_Utc_daytime = fmod(t_e - Delta_t_Utc, 86400);
} }
double secondsOfWeekBeforeToday = 43200 * floor(t_e / 43200);
t_Utc = secondsOfWeekBeforeToday + t_Utc_daytime;
return t_Utc;
double secondsOfWeekBeforeToday = 43200 * floor(t_e / 43200);
t_Utc = secondsOfWeekBeforeToday + t_Utc_daytime;
return t_Utc;
} }

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gps_utc_model.h * \file galileo_utc_model.h
* \brief Interface of a GPS UTC MODEL storage * \brief Interface of a Galileo UTC MODEL storage
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
* *
@ -45,29 +45,24 @@
class Galileo_Utc_Model class Galileo_Utc_Model
{ {
public: public:
//bool valid;
/*Word type 6: GST-UTC conversion parameters*/
double A0_6;
double A1_6;
double Delta_tLS_6;
double t0t_6; //UTC data reference Time of Week [s]
double WNot_6; //UTC data reference Week number [week]
double WN_LSF_6;
double DN_6;
double Delta_tLSF_6;
bool flag_utc_model;
//double TOW_6;
//bool valid; double GST_to_UTC_time(double t_e, int WN);
/*Word type 6: GST-UTC conversion parameters*/ /*!
double A0_6;
double A1_6;
double Delta_tLS_6;
double t0t_6;//UTC data reference Time of Week [s]
double WNot_6; //UTC data reference Week number [week]
double WN_LSF_6;
double DN_6;
double Delta_tLSF_6;
bool flag_utc_model;
//double TOW_6;
double GST_to_UTC_time(double t_e, int WN);
/*!
* Default constructor * Default constructor
*/ */
Galileo_Utc_Model(); Galileo_Utc_Model();
}; };
#endif #endif

View File

@ -1,5 +1,5 @@
/*! /*!
* \file gps_navigation_message.h * \file gps_ephemeris.h
* \brief Interface of a GPS EPHEMERIS storage * \brief Interface of a GPS EPHEMERIS storage
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
@ -47,7 +47,6 @@
class Gps_Ephemeris class Gps_Ephemeris
{ {
private: private:
/* /*
* Accounts for the beginning or end of week crossover * Accounts for the beginning or end of week crossover
* *
@ -57,9 +56,7 @@ private:
*/ */
double check_t(double time); double check_t(double time);
public: public:
unsigned int i_satellite_PRN; // SV PRN NUMBER unsigned int i_satellite_PRN; // SV PRN NUMBER
double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] double d_TOW; //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] double d_Crs; //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
@ -139,45 +136,45 @@ public:
{ {
using boost::serialization::make_nvp; using boost::serialization::make_nvp;
archive & make_nvp("i_satellite_PRN",i_satellite_PRN); // SV PRN NUMBER archive & make_nvp("i_satellite_PRN", i_satellite_PRN); // SV PRN NUMBER
archive & make_nvp("d_TOW",d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s] archive & make_nvp("d_TOW", d_TOW); //!< Time of GPS Week of the ephemeris set (taken from subframes TOW) [s]
archive & make_nvp("d_Crs",d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m] archive & make_nvp("d_Crs", d_Crs); //!< Amplitude of the Sine Harmonic Correction Term to the Orbit Radius [m]
archive & make_nvp("d_Delta_n",d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s] archive & make_nvp("d_Delta_n", d_Delta_n); //!< Mean Motion Difference From Computed Value [semi-circles/s]
archive & make_nvp("d_M_0",d_M_0); //!< Mean Anomaly at Reference Time [semi-circles] archive & make_nvp("d_M_0", d_M_0); //!< Mean Anomaly at Reference Time [semi-circles]
archive & make_nvp("d_Cuc",d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] archive & make_nvp("d_Cuc", d_Cuc); //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad]
archive & make_nvp("d_e_eccentricity",d_e_eccentricity); //!< Eccentricity [dimensionless] archive & make_nvp("d_e_eccentricity", d_e_eccentricity); //!< Eccentricity [dimensionless]
archive & make_nvp("d_Cus",d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad] archive & make_nvp("d_Cus", d_Cus); //!< Amplitude of the Sine Harmonic Correction Term to the Argument of Latitude [rad]
archive & make_nvp("d_sqrt_A",d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)] archive & make_nvp("d_sqrt_A", d_sqrt_A); //!< Square Root of the Semi-Major Axis [sqrt(m)]
archive & make_nvp("d_Toe",d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s] archive & make_nvp("d_Toe", d_Toe); //!< Ephemeris data reference time of week (Ref. 20.3.3.4.3 IS-GPS-200E) [s]
archive & make_nvp("d_Toc",d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] archive & make_nvp("d_Toc", d_Toe); //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s]
archive & make_nvp("d_Cic",d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] archive & make_nvp("d_Cic", d_Cic); //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad]
archive & make_nvp("d_OMEGA0",d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] archive & make_nvp("d_OMEGA0", d_OMEGA0); //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles]
archive & make_nvp("d_Cis",d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] archive & make_nvp("d_Cis", d_Cis); //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad]
archive & make_nvp("d_i_0",d_i_0); //!< Inclination Angle at Reference Time [semi-circles] archive & make_nvp("d_i_0", d_i_0); //!< Inclination Angle at Reference Time [semi-circles]
archive & make_nvp("d_Crc",d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m] archive & make_nvp("d_Crc", d_Crc); //!< Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius [m]
archive & make_nvp("d_OMEGA",d_OMEGA); //!< Argument of Perigee [semi-cicles] archive & make_nvp("d_OMEGA", d_OMEGA); //!< Argument of Perigee [semi-cicles]
archive & make_nvp("d_OMEGA_DOT",d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s] archive & make_nvp("d_OMEGA_DOT", d_OMEGA_DOT); //!< Rate of Right Ascension [semi-circles/s]
archive & make_nvp("d_IDOT",d_IDOT); //!< Rate of Inclination Angle [semi-circles/s] archive & make_nvp("d_IDOT", d_IDOT); //!< Rate of Inclination Angle [semi-circles/s]
archive & make_nvp("i_code_on_L2",i_code_on_L2); //!< If 1, P code ON in L2; if 2, C/A code ON in L2; archive & make_nvp("i_code_on_L2", i_code_on_L2); //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
archive & make_nvp("i_GPS_week",i_GPS_week); //!< GPS week number, aka WN [week] archive & make_nvp("i_GPS_week", i_GPS_week); //!< GPS week number, aka WN [week]
archive & make_nvp("b_L2_P_data_flag",b_L2_P_data_flag); //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel archive & make_nvp("b_L2_P_data_flag", b_L2_P_data_flag); //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
archive & make_nvp("i_SV_accuracy",i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E) archive & make_nvp("i_SV_accuracy", i_SV_accuracy); //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200E)
archive & make_nvp("i_SV_health",i_SV_health); archive & make_nvp("i_SV_health", i_SV_health);
archive & make_nvp("d_TGD",d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s] archive & make_nvp("d_TGD", d_TGD); //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
archive & make_nvp("d_IODC",d_IODC); //!< Issue of Data, Clock archive & make_nvp("d_IODC", d_IODC); //!< Issue of Data, Clock
archive & make_nvp("i_AODO",i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] archive & make_nvp("i_AODO", i_AODO); //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
archive & make_nvp("b_fit_interval_flag",b_fit_interval_flag);//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. archive & make_nvp("b_fit_interval_flag", b_fit_interval_flag);//!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
archive & make_nvp("d_spare1",d_spare1); archive & make_nvp("d_spare1", d_spare1);
archive & make_nvp("d_spare2",d_spare2); archive & make_nvp("d_spare2", d_spare2);
archive & make_nvp("d_A_f0",d_A_f0); //!< Coefficient 0 of code phase offset model [s] archive & make_nvp("d_A_f0", d_A_f0); //!< Coefficient 0 of code phase offset model [s]
archive & make_nvp("d_A_f1",d_A_f1); //!< Coefficient 1 of code phase offset model [s/s] archive & make_nvp("d_A_f1", d_A_f1); //!< Coefficient 1 of code phase offset model [s/s]
archive & make_nvp("d_A_f2",d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2] archive & make_nvp("d_A_f2", d_A_f2); //!< Coefficient 2 of code phase offset model [s/s^2]
archive & make_nvp("b_integrity_status_flag",b_integrity_status_flag); archive & make_nvp("b_integrity_status_flag", b_integrity_status_flag);
archive & make_nvp("b_alert_flag",b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk. archive & make_nvp("b_alert_flag", b_alert_flag); //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
archive & make_nvp("b_antispoofing_flag",b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV archive & make_nvp("b_antispoofing_flag", b_antispoofing_flag); //!< If true, the AntiSpoofing mode is ON in that SV
} }
/*! /*!

View File

@ -35,11 +35,11 @@ add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
if(OS_IS_MACOSX) if(OS_IS_MACOSX)
# Tell the linker where the libraries installed by MacPorts are # Tell the linker where the libraries installed by MacPorts are
link_directories( /opt/local/lib ) link_directories( /opt/local/lib ) # Not very elegant, to be fixed
endif(OS_IS_MACOSX) endif(OS_IS_MACOSX)
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
target_link_libraries(gnss-sdr ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${ARMADILLO_LIBRARIES} gnss_sp_libs gnss_rx) target_link_libraries(gnss-sdr ${MAC_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${ARMADILLO_LIBRARIES} gnss_sp_libs gnss_rx)
install(TARGETS gnss-sdr install(TARGETS gnss-sdr

View File

@ -24,12 +24,12 @@ endif(NOT EXISTS GTEST_DIR_LOCAL)
if(NOT GTEST_DIR_LOCAL) if(NOT GTEST_DIR_LOCAL)
# if GTEST_DIR is not defined, we download and build it # if GTEST_DIR is not defined, we download and build it
set(gtest_RELEASE 1.6.0) set(gtest_RELEASE 1.7.0)
ExternalProject_Add( ExternalProject_Add(
gtest-${gtest_RELEASE} gtest-${gtest_RELEASE}
URL http://googletest.googlecode.com/files/gtest-${gtest_RELEASE}.zip URL http://googletest.googlecode.com/files/gtest-${gtest_RELEASE}.zip
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../download/gtest-${gtest_RELEASE} DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../download/gtest-${gtest_RELEASE}
URL_MD5 "4577b49f2973c90bf9ba69aa8166b786" URL_MD5 "2d6ec8ccdf5c46b05ba54a9fd1d130d7"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${gtest_RELEASE}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}
UPDATE_COMMAND "" UPDATE_COMMAND ""
@ -88,7 +88,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/algorithms/output_filter/adapters ${CMAKE_SOURCE_DIR}/src/algorithms/output_filter/adapters
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
# ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )
@ -100,7 +100,11 @@ find_library(
/usr/lib /usr/lib
/usr/lib64 /usr/lib64
) )
if(OS_IS_MACOSX)
# Tell the linker where the libraries installed by MacPorts are
link_directories( /opt/local/lib ) # not very elegant, to be fixed
# set(MAC_LIBRARIES sdtc++)
endif(OS_IS_MACOSX)
add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc)
target_link_libraries(run_tests ${Boost_LIBRARIES} ${GFLAGS_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs gnss_rx) target_link_libraries(run_tests ${Boost_LIBRARIES} ${GFLAGS_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs gnss_rx)