1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00
This commit is contained in:
Carles Fernandez 2016-12-27 21:06:13 +01:00
commit 750c4a6297
26 changed files with 363 additions and 326 deletions

View File

@ -436,30 +436,65 @@ endif()
# volk_gnsssdr module - GNSS-SDR's own VOLK library # volk_gnsssdr module - GNSS-SDR's own VOLK library
################################################################################ ################################################################################
find_package(VolkGnssSdr) find_package(VolkGnssSdr)
if(ENABLE_PACKAGING)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif(ENABLE_PACKAGING)
set(VOLK_GNSSSDR_BUILD_COMMAND "make")
if(PYTHON_EXECUTABLE)
set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
endif(PYTHON_EXECUTABLE)
if(OS_IS_MACOSX)
if(NOT PYTHON_EXECUTABLE)
find_file(MAC_PYTHON python
PATHS /opt/local/bin
/usr/local/bin )
if(MAC_PYTHON)
set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${MAC_PYTHON}")
endif(MAC_PYTHON)
endif(NOT PYTHON_EXECUTABLE)
if(CMAKE_GENERATOR STREQUAL Xcode)
set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target")
endif(CMAKE_GENERATOR STREQUAL Xcode)
endif(OS_IS_MACOSX)
if(NOT VOLK_GNSSSDR_FOUND) if(NOT VOLK_GNSSSDR_FOUND)
message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing 'make'") message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing 'make'")
###############################
# Find Python required modules
###############################
include(SetupPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
GNSSSDR_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
if(NOT PYTHON_MIN_VER_FOUND)
message(FATAL_ERROR "Python 2.7 or greater required to build VOLK_GNSSSDR")
endif()
# Mako
if(NOT MAKO_FOUND)
message(STATUS "Mako templates not found. See http://www.makotemplates.org/ ")
message(STATUS " You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo yum install python-mako")
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
message(STATUS " sudo zypper install python-Mako")
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo apt-get install python-mako")
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR")
endif(NOT MAKO_FOUND)
# Six
if(NOT SIX_FOUND)
message(STATUS "python-six not found. See https://pythonhosted.org/six/ ")
message(STATUS " You can try to install it by typing:")
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo yum install python-six")
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
message(STATUS " sudo zypper install python-six")
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(STATUS " sudo apt-get install python-six")
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR")
endif(NOT SIX_FOUND)
if(ENABLE_PACKAGING)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif(ENABLE_PACKAGING)
set(VOLK_GNSSSDR_BUILD_COMMAND "make")
if(PYTHON_EXECUTABLE)
set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
endif(PYTHON_EXECUTABLE)
if(OS_IS_MACOSX)
if(CMAKE_GENERATOR STREQUAL Xcode)
set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target")
endif(CMAKE_GENERATOR STREQUAL Xcode)
endif(OS_IS_MACOSX)
set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(C_FLAGS "${CMAKE_C_FLAGS} -std=c11") set(C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
@ -844,8 +879,8 @@ if(NOT ARMADILLO_FOUND)
set(armadillo_MD5 "8116185e1d7391eed3bf6c500f81b4d8") set(armadillo_MD5 "8116185e1d7391eed3bf6c500f81b4d8")
set(ARMA_FILE_EXTENSION "gz") set(ARMA_FILE_EXTENSION "gz")
else(CMAKE_VERSION VERSION_LESS 3.1) else(CMAKE_VERSION VERSION_LESS 3.1)
set(armadillo_RELEASE 7.600.1) set(armadillo_RELEASE 7.600.2)
set(armadillo_MD5 "7edc68972ad5f0121efcd1173551d9a1") set(armadillo_MD5 "8dee8bc37f7cb29323c20c4104126b5c")
set(ARMA_FILE_EXTENSION "xz") set(ARMA_FILE_EXTENSION "xz")
endif(CMAKE_VERSION VERSION_LESS 3.1) endif(CMAKE_VERSION VERSION_LESS 3.1)

111
README.md
View File

@ -17,7 +17,7 @@ This section describes how to set up the compilation environment in GNU/Linux or
GNU/Linux GNU/Linux
---------- ----------
* Tested distributions: Ubuntu from 14.04 LTS to 16.10, Debian 8.0 "jessie", Linaro 15.03 * Tested distributions: Ubuntu 14.04 LTS and [above](http://packages.ubuntu.com/search?keywords=gnss-sdr), Debian 8.0 "jessie" and [above](https://packages.debian.org/search?searchon=names&keywords=gnss-sdr), Linaro 15.03
* Known to work but not continually tested: Arch Linux, Fedora, and openSUSE * Known to work but not continually tested: Arch Linux, Fedora, and openSUSE
* Supported microprocessor architectures: * Supported microprocessor architectures:
* i386: Intel x86 instruction set (32-bit microprocessors). * i386: Intel x86 instruction set (32-bit microprocessors).
@ -46,7 +46,8 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time
libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \
libboost-serialization-dev libboost-program-options-dev libboost-test-dev \ libboost-serialization-dev libboost-program-options-dev libboost-test-dev \
liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr libblas-dev liblapack-dev \ liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr libblas-dev liblapack-dev \
libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libgtest-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libgtest-dev \
python-mako python-six
~~~~~~ ~~~~~~
Alternatively, and starting from Ubuntu 16.04 LTS, you can install all the required dependencies by adding the line Alternatively, and starting from Ubuntu 16.04 LTS, you can install all the required dependencies by adding the line
@ -128,9 +129,9 @@ or manually as explained below, and then please follow instructions on how to [d
$ sudo apt-get install libopenblas-dev liblapack-dev # For Debian/Ubuntu/LinuxMint $ sudo apt-get install libopenblas-dev liblapack-dev # For Debian/Ubuntu/LinuxMint
$ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL $ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL
$ sudo zypper install lapack-devel blas-devel # For OpenSUSE $ sudo zypper install lapack-devel blas-devel # For OpenSUSE
$ wget http://sourceforge.net/projects/arma/files/armadillo-7.500.2.tar.xz $ wget http://sourceforge.net/projects/arma/files/armadillo-7.600.2.tar.xz
$ tar xvfz armadillo-7.500.2.tar.xz $ tar xvfz armadillo-7.600.2.tar.xz
$ cd armadillo-7.500.2 $ cd armadillo-7.600.2
$ cmake . $ cmake .
$ make $ make
$ sudo make install $ sudo make install
@ -441,6 +442,8 @@ $ sudo port install gnuradio
$ sudo port install armadillo $ sudo port install armadillo
$ sudo port install gnutls $ sudo port install gnutls
$ sudo port install google-glog +gflags $ sudo port install google-glog +gflags
$ sudo port install py27-mako
$ sudo port install py27-six
~~~~~~ ~~~~~~
You also might need to activate a Python installation. The list of installed versions can be retrieved with: You also might need to activate a Python installation. The list of installed versions can be retrieved with:
@ -520,29 +523,28 @@ changing ```/opt/local``` by the base directory in which your software is instal
The CMake script will create Makefiles that download, build and link Armadillo, Gflags, Glog and Google Test on the fly at compile time if they are not detected in your machine. The CMake script will create Makefiles that download, build and link Armadillo, Gflags, Glog and Google Test on the fly at compile time if they are not detected in your machine.
Android
----------
In the framework of the [Google Summer of Code](https://summerofcode.withgoogle.com/) program [2016](https://summerofcode.withgoogle.com/organizations/4864875935301632/) there is a project working on a [GNSS-SDR Android port](https://summerofcode.withgoogle.com/projects/?sp-page=2#4871316700135424).
See https://github.com/Hoernchen/grand-build for ongoing work on a script which will build GNSS-SDR for Android.
Updating GNSS-SDR Updating GNSS-SDR
================= =================
If you cloned GNSS-SDR some time ago, it is possible that some developer has updated files at the Git repository. You can update your working copy by doing: If you cloned or forked GNSS-SDR some time ago, it is possible that some developer has updated files at the Git repository. If you still have not done so, add the ```upstream``` repository to the list of remotes:
~~~~~~ ~~~~~~
$ git checkout master # Switch to branch you want to update $ git remote add upstream https://github.com/gnss-sdr/gnss-sdr.git
$ git pull origin master # Download the newest code from our repository ~~~~~~
and then you can update your working copy by doing:
~~~~~~
$ git checkout master # Switch to branch you want to update
$ git pull upstream master # Download the newest code from our repository
~~~~~~ ~~~~~~
or, if you want to test the latest developments: or, if you want to test the latest developments:
~~~~~~ ~~~~~~
$ git checkout next $ git checkout next
$ git pull origin next $ git pull upstream next
~~~~~~ ~~~~~~
Before rebuilding the source code, it is safe (and recommended) to remove the remainders of old compilations: Before rebuilding the source code, it is safe (and recommended) to remove the remainders of old compilations:
@ -553,7 +555,7 @@ $ rm -rf gnss-sdr/build/*
If you are interested in contributing to the development of GNSS-SDR, please check out [how to do it](http://gnss-sdr.org/contribute/ "How to contribute to GNSS-SDR source code"). If you are interested in contributing to the development of GNSS-SDR, please check out [how to do it](http://gnss-sdr.org/contribute/ "How to contribute to GNSS-SDR source code").
There is a more controlled way to upgrade your repository, which is to use the Git commands ```fetch``` and ```merge```, as described [here](http://gnss-sdr.org/docs/tutorials/using-git/). There is a more controlled way to upgrade your repository, which is to use the Git commands ```fetch``` and ```merge```, as described in our [Git Tutorial](http://gnss-sdr.org/docs/tutorials/using-git/ "Using Git").
@ -1277,69 +1279,11 @@ But what this also means is that non-GPL code cannot use GPL code. This means th
Publications and Credits Publications and Credits
======================== ========================
If you use GNSS-SDR to produce a research paper or Thesis, we would appreciate if you reference any of these articles to credit the GNSS-SDR project: If you use GNSS-SDR to produce a research paper or Thesis, we would appreciate if you reference the following article to credit the GNSS-SDR project:
* J. Arribas, M. Branzanti, C. Fernández-Prades, P. Closas, [Fastening GPS and Galileo Tight with a Software Receiver](http://www.cttc.es/publication/fastening-gps-and-galileo-tight-with-a-software-receiver/), in Proc. of the ION GNSS+ 2014 Conference, Tampa, Florida, Sept. 2014. * C. Fernández-Prades, J. Arribas, P. Closas, C. Avilés, and L. Esteve, [GNSS-SDR: an open source tool for researchers and developers](http://www.cttc.es/publication/gnss-sdr-an-open-source-tool-for-researchers-and-developers/), in Proc. of the ION GNSS 2011 Conference, Portland, Oregon, Sept. 19-23, 2011.
* J. Arribas, P. Closas, C. Fernández-Prades, [Interference Mitigation in GNSS Receivers by Array Signal Processing: A Software Radio Approach](http://www.cttc.es/publication/interference-mitigation-in-gnss-receivers-by-array-signal-processing-a-software-radio-approach/), in Proc. of the 8th IEEE Sensor Array and Multichannel Signal Processing Workshop, A Coruña, Spain, June 2014.
* C. Fernández-Prades, J. Arribas, P. Closas, [Turning a Television into a GNSS Receiver](http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/), in Proc. of the ION GNSS+ 2013 Conference, Nashville, Tennessee, Sept. 2013.
* C. Fernández-Prades, J. Arribas, L. Esteve, D. Pubill, P. Closas, [An Open Source Galileo E1 Software Receiver](http://www.cttc.es/publication/an-open-source-galileo-e1-software-receiver/), in Proc. of the 6th ESA Workshop on Satellite Navigation Technologies (NAVITEC 2012), ESTEC, Noordwijk, The Netherlands, Dec. 2012.
* J. Arribas, [GNSS Array-based Acquisition: Theory and Implementation](http://theses.eurasip.org/theses/449/gnss-array-based-acquisition-theory-and/), PhD Thesis, Universitat Politècnica de Catalunya, Barcelona, Spain, June 2012.
* C. Fernández-Prades, J. Arribas, P. Closas, C. Avilés, and L. Esteve, [GNSS-SDR: an open source tool for researchers and developers](http://www.cttc.es/publication/gnss-sdr-an-open-source-tool-for-researchers-and-developers/), in Proc. of the ION GNSS 2011 Conference, Portland, Oregon, Sept. 19-23, 2011.
* C. Fernández-Prades, C. Avilés, L. Esteve, J. Arribas, and P. Closas, [Design patterns for GNSS software receivers](http://www.cttc.es/publication/design-patterns-for-gnss-software-receivers/), in Proc. of the 5th ESA Workshop on Satellite Navigation Technologies (NAVITEC'2010), ESTEC, Noordwijk, The Netherlands, Dec. 2010. DOI:10.1109/NAVITEC.2010.5707981
For LaTeX users, these are the BibTeX cites for your convenience: For LaTeX users, this is the BibTeX entry for your convenience:
~~~~~~
@INPROCEEDINGS{GNSS-SDR14b,
AUTHOR = {J.~Arribas and M.~Branzanti and C.~{Fern\'{a}ndez--Prades} and P.~Closas},
TITLE = {Fastening {GPS} and {G}alileo Tight with a Software Receiver},
BOOKTITLE = {Proc. of the ION GNSS+ 2014 Conference},
YEAR = {2014},
address = {Tampa, Florida},
month = {Sept.}
}
~~~~~~
~~~~~~
@INPROCEEDINGS{GNSS-SDR14a,
AUTHOR = {J.~Arribas and P.~Closas and C.~{Fern\'{a}ndez--Prades}},
TITLE = {Interference Mitigation in {GNSS} Receivers by Array Signal Processing: {A} Software Radio Approach},
BOOKTITLE = {Proc. of the 8th IEEE Sensor Array and Multichannel Signal Processing Workshop},
YEAR = {2014},
address = {A Coru\~{n}a, Spain},
month = {June}
}
~~~~~~
~~~~~~
@INPROCEEDINGS{GNSS-SDR13,
AUTHOR = {C.~{Fern\'{a}ndez--Prades} and J.~Arribas and P.~Closas},
TITLE = {Turning a Television into a {GNSS} Receiver},
BOOKTITLE = {Proc. of the ION GNSS+ 2013 Conference},
YEAR = {2013},
address = {Nashville, Tennessee},
month = {Sept.}
}
~~~~~~
~~~~~~
@INPROCEEDINGS{GNSS-SDR12
author = {C.~{Fern\'{a}ndez--Prades} and J.~Arribas and L.~Esteve and D.~Pubill and P.~Closas},
title = {An Open Source {G}alileo {E1} Software Receiver},
booktitle = {Proc. of the 6th ESA Workshop on Satellite Navigation Technologies (NAVITEC'2012)},
year = {2012},
address = {ESTEC, Noordwijk, The Netherlands},
month = {Dec.} }
~~~~~~
~~~~~~
@PHDTHESIS{Arribas12,
author = {J.~Arribas},
title = {{GNSS} Array-based Acquisition: Theory and Implementation},
school = {Universitat Polit\`{e}cnica de Catalunya},
year = {2012},
address = {Barcelona, Spain},
month = {June} }
~~~~~~
~~~~~~ ~~~~~~
@INPROCEEDINGS{GNSS-SDR11, @INPROCEEDINGS{GNSS-SDR11,
@ -1351,17 +1295,8 @@ For LaTeX users, these are the BibTeX cites for your convenience:
month = {Sept.} } month = {Sept.} }
~~~~~~ ~~~~~~
~~~~~~
@INPROCEEDINGS{GNSS-SDR10,
AUTHOR = {C.~{Fern\'{a}ndez--Prades} and C.~Avil\'{e}s and L.~Esteve and J.~Arribas and P.~Closas},
TITLE = {Design patterns for {GNSS} software receivers},
BOOKTITLE = {Proc. of the 5th ESA Workshop on Satellite Navigation Technologies (NAVITEC'2010)},
YEAR = {2010},
address = {ESTEC, Noordwijk, The Netherlands},
month = {Dec.},
note = {DOI:10.1109/NAVITEC.2010.5707981} }
~~~~~~
There is a list of papers related to GNSS-SDR in our [publications page](http://gnss-sdr.org/publications/ "Publications").

View File

@ -0,0 +1,78 @@
########################################################################
# Setup the python interpreter:
# This allows the user to specify a specific interpreter,
# or finds the interpreter via the built-in cmake module.
########################################################################
#this allows the user to override PYTHON_EXECUTABLE
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
#otherwise if not set, try to automatically find it
else(PYTHON_EXECUTABLE)
#use the built-in find script
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
find_package(PythonInterp 2)
#and if that fails use the find program routine
if(NOT PYTHONINTERP_FOUND)
find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python3)
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE)
endif(NOT PYTHONINTERP_FOUND)
endif(PYTHON_EXECUTABLE)
if (CMAKE_CROSSCOMPILING)
set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
else (CMAKE_CROSSCOMPILING)
set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
endif(CMAKE_CROSSCOMPILING)
#make the path to the executable appear in the cmake gui
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")
#make sure we can use -B with python (introduced in 2.6)
if(PYTHON_EXECUTABLE)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -B -c ""
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT
)
if(PYTHON_HAS_DASH_B_RESULT EQUAL 0)
set(PYTHON_DASH_B "-B")
endif()
endif(PYTHON_EXECUTABLE)
########################################################################
# Check for the existence of a python module:
# - desc a string description of the check
# - mod the name of the module to import
# - cmd an additional command to run
# - have the result variable to set
########################################################################
macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have)
message(STATUS "Python checking for ${desc}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "
#########################################
try: import ${mod}
except:
try: ${mod}
except: exit(-1)
try: assert ${cmd}
except: exit(-1)
#########################################"
RESULT_VARIABLE ${have}
)
if(${have} EQUAL 0)
message(STATUS "Python checking for ${desc} - found")
set(${have} TRUE)
else(${have} EQUAL 0)
message(STATUS "Python checking for ${desc} - not found")
set(${have} FALSE)
endif(${have} EQUAL 0)
endmacro(GNSSSDR_PYTHON_CHECK_MODULE)

View File

@ -29,7 +29,7 @@ GNSS-SDR.SUPL_CI=0x31b0
SignalSource.implementation=File_Signal_Source SignalSource.implementation=File_Signal_Source
;#filename: path to file with the captured GNSS signal samples to be processed ;#filename: path to file with the captured GNSS signal samples to be processed
SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE SignalSource.filename=/Users/carlesfernandez/Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ;/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE
;#item_type: Type and resolution for each of the signal samples. ;#item_type: Type and resolution for each of the signal samples.
SignalSource.item_type=ishort SignalSource.item_type=ishort

View File

@ -73,8 +73,8 @@ As signal inputs, it accepts:
\li Raw data file captured with a data grabber (digitized at some intermediate frequency or directly at baseband). \li Raw data file captured with a data grabber (digitized at some intermediate frequency or directly at baseband).
\li Any suitable RF configuration that can be driven by the Universal Software Radio Peripheral Hardware Driver (<a href="http://files.ettus.com/uhd_docs/manual/html/" target="_blank">UHD</a>). \li Any suitable RF configuration that can be driven by the Universal Software Radio Peripheral Hardware Driver (<a href="http://files.ettus.com/uhd_docs/manual/html/" target="_blank">UHD</a>).
This includes all current and future <a href="http://www.ettus.com/">Ettus Research</a> products. The USRP1 + DBSRX 2.2 daughterboard is an example of working configuration for GPS L1 C/A and Galileo E1B and E1C signals. This includes all current and future <a href="http://www.ettus.com/">Ettus Research</a> products. The USRP1 + DBSRX 2.2 daughterboard is an example of working configuration for GPS L1 C/A and Galileo E1B and E1C signals.
\li The <a href="http://gnss-sdr.org/documentation/sige-gn3s-sampler-v2-usb-front-end" target="blank">GN3S v2 USB dongle</a> (GN3S v3 might work with small modifications). \li The <a href="http://gnss-sdr.org/docs/tutorials/sige-gn3s-sampler-v2-usb-front-end/" target="blank">GN3S v2 USB dongle</a> (GN3S v3 might work with small modifications).
\li Experimentally, with some <a href="http://gnss-sdr.org/documentation/gnss-sdr-operation-realtek-rtl2832u-usb-dongle-dvb-t-receiver" target="_blank">USB DVB-T dongles based on the Realtek RTL2832U chipset</a>. \li Experimentally, with some <a href="http://gnss-sdr.org/docs/tutorials/gnss-sdr-operation-realtek-rtl2832u-usb-dongle-dvb-t-receiver/" target="_blank">USB DVB-T dongles based on the Realtek RTL2832U chipset</a>.
\li For mathematical representations of the targeted signals, check out the \ref the_signal_model page. \li For mathematical representations of the targeted signals, check out the \ref the_signal_model page.
As outputs, it provides: As outputs, it provides:
@ -87,7 +87,7 @@ As outputs, it provides:
\section build Building GNSS-SDR \section build Building GNSS-SDR
In principle, GNSS-SDR can be built in any Unix-like system. In practice, it depends on being able to install all the required dependencies. See the <a href="http://gnss-sdr.org/documentation/building-guide" target="_blank">building guide</a> page for details about the project's In principle, GNSS-SDR can be built in any Unix-like system. In practice, it depends on being able to install all the required dependencies. See the <a href="http://gnss-sdr.org/build-and-install/" target="_blank">building guide</a> page for details about the project's
dependencies and build process. Mainly, it consists on installing <a href="http://gnuradio.org/" target="_blank">GNU Radio</a> plus some few more libraries: dependencies and build process. Mainly, it consists on installing <a href="http://gnuradio.org/" target="_blank">GNU Radio</a> plus some few more libraries:
\li <a href="http://code.google.com/p/gflags/" target="_blank">Gflags</a>, a library that implements commandline flags processing, \li <a href="http://code.google.com/p/gflags/" target="_blank">Gflags</a>, a library that implements commandline flags processing,
@ -655,12 +655,12 @@ Please ask the Developer Team for a signal sample if you need one, and they will
Another interesting option is working in real-time with a RF front-end. We provide drivers for UHD-compatible hardware (see \ref signal_source), for the GN3S v2 USB dongle Another interesting option is working in real-time with a RF front-end. We provide drivers for UHD-compatible hardware (see \ref signal_source), for the GN3S v2 USB dongle
and for some DVB-T USB dongles. Start with a low number of channels and then increase it in order to test how many channels your processor can handle in real-time. and for some DVB-T USB dongles. Start with a low number of channels and then increase it in order to test how many channels your processor can handle in real-time.
You can find more information at the <a href="http://gnss-sdr.org/documents" target="_blank"><b>GNSS-SDR Documentation page</b></a> or directly asking to the You can find more information at the <a href="http://gnss-sdr.org/docs/" target="_blank"><b>GNSS-SDR Documentation page</b></a> or directly asking to the
<a href="http://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers" target="_blank"><b>GNSS-SDR Developers mailing list</b></a>. <a href="http://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers" target="_blank"><b>GNSS-SDR Developers mailing list</b></a>.
You are also very welcome to contribute to the project, there are many ways to <a href="http://gnss-sdr.org/participate" target="_blank"><b>participate in GNSS-SDR</b></a>. You are also very welcome to contribute to the project, there are many ways to <a href="http://gnss-sdr.org/contribute/" target="_blank"><b>participate in GNSS-SDR</b></a>.
If you need some special feature not yet implemented, the Developer Team would love to be hired for developing it. If you need some special feature not yet implemented, the Developer Team would love to be hired for developing it.
Please do not hesitate to <a href="http://gnss-sdr.org/contact-us" target="_blank"><b>contact them</b></a>. Please do not hesitate to <a href="http://gnss-sdr.org/team/" target="_blank"><b>contact them</b></a>.
Enjoy GNSS-SDR! Enjoy GNSS-SDR!

View File

@ -74,17 +74,24 @@ SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\"
# Python # Python
include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
VOLK_PYTHON_CHECK_MODULE("python >= 2.5" sys "sys.version.split()[0] >= '2.5'" PYTHON_MIN_VER_FOUND) VOLK_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND)
VOLK_PYTHON_CHECK_MODULE("Cheetah >= 2.0.0" Cheetah "Cheetah.Version >= '2.0.0'" CHEETAH_FOUND) VOLK_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
VOLK_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
if(NOT PYTHON_MIN_VER_FOUND) if(NOT PYTHON_MIN_VER_FOUND)
message(FATAL_ERROR "Python 2.5 or greater required to build VOLK_GNSSSDR") message(FATAL_ERROR "Python 2.7 or greater required to build VOLK_GNSSSDR")
endif() endif()
# Cheetah # Mako
if(NOT CHEETAH_FOUND) if(NOT MAKO_FOUND)
message(FATAL_ERROR "Cheetah templates required to build VOLK_GNSSSDR") message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR")
endif() endif()
# Six
if(NOT SIX_FOUND)
message(FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK")
endif()
# Boost # Boost
if(MSVC) if(MSVC)

View File

@ -17,7 +17,7 @@ However, you can install and use VOLK_GNSSSDR kernels as you use VOLK's, indepen
First, make sure that the required dependencies are installed in you machine: First, make sure that the required dependencies are installed in you machine:
~~~~~~ ~~~~~~
$ sudo apt-get install git subversion cmake python-cheetah libboost-dev libbbost-filesystem $ sudo apt-get install git cmake python-mako python-six libboost-dev libbbost-filesystem
~~~~~~ ~~~~~~
In order to build and install the library, go to the base folder of the source code and do: In order to build and install the library, go to the base folder of the source code and do:

View File

@ -91,8 +91,19 @@ endif()
# MAKE volk_gnsssdr-config-info # MAKE volk_gnsssdr-config-info
add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc) add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc)
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib}) if(ENABLE_STATIC_LIBS)
add_dependencies(volk_gnsssdr-config-info volk_gnsssdr) target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
else(ENABLE_STATIC_LIBS)
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
add_dependencies(volk_gnsssdr-config-info volk_gnsssdr)
endif(ENABLE_STATIC_LIBS)
if(ENABLE_STRIP)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set_target_properties(volk_gnsssdr-config-info
PROPERTIES LINK_FLAGS "-s")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif(ENABLE_STRIP)
install( install(
TARGETS volk_gnsssdr-config-info TARGETS volk_gnsssdr-config-info

View File

@ -36,11 +36,12 @@ if(PYTHON_EXECUTABLE)
else(PYTHON_EXECUTABLE) else(PYTHON_EXECUTABLE)
#use the built-in find script #use the built-in find script
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
find_package(PythonInterp 2) find_package(PythonInterp 2)
#and if that fails use the find program routine #and if that fails use the find program routine
if(NOT PYTHONINTERP_FOUND) if(NOT PYTHONINTERP_FOUND)
find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python2.6 python2.5) find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python3)
if(PYTHON_EXECUTABLE) if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE) set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE) endif(PYTHON_EXECUTABLE)
@ -100,7 +101,7 @@ endmacro(VOLK_PYTHON_CHECK_MODULE)
if(NOT DEFINED VOLK_PYTHON_DIR) if(NOT DEFINED VOLK_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
from distutils import sysconfig from distutils import sysconfig
print sysconfig.get_python_lib(plat_specific=True, prefix='') print(sysconfig.get_python_lib(plat_specific=True, prefix=''))
" OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE " OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
) )
endif() endif()
@ -113,7 +114,7 @@ file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)
function(VOLK_UNIQUE_TARGET desc) function(VOLK_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${PROJECT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) file(RELATIVE_PATH reldir ${PROJECT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5]
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_target(${_target} ALL DEPENDS ${ARGN}) add_custom_target(${_target} ALL DEPENDS ${ARGN})
@ -230,7 +231,7 @@ endfunction(VOLK_PYTHON_INSTALL)
file(WRITE ${PROJECT_BINARY_DIR}/python_compile_helper.py " file(WRITE ${PROJECT_BINARY_DIR}/python_compile_helper.py "
import sys, py_compile import sys, py_compile
files = sys.argv[1:] files = sys.argv[1:]
srcs, gens = files[:len(files)/2], files[len(files)/2:] srcs, gens = files[:len(files)//2], files[len(files)//2:]
for src, gen in zip(srcs, gens): for src, gen in zip(srcs, gens):
py_compile.compile(file=src, cfile=gen, doraise=True) py_compile.compile(file=src, cfile=gen, doraise=True)
") ")

View File

@ -18,6 +18,10 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
from __future__ import print_function
import six
archs = list() archs = list()
arch_dict = dict() arch_dict = dict()
@ -81,8 +85,8 @@ for arch_xml in archs_xml:
if not flags.has_key(name): flags[name] = list() if not flags.has_key(name): flags[name] = list()
flags[name].append(flag_xml.firstChild.data) flags[name].append(flag_xml.firstChild.data)
#force kwargs keys to be of type str, not unicode for py25 #force kwargs keys to be of type str, not unicode for py25
kwargs = dict((str(k), v) for k, v in kwargs.iteritems()) kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
register_arch(flags=flags, checks=checks, **kwargs) register_arch(flags=flags, checks=checks, **kwargs)
if __name__ == '__main__': if __name__ == '__main__':
print archs print(archs)

View File

@ -18,6 +18,8 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
from __future__ import print_function
import optparse import optparse
import volk_gnsssdr_arch_defs import volk_gnsssdr_arch_defs
import volk_gnsssdr_machine_defs import volk_gnsssdr_machine_defs
@ -28,7 +30,7 @@ def do_arch_flags_list(compiler):
if not arch.is_supported(compiler): continue if not arch.is_supported(compiler): continue
fields = [arch.name] + arch.get_flags(compiler) fields = [arch.name] + arch.get_flags(compiler)
output.append(','.join(fields)) output.append(','.join(fields))
print ';'.join(output) print(';'.join(output))
def do_machines_list(arch_names): def do_machines_list(arch_names):
output = list() output = list()
@ -36,14 +38,14 @@ def do_machines_list(arch_names):
machine_arch_set = set(machine.arch_names) machine_arch_set = set(machine.arch_names)
if set(arch_names).intersection(machine_arch_set) == machine_arch_set: if set(arch_names).intersection(machine_arch_set) == machine_arch_set:
output.append(machine.name) output.append(machine.name)
print ';'.join(output) print(';'.join(output))
def do_machine_flags_list(compiler, machine_name): def do_machine_flags_list(compiler, machine_name):
output = list() output = list()
machine = volk_gnsssdr_machine_defs.machine_dict[machine_name] machine = volk_gnsssdr_machine_defs.machine_dict[machine_name]
for arch in machine.archs: for arch in machine.archs:
output.extend(arch.get_flags(compiler)) output.extend(arch.get_flags(compiler))
print ' '.join(output) print(' '.join(output))
def main(): def main():
parser = optparse.OptionParser() parser = optparse.OptionParser()

View File

@ -19,6 +19,8 @@
# #
from __future__ import print_function
import os import os
import re import re
import sys import sys
@ -98,9 +100,9 @@ def split_into_nested_ifdef_sections(code):
def print_sections(sections, indent = ' '): def print_sections(sections, indent = ' '):
for header, body in sections: for header, body in sections:
if header == 'text': if header == 'text':
print indent, ('\n'+indent).join(body.splitlines()) print(indent, ('\n'+indent).join(body.splitlines()))
continue continue
print indent.replace(' ', '-') + '>', header print(indent.replace(' ', '-') + '>', header)
print_sections(body, indent + ' ') print_sections(body, indent + ' ')
######################################################################## ########################################################################
@ -136,7 +138,7 @@ class impl_class:
arg_type, arg_name = m.groups() arg_type, arg_name = m.groups()
self.args.append((arg_type, arg_name)) self.args.append((arg_type, arg_name))
except Exception as ex: except Exception as ex:
raise Exception, 'I cant parse the function prototype from: %s in %s\n%s'%(kern_name, body, ex) raise Exception('I cant parse the function prototype from: %s in %s\n%s'%(kern_name, body, ex))
assert self.name assert self.name
self.is_aligned = self.name.startswith('a_') self.is_aligned = self.name.startswith('a_')
@ -206,4 +208,4 @@ kernel_files = glob.glob(os.path.join(srcdir, "kernels", "volk_gnsssdr", "*.h"))
kernels = map(kernel_class, kernel_files) kernels = map(kernel_class, kernel_files)
if __name__ == '__main__': if __name__ == '__main__':
print kernels print(kernels)

View File

@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
from __future__ import print_function
import six
from volk_gnsssdr_arch_defs import arch_dict from volk_gnsssdr_arch_defs import arch_dict
@ -70,8 +73,8 @@ for machine_xml in machines_xml:
except: pass except: pass
kwargs['archs'] = kwargs['archs'].split() kwargs['archs'] = kwargs['archs'].split()
#force kwargs keys to be of type str, not unicode for py25 #force kwargs keys to be of type str, not unicode for py25
kwargs = dict((str(k), v) for k, v in kwargs.iteritems()) kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
register_machine(**kwargs) register_machine(**kwargs)
if __name__ == '__main__': if __name__ == '__main__':
print machines print(machines)

View File

@ -18,6 +18,8 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
from __future__ import print_function
import os import os
import re import re
import sys import sys
@ -25,22 +27,7 @@ import optparse
import volk_gnsssdr_arch_defs import volk_gnsssdr_arch_defs
import volk_gnsssdr_machine_defs import volk_gnsssdr_machine_defs
import volk_gnsssdr_kernel_defs import volk_gnsssdr_kernel_defs
from Cheetah import Template from mako.template import Template
def __escape_pre_processor(code):
out = list()
for line in code.splitlines():
m = re.match('^(\s*)#(\s*)(\w+)(.*)$', line)
if m:
p0, p1, fcn, stuff = m.groups()
conly = fcn in ('include', 'define', 'ifdef', 'ifndef', 'endif', 'elif', 'pragma')
both = fcn in ('if', 'else')
istmpl = '$' in stuff
if 'defined' in stuff: istmpl = False
if conly or (both and not istmpl):
line = '%s\\#%s%s%s'%(p0, p1, fcn, stuff)
out.append(line)
return '\n'.join(out)
def __parse_tmpl(_tmpl, **kwargs): def __parse_tmpl(_tmpl, **kwargs):
defs = { defs = {
@ -51,13 +38,12 @@ def __parse_tmpl(_tmpl, **kwargs):
'kernels': volk_gnsssdr_kernel_defs.kernels, 'kernels': volk_gnsssdr_kernel_defs.kernels,
} }
defs.update(kwargs) defs.update(kwargs)
_tmpl = __escape_pre_processor(_tmpl)
_tmpl = """ _tmpl = """
/* this file was generated by volk_gnsssdr template utils, do not edit! */ /* this file was generated by volk_gnsssdr template utils, do not edit! */
""" + _tmpl """ + _tmpl
return str(Template.Template(_tmpl, defs)) return str(Template(_tmpl).render(**defs))
def main(): def main():
parser = optparse.OptionParser() parser = optparse.OptionParser()
@ -67,7 +53,7 @@ def main():
output = __parse_tmpl(open(opts.input).read(), args=args) output = __parse_tmpl(open(opts.input).read(), args=args)
if opts.output: open(opts.output, 'w').write(output) if opts.output: open(opts.output, 'w').write(output)
else: print output else: print(output)
if __name__ == '__main__': main() if __name__ == '__main__': main()

View File

@ -542,11 +542,8 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7")
#Create a volk_gnsssdr object library (requires cmake >= 2.8.8) #Create a volk_gnsssdr object library (requires cmake >= 2.8.8)
add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources})
if(ENABLE_STATIC_LIBS) #Add dynamic library
add_library(volk_gnsssdr STATIC $<TARGET_OBJECTS:volk_gnsssdr_obj> ${volk_gnsssdr_sources}) add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj>)
else(ENABLE_STATIC_LIBS)
add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj> ${volk_gnsssdr_sources})
endif(ENABLE_STATIC_LIBS)
target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES}) target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES})
#Configure target properties #Configure target properties

