From baebfd96be67040d0a6dbb56c10bb5dbe86a8ada Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 24 Dec 2011 20:54:25 +0000 Subject: [PATCH] Adding compatibility with Mac OS X 10.6.8 (Snow Leopard) git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@94 64b25241-fba3-4117-9849-534c7e92360d --- conf/gnss-sdr.conf | 2 +- jamroot.jam | 6 ++-- .../gps_l1_ca_gps_sdr_acquisition_ss.cc | 32 ++++++++++++++++--- .../acquisition/gnuradio_blocks/jamfile.jam | 4 +-- src/algorithms/libs/gps_sdr_simd.cc | 5 ++- src/algorithms/libs/jamfile.jam | 4 +-- .../gps_l1_ca_dll_fll_pll_tracking.cc | 4 +-- .../adapters/gps_l1_ca_dll_pll_tracking.cc | 4 +-- src/main/jamfile.jam | 2 +- 9 files changed, 44 insertions(+), 19 deletions(-) diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf index c5b14d63a..a416b7502 100644 --- a/conf/gnss-sdr.conf +++ b/conf/gnss-sdr.conf @@ -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=/media/sf_captures/cap2/agilent_cap2.dat +SignalSource.filename=/Users/carlesfernandez/Documents/workspace/gnss-sdr/trunk/data/agilent_cap2.dat diff --git a/jamroot.jam b/jamroot.jam index 6a2f35420..3cd3b91e7 100644 --- a/jamroot.jam +++ b/jamroot.jam @@ -3,12 +3,11 @@ lib gtest ; lib glog ; lib gflags ; lib gnuradio-core ; -lib armadillo ; project : requirements OMNITHREAD_POSIX "-std=c++0x -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" -"-larmadillo -lboost_thread -llapack -lblas -lprofiler -ltcmalloc" +"-larmadillo -lboost_system -lboost_filesystem -lboost_thread -llapack -lblas -lprofiler -ltcmalloc" src/algorithms/acquisition/adapters src/algorithms/acquisition/gnuradio_blocks src/algorithms/channel/adapters @@ -42,6 +41,7 @@ project : requirements $GNURADIO_ROOT/gnuradio-core/src/lib/io $GNURADIO_ROOT/gnuradio-core/src/lib/general $GNURADIO_ROOT/gnuradio-core/src/lib/gengen -multi ; +multi +darwin:/opt/local/include ; build-project src ; diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc index 58d5525dc..fc5664e7e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/gps_l1_ca_gps_sdr_acquisition_ss.cc @@ -31,12 +31,15 @@ * ------------------------------------------------------------------------- */ #include "gps_l1_ca_gps_sdr_acquisition_ss.h" - -#include "gps_sdr_simd.h" #include "gps_sdr_fft.h" #include "gps_sdr_prn_codes_short.h" #include "control_message_factory.h" -#include "gps_sdr_x86.h" + +#ifdef NO_SIMD + #include "gps_sdr_x86.h" +#else + #include "gps_sdr_simd.h" +#endif #include @@ -179,7 +182,17 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items, DLOG(INFO) << "copied " << (d_fft_size * sizeof(CPX)) << " bytes into buffer (" << d_fft_size << " samples)"; memcpy(d_baseband_signal, in, d_fft_size * sizeof(CPX)); + #ifdef NO_SIMD + x86_cmulsc(d_baseband_signal, d_sine_250, + &d_baseband_signal[d_fft_size], d_fft_size, 14); + x86_cmulsc(d_baseband_signal, d_sine_500, &d_baseband_signal[2 + * d_fft_size], d_fft_size, 14); + x86_cmulsc(d_baseband_signal, d_sine_750, &d_baseband_signal[3 + * d_fft_size], d_fft_size, 14); + x86_cmuls(d_baseband_signal, d_sine_if, d_fft_size, 14); + + #else sse_cmulsc(d_baseband_signal, d_sine_250, &d_baseband_signal[d_fft_size], d_fft_size, 14); sse_cmulsc(d_baseband_signal, d_sine_500, &d_baseband_signal[2 @@ -188,7 +201,7 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items, * d_fft_size], d_fft_size, 14); sse_cmuls(d_baseband_signal, d_sine_if, d_fft_size, 14); - + #endif for (unsigned int i = 0; i < d_doppler_resolution; i++) { d_pFFT->doFFT(&d_baseband_signal[i * d_fft_size], true); @@ -209,10 +222,19 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items, { for (unsigned int j = 0; j < d_doppler_resolution; j++) { + + #ifdef NO_SIMD + x86_cmulsc(&d_baseband_signal_shift[(j * (d_fft_size + 201)) + + 100 + i], d_fft_codes[d_satellite], buffer, + d_fft_size, 10); + + #else sse_cmulsc(&d_baseband_signal_shift[(j * (d_fft_size + 201)) + 100 + i], d_fft_codes[d_satellite], buffer, d_fft_size, 10); - d_piFFT->doiFFT(buffer, true); + + #endif + d_piFFT->doiFFT(buffer, true); x86_cmag(buffer, d_fft_size); x86_max((unsigned int *)buffer, &indext, &magt, d_fft_size); diff --git a/src/algorithms/acquisition/gnuradio_blocks/jamfile.jam b/src/algorithms/acquisition/gnuradio_blocks/jamfile.jam index 7e90c42b2..db00608aa 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/jamfile.jam +++ b/src/algorithms/acquisition/gnuradio_blocks/jamfile.jam @@ -1,6 +1,6 @@ project : build-dir ../../../../build ; obj gps_l1_ca_gps_sdr_acquisition_cc : gps_l1_ca_gps_sdr_acquisition_cc.cc ; -obj gps_l1_ca_gps_sdr_acquisition_ss : gps_l1_ca_gps_sdr_acquisition_ss.cc ; +obj gps_l1_ca_gps_sdr_acquisition_ss : gps_l1_ca_gps_sdr_acquisition_ss.cc : darwin:NO_SIMD ; obj gps_l1_ca_pcps_acquisition_cc : gps_l1_ca_pcps_acquisition_cc.cc ; -obj gps_l1_ca_tong_pcps_acquisition_cc : gps_l1_ca_tong_pcps_acquisition_cc.cc ; \ No newline at end of file +obj gps_l1_ca_tong_pcps_acquisition_cc : gps_l1_ca_tong_pcps_acquisition_cc.cc ; diff --git a/src/algorithms/libs/gps_sdr_simd.cc b/src/algorithms/libs/gps_sdr_simd.cc index 93f80d31b..0ff08c93f 100644 --- a/src/algorithms/libs/gps_sdr_simd.cc +++ b/src/algorithms/libs/gps_sdr_simd.cc @@ -20,6 +20,9 @@ write to the: Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ************************************************************************************************/ +#ifdef NO_SIMD +#else + #include "gps_sdr_simd.h" // __asm @@ -1035,7 +1038,7 @@ void sse_prn_accum_new(CPX *A, MIX *E, MIX *P, MIX *L, int32 cnt, CPX_ACCUM *acc } - +#endif diff --git a/src/algorithms/libs/jamfile.jam b/src/algorithms/libs/jamfile.jam index 2f62b3800..d213aee25 100644 --- a/src/algorithms/libs/jamfile.jam +++ b/src/algorithms/libs/jamfile.jam @@ -3,8 +3,8 @@ project : build-dir ../../../build ; obj gps_sdr_signal_processing : gps_sdr_signal_processing.cc ; obj gnss_sdr_valve : gnss_sdr_valve.cc ; obj pass_through : pass_through.cc ; -obj gps_sdr_fft : gps_sdr_fft.cc ; -obj gps_sdr_simd : gps_sdr_simd.cc ; +obj gps_sdr_fft : gps_sdr_fft.cc : darwin:NO_SIMD ; +obj gps_sdr_simd : gps_sdr_simd.cc : darwin:NO_SIMD ; obj gps_sdr_x86 : gps_sdr_x86.cc ; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc index 58e08fdea..e04758974 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_fll_pll_tracking.cc @@ -36,7 +36,7 @@ #include "gps_l1_ca_dll_fll_pll_tracking.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" - +#include #include #include @@ -85,7 +85,7 @@ GpsL1CaDllFllPllTracking::GpsL1CaDllFllPllTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! - vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length = round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index 51fa7f870..807126f5c 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -36,7 +36,7 @@ #include "gps_l1_ca_dll_pll_tracking.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" - +#include #include #include @@ -81,7 +81,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused! - vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length = round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) diff --git a/src/main/jamfile.jam b/src/main/jamfile.jam index 0b86c6f6b..1c3ee08ff 100644 --- a/src/main/jamfile.jam +++ b/src/main/jamfile.jam @@ -16,7 +16,7 @@ exe gnss-sdr : main.cc ../algorithms/libs//gnss_sdr_valve ../algorithms/libs//pass_through ../algorithms/libs//gps_sdr_fft -../algorithms/libs//gps_sdr_simd +#../algorithms/libs//gps_sdr_simd ../algorithms/libs//gps_sdr_x86 ../algorithms/observables/adapters//gps_l1_ca_observables ../algorithms/observables/gnuradio_blocks//gps_l1_ca_observables_cc