View File

@ -19,6 +19,8 @@
# #
# #
from __future__ import print_function
import ConfigParser import ConfigParser
import sys import sys
import os import os
@ -70,7 +72,7 @@ class volk_gnsssdr_modtool_config:
elif os.path.exists(default): elif os.path.exists(default):
icfg.read(default) icfg.read(default)
else: else:
print "Initializing config file..." print("Initializing config file...")
icfg.add_section(self.config_name) icfg.add_section(self.config_name)
for kn in self.config_defaults: for kn in self.config_defaults:
rv = raw_input("%s: "%(kn)) rv = raw_input("%s: "%(kn))
@ -95,9 +97,3 @@ class volk_gnsssdr_modtool_config:
retval[i[0]] = i[1] retval[i[0]] = i[1]
return retval return retval

View File

@ -18,6 +18,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street, # the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA. # Boston, MA 02110-1301, USA.
# #
from __future__ import print_function
import os import os
import glob import glob
@ -225,14 +226,14 @@ class volk_gnsssdr_modtool:
for kernel in search_kernels: for kernel in search_kernels:
infile = os.path.join(inpath, 'kernels/' + top[:-1] + '/' + top + kernel.pattern + '.h'); infile = os.path.join(inpath, 'kernels/' + top[:-1] + '/' + top + kernel.pattern + '.h');
print "Removing kernel %s"%(kernel.pattern) print("Removing kernel %s" % kernel.pattern)
if os.path.exists(infile): if os.path.exists(infile):
os.remove(infile); os.remove(infile);
# remove the orc proto-kernels if they exist. There are no puppets here # remove the orc proto-kernels if they exist. There are no puppets here
# so just need to glob for files matching kernel name # so just need to glob for files matching kernel name
print glob.glob(inpath + '/orc/' + top + name + '*.orc'); print(glob.glob(inpath + '/kernel/volk/asm/orc/' + top + name + '*.orc'))
for orcfile in glob.glob(inpath + '/orc/' + top + name + '*.orc'): for orcfile in glob.glob(inpath + '/orc/' + top + name + '*.orc'):
print orcfile print(orcfile)
if(os.path.exists(orcfile)): if(os.path.exists(orcfile)):
os.remove(orcfile); os.remove(orcfile);
@ -294,7 +295,7 @@ class volk_gnsssdr_modtool:
open(dest, 'a').write(otherline); open(dest, 'a').write(otherline);
for kernel in search_kernels: for kernel in search_kernels:
print "Adding kernel %s from module %s"%(kernel.pattern,base) print("Adding kernel %s from module %s" % (kernel.pattern, base))
infile = open(os.path.join(inpath, 'lib/testqa.cc')); infile = open(os.path.join(inpath, 'lib/testqa.cc'));
otherinfile = open(os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'lib/testqa.cc')); otherinfile = open(os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'lib/testqa.cc'));

View File

@ -110,93 +110,91 @@ bool volk_gnsssdr_is_aligned(const void *ptr)
#define LV_HAVE_GENERIC #define LV_HAVE_GENERIC
#define LV_HAVE_DISPATCHER #define LV_HAVE_DISPATCHER
#for $kern in $kernels %for kern in kernels:
#if $kern.has_dispatcher %if kern.has_dispatcher:
#include <volk_gnsssdr/$(kern.name).h> //pulls in the dispatcher #include <volk_gnsssdr/${kern.name}.h> //pulls in the dispatcher
#end if %endif
static inline void __$(kern.name)_d($kern.arglist_full) static inline void __${kern.name}_d(${kern.arglist_full})
{ {
#if $kern.has_dispatcher %if kern.has_dispatcher:
$(kern.name)_dispatcher($kern.arglist_names); ${kern.name}_dispatcher(${kern.arglist_names});
return; return;
#end if %endif
if (volk_gnsssdr_is_aligned( if (volk_gnsssdr_is_aligned(<% num_open_parens = 0 %>
#set $num_open_parens = 0 %for arg_type, arg_name in kern.args:
#for $arg_type, $arg_name in $kern.args %if '*' in arg_type:
#if '*' in $arg_type VOLK_OR_PTR(${arg_name},<% num_open_parens += 1 %>
VOLK_OR_PTR($arg_name, %endif
#set $num_open_parens += 1 %endfor
#end if 0<% end_open_parens = ')'*num_open_parens %>${end_open_parens}
#end for
0$(')'*$num_open_parens)
)){ )){
$(kern.name)_a($kern.arglist_names); ${kern.name}_a(${kern.arglist_names});
} }
else{ else{
$(kern.name)_u($kern.arglist_names); ${kern.name}_u(${kern.arglist_names});
} }
} }
static inline void __init_$(kern.name)(void) static inline void __init_${kern.name}(void)
{ {
const char *name = get_machine()->$(kern.name)_name; const char *name = get_machine()->${kern.name}_name;
const char **impl_names = get_machine()->$(kern.name)_impl_names; const char **impl_names = get_machine()->${kern.name}_impl_names;
const int *impl_deps = get_machine()->$(kern.name)_impl_deps; const int *impl_deps = get_machine()->${kern.name}_impl_deps;
const bool *alignment = get_machine()->$(kern.name)_impl_alignment; const bool *alignment = get_machine()->${kern.name}_impl_alignment;
const size_t n_impls = get_machine()->$(kern.name)_n_impls; const size_t n_impls = get_machine()->${kern.name}_n_impls;
const size_t index_a = volk_gnsssdr_rank_archs(name, impl_names, impl_deps, alignment, n_impls, true/*aligned*/); const size_t index_a = volk_gnsssdr_rank_archs(name, impl_names, impl_deps, alignment, n_impls, true/*aligned*/);
const size_t index_u = volk_gnsssdr_rank_archs(name, impl_names, impl_deps, alignment, n_impls, false/*unaligned*/); const size_t index_u = volk_gnsssdr_rank_archs(name, impl_names, impl_deps, alignment, n_impls, false/*unaligned*/);
$(kern.name)_a = get_machine()->$(kern.name)_impls[index_a]; ${kern.name}_a = get_machine()->${kern.name}_impls[index_a];
$(kern.name)_u = get_machine()->$(kern.name)_impls[index_u]; ${kern.name}_u = get_machine()->${kern.name}_impls[index_u];
assert($(kern.name)_a); assert(${kern.name}_a);
assert($(kern.name)_u); assert(${kern.name}_u);
$(kern.name) = &__$(kern.name)_d; ${kern.name} = &__${kern.name}_d;
} }
static inline void __$(kern.name)_a($kern.arglist_full) static inline void __${kern.name}_a(${kern.arglist_full})
{ {
__init_$(kern.name)(); __init_${kern.name}();
$(kern.name)_a($kern.arglist_names); ${kern.name}_a(${kern.arglist_names});
} }
static inline void __$(kern.name)_u($kern.arglist_full) static inline void __${kern.name}_u(${kern.arglist_full})
{ {
__init_$(kern.name)(); __init_${kern.name}();
$(kern.name)_u($kern.arglist_names); ${kern.name}_u(${kern.arglist_names});
} }
static inline void __$(kern.name)($kern.arglist_full) static inline void __${kern.name}(${kern.arglist_full})
{ {
__init_$(kern.name)(); __init_${kern.name}();
$(kern.name)($kern.arglist_names); ${kern.name}(${kern.arglist_names});
} }
$kern.pname $(kern.name)_a = &__$(kern.name)_a; ${kern.pname} ${kern.name}_a = &__${kern.name}_a;
$kern.pname $(kern.name)_u = &__$(kern.name)_u; ${kern.pname} ${kern.name}_u = &__${kern.name}_u;
$kern.pname $(kern.name) = &__$(kern.name); ${kern.pname} ${kern.name} = &__${kern.name};
void $(kern.name)_manual($kern.arglist_full, const char* impl_name) void ${kern.name}_manual(${kern.arglist_full}, const char* impl_name)
{ {
const int index = volk_gnsssdr_get_index( const int index = volk_gnsssdr_get_index(
get_machine()->$(kern.name)_impl_names, get_machine()->${kern.name}_impl_names,
get_machine()->$(kern.name)_n_impls, get_machine()->${kern.name}_n_impls,
impl_name impl_name
); );
get_machine()->$(kern.name)_impls[index]( get_machine()->${kern.name}_impls[index](
$kern.arglist_names ${kern.arglist_names}
); );
} }
volk_gnsssdr_func_desc_t $(kern.name)_get_func_desc(void) { volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void) {
const char **impl_names = get_machine()->$(kern.name)_impl_names; const char **impl_names = get_machine()->${kern.name}_impl_names;
const int *impl_deps = get_machine()->$(kern.name)_impl_deps; const int *impl_deps = get_machine()->${kern.name}_impl_deps;
const bool *alignment = get_machine()->$(kern.name)_impl_alignment; const bool *alignment = get_machine()->${kern.name}_impl_alignment;
const size_t n_impls = get_machine()->$(kern.name)_n_impls; const size_t n_impls = get_machine()->${kern.name}_n_impls;
volk_gnsssdr_func_desc_t desc = { volk_gnsssdr_func_desc_t desc = {
impl_names, impl_names,
impl_deps, impl_deps,
@ -206,4 +204,4 @@ volk_gnsssdr_func_desc_t $(kern.name)_get_func_desc(void) {
return desc; return desc;
} }
#end for %endfor

View File

@ -68,23 +68,23 @@ VOLK_API size_t volk_gnsssdr_get_alignment(void);
*/ */
VOLK_API bool volk_gnsssdr_is_aligned(const void *ptr); VOLK_API bool volk_gnsssdr_is_aligned(const void *ptr);
#for $kern in $kernels %for kern in kernels:
//! A function pointer to the dispatcher implementation //! A function pointer to the dispatcher implementation
extern VOLK_API $kern.pname $kern.name; extern VOLK_API ${kern.pname} ${kern.name};
//! A function pointer to the fastest aligned implementation //! A function pointer to the fastest aligned implementation
extern VOLK_API $kern.pname $(kern.name)_a; extern VOLK_API ${kern.pname} ${kern.name}_a;
//! A function pointer to the fastest unaligned implementation //! A function pointer to the fastest unaligned implementation
extern VOLK_API $kern.pname $(kern.name)_u; extern VOLK_API ${kern.pname} ${kern.name}_u;
//! Call into a specific implementation given by name //! Call into a specific implementation given by name
extern VOLK_API void $(kern.name)_manual($kern.arglist_full, const char* impl_name); extern VOLK_API void ${kern.name}_manual(${kern.arglist_full}, const char* impl_name);
//! Get description paramaters for this kernel //! Get description paramaters for this kernel
extern VOLK_API volk_gnsssdr_func_desc_t $(kern.name)_get_func_desc(void); extern VOLK_API volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void);
#end for %endfor
__VOLK_DECL_END __VOLK_DECL_END

View File

@ -19,10 +19,10 @@
#ifndef INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H #ifndef INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H
#define INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H #define INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H
#for $i, $arch in enumerate($archs) %for i, arch in enumerate(archs):
#ifndef LV_$(arch.name.upper()) //#ifndef LV_${arch.name.upper()}
#define LV_$(arch.name.upper()) $i #define LV_${arch.name.upper()} ${i}
#endif //#endif
#end for %endfor
#endif /*INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED*/ #endif /*INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED*/

View File

@ -147,15 +147,14 @@ static int has_neon(void){
#endif #endif
} }
#for $arch in $archs %for arch in archs:
static int i_can_has_$arch.name (void) { static int i_can_has_${arch.name} (void) {
#for $check, $params in $arch.checks %for check, params in arch.checks:
if ($(check)($(', '.join($params))) == 0) return 0; if (${check}(<% joined_params = ', '.join(params)%>${joined_params}) == 0) return 0;
#end for %endfor
return 1; return 1;
} }
%endfor
#end for
#if defined(HAVE_FENV_H) #if defined(HAVE_FENV_H)
#if defined(FE_TONEAREST) #if defined(FE_TONEAREST)
@ -182,17 +181,17 @@ static int i_can_has_$arch.name (void) {
#endif #endif
void volk_gnsssdr_cpu_init() { void volk_gnsssdr_cpu_init() {
#for $arch in $archs %for arch in archs:
volk_gnsssdr_cpu.has_$arch.name = &i_can_has_$arch.name; volk_gnsssdr_cpu.has_${arch.name} = &i_can_has_${arch.name};
#end for %endfor
set_float_rounding(); set_float_rounding();
} }
unsigned int volk_gnsssdr_get_lvarch() { unsigned int volk_gnsssdr_get_lvarch() {
unsigned int retval = 0; unsigned int retval = 0;
volk_gnsssdr_cpu_init(); volk_gnsssdr_cpu_init();
#for $arch in $archs %for arch in archs:
retval += volk_gnsssdr_cpu.has_$(arch.name)() << LV_$(arch.name.upper()); retval += volk_gnsssdr_cpu.has_${arch.name}() << LV_${arch.name.upper()};
#end for %endfor
return retval; return retval;
} }

View File

@ -24,9 +24,9 @@
__VOLK_DECL_BEGIN __VOLK_DECL_BEGIN
struct VOLK_CPU { struct VOLK_CPU {
#for $arch in $archs %for arch in archs:
int (*has_$arch.name) (); int (*has_${arch.name}) ();
#end for %endfor
}; };
extern struct VOLK_CPU volk_gnsssdr_cpu; extern struct VOLK_CPU volk_gnsssdr_cpu;

View File

@ -16,12 +16,12 @@
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*/ */
#set $this_machine = $machine_dict[$args[0]] <% this_machine = machine_dict[args[0]] %>
#set $arch_names = $this_machine.arch_names <% arch_names = this_machine.arch_names %>
#for $arch in $this_machine.archs %for arch in this_machine.archs:
#define LV_HAVE_$(arch.name.upper()) 1 #define LV_HAVE_${arch.name.upper()} 1
#end for %endfor
#include <volk_gnsssdr/volk_gnsssdr_common.h> #include <volk_gnsssdr/volk_gnsssdr_common.h>
#include "volk_gnsssdr_machines.h" #include "volk_gnsssdr_machines.h"
@ -31,46 +31,28 @@
#include "config.h" #include "config.h"
#endif #endif
#for $kern in $kernels %for kern in kernels:
#include <volk_gnsssdr/$(kern.name).h> #include <volk_gnsssdr/${kern.name}.h>
#end for %endfor
######################################################################## struct volk_gnsssdr_machine volk_gnsssdr_machine_${this_machine.name} = {
#def make_arch_have_list($archs) <% make_arch_have_list = (' | '.join(['(1 << LV_%s)'%a.name.upper() for a in this_machine.archs])) %> ${make_arch_have_list},
$(' | '.join(['(1 << LV_%s)'%a.name.upper() for a in $archs]))#slurp <% this_machine_name = "\""+this_machine.name+"\"" %> ${this_machine_name},
#end def ${this_machine.alignment},
##//list all kernels
######################################################################## %for kern in kernels:
#def make_impl_name_list($impls) <% impls = kern.get_impls(arch_names) %>
{$(', '.join(['"%s"'%i.name for i in $impls]))}#slurp ##//kernel name
#end def <% kern_name = "\""+kern.name+"\"" %> ${kern_name},
##//list of kernel implementations by name
######################################################################## <% make_impl_name_list = "{"+', '.join(['"%s"'%i.name for i in impls])+"}" %> ${make_impl_name_list},
#def make_impl_align_list($impls) ##//list of arch dependencies per implementation
{$(', '.join(['true' if i.is_aligned else 'false' for i in $impls]))}#slurp <% make_impl_deps_list = "{"+', '.join([' | '.join(['(1 << LV_%s)'%d.upper() for d in i.deps]) for i in impls])+"}" %> ${make_impl_deps_list},
#end def ##//alignment required? for each implementation
<% make_impl_align_list = "{"+', '.join(['true' if i.is_aligned else 'false' for i in impls])+"}" %> ${make_impl_align_list},
######################################################################## ##//pointer to each implementation
#def make_impl_deps_list($impls) <% make_impl_fcn_list = "{"+', '.join(['%s_%s'%(kern.name, i.name) for i in impls])+"}" %> ${make_impl_fcn_list},
{$(', '.join([' | '.join(['(1 << LV_%s)'%d.upper() for d in i.deps]) for i in $impls]))}#slurp ##//number of implementations listed here
#end def <% len_impls = len(impls) %> ${len_impls},
%endfor
########################################################################
#def make_impl_fcn_list($name, $impls)
{$(', '.join(['%s_%s'%($name, i.name) for i in $impls]))}#slurp
#end def
struct volk_gnsssdr_machine volk_gnsssdr_machine_$(this_machine.name) = {
$make_arch_have_list($this_machine.archs),
"$this_machine.name",
$this_machine.alignment,
#for $kern in $kernels
#set $impls = $kern.get_impls($arch_names)
"$kern.name", ##//kernel name
$make_impl_name_list($impls), ##//list of kernel implementations by name
$make_impl_deps_list($impls), ##//list of arch dependencies per implementation
$make_impl_align_list($impls), ##//alignment required? for each implementation
$make_impl_fcn_list($kern.name, $impls), ##//pointer to each implementation
$(len($impls)), ##//number of implementations listed here
#end for
}; };

View File

@ -21,11 +21,11 @@
#include "volk_gnsssdr_machines.h" #include "volk_gnsssdr_machines.h"
struct volk_gnsssdr_machine *volk_gnsssdr_machines[] = { struct volk_gnsssdr_machine *volk_gnsssdr_machines[] = {
#for $machine in $machines %for machine in machines:
#ifdef LV_MACHINE_$(machine.name.upper()) #ifdef LV_MACHINE_${machine.name.upper()}
&volk_gnsssdr_machine_$(machine.name), &volk_gnsssdr_machine_${machine.name},
#endif #endif
#end for %endfor
}; };
unsigned int n_volk_gnsssdr_machines = sizeof(volk_gnsssdr_machines)/sizeof(*volk_gnsssdr_machines); unsigned int n_volk_gnsssdr_machines = sizeof(volk_gnsssdr_machines)/sizeof(*volk_gnsssdr_machines);

View File

@ -31,21 +31,21 @@ struct volk_gnsssdr_machine {
const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format) const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format)
const char *name; const char *name;
const size_t alignment; //the maximum byte alignment required for functions in this library const size_t alignment; //the maximum byte alignment required for functions in this library
#for $kern in $kernels %for kern in kernels:
const char *$(kern.name)_name; const char *${kern.name}_name;
const char *$(kern.name)_impl_names[$(len($archs))]; const char *${kern.name}_impl_names[<%len_archs=len(archs)%>${len_archs}];
const int $(kern.name)_impl_deps[$(len($archs))]; const int ${kern.name}_impl_deps[${len_archs}];
const bool $(kern.name)_impl_alignment[$(len($archs))]; const bool ${kern.name}_impl_alignment[${len_archs}];
const $(kern.pname) $(kern.name)_impls[$(len($archs))]; const ${kern.pname} ${kern.name}_impls[${len_archs}];
const size_t $(kern.name)_n_impls; const size_t ${kern.name}_n_impls;
#end for %endfor
}; };
#for $machine in $machines %for machine in machines:
#ifdef LV_MACHINE_$(machine.name.upper()) #ifdef LV_MACHINE_${machine.name.upper()}
extern struct volk_gnsssdr_machine volk_gnsssdr_machine_$(machine.name); extern struct volk_gnsssdr_machine volk_gnsssdr_machine_${machine.name};
#endif #endif
#end for %endfor
__VOLK_DECL_END __VOLK_DECL_END

View File

@ -22,8 +22,8 @@
#include <inttypes.h> #include <inttypes.h>
#include <volk_gnsssdr/volk_gnsssdr_complex.h> #include <volk_gnsssdr/volk_gnsssdr_complex.h>
#for $kern in $kernels %for kern in kernels:
typedef void (*$(kern.pname))($kern.arglist_types); typedef void (*${kern.pname})(${kern.arglist_types});
#end for %endfor
#endif /*INCLUDED_VOLK_GNSSSDR_TYPEDEFS*/ #endif /*INCLUDED_VOLK_GNSSSDR_TYPEDEFS*/