From 31311aef7c4602a4118aa0d7eb154720fd969fc0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 6 Nov 2017 23:53:05 +0100 Subject: [PATCH 01/19] Add pull request template --- docs/PULL_REQUEST_TEMPLATE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/PULL_REQUEST_TEMPLATE.md diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..b4e04e2c1 --- /dev/null +++ b/docs/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +:+1::tada: Hello, and thanks for contributing to [GNSS-SDR](http://gnss-sdr.org)! :tada::+1: + +Before submitting your pull request, please make sure the following is done: + 1. You undertake the [Contributor Covenant Code of Conduct](https://github.com/gnss-sdr/gnss-sdr/blob/master/CODE_OF_CONDUCT.md). + 2. If you are a first-time contributor, after your pull request you will be asked to sign an Individual Contributor License Agreement ([CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement)) before your code gets accepted into `master`. This license is for your protection as a Contributor as well as for the protection of [CTTC](http://www.cttc.es/); it does not change your rights to use your own contributions for any other purpose. Except for the license granted therein to CTTC and recipients of software distributed by CTTC, you reserve all right, title, and interest in and to your contributions. The information you provide in that CLA will be maintained in accordance with [CTTC's privacy policy](http://www.cttc.es/privacy/). + 3. You have read the [Contributing Guidelines](https://github.com/gnss-sdr/gnss-sdr/blob/master/CONTRIBUTING.md). + 4. You have read the [coding style guide](http://gnss-sdr.org/coding-style/). + 5. You have forked the [gnss-sdr upstream repository](https://github.com/gnss-sdr/gnss-sdr) and have created your branch from `next` (or any other currently living branch in the upstream repository). + 6. Please include a description of your changes here. + +**Please feel free to delete this line and the above text once you have read it and in case you want to go on with your pull request.** \ No newline at end of file From 0c2df93794777ae00f5bb5b610d8c6c12a53f59d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 8 Jun 2018 13:43:50 +0200 Subject: [PATCH 02/19] Bump version number to 0.0.10 --- CMakeLists.txt | 6 +++--- docs/changelog | 4 ++-- docs/manpage/gnss-sdr-manpage | 2 +- .../volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt | 2 +- .../cmake/Packaging/volk_gnsssdr-config-info-manpage | 12 ++++++------ .../cmake/Packaging/volk_gnsssdr_profile-manpage | 2 +- src/main/main.cc | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ccce85891..2d3643227 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,7 @@ endif(ENABLE_FPGA) ############################### # GNSS-SDR version information ############################### -set(THIS_IS_A_RELEASE OFF) # only related to version name, no further implications. +set(THIS_IS_A_RELEASE ON) # only related to version name, no further implications. if(NOT ${THIS_IS_A_RELEASE}) # Get the current working branch execute_process( @@ -115,9 +115,9 @@ endif(NOT ${THIS_IS_A_RELEASE}) set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_API_COMPAT 0) if(${THIS_IS_A_RELEASE}) - set(VERSION_INFO_MINOR_VERSION 9) + set(VERSION_INFO_MINOR_VERSION 10) else(${THIS_IS_A_RELEASE}) - set(VERSION_INFO_MINOR_VERSION 9.git-${GIT_BRANCH}-${GIT_COMMIT_HASH}) + set(VERSION_INFO_MINOR_VERSION 10.git-${GIT_BRANCH}-${GIT_COMMIT_HASH}) endif(${THIS_IS_A_RELEASE}) set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_INFO_MINOR_VERSION}) diff --git a/docs/changelog b/docs/changelog index 7c8d1918e..83c8111a8 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,6 @@ -## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) +## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) -Next release will have several improvements in different dimensions, addition of new features and bug fixes: +This release has several improvements in different dimensions, addition of new features and bug fixes: ### Improvements in Accuracy: diff --git a/docs/manpage/gnss-sdr-manpage b/docs/manpage/gnss-sdr-manpage index 5ca98ccb7..aa5440903 100644 --- a/docs/manpage/gnss-sdr-manpage +++ b/docs/manpage/gnss-sdr-manpage @@ -1,6 +1,6 @@ .\" Manpage for gnss\-sdr. .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH gnss\-sdr 1 "24 Feb 2018" "0.0.9" "gnss\-sdr man page" +.TH gnss\-sdr 1 "14 Jun 2018" "0.0.10" "gnss\-sdr man page" .SH NAME \fBgnss\-sdr\fR \- GNSS Software Defined Receiver. .SH SYNOPSIS diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 017132296..13a2ee40c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -135,7 +135,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_MINOR_VERSION 0) -set(VERSION_INFO_MAINT_VERSION 9.git) +set(VERSION_INFO_MAINT_VERSION 10) include(VolkVersion) #setup version info diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage index 48de3376a..0d8c0f212 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage @@ -1,14 +1,14 @@ -.\" Manpage for volk_gnsssdr-config-info +.\" Manpage for volk_gnsssdr\-config\-info .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH volk_gnsssdr_profile 1 "06 Feb 2017" "0.0.9" "volk_gnsssdr-config-info man page" +.TH volk_gnsssdr\-config\-info 1 "14 Jun 2018" "0.0.10" "volk_gnsssdr\-config\-info man page" .SH NAME -\fBvolk_gnsssdr-config-info\fR \- Prints configuration information of libvolk_gnsssdr functions. +\fBvolk_gnsssdr\-config\-info\fR \- Prints configuration information of libvolk_gnsssdr functions. .SH SYNOPSIS -\fBvolk_gnsssdr-config-info\fR [OPTION] +\fBvolk_gnsssdr\-config\-info\fR [OPTION] .SH DESCRIPTION -This program prints configuration information for the Vector-Optimized Library of Kernels of GNSS-SDR (VOLK_GNSSSDR). +This program prints configuration information for the Vector\-Optimized Library of Kernels of GNSS\-SDR (VOLK_GNSSSDR). .SH OPTIONS -\fBvolk_gnsssdr-config-info\fR takes the following options: +\fBvolk_gnsssdr\-config\-info\fR takes the following options: .TP \fB-h\fR [ \fB--help\fR ] Print help message. .TP diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage index 186bcb9c9..154e78f39 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage @@ -1,6 +1,6 @@ .\" Manpage for volk_gnsssdr_profile .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH volk_gnsssdr_profile 1 "06 Feb 2017" "0.0.9" "volk_gnsssdr_profile man page" +.TH volk_gnsssdr_profile 1 "14 Jun 2018" "0.0.10" "volk_gnsssdr_profile man page" .SH NAME \fBvolk_gnsssdr_profile\fR \- Profiler application for libvolk_gnsssdr functions. .SH SYNOPSIS diff --git a/src/main/main.cc b/src/main/main.cc index d64f9bab6..ef12d5410 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -32,7 +32,7 @@ */ #ifndef GNSS_SDR_VERSION -#define GNSS_SDR_VERSION "0.0.9" +#define GNSS_SDR_VERSION "0.0.10" #endif #ifndef GOOGLE_STRIP_LOG From b094d7317a7908f6ec5eaf9c7e56dff2fcf713e0 Mon Sep 17 00:00:00 2001 From: Marc L Date: Mon, 27 Aug 2018 17:50:13 -0400 Subject: [PATCH 03/19] Update MANIFEST.md fixed dependencies list so it parses nicely on cgran.org --- MANIFEST.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MANIFEST.md b/MANIFEST.md index 1248e47aa..4c1d394f2 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -11,7 +11,12 @@ author: - et altri (see AUTHORS file for a list of contributors) copyright_owner: - The Authors -dependencies: gnuradio (>= 3.7.3), armadillo, gflags, glog, gnutls +dependencies: + - gnuradio (>= 3.7.3) + - armadillo + - gflags + - glog + - gnutls license: GPLv3+ repo: https://github.com/gnss-sdr/gnss-sdr website: http://gnss-sdr.org From ee551937140623ca17796e4d1ce8fbd1ebed98f4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 28 Aug 2018 20:34:46 +0200 Subject: [PATCH 04/19] Update URLs --- MANIFEST.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MANIFEST.md b/MANIFEST.md index 4c1d394f2..487b88be4 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -19,13 +19,13 @@ dependencies: - gnutls license: GPLv3+ repo: https://github.com/gnss-sdr/gnss-sdr -website: http://gnss-sdr.org -icon: http://a.fsdn.com/con/app/proj/gnss-sdr/screenshots/logo400x400.jpg +website: https://gnss-sdr.org +icon: https://gnss-sdr.org/assets/images/logo400x400.jpg --- Global Navigation Satellite Systems receiver defined by software. It performs all the signal processing from raw signal samples up to the computation of the Position-Velocity-Time solution, including code and phase observables. It is able to work with raw data files or, if there is computational power enough, in real time with suitable radiofrequency front-ends. This software is mainly developed at [CTTC](http://www.cttc.es "Centre Tecnologic de Telecomunicacions de Catalunya") -with contributions from around the world. More info at [gnss-sdr.org](http://gnss-sdr.org "GNSS-SDR's Homepage"). +with contributions from around the world. More info at [gnss-sdr.org](https://gnss-sdr.org "GNSS-SDR's Homepage"). From ddc5f6fcf4bad611e77ae4b4da17c74d068363f3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 9 Dec 2018 01:06:27 +0100 Subject: [PATCH 05/19] Merge --- cmake/Modules/FindGFLAGS.cmake | 111 +++++++++++ cmake/Modules/FindGFORTRAN.cmake | 256 +++++++++++++------------- cmake/Modules/FindGLOG.cmake | 103 ++++++----- cmake/Modules/FindGNSSSIMULATOR.cmake | 30 +++ cmake/Modules/FindGNURADIO.cmake | 202 ++++++++++++++++++++ cmake/Modules/FindGPERFTOOLS.cmake | 87 +++++++++ cmake/Modules/FindGPSTK.cmake | 42 +++-- cmake/Modules/FindGRDBFCTTC.cmake | 56 ++++++ cmake/Modules/FindGRGN3S.cmake | 56 ++++++ cmake/Modules/FindGRIIO.cmake | 72 ++++++++ cmake/Modules/FindGROSMOSDR.cmake | 92 +++++++++ cmake/Modules/FindLIBIIO.cmake | 76 ++++++++ cmake/Modules/FindLIBOSMOSDR.cmake | 80 ++++++++ cmake/Modules/FindLOG4CPP.cmake | 92 +++++++++ cmake/Modules/FindMATIO.cmake | 94 +++++----- cmake/Modules/FindOPENBLAS.cmake | 49 +++++ cmake/Modules/FindOPENCL.cmake | 110 +++++++++++ cmake/Modules/FindORC.cmake | 95 +++++----- cmake/Modules/FindPCAP.cmake | 107 +++++------ cmake/Modules/FindPUGIXML.cmake | 75 ++++++++ cmake/Modules/FindTELEORBIT.cmake | 50 +++++ cmake/Modules/FindUHD.cmake | 26 +-- cmake/Modules/FindVOLK.cmake | 76 ++++++++ cmake/Modules/FindVOLKGNSSSDR.cmake | 53 ++++++ cmake/Modules/GnsssdrBuildTypes.cmake | 219 ++++++++++++++++++++++ cmake/Modules/SetupPython.cmake | 152 ++++++++------- cmake/Modules/TestForARM.cmake | 39 ++-- cmake/Modules/TestForSSE.cmake | 19 +- 28 files changed, 2084 insertions(+), 435 deletions(-) create mode 100644 cmake/Modules/FindGFLAGS.cmake create mode 100644 cmake/Modules/FindGNSSSIMULATOR.cmake create mode 100644 cmake/Modules/FindGNURADIO.cmake create mode 100644 cmake/Modules/FindGPERFTOOLS.cmake create mode 100644 cmake/Modules/FindGRDBFCTTC.cmake create mode 100644 cmake/Modules/FindGRGN3S.cmake create mode 100644 cmake/Modules/FindGRIIO.cmake create mode 100644 cmake/Modules/FindGROSMOSDR.cmake create mode 100644 cmake/Modules/FindLIBIIO.cmake create mode 100644 cmake/Modules/FindLIBOSMOSDR.cmake create mode 100644 cmake/Modules/FindLOG4CPP.cmake create mode 100644 cmake/Modules/FindOPENBLAS.cmake create mode 100644 cmake/Modules/FindOPENCL.cmake create mode 100644 cmake/Modules/FindPUGIXML.cmake create mode 100644 cmake/Modules/FindTELEORBIT.cmake create mode 100644 cmake/Modules/FindVOLK.cmake create mode 100644 cmake/Modules/FindVOLKGNSSSDR.cmake create mode 100644 cmake/Modules/GnsssdrBuildTypes.cmake diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake new file mode 100644 index 000000000..31739e216 --- /dev/null +++ b/cmake/Modules/FindGFLAGS.cmake @@ -0,0 +1,111 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find GFlags +# +# The following CMake and environment variables are optionally searched +# for defaults: +# GFLAGS_ROOT: Base directory where all GFlags components are found +# +# The following are set after configuration is done: +# GFlags_FOUND +# GFlags_INCLUDE_DIRS +# GFlags_LIBS +# GFlags_LIBRARY_DIRS + +if(APPLE) + find_path(GFlags_ROOT_DIR + libgflags.dylib + PATHS + /opt/local/lib + /usr/local/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ) +else() + find_path(GFlags_ROOT_DIR + libgflags.so + HINTS + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ${GFLAGS_ROOT}/lib64 + $ENV{GFLAGS_ROOT}/lib64 + ) +endif() + +if(GFlags_ROOT_DIR) + # We are testing only a couple of files in the include directories + find_path(GFlags_INCLUDE_DIRS + gflags/gflags.h + HINTS + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ${GFLAGS_ROOT}/include + $ENV{GFLAGS_ROOT}/include + ) + + # Find the libraries + set(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) + + find_library(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) + if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) + set(GFLAGS_GREATER_20 TRUE) + else() + set(GFLAGS_GREATER_20 FALSE) + endif() + # set up include and link directory + include_directories(${GFlags_INCLUDE_DIRS}) + link_directories(${GFlags_LIBRARY_DIRS}) + message(STATUS "gflags library found at ${GFlags_lib}") + set(GFlags_LIBS ${GFlags_lib}) + set(GFlags_FOUND true) + mark_as_advanced(GFlags_INCLUDE_DIRS) +else() + message(STATUS "Cannot find gflags") + set(GFlags_FOUND false) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index eec7a4265..f19ccd77a 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -15,126 +15,136 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . - find_library(GFORTRAN NAMES gfortran - PATHS /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib/i386 - /usr/lib/gcc/x86_64-linux-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/i386-linux-gnu - /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 - /usr/lib/gcc/i686-linux-gnu/4.6 - /usr/lib/gcc/x86_64-linux-gnu/4.7 - /usr/lib/gcc/i686-linux-gnu/4.7 - /usr/lib/gcc/x86_64-linux-gnu/4.8 - /usr/lib/gcc/i686-linux-gnu/4.8 - /usr/lib/gcc/x86_64-linux-gnu/4.9 - /usr/lib/gcc/i686-linux-gnu/4.9 - /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 - /usr/lib/gcc/i686-redhat-linux/4.7.2 - /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 - /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 - /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 - /usr/lib/gcc/i686-redhat-linux/4.8.1 - /usr/lib/gcc/i686-redhat-linux/4.8.3 - /usr/lib/gcc/i686-redhat-linux/4.9.1 - /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 - /usr/lib/gcc/i686-redhat-linux/4.4.4 - /usr/lib/gcc/x86_64-redhat-linux/4.8.2 - /usr/lib/gcc/i686-redhat-linux/4.8.2 - /usr/lib/gcc/x86_64-redhat-linux/7 - /usr/lib/gcc/i686-redhat-linux/7 - /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 - /usr/lib/gcc/aarch64-redhat-linux/7 - /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 - /usr/lib/gcc/i586-suse-linux/4.9 - /usr/lib/gcc/x86_64-suse-linux/4.8 - /usr/lib/gcc/x86_64-suse-linux/4.9 - /usr/lib/gcc/i486-linux-gnu # Debian 7 - /usr/lib/gcc/i486-linux-gnu/4.4 - /usr/lib/gcc/i486-linux-gnu/4.6 - /usr/lib/gcc/i486-linux-gnu/4.7 - /usr/lib/gcc/i486-linux-gnu/4.8 - /usr/lib/gcc/i486-linux-gnu/4.9 - /usr/lib/gcc/i586-linux-gnu/4.9 - /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf - /usr/lib/gcc/arm-linux-gnueabihf/4.5 - /usr/lib/gcc/arm-linux-gnueabihf/4.6 - /usr/lib/gcc/arm-linux-gnueabihf/4.7 - /usr/lib/gcc/arm-linux-gnueabihf/4.8 - /usr/lib/gcc/arm-linux-gnueabihf/4.9 - /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 - /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel - /usr/lib/gcc/arm-linux-gnueabi/4.9 - /usr/lib/gcc/x86_64-linux-gnu/5 - /usr/lib/gcc/i686-linux-gnu/5 - /usr/lib/gcc/arm-linux-gnueabi/5 - /usr/lib/gcc/arm-linux-gnueabihf/5 - /usr/lib/gcc/aarch64-linux-gnu/5 - /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 - /usr/lib/gcc/alpha-linux-gnu/6 - /usr/lib/gcc/aarch64-linux-gnu/6 - /usr/lib/gcc/arm-linux-gnueabi/6 - /usr/lib/gcc/arm-linux-gnueabihf/6 - /usr/lib/gcc/hppa-linux-gnu/6 - /usr/lib/gcc/i686-gnu/6 - /usr/lib/gcc/i686-linux-gnu/6 - /usr/lib/gcc/x86_64-kfreebsd-gnu/6 - /usr/lib/gcc/i686-kfreebsd-gnu/6 - /usr/lib/gcc/m68k-linux-gnu/6 - /usr/lib/gcc/mips-linux-gnu/6 - /usr/lib/gcc/mips64el-linux-gnuabi64/6 - /usr/lib/gcc/mipsel-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnu/6 - /usr/lib/gcc/powerpc-linux-gnuspe/6 - /usr/lib/gcc/powerpc64-linux-gnu/6 - /usr/lib/gcc/powerpc64le-linux-gnu/6 - /usr/lib/gcc/s390x-linux-gnu/6 - /usr/lib/gcc/sparc64-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnux32/6 - /usr/lib/gcc/sh4-linux-gnu/6 - /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster - /usr/lib/gcc/alpha-linux-gnu/7 - /usr/lib/gcc/aarch64-linux-gnu/7 - /usr/lib/gcc/arm-linux-gnueabi/7 - /usr/lib/gcc/arm-linux-gnueabihf/7 - /usr/lib/gcc/hppa-linux-gnu/7 - /usr/lib/gcc/i686-gnu/7 - /usr/lib/gcc/i686-linux-gnu/7 - /usr/lib/gcc/x86_64-kfreebsd-gnu/7 - /usr/lib/gcc/i686-kfreebsd-gnu/7 - /usr/lib/gcc/m68k-linux-gnu/7 - /usr/lib/gcc/mips-linux-gnu/7 - /usr/lib/gcc/mips64el-linux-gnuabi64/7 - /usr/lib/gcc/mipsel-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnu/7 - /usr/lib/gcc/powerpc-linux-gnuspe/7 - /usr/lib/gcc/powerpc64-linux-gnu/7 - /usr/lib/gcc/powerpc64le-linux-gnu/7 - /usr/lib/gcc/s390x-linux-gnu/7 - /usr/lib/gcc/sparc64-linux-gnu/7 - /usr/lib/gcc/x86_64-linux-gnux32/7 - /usr/lib/gcc/sh4-linux-gnu/7 - /usr/lib/x86_64-linux-gnu # libgfortran4 - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabi - /usr/lib/arm-linux-gnueabihf - /usr/lib/aarch64-linux-gnu - /usr/lib/i386-gnu - /usr/lib/x86_64-kfreebsd-gnu - /usr/lib/i386-kfreebsd-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/mipsel-linux-gnu - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib/sh4-linux-gnu - /usr/lib/sparc64-linux-gnu - /usr/lib/x86_64-linux-gnux32 - /usr/lib/alpha-linux-gnu - ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN) \ No newline at end of file +find_library(GFORTRAN NAMES gfortran + PATHS /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib/i386 + /usr/lib/gcc/x86_64-linux-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/i386-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 + /usr/lib/gcc/i686-linux-gnu/4.6 + /usr/lib/gcc/x86_64-linux-gnu/4.7 + /usr/lib/gcc/i686-linux-gnu/4.7 + /usr/lib/gcc/x86_64-linux-gnu/4.8 + /usr/lib/gcc/i686-linux-gnu/4.8 + /usr/lib/gcc/x86_64-linux-gnu/4.9 + /usr/lib/gcc/i686-linux-gnu/4.9 + /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 + /usr/lib/gcc/i686-redhat-linux/4.7.2 + /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 + /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 + /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 + /usr/lib/gcc/i686-redhat-linux/4.8.1 + /usr/lib/gcc/i686-redhat-linux/4.8.3 + /usr/lib/gcc/i686-redhat-linux/4.9.1 + /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 + /usr/lib/gcc/i686-redhat-linux/4.4.4 + /usr/lib/gcc/x86_64-redhat-linux/4.8.2 + /usr/lib/gcc/i686-redhat-linux/4.8.2 + /usr/lib/gcc/x86_64-redhat-linux/7 + /usr/lib/gcc/i686-redhat-linux/7 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 + /usr/lib/gcc/aarch64-redhat-linux/7 + /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 + /usr/lib/gcc/i586-suse-linux/4.9 + /usr/lib/gcc/x86_64-suse-linux/4.8 + /usr/lib/gcc/x86_64-suse-linux/4.9 + /usr/lib/gcc/i486-linux-gnu # Debian 7 + /usr/lib/gcc/i486-linux-gnu/4.4 + /usr/lib/gcc/i486-linux-gnu/4.6 + /usr/lib/gcc/i486-linux-gnu/4.7 + /usr/lib/gcc/i486-linux-gnu/4.8 + /usr/lib/gcc/i486-linux-gnu/4.9 + /usr/lib/gcc/i586-linux-gnu/4.9 + /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf + /usr/lib/gcc/arm-linux-gnueabihf/4.5 + /usr/lib/gcc/arm-linux-gnueabihf/4.6 + /usr/lib/gcc/arm-linux-gnueabihf/4.7 + /usr/lib/gcc/arm-linux-gnueabihf/4.8 + /usr/lib/gcc/arm-linux-gnueabihf/4.9 + /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 + /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel + /usr/lib/gcc/arm-linux-gnueabi/4.9 + /usr/lib/gcc/x86_64-linux-gnu/5 + /usr/lib/gcc/i686-linux-gnu/5 + /usr/lib/gcc/arm-linux-gnueabi/5 + /usr/lib/gcc/arm-linux-gnueabihf/5 + /usr/lib/gcc/aarch64-linux-gnu/5 + /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 + /usr/lib/gcc/alpha-linux-gnu/6 + /usr/lib/gcc/aarch64-linux-gnu/6 + /usr/lib/gcc/arm-linux-gnueabi/6 + /usr/lib/gcc/arm-linux-gnueabihf/6 + /usr/lib/gcc/hppa-linux-gnu/6 + /usr/lib/gcc/i686-gnu/6 + /usr/lib/gcc/i686-linux-gnu/6 + /usr/lib/gcc/x86_64-kfreebsd-gnu/6 + /usr/lib/gcc/i686-kfreebsd-gnu/6 + /usr/lib/gcc/m68k-linux-gnu/6 + /usr/lib/gcc/mips-linux-gnu/6 + /usr/lib/gcc/mips64el-linux-gnuabi64/6 + /usr/lib/gcc/mipsel-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnuspe/6 + /usr/lib/gcc/powerpc64-linux-gnu/6 + /usr/lib/gcc/powerpc64le-linux-gnu/6 + /usr/lib/gcc/s390x-linux-gnu/6 + /usr/lib/gcc/sparc64-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnux32/6 + /usr/lib/gcc/sh4-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster + /usr/lib/gcc/alpha-linux-gnu/7 + /usr/lib/gcc/aarch64-linux-gnu/7 + /usr/lib/gcc/arm-linux-gnueabi/7 + /usr/lib/gcc/arm-linux-gnueabihf/7 + /usr/lib/gcc/hppa-linux-gnu/7 + /usr/lib/gcc/i686-gnu/7 + /usr/lib/gcc/i686-linux-gnu/7 + /usr/lib/gcc/x86_64-kfreebsd-gnu/7 + /usr/lib/gcc/i686-kfreebsd-gnu/7 + /usr/lib/gcc/m68k-linux-gnu/7 + /usr/lib/gcc/mips-linux-gnu/7 + /usr/lib/gcc/mips64el-linux-gnuabi64/7 + /usr/lib/gcc/mipsel-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnuspe/7 + /usr/lib/gcc/powerpc64-linux-gnu/7 + /usr/lib/gcc/powerpc64le-linux-gnu/7 + /usr/lib/gcc/s390x-linux-gnu/7 + /usr/lib/gcc/sparc64-linux-gnu/7 + /usr/lib/gcc/x86_64-linux-gnux32/7 + /usr/lib/gcc/sh4-linux-gnu/7 + /usr/lib/x86_64-linux-gnu # libgfortran4 + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/aarch64-linux-gnu + /usr/lib/i386-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran8 + /usr/lib/gcc/aarch64-linux-gnu/8 + /usr/lib/gcc/arm-linux-gnueabihf/8 + /usr/lib/gcc/i686-linux-gnu/8 + /usr/lib/gcc/powerpc64le-linux-gnu/8 + /usr/lib/gcc/s390x-linux-gnu/8 + /usr/lib/gcc/alpha-linux-gnu/8 + ${GFORTRAN_ROOT}/lib + $ENV{GFORTRAN_ROOT}/lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 7c50d8805..2d8f154f3 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -28,20 +28,20 @@ # GLOG_ROOT - Can be set to Glog install path or Windows build path # -if (NOT DEFINED GLOG_ROOT) - set (GLOG_ROOT /usr /usr/local) -endif (NOT DEFINED GLOG_ROOT) +if(NOT DEFINED GLOG_ROOT) + set(GLOG_ROOT /usr /usr/local) +endif() if(MSVC) - set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) -else(MSVC) - set (LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) -endif(MSVC) + set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) +else() + set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) +endif() macro(_FIND_GLOG_LIBRARIES _var) - find_library(${_var} - NAMES ${ARGN} - PATHS ${LIB_PATHS} + find_library(${_var} + NAMES ${ARGN} + PATHS ${LIB_PATHS} /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -68,48 +68,52 @@ macro(_FIND_GLOG_LIBRARIES _var) /usr/lib/alpha-linux-gnu /usr/lib64 /usr/lib + ${GLOG_ROOT}/lib + $ENV{GLOG_ROOT}/lib + ${GLOG_ROOT}/lib64 + $ENV{GLOG_ROOT}/lib64 PATH_SUFFIXES lib ) - mark_as_advanced(${_var}) + mark_as_advanced(${_var}) endmacro() macro(_GLOG_APPEND_LIBRARIES _list _release) set(_debug ${_release}_DEBUG) if(${_debug}) - set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}}) + set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}}) else() - set(${_list} ${${_list}} ${${_release}}) + set(${_list} ${${_list}} ${${_release}}) endif() endmacro() if(MSVC) - find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h - PATHS - ${GLOG_ROOT}/src/windows - ${GLOG_ROOT}/src/windows/glog - ) -else(MSVC) - # Linux/OS X builds - find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h - PATHS - ${GLOG_ROOT}/include/glog - /usr/include/glog - /opt/local/include/glog # default location in Macports - ) -endif(MSVC) + find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h + PATHS + ${GLOG_ROOT}/src/windows + ${GLOG_ROOT}/src/windows/glog + ) +else() + # Linux/OS X builds + find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h + PATHS + ${GLOG_ROOT}/include/glog + /usr/include/glog + /opt/local/include/glog # default location in Macports + ) +endif() # Find the libraries if(MSVC) - _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.lib) -else(MSVC) - # Linux/OS X builds - if(UNIX) - _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.so) - endif(UNIX) - if(APPLE) - _FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.dylib) - endif(APPLE) -endif(MSVC) + _find_glog_libraries(GLOG_LIBRARIES libglog.lib) +else() + # Linux/OS X builds + if(UNIX) + _find_glog_libraries(GLOG_LIBRARIES libglog.so) + endif() + if(APPLE) + _find_glog_libraries(GLOG_LIBRARIES libglog.dylib) + endif() +endif() if(GLOG_FOUND) message(STATUS "glog library found at ${GLOG_LIBRARIES}") @@ -117,21 +121,20 @@ endif() # handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if # all listed variables are TRUE -include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake") -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glog DEFAULT_MSG - GLOG_LIBRARIES) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES) if(MSVC) - string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) - string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) - set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") - string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) -else(MSVC) - # Linux/OS X builds - set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) - string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) -endif(MSVC) + string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) + string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) + set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") + string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) +else() + # Linux/OS X builds + set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) + string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) +endif() if(GLOG_FOUND) - # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) + # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) endif() diff --git a/cmake/Modules/FindGNSSSIMULATOR.cmake b/cmake/Modules/FindGNSSSIMULATOR.cmake new file mode 100644 index 000000000..66aa9176a --- /dev/null +++ b/cmake/Modules/FindGNSSSIMULATOR.cmake @@ -0,0 +1,30 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +find_program(SW_GENERATOR_BIN gnss_sim + PATHS /usr/bin + /usr/local/bin + /opt/local/bin + ${CMAKE_INSTALL_PREFIX}/bin + ${GNSSSIMULATOR_ROOT}/bin + $ENV{GNSSSIMULATOR_ROOT}/bin + PATH_SUFFIXES bin +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) +mark_as_advanced(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake new file mode 100644 index 000000000..7f5deb3ab --- /dev/null +++ b/cmake/Modules/FindGNURADIO.cmake @@ -0,0 +1,202 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GNU Radio +######################################################################## + +include(FindPkgConfig) +include(FindPackageHandleStandardArgs) + +# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list +if(NOT GR_REQUIRED_COMPONENTS) + set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD) +endif() + +# Allows us to use all .cmake files in this directory +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) + +# Easily access all libraries and includes of GNU Radio +set(GNURADIO_ALL_LIBRARIES "") +set(GNURADIO_ALL_INCLUDE_DIRS "") + +macro(LIST_CONTAINS var value) + set(${var}) + foreach(value2 ${ARGN}) + if(${value} STREQUAL ${value2}) + set(${var} TRUE) + endif() + endforeach() +endmacro() + +function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) + list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) + if(NOT REQUIRED_MODULE) + #message("Ignoring GNU Radio Module ${EXTVAR}") + return() + endif() + + message(STATUS "Checking for GNU Radio Module: ${EXTVAR}") + + # check for .pc hints + pkg_check_modules(PC_GNURADIO_${EXTVAR} ${PCNAME}) + + if(NOT PC_GNURADIO_${EXTVAR}_FOUND) + set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE}) + endif() + + set(INCVAR_NAME "GNURADIO_${EXTVAR}_INCLUDE_DIRS") + set(LIBVAR_NAME "GNURADIO_${EXTVAR}_LIBRARIES") + set(PC_INCDIR ${PC_GNURADIO_${EXTVAR}_INCLUDEDIR}) + set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) + + # look for include files + find_path(${INCVAR_NAME} + NAMES ${INCFILE} + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${PC_INCDIR} + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include + ) + + # look for libs + foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) + find_library(${LIBVAR_NAME}_${libname} + NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} + HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_INSTALL_PREFIX}/lib64 + PATHS /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_ROOT}/lib + $ENV{GNURADIO_ROOT}/lib + ${GNURADIO_ROOT}/lib64 + $ENV{GNURADIO_ROOT}/lib64 + ) + list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) + endforeach() + + set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE) + + # show results + message(STATUS " * INCLUDES=${GNURADIO_${EXTVAR}_INCLUDE_DIRS}") + message(STATUS " * LIBS=${GNURADIO_${EXTVAR}_LIBRARIES}") + + # append to all includes and libs list + set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE) + set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_${EXTVAR}_LIBRARIES} PARENT_SCOPE) + + find_package_handle_standard_args(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) + message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}") + set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE) + + # generate an error if the module is missing + if(NOT GNURADIO_${EXTVAR}_FOUND) + message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") + endif() + + mark_as_advanced(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) +endfunction() + +gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) +gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) +gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) +gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) +gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) +gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) +gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) +gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) +gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) +gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) +gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) +gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) +gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) +gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) +gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) +gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) +gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) +gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) +gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) + +list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS) +list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) + +# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present +if(NOT PC_GNURADIO_RUNTIME_VERSION) + find_file(GNURADIO_VERSION_GREATER_THAN_373 + NAMES gnuradio/blocks/tsb_vector_sink_f.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include + ) + if(GNURADIO_VERSION_GREATER_THAN_373) + set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") + endif() + + find_file(GNURADIO_VERSION_GREATER_THAN_38 + NAMES gnuradio/filter/mmse_resampler_cc.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include + ) + if(GNURADIO_VERSION_GREATER_THAN_38) + set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") + endif() +endif() diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake new file mode 100644 index 000000000..67dfff8af --- /dev/null +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -0,0 +1,87 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find Gperftools. +# +# Usage of this module as follows: +# +# find_package(GPERFTOOLS) +# +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# GPERFTOOLS_ROOT Set this variable to the root installation of +# Gperftools if the module has problems finding +# the proper installation path. +# +# Variables defined by this module: +# +# GPERFTOOLS_FOUND System has Gperftools libs/headers +# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler) +# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers + +find_library(GPERFTOOLS_TCMALLOC + NAMES tcmalloc + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_library(GPERFTOOLS_PROFILER + NAMES profiler + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER + NAMES tcmalloc_and_profiler + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_path(GPERFTOOLS_INCLUDE_DIR + NAMES gperftools/heap-profiler.h + HINTS ${Gperftools_ROOT_DIR}/include + ${GPERFTOOLS_ROOT}/include + $ENV{GPERFTOOLS_ROOT}/include +) + +set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + GPERFTOOLS + DEFAULT_MSG + GPERFTOOLS_LIBRARIES + GPERFTOOLS_INCLUDE_DIR +) + +mark_as_advanced( + Gperftools_ROOT_DIR + GPERFTOOLS_TCMALLOC + GPERFTOOLS_PROFILER + GPERFTOOLS_TCMALLOC_AND_PROFILER + GPERFTOOLS_LIBRARIES + GPERFTOOLS_INCLUDE_DIR) diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index 515878d5a..f5ecb667e 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -19,29 +19,31 @@ # Find the native gpstk includes and library # This module defines # GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc. -# GPSTK_LIBRARIES, libraries to link against to use GPSTK. # GPSTK_FOUND, If false, do not try to use GPSTK. -# also defined, but not for general use are # GPSTK_LIBRARY, where to find the GPSTK library. -FIND_PATH(GPSTK_INCLUDE_DIR Rinex3ObsBase.hpp - HINTS /usr/include/gpstk - /usr/local/include/gpstk - /opt/local/include/gpstk ) +find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp + HINTS /usr/include + /usr/local/include + /opt/local/include + ${GPSTK_ROOT}/include + $ENV{GPSTK_ROOT}/include +) -SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) -FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} - HINTS /usr/lib - /usr/local/lib - /opt/local/lib ) +set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) -# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if +find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} + HINTS /usr/lib + /usr/local/lib + /opt/local/lib + ${GPSTK_ROOT}/lib + $ENV{GPSTK_ROOT}/lib + ${GPSTK_ROOT}/lib64 + $ENV{GPSTK_ROOT}/lib64 +) + +# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) - -IF(GPSTK_FOUND) - SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} ) -ENDIF(GPSTK_FOUND) - -MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) +mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR) diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake new file mode 100644 index 000000000..e0689aeaf --- /dev/null +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GR-DBFCTTC Module +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc) + +find_path( + GR_DBFCTTC_INCLUDE_DIRS + NAMES dbfcttc/api.h + HINTS $ENV{GR_DBFCTTC_DIR}/include + ${PC_GR_DBFCTTC_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/include + /usr/local/include + ${GRDBFCTTC_ROOT}/include + $ENV{GRDBFCTTC_ROOT}/include +) + +find_library( + GR_DBFCTTC_LIBRARIES + NAMES gnuradio-dbfcttc + HINTS $ENV{GR_DBFCTTC_DIR}/lib + ${PC_GR_DBFCTTC_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + ${GRDBFCTTC_ROOT}/lib + $ENV{GRDBFCTTC_ROOT}/lib + ${GRDBFCTTC_ROOT}/lib64 + $ENV{GRDBFCTTC_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) +mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake new file mode 100644 index 000000000..93f7bda89 --- /dev/null +++ b/cmake/Modules/FindGRGN3S.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GR-GN3S Module +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_GR_GN3S gr-gn3s) + +find_path( + GR_GN3S_INCLUDE_DIRS + NAMES gn3s/gn3s_api.h + HINTS $ENV{GR_GN3S_DIR}/include + ${PC_GR_GN3S_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${GRGN3S_ROOT}/include + $ENV{GRGN3S_ROOT}/include +) + +find_library( + GR_GN3S_LIBRARIES + NAMES gr-gn3s + HINTS $ENV{GR_GN3S_DIR}/lib + ${PC_GR_GN3S_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${GRGN3S_ROOT}/lib + $ENV{GRGN3S_ROOT}/lib + ${GRGN3S_ROOT}/lib64 + $ENV{GRGN3S_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) +mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake new file mode 100644 index 000000000..6d341e7fd --- /dev/null +++ b/cmake/Modules/FindGRIIO.cmake @@ -0,0 +1,72 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_IIO gnuradio-iio) + +find_path(IIO_INCLUDE_DIRS + NAMES gnuradio/iio/api.h + HINTS $ENV{IIO_DIR}/include + ${PC_IIO_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${GRIIO_ROOT}/include + $ENV{GRIIO_ROOT}/include +) + +find_library(IIO_LIBRARIES + NAMES gnuradio-iio + HINTS $ENV{IIO_DIR}/lib + ${PC_IIO_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu + ${GRIIO_ROOT}/lib + $ENV{GRIIO_ROOT}/lib + ${GRIIO_ROOT}/lib64 + $ENV{GRIIO_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) +mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake new file mode 100644 index 000000000..48379ed76 --- /dev/null +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -0,0 +1,92 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find gr-osmosdr. +# +# Usage of this module as follows: +# +# find_package(GROSMOSDR) +# +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# GrOsmoSDR_ROOT_DIR Set this variable to the root installation of +# gr-osmosdr if the module has problems finding +# the proper installation path. +# +# Variables defined by this module: +# +# GROSMOSDR_FOUND System has gr-osmosdr libs/headers +# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) +# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers + +include(FindPkgConfig) +pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) + +find_path(GROSMOSDR_INCLUDE_DIR + NAMES + osmosdr/source.h + osmosdr/api.h + PATHS + ${GROSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + /opt/local/include + ${GROSMOSDR_ROOT}/include + $ENV{GROSMOSDR_ROOT}/include +) + +find_library(GROSMOSDR_LIBRARIES + NAMES gnuradio-osmosdr + PATHS + ${GROSMOSDR_PKG_LIBRARY_DIRS} + /usr/lib + /usr/local/lib + /opt/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${GROSMOSDR_ROOT}/lib + $ENV{GROSMOSDR_ROOT}/lib + ${GROSMOSDR_ROOT}/lib64 + $ENV{GROSMOSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) +mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake new file mode 100644 index 000000000..a76180ca2 --- /dev/null +++ b/cmake/Modules/FindLIBIIO.cmake @@ -0,0 +1,76 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_LIBIIO libiio) + +find_path( + LIBIIO_INCLUDE_DIRS + NAMES iio.h + HINTS $ENV{LIBIIO_DIR}/include + ${PC_LIBIIO_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + /opt/local/include + ${LIBIIO_ROOT}/include + $ENV{LIBIIO_ROOT}/include +) + +find_library( + LIBIIO_LIBRARIES + NAMES iio libiio.so.0 + HINTS $ENV{LIBIIO_DIR}/lib + ${PC_LIBIIO_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu + /Library/Frameworks/iio.framework/ + ${LIBIIO_ROOT}/lib + $ENV{LIBIIO_ROOT}/lib + ${LIBIIO_ROOT}/lib64 + $ENV{LIBIIO_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) +mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake new file mode 100644 index 000000000..1e3aaf5e0 --- /dev/null +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -0,0 +1,80 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find libosmosdr. +# +# Usage of this module as follows: +# +# find_package(LIBOSMOSDR) +# +# +# Variables defined by this module: +# +# LIBOSMOSDR_FOUND System has libosmosdr libs/headers +# LIBOSMOSDR_LIBRARIES The libosmosdr libraries +# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers + +include(FindPkgConfig) +pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) + +find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h + PATHS + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + ${LIBOSMOSDR_ROOT}/include + $ENV{LIBOSMOSDR_ROOT}/include +) + +find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr + PATHS + ${LIBOSMOSDR_PKG_LIBRARY_DIRS} + /usr/lib + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${LIBOSMOSDR_ROOT}/lib + $ENV{LIBOSMOSDR_ROOT}/lib + ${LIBOSMOSDR_ROOT}/lib64 + $ENV{LIBOSMOSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) +mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake new file mode 100644 index 000000000..283c3ddf9 --- /dev/null +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -0,0 +1,92 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Find Log4cpp +# Find the native LOG4CPP includes and library +# +# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. +# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. +# LOG4CPP_FOUND - True if LOG4CPP found. + + +if(LOG4CPP_INCLUDE_DIR) + # Already in cache, be silent + set(LOG4CPP_FIND_QUIETLY TRUE) +endif() + +find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh + /opt/local/include + /usr/local/include + /usr/include + ${LOG4CPP_ROOT}/include + $ENV{LOG4CPP_ROOT}/include +) + +set(LOG4CPP_NAMES log4cpp) +find_library(LOG4CPP_LIBRARY + NAMES ${LOG4CPP_NAMES} + HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib/ + PATHS /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + /usr/local/lib + /opt/local/lib + ${LOG4CPP_ROOT}/lib + $ENV{LOG4CPP_ROOT}/lib + ${LOG4CPP_ROOT}/lib64 + $ENV{LOG4CPP_ROOT}/lib64 +) + +if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) + set(LOG4CPP_FOUND TRUE) + set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE) +else() + set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index 2bac55ede..08facf069 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -21,30 +21,30 @@ # # Once done this will define: # -# MATIO_FOUND - True if MATIO found. -# MATIO_LIBRARIES - MATIO libraries. +# MATIO_FOUND - True if MATIO found. +# MATIO_LIBRARIES - MATIO libraries. # MATIO_INCLUDE_DIRS - where to find matio.h, etc.. # MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") -# +# #============================================================================= # Copyright 2015 Avtech Scientific -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: -# +# # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. -# +# # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# +# # * Neither the names of Kitware, Inc., the Insight Software Consortium, # nor the names of their contributors may be used to endorse or promote # products derived from this software without specific prior written # permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -60,58 +60,70 @@ # # Look for the header file. -find_path(MATIO_INCLUDE_DIR NAMES matio.h DOC "The MATIO include directory") +find_path(MATIO_INCLUDE_DIR + NAMES matio.h + HINTS + ${MATIO_ROOT}/include + $ENV{MATIO_ROOT}/include + DOC "The MATIO include directory" +) # Look for the library. -find_library(MATIO_LIBRARY NAMES matio DOC "The MATIO library") +find_library(MATIO_LIBRARY + NAMES matio + HINTS + ${MATIO_ROOT}/lib + $ENV{MATIO_ROOT}/lib + ${MATIO_ROOT}/lib64 + $ENV{MATIO_ROOT}/lib64 + DOC "The MATIO library" +) if(MATIO_INCLUDE_DIR) - # --------------------------------------------------- - # Extract version information from MATIO - # --------------------------------------------------- + # --------------------------------------------------- + # Extract version information from MATIO + # --------------------------------------------------- - # If the file is missing, set all values to 0 - set(MATIO_MAJOR_VERSION 0) - set(MATIO_MINOR_VERSION 0) - set(MATIO_RELEASE_LEVEL 0) + # If the file is missing, set all values to 0 + set(MATIO_MAJOR_VERSION 0) + set(MATIO_MINOR_VERSION 0) + set(MATIO_RELEASE_LEVEL 0) - # new versions of MATIO have `matio_pubconf.h` - if(EXISTS ${MATIO_INCLUDE_DIR}/matio_pubconf.h) - set(MATIO_CONFIG_FILE "matio_pubconf.h") - else() - set(MATIO_CONFIG_FILE "matioConfig.h") - endif() + # new versions of MATIO have `matio_pubconf.h` + if(EXISTS ${MATIO_INCLUDE_DIR}/matio_pubconf.h) + set(MATIO_CONFIG_FILE "matio_pubconf.h") + else() + set(MATIO_CONFIG_FILE "matioConfig.h") + endif() - if(MATIO_CONFIG_FILE) + if(MATIO_CONFIG_FILE) - # Read and parse MATIO config header file for version number - file(STRINGS "${MATIO_INCLUDE_DIR}/${MATIO_CONFIG_FILE}" _matio_HEADER_CONTENTS REGEX "#define MATIO_((MAJOR|MINOR)_VERSION)|(RELEASE_LEVEL) ") + # Read and parse MATIO config header file for version number + file(STRINGS "${MATIO_INCLUDE_DIR}/${MATIO_CONFIG_FILE}" _matio_HEADER_CONTENTS REGEX "#define MATIO_((MAJOR|MINOR)_VERSION)|(RELEASE_LEVEL) ") - foreach(line ${_matio_HEADER_CONTENTS}) - if(line MATCHES "#define ([A-Z_]+) ([0-9]+)") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() + foreach(line ${_matio_HEADER_CONTENTS}) + if(line MATCHES "#define ([A-Z_]+) ([0-9]+)") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() - unset(_matio_HEADER_CONTENTS) - endif() + unset(_matio_HEADER_CONTENTS) + endif() - set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") -endif () - -#================== + set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") +endif() mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) -# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if +# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) +find_package_handle_standard_args(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) if(MATIO_FOUND) set(MATIO_LIBRARIES ${MATIO_LIBRARY}) set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR}) -else(MATIO_FOUND) +else() set(MATIO_LIBRARIES) set(MATIO_INCLUDE_DIRS) -endif(MATIO_FOUND) \ No newline at end of file +endif() diff --git a/cmake/Modules/FindOPENBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake new file mode 100644 index 000000000..8ff70d65f --- /dev/null +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -0,0 +1,49 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find OpenBLAS library (not headers!) +# +# The following environment variable is optionally searched +# OPENBLAS_HOME: Base directory where all OpenBlas components are found + +set(OPEN_BLAS_SEARCH_PATHS + /lib + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib + ${OPENBLAS_ROOT}/lib + $ENV{OPENBLAS_ROOT}/lib + ${OPENBLAS_ROOT}/lib64 + $ENV{OPENBLAS_ROOT}/lib64 +) + +find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) + +if(OPENBLAS) + set(OPENBLAS_FOUND ON) + message(STATUS "Found OpenBLAS") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS) +mark_as_advanced(OPENBLAS) diff --git a/cmake/Modules/FindOPENCL.cmake b/cmake/Modules/FindOPENCL.cmake new file mode 100644 index 000000000..988360c29 --- /dev/null +++ b/cmake/Modules/FindOPENCL.cmake @@ -0,0 +1,110 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# +# This file taken from FindOpenCL project @ http://gitorious.com/findopencl +# +# - Try to find OpenCL +# This module tries to find an OpenCL implementation on your system. It supports +# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. +# +# Once done this will define +# OPENCL_FOUND - system has OpenCL +# OPENCL_INCLUDE_DIRS - the OpenCL include directory +# OPENCL_LIBRARIES - link these to use OpenCL +# +# WIN32 should work, but is untested + +include(FindPackageHandleStandardArgs) + +set(OPENCL_VERSION_STRING "0.1.0") +set(OPENCL_VERSION_MAJOR 0) +set(OPENCL_VERSION_MINOR 1) +set(OPENCL_VERSION_PATCH 0) + +if(APPLE) + find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") + find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") + find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") + +else() + if(WIN32) + find_path(OPENCL_INCLUDE_DIRS CL/cl.h) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) + + # The AMD SDK currently installs both x86 and x86_64 libraries + # This is only a hack to find out architecture + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") + else() + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") + endif() + + # find out if the user asked for a 64-bit build, and use the corresponding + # 64 or 32 bit NVIDIA library paths to the search: + string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) + if("${ISWIN64}" STREQUAL "Win64") + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) + else() + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) + endif() + + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # On Win32 search relative to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + + else() + # Unix style platforms + find_library(OPENCL_LIBRARIES OpenCL + ENV LD_LIBRARY_PATH + ) + + get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # The AMD SDK currently does not place its headers + # in /usr/include, therefore also search relative + # to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + endif() +endif() + +find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS) + +if(_OPENCL_CPP_INCLUDE_DIRS) + set(OPENCL_HAS_CPP_BINDINGS TRUE) + list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS}) + # This is often the same, so clean up + list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS) +endif() + +mark_as_advanced( + OPENCL_INCLUDE_DIRS +) + +if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES) + set( OPENCL_FOUND TRUE ) + add_definitions( -DOPENCL=1 ) +else() + set( OPENCL_FOUND FALSE ) + add_definitions( -DOPENCL=0 ) +endif() diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 2751494ba..fea12b98f 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -15,52 +15,61 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") +find_package(PkgConfig) +pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") -FIND_PROGRAM(ORCC_EXECUTABLE orcc - HINTS ${PC_ORC_TOOLSDIR} - PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) - -FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h - HINTS ${PC_ORC_INCLUDEDIR} - PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) - - -FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} - HINTS ${PC_ORC_LIBDIR} - /usr/local/lib - /usr/lib/x86_64-linux-gnu - /usr/lib/i386-linux-gnu - /usr/lib/arm-linux-gnueabihf - /usr/lib/arm-linux-gnueabi - /usr/lib/aarch64-linux-gnu - /usr/lib/mipsel-linux-gnu - /usr/lib/mips-linux-gnu - /usr/lib/mips64el-linux-gnuabi64 - /usr/lib/powerpc-linux-gnu - /usr/lib/powerpc64-linux-gnu - /usr/lib/powerpc64le-linux-gnu - /usr/lib/hppa-linux-gnu - /usr/lib/s390x-linux-gnu - /usr/lib64 - /usr/lib - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -FIND_LIBRARY(ORC_LIB orc-0.4 - HINTS ${PC_ORC_LIBRARY_DIRS} - PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - -LIST(APPEND ORC_LIBRARY - ${ORC_LIB} +find_program(ORCC_EXECUTABLE orcc + HINTS ${PC_ORC_TOOLSDIR} + PATHS ${ORC_ROOT}/bin + ${CMAKE_INSTALL_PREFIX}/bin ) +find_path(ORC_INCLUDE_DIR + NAMES orc/orc.h + HINTS ${PC_ORC_INCLUDEDIR} + PATHS ${ORC_ROOT}/include/orc-0.4 + ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 +) -SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) -SET(ORC_LIBRARIES ${ORC_LIBRARY}) -SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} + HINTS ${PC_ORC_LIBDIR} + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + ${ORC_ROOT}/lib + $ENV{ORC_ROOT}/lib + PATHS + ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) +find_library(ORC_LIB orc-0.4 + HINTS ${PC_ORC_LIBRARY_DIRS} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) -mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) \ No newline at end of file +list(APPEND ORC_LIBRARY ${ORC_LIB}) + +set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) +set(ORC_LIBRARIES ${ORC_LIBRARY}) +set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) + +mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index 3be89420e..af746c852 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -37,85 +37,86 @@ # Find the PCAP includes and library # http://www.tcpdump.org/ # -# The environment variable PCAPDIR allows to specficy where to find +# The environment variable PCAPDIR allows to specficy where to find # libpcap in non standard location. -# +# # PCAP_INCLUDE_DIRS - where to find pcap.h, etc. # PCAP_LIBRARIES - List of libraries when using pcap. # PCAP_FOUND - True if pcap found. -IF(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR +if(EXISTS $ENV{PCAPDIR}) + find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include NO_DEFAULT_PATH ) - - FIND_LIBRARY(PCAP_LIBRARY - NAMES + find_library(PCAP_LIBRARY + NAMES pcap PATHS $ENV{PCAPDIR} + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib NO_DEFAULT_PATH ) - - -ELSE(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR +else() + find_path(PCAP_INCLUDE_DIR NAMES - pcap/pcap.h - pcap.h + pcap/pcap.h + pcap.h + HINTS + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include ) - - FIND_LIBRARY(PCAP_LIBRARY - NAMES + find_library(PCAP_LIBRARY + NAMES pcap + HINTS + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib ) - -ENDIF(EXISTS $ENV{PCAPDIR}) +endif() -SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) -SET(PCAP_LIBRARIES ${PCAP_LIBRARY}) +set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) +set(PCAP_LIBRARIES ${PCAP_LIBRARY}) -IF(PCAP_INCLUDE_DIRS) - MESSAGE(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") -ELSE(PCAP_INCLUDE_DIRS) - MESSAGE(FATAL " Pcap include dirs cannot be found") -ENDIF(PCAP_INCLUDE_DIRS) +if(PCAP_INCLUDE_DIRS) + message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") +else() + message(FATAL " Pcap include dirs cannot be found") +endif() -IF(PCAP_LIBRARIES) - MESSAGE(STATUS "Pcap library set to ${PCAP_LIBRARIES}") -ELSE(PCAP_LIBRARIES) - MESSAGE(FATAL "Pcap library cannot be found") -ENDIF(PCAP_LIBRARIES) +if(PCAP_LIBRARIES) + message(STATUS "Pcap library set to ${PCAP_LIBRARIES}") +else() + message(FATAL "Pcap library cannot be found") +endif() #Functions -INCLUDE(CheckFunctionExists) -SET(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) -SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) -CHECK_FUNCTION_EXISTS("pcap_breakloop" HAVE_PCAP_BREAKLOOP) -CHECK_FUNCTION_EXISTS("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) -CHECK_FUNCTION_EXISTS("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) -CHECK_FUNCTION_EXISTS("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) -CHECK_FUNCTION_EXISTS("pcap_freecode" HAVE_PCAP_FREECODE) -CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) -CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION) -CHECK_FUNCTION_EXISTS("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) -CHECK_FUNCTION_EXISTS("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) -CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) +include(CheckFunctionExists) +set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) +set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) +check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP) +check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) +check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) +check_function_exists("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) +check_function_exists("pcap_freecode" HAVE_PCAP_FREECODE) +check_function_exists("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) +check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION) +check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) +check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) +check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) - -#Is pcap found ? -IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) - SET( PCAP_FOUND true ) -ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) - - -MARK_AS_ADVANCED( +mark_as_advanced( PCAP_LIBRARIES PCAP_INCLUDE_DIRS ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake new file mode 100644 index 000000000..236a4c95a --- /dev/null +++ b/cmake/Modules/FindPUGIXML.cmake @@ -0,0 +1,75 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Find the pugixml XML parsing library. +# +# Sets the usual variables expected for find_package scripts: +# +# PUGIXML_INCLUDE_DIR - header location +# PUGIXML_LIBRARIES - library to link against +# PUGIXML_FOUND - true if pugixml was found. + +find_path(PUGIXML_INCLUDE_DIR + NAMES pugixml.hpp + PATHS ${PUGIXML_HOME}/include + /usr/include + /usr/local/include + /opt/local/include + ${PUGIXML_ROOT}/include + $ENV{PUGIXML_ROOT}/include +) + +find_library(PUGIXML_LIBRARY + NAMES pugixml + PATHS ${PUGIXML_HOME}/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib + /usr/lib64 + /usr/local/lib64 + ${PUGIXML_ROOT}/lib + $ENV{PUGIXML_ROOT}/lib + ${PUGIXML_ROOT}/lib64 + $ENV{PUGIXML_ROOT}/lib64 +) + +# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_LIBRARY + PUGIXML_INCLUDE_DIR) + +if(PUGIXML_FOUND) + set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY}) + if(NOT PUGIXML_FIND_QUIETLY) + message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") + message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}") + endif() +else() + message(STATUS "PugiXML not found.") +endif() + +mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake new file mode 100644 index 000000000..eb2420687 --- /dev/null +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -0,0 +1,50 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_TELEORBIT teleorbit) + +find_path(TELEORBIT_INCLUDE_DIRS + NAMES teleorbit/api.h + HINTS $ENV{TELEORBIT_DIR}/include + ${PC_TELEORBIT_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${TELEORBIT_ROOT}/include + $ENV{TELEORBIT_ROOT}/include +) + +find_library(TELEORBIT_LIBRARIES + NAMES gnuradio-teleorbit + HINTS $ENV{TELEORBIT_DIR}/lib + ${PC_TELEORBIT_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${TELEORBIT_ROOT}/lib + $ENV{TELEORBIT_ROOT}/lib + ${TELEORBIT_ROOT}/lib64 + $ENV{TELEORBIT_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) +mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 3a245f8a2..31d299937 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -19,24 +19,24 @@ # Find the library for the USRP Hardware Driver ######################################################################## -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_UHD uhd) +include(FindPkgConfig) +pkg_check_modules(PC_UHD uhd) -FIND_PATH( - UHD_INCLUDE_DIRS +find_path(UHD_INCLUDE_DIRS NAMES uhd/config.hpp HINTS $ENV{UHD_DIR}/include - ${PC_UHD_INCLUDEDIR} + ${PC_UHD_INCLUDEDIR} PATHS /usr/local/include /usr/include ${GNURADIO_INSTALL_PREFIX}/include + ${UHD_ROOT}/include + $ENV{UHD_ROOT}/include ) -FIND_LIBRARY( - UHD_LIBRARIES +find_library(UHD_LIBRARIES NAMES uhd HINTS $ENV{UHD_DIR}/lib - ${PC_UHD_LIBDIR} + ${PC_UHD_LIBDIR} PATHS /usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu @@ -64,8 +64,12 @@ FIND_LIBRARY( /usr/lib64 /usr/lib ${GNURADIO_INSTALL_PREFIX}/lib + ${UHD_ROOT}/lib + $ENV{UHD_ROOT}/lib + ${UHD_ROOT}/lib64 + $ENV{UHD_ROOT}/lib64 ) -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) -MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) +mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake new file mode 100644 index 000000000..97191179c --- /dev/null +++ b/cmake/Modules/FindVOLK.cmake @@ -0,0 +1,76 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find VOLK (Vector-Optimized Library of Kernels) +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_VOLK volk) + +find_path(VOLK_INCLUDE_DIRS + NAMES volk/volk.h + HINTS $ENV{VOLK_DIR}/include + ${PC_VOLK_INCLUDEDIR} + PATHS /usr/local/include + /usr/include + ${CMAKE_INSTALL_PREFIX}/include + ${VOLK_ROOT}/include + $ENV{VOLK_ROOT}/include +) + +find_library(VOLK_LIBRARIES + NAMES volk + HINTS $ENV{VOLK_DIR}/lib + ${PC_VOLK_LIBDIR} + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${CMAKE_INSTALL_PREFIX}/lib + ${VOLK_ROOT}/lib + $ENV{VOLK_ROOT}/lib + ${VOLK_ROOT}/lib64 + $ENV{VOLK_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) +mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake new file mode 100644 index 000000000..5cdc4e61d --- /dev/null +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -0,0 +1,53 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) + +find_path(VOLK_GNSSSDR_INCLUDE_DIRS + NAMES volk_gnsssdr/volk_gnsssdr.h + HINTS $ENV{VOLK_GNSSSDR_DIR}/include + ${PC_VOLK_GNSSSDR_INCLUDEDIR} + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${VOLKGNSSSDR_ROOT}/include + $ENV{VOLKGNSSSDR_ROOT}/include +) + +find_library(VOLK_GNSSSDR_LIBRARIES + NAMES volk_gnsssdr + HINTS $ENV{VOLK_GNSSSDR_DIR}/lib + ${PC_VOLK_GNSSSDR_LIBDIR} + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${VOLKGNSSSDR_ROOT}/lib + $ENV{VOLKGNSSSDR_ROOT}/lib + ${VOLKGNSSSDR_ROOT}/lib64 + $ENV{VOLKGNSSSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) diff --git a/cmake/Modules/GnsssdrBuildTypes.cmake b/cmake/Modules/GnsssdrBuildTypes.cmake new file mode 100644 index 000000000..a80cd0c6b --- /dev/null +++ b/cmake/Modules/GnsssdrBuildTypes.cmake @@ -0,0 +1,219 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +if(DEFINED __INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE) + return() +endif() +set(__INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE TRUE) + +# Standard CMake Build Types and their basic CFLAGS: +# - None: nothing set +# - Debug: -O2 -g +# - Release: -O3 +# - RelWithDebInfo: -O3 -g +# - MinSizeRel: -Os + +# Additional Build Types, defined below: +# - NoOptWithASM: -O0 -g -save-temps +# - O2WithASM: -O2 -g -save-temps +# - O3WithASM: -O3 -g -save-temps + +# Defines the list of acceptable cmake build types. When adding a new +# build type below, make sure to add it to this list. +list(APPEND AVAIL_BUILDTYPES + None Debug Release RelWithDebInfo MinSizeRel + Coverage NoOptWithASM O2WithASM O3WithASM ASAN +) + +######################################################################## +# GNSSSDR_CHECK_BUILD_TYPE(build type) +# +# Use this to check that the build type set in CMAKE_BUILD_TYPE on the +# commandline is one of the valid build types used by this project. It +# checks the value set in the cmake interface against the list of +# known build types in AVAIL_BUILDTYPES. If the build type is found, +# the function exits immediately. If nothing is found by the end of +# checking all available build types, we exit with an error and list +# the avialable build types. +######################################################################## +function(GNSSSDR_CHECK_BUILD_TYPE settype) + string(TOUPPER ${settype} _settype) + foreach(btype ${AVAIL_BUILDTYPES}) + string(TOUPPER ${btype} _btype) + if(${_settype} STREQUAL ${_btype}) + return() # found it; exit cleanly + endif() + endforeach() + # Build type not found; error out + message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") +endfunction() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=Coverage +# +# This type uses no optimization (-O0), outputs debug symbols (-g) and +# outputs all intermediary files the build system produces, including +# all assembly (.s) files. Look in the build directory for these +# files. +# NOTE: This is not defined on Windows systems. +######################################################################## +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING + "Flags used by the C++ compiler during Coverage builds." FORCE) + set(CMAKE_C_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING + "Flags used by the C compiler during Coverage builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_COVERAGE + "-W" CACHE STRING + "Flags used for linking binaries during Coverage builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE + "-W" CACHE STRING + "Flags used by the shared lib linker during Coverage builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_COVERAGE + CMAKE_C_FLAGS_COVERAGE + CMAKE_EXE_LINKER_FLAGS_COVERAGE + CMAKE_SHARED_LINKER_FLAGS_COVERAGE) +endif() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=NoOptWithASM +# +# This type uses no optimization (-O0), outputs debug symbols (-g) and +# outputs all intermediary files the build system produces, including +# all assembly (.s) files. Look in the build directory for these +# files. +# NOTE: This is not defined on Windows systems. +######################################################################## +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING + "Flags used by the C++ compiler during NoOptWithASM builds." FORCE) + set(CMAKE_C_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING + "Flags used by the C compiler during NoOptWithASM builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM + "-W" CACHE STRING + "Flags used for linking binaries during NoOptWithASM builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM + "-W" CACHE STRING + "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_NOOPTWITHASM + CMAKE_C_FLAGS_NOOPTWITHASM + CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM + CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) +endif() + + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=O2WithASM +# +# This type uses level 2 optimization (-O2), outputs debug symbols +# (-g) and outputs all intermediary files the build system produces, +# including all assembly (.s) files. Look in the build directory for +# these files. +# NOTE: This is not defined on Windows systems. +######################################################################## + +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING + "Flags used by the C++ compiler during O2WithASM builds." FORCE) + set(CMAKE_C_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING + "Flags used by the C compiler during O2WithASM builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM + "-W" CACHE STRING + "Flags used for linking binaries during O2WithASM builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM + "-W" CACHE STRING + "Flags used by the shared lib linker during O2WithASM builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_O2WITHASM + CMAKE_C_FLAGS_O2WITHASM + CMAKE_EXE_LINKER_FLAGS_O2WITHASM + CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) +endif() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=O3WithASM +# +# This type uses level 3 optimization (-O3), outputs debug symbols +# (-g) and outputs all intermediary files the build system produces, +# including all assembly (.s) files. Look in the build directory for +# these files. +# NOTE: This is not defined on Windows systems. +######################################################################## + +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING + "Flags used by the C++ compiler during O3WithASM builds." FORCE) + set(CMAKE_C_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING + "Flags used by the C compiler during O3WithASM builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM + "-W" CACHE STRING + "Flags used for linking binaries during O3WithASM builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM + "-W" CACHE STRING + "Flags used by the shared lib linker during O3WithASM builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_O3WITHASM + CMAKE_C_FLAGS_O3WITHASM + CMAKE_EXE_LINKER_FLAGS_O3WITHASM + CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) +endif() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=ASAN +# +# This type creates an address sanitized build (-fsanitize=address) +# and defaults to the DebugParanoid linker flags. +# NOTE: This is not defined on Windows systems. +######################################################################## +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + "Flags used by the C++ compiler during Address Sanitized builds." FORCE) + set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + "Flags used by the C compiler during Address Sanitized builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_ASAN + "-W" CACHE STRING + "Flags used for linking binaries during Address Sanitized builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_ASAN + "-W" CACHE STRING + "Flags used by the shared lib linker during Address Sanitized builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_ASAN + CMAKE_C_FLAGS_ASAN + CMAKE_EXE_LINKER_FLAGS_ASAN + CMAKE_SHARED_LINKER_ASAN) +endif() diff --git a/cmake/Modules/SetupPython.cmake b/cmake/Modules/SetupPython.cmake index eb4e7a55d..f3d59c900 100644 --- a/cmake/Modules/SetupPython.cmake +++ b/cmake/Modules/SetupPython.cmake @@ -15,54 +15,6 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -######################################################################## -# 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: @@ -71,25 +23,97 @@ endif(PYTHON_EXECUTABLE) # - 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}") +macro(GNSSSDR_PYTHON_CHECK_MODULE_RAW desc python_code have) execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c " -######################################### -try: import ${mod} -except: - try: ${mod} - except: exit(-1) -try: assert ${cmd} -except: exit(-1) -#########################################" - RESULT_VARIABLE ${have} + COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}" + OUTPUT_QUIET ERROR_QUIET + RESULT_VARIABLE return_code ) - if(${have} EQUAL 0) + if(return_code EQUAL 0) message(STATUS "Python checking for ${desc} - found") set(${have} TRUE) - else(${have} EQUAL 0) + else() message(STATUS "Python checking for ${desc} - not found") set(${have} FALSE) - endif(${have} EQUAL 0) -endmacro(GNSSSDR_PYTHON_CHECK_MODULE) + endif() +endmacro() + +macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have) + gnsssdr_python_check_module_raw( + "${desc}" " +######################################### +try: + import ${mod} + assert ${cmd} +except (ImportError, AssertionError): exit(-1) +except: pass +#########################################" + "${have}") +endmacro() + + +######################################################################## +# Setup the python interpreter: +# This allows the user to specify a specific interpreter, +# or finds the interpreter via the built-in cmake module. +######################################################################## + +if(CMAKE_VERSION VERSION_LESS 3.12) + if(PYTHON_EXECUTABLE) + message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") + string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3) + if(IS_PYTHON3 EQUAL -1) + find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) + else() + find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) + endif() + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + else() + message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2") + message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") + find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) + if(NOT PYTHONINTERP_FOUND) + message(STATUS "python2 not found - trying with python3") + find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) + endif() + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) +else() + find_package(Python3 COMPONENTS Interpreter) + if(Python3_FOUND) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) + find_package(Python2 COMPONENTS Interpreter) + if(Python2_FOUND) + set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) + set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR}) + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + endif() +endif() + +if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) + set(PYTHON3 TRUE) +endif() + +if(CMAKE_CROSSCOMPILING) + set(QA_PYTHON_EXECUTABLE "/usr/bin/python") +else() + set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) +endif() + +# 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") diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake index 26c0a1874..05a5c172e 100644 --- a/cmake/Modules/TestForARM.cmake +++ b/cmake/Modules/TestForARM.cmake @@ -16,14 +16,14 @@ # along with GNSS-SDR. If not, see . ############################################################################## -# check if the compiler defines the architecture as ARM and set the +# check if the compiler defines the architecture as ARM and set the # version, if found. # # - Anthony Arnold ############################################################################## -if (__TEST_FOR_ARM_INCLUDED) - return () +if(__TEST_FOR_ARM_INCLUDED) + return() endif() set(__TEST_FOR_ARM_INCLUDED TRUE) @@ -31,27 +31,27 @@ set(__TEST_FOR_ARM_INCLUDED TRUE) # output variable if found. function(check_arm_version ppdef input_string version output_var) string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}") - if (NOT _VERSION_MATCH STREQUAL "") + if(NOT _VERSION_MATCH STREQUAL "") set(${output_var} "${version}" PARENT_SCOPE) - endif(NOT _VERSION_MATCH STREQUAL "") + endif() endfunction() message(STATUS "Checking for ARM") -set (IS_ARM NO) -set (ARM_VERSION "") +set(IS_ARM NO) +set(ARM_VERSION "") -if (CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") execute_process(COMMAND echo "int main(){}" COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") if(ARM_FOUND STREQUAL "") - string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") - endif(ARM_FOUND STREQUAL "") + string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") + endif() - if (NOT ARM_FOUND STREQUAL "") + if(NOT ARM_FOUND STREQUAL "") set(IS_ARM YES) message(STATUS "ARM system detected") @@ -83,22 +83,21 @@ if (CMAKE_COMPILER_IS_GNUCXX) check_arm_version("__ARM_ARCH_8A" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION) # anything else just define as arm - if (ARM_VERSION STREQUAL "") + if(ARM_VERSION STREQUAL "") message(STATUS "Couldn't detect ARM version. Setting to 'arm'") set(ARM_VERSION "arm") - else (ARM_VERSION STREQUAL "") + else() message(STATUS "ARM version ${ARM_VERSION} detected") - endif (ARM_VERSION STREQUAL "") - - else (NOT ARM_FOUND STREQUAL "") - message(STATUS "System is not ARM") - endif(NOT ARM_FOUND STREQUAL "") + endif() + else() + message(STATUS "System is not ARM") + endif() -else (CMAKE_COMPILE_IS_GNUCXX) +else() # TODO: Other compilers message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false") message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually") -endif(CMAKE_COMPILER_IS_GNUCXX) +endif() set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") diff --git a/cmake/Modules/TestForSSE.cmake b/cmake/Modules/TestForSSE.cmake index 135a434ef..23b2d16a8 100644 --- a/cmake/Modules/TestForSSE.cmake +++ b/cmake/Modules/TestForSSE.cmake @@ -22,21 +22,20 @@ # - Anthony Arnold ############################################################################### - -function (test_for_sse h_file result_var name) - if (NOT DEFINED ${result_var}) +function(test_for_sse h_file result_var name) + if(NOT DEFINED ${result_var}) execute_process(COMMAND echo "#include <${h_file}>" - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ - - RESULT_VARIABLE COMPILE_RESULT - OUTPUT_QUIET ERROR_QUIET) + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ - + RESULT_VARIABLE COMPILE_RESULT + OUTPUT_QUIET ERROR_QUIET) set(detected 0) - if (COMPILE_RESULT EQUAL 0) + if(COMPILE_RESULT EQUAL 0) message(STATUS "Detected ${name}") set(detected 1) - endif(COMPILE_RESULT EQUAL 0) + endif() set(${result_var} ${detected} CACHE INTERNAL "${name} Available") - endif (NOT DEFINED ${result_var}) -endfunction(test_for_sse) + endif() +endfunction() message(STATUS "Testing for SIMD extensions") From 00c1d331e03fc957058694b9c0658b7a2dd08cfe Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 12 Dec 2018 01:31:14 +0100 Subject: [PATCH 06/19] Remove .gitlab-ci.yml file --- .gitlab-ci.yml | 748 ------------------------------------------------- 1 file changed, 748 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 37c3ef6a4..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,748 +0,0 @@ -# This script sets up a Continuous Reproducibility system for GNSS-SDR at GitLab -# -# Useful links: -# Website: https://gnss-sdr.org -# Upstream repository: https://github.com/gnss-sdr/gnss-sdr.git -# Dockerfile at https://github.com/carlesfernandez/docker-gnsssdr -# Docker cloud image: carlesfernandez/docker-gnsssdr -# -# In order to use this system and be able to make changes, you will need: -# - A GitHub account https://github.com -# - A GitLab account https://gitlab.com -# - A Docker Hub account https://hub.docker.com -# - A repository at Docker Hub. -# -# In order to use this system, please fork at GitHub the upstream -# repository; import that forked repo at GitLab; then add, commit and push to -# your GitLab repo this .gitlab-ci.yml file; and finally go to your project page -# at GitLab and set up the following secret variables. In the left panel: -# Settings > CI / CD > Secret variables -# -# DOCKER_HUB_USER -# DOCKER_HUB_REPO -# DOCKER_HUB_PASSWORD -# -# You will need either to protect your branch, or to leave those variables -# unproctected. -# -# For instance, my settings are: -# DOCKER_HUB_USER = carlesfernandez -# DOCKER_HUB_REPO = docker-gnsssdr -# DOCKER_HUB_PASSWORD = ******************** -# -# If you want to make changes in the source code, branch-off from the 'next' -# branch of your forked repository and, if needed, add new jobs in this -# file at the 'deploy' and 'experiment' stages. Please do not use the next -# branch for your changes, always open a new branch from next and work there. -# -# Feel free to delete the docker-gnsssdr and docker-pybombs-gnsssdr jobs, -# they are for developers' team only. Actually, this is their CI/CD system. -# -# More info about how to contribute to GNSS-SDR at -# https://github.com/gnss-sdr/gnss-sdr/blob/master/CONTRIBUTING.md -# -# (C) Carles Fernandez-Prades, 2018 cfernandez@cttc.cat - - -# This is performed before the scripts in the stages step -before_script: - - source /etc/profile - - -# Defines stages which are to be executed -stages: - - build - - test - - deploy - - experiment - - -# Stage "build" -archlinux: - image: base/devel:latest - stage: build - before_script: - - pwd - script: - - pacman -Syu --noconfirm - - pacman -S --noconfirm cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr libpcap blas lapack gflags google-glog openssl python-mako python-six pugixml libmatio gtest - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -centos7: - image: centos:centos7 - stage: build - before_script: - - pwd - script: - - yum install -y wget - - wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - - rpm -Uvh epel-release-latest-7.noarch.rpm - - yum install -y make automake gcc gcc-c++ kernel-devel libtool hdf5-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel pugixml-devel libpcap-devel blas-devel lapack-devel armadillo-devel openssl-devel python-mako python-six - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -crosscompile: - image: ubuntu:xenial - stage: build - tags: - - kepler - script: - - apt-get update - - apt-get install -y build-essential xz-utils curl gawk wget git-core diffstat unzip texinfo gcc-multilib chrpath socat cpio python python3 python3-pip python3-pexpect debianutils iputils-ping - - curl -k https://sites.cttc.es/gnss_files/SDK/Sumo/oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0.sh --output oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0.sh - - echo "d25313709bc8c13eba01f7f9a589d8c6 oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0.sh" > sdk.md5 - - md5sum -c sdk.md5 - - chmod +x ./oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0.sh - - sh ./oecore-x86_64-armv7ahf-neon-toolchain-nodistro.0.sh -y - - . /usr/local/oecore-x86_64/environment-setup-armv7ahf-neon-oe-linux-gnueabi - - cd build - - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake -DENABLE_OSMOSDR=ON -DENABLE_UNIT_TESTING_EXTRA=ON -DENABLE_SYSTEM_TESTING_EXTRA=ON -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_FMCOMMS2=ON -DENABLE_AD9361=ON -DENABLE_RAW_UDP=ON -DENABLE_INSTALL_TESTS=ON -DCMAKE_C_FLAGS_RELEASE="-s" -DCMAKE_CXX_FLAGS_RELEASE="-s" -DENABLE_PACKAGING=ON .. - - make -j - - mkdir local_install - - make install DESTDIR=./local_install - - rm ./local_install/usr/bin/front-end-cal - - rm ./local_install/usr/bin/ttff - - cd .. - - mkdir binaries - - mkdir binaries/bin - - mkdir binaries/share - - cp build/local_install/usr/bin/* binaries/bin/ - - cp build/local_install/usr/share/gnss-sim/* binaries/share/ - allow_failure: true - artifacts: - paths: - - binaries/* - - -debian8.11: - image: debian:8.11-slim - stage: build - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential libtool automake libhdf5-dev cmake git ca-certificates libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libgfortran-4.9-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libgtest-dev - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -debian9.5: - image: debian:9.5-slim - stage: build - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - - -debian10: - image: debian:buster - stage: build - script: - - apt-get update - - apt-get upgrade -y - - apt-get install -y --no-install-recommends build-essential cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libiio-dev gr-iio libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev libgtest-dev - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON -DENABLE_FMCOMMS2=ON -DENABLE_AD9361=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -fedora26: - image: fedora:26 - stage: build - before_script: - - source ~/.bash_profile - script: - - yum install -y make automake gcc gcc-c++ kernel-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel pugixml-devel libpcap-devel blas-devel lapack-devel armadillo-devel gflags-devel glog-devel openssl-devel python-mako python-six matio-devel - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -fedora28: - image: fedora:28 - stage: build - before_script: - - source ~/.bash_profile - script: - - yum install -y make automake gcc gcc-c++ kernel-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel pugixml-devel libpcap-devel blas-devel lapack-devel armadillo-devel gflags-devel glog-devel openssl-devel python-mako python-six matio-devel - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - - -fedora29: - image: fedora:29 - stage: build - before_script: - - source ~/.bash_profile - script: - - yum install -y make gcc gcc-c++ kernel-devel cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono boost-serialization log4cpp-devel gnuradio-devel pugixml-devel libpcap-devel blas-devel lapack-devel armadillo-devel gflags-devel glog-devel openssl-devel python3-mako python3-six matio-devel - - cd build - - cmake -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -fedora-rawhide: - image: fedora:rawhide - stage: build - before_script: - - source ~/.bash_profile - script: - - dnf upgrade -y --nogpgcheck - - yum install -y automake gcc gcc-c++ kernel-devel make cmake git boost-devel boost-date-time boost-system boost-filesystem boost-thread boost-chrono boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel pugixml-devel libpcap-devel blas-devel lapack-devel armadillo-devel gflags-devel glog-devel openssl-devel python-mako python-six matio-devel - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -opensuse42.3: - image: opensuse/leap:42.3 - stage: build - before_script: - - pwd - script: - - zypper -n up - - zypper -n install cmake git gcc-c++ boost-devel log4cpp-devel gnuradio-devel pugixml-devel libpcap-devel armadillo-devel libtool automake hdf5-devel openssl-devel python-Mako python-six - - cd build - - cmake -DENABLE_PACKAGING=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -opensuse-leap15.0: - image: opensuse/leap:15.0 - stage: build - before_script: - - pwd - script: - - zypper -n up - - zypper -n install cmake git gcc-c++ boost-devel libboost_chrono-devel libboost_thread-devel libboost_system-devel libboost_filesystem-devel libboost_serialization-devel log4cpp-devel gnuradio-devel pugixml-devel libpcap-devel armadillo-devel libtool automake hdf5-devel openssl-devel python-Mako python-six - - cd build - - cmake -DENABLE_PACKAGING=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -opensuse-tumbleweed: - image: opensuse/tumbleweed - stage: build - before_script: - - pwd - script: - - zypper -n dup - - zypper -n install cmake git gcc-c++ boost-devel libboost_system-devel libboost_filesystem-devel libboost_date_time-devel libboost_thread-devel libboost_chrono-devel libboost_serialization-devel log4cpp-devel gtest gnuradio-devel pugixml-devel libpcap-devel armadillo-devel libtool automake hdf5-devel openssl-devel python-Mako python-six - - cd build - - cmake -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -ubuntu14.04: - image: ubuntu:trusty - stage: build - script: - - apt-get update - - apt-get install -y apt-file - - apt-file update - - apt-get install -y software-properties-common - - add-apt-repository -y ppa:myriadrf/gnuradio - - add-apt-repository -y ppa:myriadrf/drivers - - apt-get update - - apt-get install -y --no-install-recommends build-essential libtool automake libhdf5-dev cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libpcap-dev libblas-dev liblapack-dev libgfortran-4.7-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libgtest-dev - - cd build - - cmake -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -ubuntu16.04: - image: ubuntu:xenial - stage: build - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev libgtest-dev - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -ubuntu18.04: - image: ubuntu:bionic - stage: build - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - - -ubuntu18.10: - image: ubuntu:cosmic - stage: build - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev libgtest-dev - - cd build - - cmake -DENABLE_OSMOSDR=ON -DENABLE_RAW_UDP=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - - make check - - make install - allow_failure: true - - -coverity-scan: - image: ubuntu:xenial - stage: build - script: - - apt-get update - - apt-get install -y wget curl - - wget -O ./cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 --post-data "project=$COVERITY_SCAN_USER%2Fgnss-sdr&token=$COVERITY_SCAN_TOKEN" - - tar xvzf cov-analysis-linux64.tgz - - export PATH=$PATH:$(pwd)/cov-analysis-linux64-2017.07/bin - - apt-get install -y --no-install-recommends build-essential cmake git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev libgtest-dev - - cd build - - cmake -DENABLE_OSMOSDR=ON -ENABLE_RAW_UDP=ON .. - - cov-build --dir cov-int make -j2 - - tar cvzf gnss-sdr.tgz cov-int - - curl --form token=$COVERITY_SCAN_TOKEN --form email=$COVERITY_SCAN_EMAIL --form file=@$(pwd)/gnss-sdr.tgz --form version="0.0.9-next" --form description=" " https://scan.coverity.com/builds?project=$COVERITY_SCAN_USER%2Fgnss-sdr --progress-bar | tee -a "log_upload.txt" ; test ${PIPESTATUS[0]} -eq 0 - when: manual - allow_failure: true - - -# Stage "test" -run-tests-x86_64: - image: debian:9.3-slim - stage: test - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake ca-certificates git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest - - mkdir build-test - - mkdir build64 - - cd build-test - - cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - # Execute Unit Tests - - ../install/run_tests --gtest_output=xml - - mv *.xml ../build64/ - # Execute System Tests - - ../install/position_test - - mv position_test*.txt ../build64/ - - cd .. - - rm -rf build-test - artifacts: - paths: - - build64/*.xml - - build64/*.txt - - -run-tests-i386: - image: i386/debian:9.3-slim - stage: test - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake ca-certificates git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest - - mkdir build-test - - mkdir build32 - - cd build-test - - cmake -DENABLE_PACKAGING=ON -DENABLE_SYSTEM_TESTING_EXTRA=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - # Execute Unit Tests - - ../install/run_tests --gtest_output=xml - - mv *.xml ../build32/ - # Execute System Tests - - ../install/position_test - - mv position_test*.txt ../build32/ - - cd .. - - rm -rf build-test - artifacts: - paths: - - build32/*.xml - - build32/*.txt - - -observables-test-180417100529: - image: ubuntu:bionic - stage: test - tags: - - kepler - when: manual - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake ca-certificates git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest gnuplot - - mkdir build-test - - mkdir build64 - - cd build-test - - cmake -DENABLE_UNIT_TESTING_EXTRA=ON -DENABLE_SYSTEM_TESTING_EXTRA=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - # Execute Unit Tests - - export DISPLAY=unknown - - echo "Running HybridObservablesTest for GPS L1 CA..." - - ../install/run_tests --gtest_filter=HybridObservablesTest* -PLL_bw_hz_start=25.0 --DLL_bw_hz_start=1.5 --PLL_narrow_bw_hz=10.0 --DLL_narrow_bw_hz=0.75 --disable_generator=1 --enable_external_signal_file=1 --signal_file=/captures/gitlab_test_signals/static/180417100529.A_L1E1_12500000Hz_ichar.dat --fs_gen_sps=12500000 --skip_samples=125000000 --external_signal_acquisition_threshold=4.0 --extend_correlation_symbols=5 --external_signal_acquisition_doppler_step_hz=10 --trk_test_implementation=GPS_L1_CA_DLL_PLL_Tracking --show_plots=0 --filename_rinex_obs=/captures/gitlab_test_signals/static/true_data_180417100529/rinex_obs/rinex-obs_V1_A1-static_vehicle.txt --skip_trk_transitory_s=30 --gtest_output=xml:test_results.xml - - echo "Running HybridObservablesTest for Galileo E1..." - - ../install/run_tests --gtest_filter=HybridObservablesTest* --PLL_bw_hz_start=5.0 --DLL_bw_hz_start=0.75 --disable_generator=1 --enable_external_signal_file=1 --show_plots=true --fs_gen_sps=12500000 --skip_samples=50000000 --external_signal_acquisition_threshold=2.5 --trk_test_implementation=Galileo_E1_DLL_PLL_VEML_Tracking --external_signal_acquisition_doppler_step_hz=25 --show_plots=0 --signal_file=/captures/gitlab_test_signals/static/180417100529.A_L1E1_12500000Hz_ichar.dat --filename_rinex_obs=/captures/gitlab_test_signals/static/true_data_180417100529/rinex_obs/rinex-obs_V1_A1-static_vehicle.txt --skip_trk_transitory_s=15 --gtest_output=xml:test_results.xml - - echo "Running HybridObservablesTest for GPS L5..." - - ../install/run_tests --gtest_filter=HybridObservablesTest* --PLL_bw_hz_start=25.0 --DLL_bw_hz_start=2.5 --disable_generator=1 --enable_external_signal_file=1 --show_plots=true --fs_gen_sps=12500000 --skip_samples=250000000 --external_signal_acquisition_threshold=2.4 --trk_test_implementation=GPS_L5_DLL_PLL_Tracking --external_signal_acquisition_dwells=10 --external_signal_acquisition_doppler_step_hz=10 --show_plots=0 --signal_file=/captures/gitlab_test_signals/static/180417100529.A_L5E5_12500000Hz_ichar.dat --filename_rinex_obs=/captures/gitlab_test_signals/static/true_data_180417100529/rinex_obs/rinex-obs_V1_A1-static_vehicle.txt --skip_trk_transitory_s=5 --gtest_output=xml:test_results.xml - - echo "Running HybridObservablesTest for Galileo E5a..." - - ../install/run_tests --gtest_filter=HybridObservablesTest* --PLL_bw_hz_start=30.0 --DLL_bw_hz_start=1.0 --disable_generator=1 --enable_external_signal_file=1 --show_plots=true --fs_gen_sps=12500000 --skip_samples=125000000 --external_signal_acquisition_threshold=2.2 --trk_test_implementation=Galileo_E5a_DLL_PLL_Tracking --external_signal_acquisition_doppler_step_hz=10 --show_plots=0 --signal_file=/captures/gitlab_test_signals/static/180417100529.A_L5E5_12500000Hz_ichar.dat --filename_rinex_obs=/captures/gitlab_test_signals/static/true_data_180417100529/rinex_obs/rinex-obs_V1_A1-static_vehicle.txt --skip_trk_transitory_s=5 --gtest_output=xml:test_results.xml - - mv *.xml ../build64/ - - cd .. - - rm -rf build-test - artifacts: - paths: - - build64/*.xml - - -leo-observables-test-180417120737: - image: ubuntu:bionic - stage: test - tags: - - kepler - when: manual - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake ca-certificates git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest gnuplot - - mkdir build-test - - mkdir build64 - - cd build-test - - cmake -DENABLE_UNIT_TESTING_EXTRA=ON -DENABLE_SYSTEM_TESTING_EXTRA=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - # Execute Unit Tests - - export DISPLAY=unknown - - echo "Running HybridObservablesTest for GPS L1 CA..." - - ../install/run_tests --gtest_filter=HybridObservablesTest* -PLL_bw_hz_start=30.0 --DLL_bw_hz_start=1.0 --disable_generator=1 --enable_external_signal_file=1 --show_plots=true --fs_gen_sps=12500000 --skip_samples=125000000 --external_signal_acquisition_threshold=2.5 --trk_test_implementation=GPS_L1_CA_DLL_PLL_Tracking --external_signal_acquisition_dwells=5 --external_signal_acquisition_doppler_step_hz=50 --show_plots=0 --signal_file=/captures/gitlab_test_signals/dynamic/180417120737.A_L1E1_12500000Hz_ichar.dat --filename_rinex_obs=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/rinex_obs/rinex-obs_V1_A1-spacecraft.txt skip_trk_transitory_s=20 --external_signal_acquisition_doppler_max_hz=50000 --gtest_output=xml:test_results.xml - - echo "Running HybridObservablesTest for Galileo E1..." - - ../../install/run_tests --gtest_filter=HybridObservablesTest* -PLL_bw_hz_start=15 --DLL_bw_hz_start=0.5 --disable_generator=1 --enable_external_signal_file=1 --show_plots=true --fs_gen_sps=12500000 --skip_samples=125000000 --external_signal_acquisition_threshold=2.5 --trk_test_implementation=Galileo_E1_DLL_PLL_VEML_Tracking --external_signal_acquisition_dwells=1 --external_signal_acquisition_doppler_step_hz=50 --show_plots=0 --signal_file=/captures/gitlab_test_signals/dynamic/180417120737.A_L1E1_12500000Hz_ichar.dat --filename_rinex_obs=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/rinex_obs/rinex-obs_V1_A1-spacecraft.txt skip_trk_transitory_s=5 --external_signal_acquisition_doppler_max_hz=50000 --gtest_output=xml:test_results.xml - - mv *.xml ../build64/ - - cd .. - - rm -rf build-test - artifacts: - paths: - - build64/*.xml - - -position-test-180417100529: - image: ubuntu:bionic - stage: test - tags: - - kepler - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake ca-certificates git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest gnuplot - - mkdir build-test - - mkdir position-test - - cd build-test - - cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - # Execute System Tests - - export DISPLAY=unknown - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_L1.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test --show_plots=0 - - mkdir ../position-test/L1 && rm PVT_*.* && mv *.ps ../position-test/L1/ && mv GSDR* ../position-test/L1/ - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_E1.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test --show_plots=0 - - mkdir ../position-test/E1 && rm PVT_*.* && mv *.ps ../position-test/E1 && mv GSDR* ../position-test/E1 - - ../install/position_test -config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_L1E1.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test --show_plots=0 - - mkdir ../position-test/L1E1 && rm PVT_*.* && mv *.ps ../position-test/L1E1/ && mv GSDR* ../position-test/L1E1/ - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_L5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --dynamic_3D_velocity_RMSE=6 --plot_position_test --show_plots=0 - - mkdir ../position-test/L5 && rm PVT_*.* && mv *.ps ../position-test/L5/ && mv GSDR* ../position-test/L5/ - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_E5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --dynamic_3D_velocity_RMSE=6 --plot_position_test --show_plots=0 - - mkdir ../position-test/E5 && rm PVT_*.* && mv *.ps ../position-test/E5 && mv GSDR* ../position-test/E5 - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_L5E5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --dynamic_3D_velocity_RMSE=6 --plot_position_test --show_plots=0 - - mkdir ../position-test/L5E5 && rm PVT_*.* && mv *.ps ../position-test/L5E5 && [ -f GSDR* ] && mv GSDR* ../position-test/L5E5 - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_L1L5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --dynamic_3D_velocity_RMSE=6 --plot_position_test --show_plots=0 - - mkdir ../position-test/L1L5 && rm PVT_*.* && mv *.ps ../position-test/L1L5 && [ -f GSDR* ] && mv GSDR* ../position-test/L1L5 - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_E1E5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --dynamic_3D_velocity_RMSE=6 --plot_position_test --show_plots=0 - - mkdir ../position-test/E1E5 && rm PVT_*.* && mv *.ps ../position-test/E1E5 && [ -f GSDR* ] && mv GSDR* ../position-test/E1E5 - - ../install/position_test --config_file_ptest=/captures/gitlab_test_signals/static/gnss-sdr_180417100529.A_L1E1L5E5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/static/true_data_180417100529/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --dynamic_3D_velocity_RMSE=6 --plot_position_test --show_plots=0 - - mkdir ../position-test/L1E1L5E5 && rm PVT_*.* && mv *.ps ../position-test/L1E1L5E5 && [ -f GSDR* ] && mv GSDR* ../position-test/L1E1L5E5 - - mv *.xml ../position-test/ - - cd .. - - rm -rf build-test - artifacts: - paths: - - position-test/* - - position-test/L1/* - - position-test/E1/* - - position-test/L1E1/* - - position-test/L5/* - - position-test/L5E5/* - - position-test/L1L5/* - - position-test/E1E5/* - - position-test/L1E1L5E5/* - allow_failure: true - - -leo-position-test-180417120737: - image: ubuntu:bionic - stage: test - when: manual - tags: - - kepler - script: - - apt-get update - - apt-get install -y --no-install-recommends build-essential cmake ca-certificates git libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev libpugixml-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev python-mako python-six libmatio-dev googletest gnuplot - - mkdir build-test - - mkdir leo_position - - cd build-test - - cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. - - NPROC=$(grep -c ^processor /proc/cpuinfo) - - make -j$(($NPROC+1)) - # Execute System Tests - - export DISPLAY=unknown - - mkdir gpsL1 && cd gpsL1 - - ../../install/position_test --config_file_ptest=/captures/gitlab_test_signals/dynamic/gnss-sdr_180417120737.A_L1.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test=1 --show_plots=0 - - cd .. && cp -r gpsL1 /../leo_position - - mkdir galE1 && cd galE1 - - ../../install/position_test --config_file_ptest=/captures/gitlab_test_signals/dynamic/gnss-sdr_180417120737.A_E1.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test=1 --show_plots=0 - - cd .. && cp -r galE1 /../leo_position - - mkdir gpsL1galE1 && cd gpsL1galE1 - - ../../install/position_test --config_file_ptest=/captures/gitlab_test_signals/dynamic/gnss-sdr_180417120737.A_L1E1.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test=1 --show_plots=0 - - cd .. && cp -r gpsL1galE1 /../leo_position - - mkdir gpsL5 && cd gpsL5 - - ../../install/position_test --config_file_ptest=/captures/gitlab_test_signals/dynamic/gnss-sdr_180417120737.A_L5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test=1 --show_plots=0 - - cd .. && cp -r gpsL5 /../leo_position - - mkdir galE5a && cd galE5a - - ../../install/position_test --config_file_ptest=/captures/gitlab_test_signals/dynamic/gnss-sdr_180417120737.A_E5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test --show_plots=0 - - cd .. && cp -r galE5a /../leo_position - - mkdir galE5a && cd galE5a - - ../../install/position_test --config_file_ptest=/captures/gitlab_test_signals/dynamic/gnss-sdr_180417120737.A_L5E5.conf --static_scenario=0 --use_ref_motion_file=1 --ref_motion_filename=/captures/gitlab_test_signals/dynamic/leo_pvt_test/2018_04_17_12_44_39/motion_V1.csv --pvt_solver_dump_filename=./PVT.dat --plot_position_test --show_plots=0 - - cd .. && cp -r galE5a /../leo_position - artifacts: - paths: - - leo_position/* - allow_failure: true - - -run-tests-armhf: - image: carlesfernandez/gnsssdr-dev-arm32v7:sumo - stage: test - tags: - - arm - when: manual - dependencies: - - crosscompile - script: - - cp binaries/bin/* /usr/bin/ - - mkdir /usr/share/gnss-sim/ - - cp -f binaries/share/* /usr/share/gnss-sim/ - - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib - - ldconfig - - volk_profile -v 8111 - - volk_gnsssdr_profile - - position_test - - run_tests --gtest_filter=Matio* - - run_tests --gtest_filter=HybridObservablesTest* --PLL_bw_hz_start=25.0 --DLL_bw_hz_start=1.5 --PLL_narrow_bw_hz=10.0 --DLL_narrow_bw_hz=0.75 --disable_generator=1 --enable_external_signal_file=1 --signal_file=/captures/gitlab_test_signals/static/180417100529.A_L1E1_12500000Hz_ichar.dat --fs_gen_sps=12500000 --skip_samples=125000000 --external_signal_acquisition_threshold=4.0 --extend_correlation_symbols=5 --external_signal_acquisition_doppler_step_hz=10 --trk_test_implementation=GPS_L1_CA_DLL_PLL_Tracking --show_plots=0 --filename_rinex_obs=/captures/gitlab_test_signals/static/true_data_180417100529/rinex_obs/rinex-obs_V1_A1-static_vehicle.txt --skip_trk_transitory_s=30 --gtest_output=xml:test_results.xml - allow_failure: true - - -# Stage "deploy" -docker-gnsssdr: - image: docker:latest - stage: deploy - services: - - docker:dind - script: - - wget https://raw.githubusercontent.com/carlesfernandez/docker-gnsssdr/master/Dockerfile - - docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" - - mkdir docker-build - - cd docker-build - - cp ../Dockerfile . - - docker build -t carlesfernandez/docker-gnsssdr . - - docker push carlesfernandez/docker-gnsssdr - only: - - next - allow_failure: true - - -docker-gnsssdr-v0.0.10: - image: docker:18.05 - stage: deploy - services: - - docker:dind - script: - - wget https://raw.githubusercontent.com/carlesfernandez/docker-gnsssdr/v0.0.10/Dockerfile - - docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" - - mkdir docker-build - - cd docker-build - - cp ../Dockerfile . - - docker build -t $DOCKER_HUB_USER/$DOCKER_HUB_REPO . - - docker tag $DOCKER_HUB_USER/$DOCKER_HUB_REPO:latest $DOCKER_HUB_USER/$DOCKER_HUB_REPO:0.0.10 - - docker push $DOCKER_HUB_USER/$DOCKER_HUB_REPO:0.0.10 - only: - - v0.0.10 - allow_failure: true - - -docker-pybombs-gnsssdr: - image: docker:latest - stage: deploy - services: - - docker:dind - script: - - wget https://raw.githubusercontent.com/carlesfernandez/docker-pybombs-gnsssdr/master/Dockerfile - - docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" - - mkdir docker-build - - cd docker-build - - cp ../Dockerfile . - - docker build -t carlesfernandez/docker-pybombs-gnsssdr . - - docker push carlesfernandez/docker-pybombs-gnsssdr - only: - - next - allow_failure: true - - -docker-access18: - image: docker:latest - stage: deploy - services: - - docker:dind - script: - - mkdir docker-build - - cd docker-build - - echo -e "FROM phusion/baseimage:0.11\nMAINTAINER carles.fernandez@cttc.es\nCMD [\"/sbin/my_init\"]\nWORKDIR /home/src\nRUN apt-get update && apt-get install -y --no-install-recommends build-essential cmake curl nano libarmadillo-dev libblas-dev libboost-chrono-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev libpugixml-dev libgflags-dev libgoogle-glog-dev googletest libgnutls-openssl-dev liblapack-dev liblog4cpp5-dev libmatio-dev git ca-certificates gnuradio-dev python-mako python-six texlive-latex-base texlive-fonts-recommended texlive-font-utils texlive-pictures epstool fig2dev octave pstoedit gnuplot-x11 && rm -rf /var/lib/apt/lists/*\nRUN git clone https://gitlab.com/gnss-sdr/gnss-sdr && cd gnss-sdr/build && git checkout $CI_COMMIT_SHA && cmake -DENABLE_PACKAGING=ON -DENABLE_INSTALL_TESTS=ON .. && NPROC=$(grep -c ^processor /proc/cpuinfo) && make -j$(($NPROC+1)) && make install && rm -rf /home/src\nWORKDIR /home\nRUN /usr/bin/volk_profile -v 8111\nRUN /usr/local/bin/volk_gnsssdr_profile\nRUN rm -rf /tmp/* /var/tmp/*\nCMD [\"bash\"]" > Dockerfile - - docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" - - docker build -t $DOCKER_HUB_USER/$DOCKER_HUB_REPO . - - docker tag $DOCKER_HUB_USER/$DOCKER_HUB_REPO:latest $DOCKER_HUB_USER/$DOCKER_HUB_REPO:access18 - - docker push $DOCKER_HUB_USER/$DOCKER_HUB_REPO:access18 - - -docker-access18-0.0.10: - image: docker:18.05 - stage: deploy - services: - - docker:dind - script: - - mkdir docker-build - - cd docker-build - - echo -e "FROM phusion/baseimage:0.11\nMAINTAINER carles.fernandez@cttc.es\nCMD [\"/sbin/my_init\"]\nWORKDIR /home/src\nRUN apt-get update && apt-get install -y --no-install-recommends build-essential cmake curl nano libarmadillo-dev libblas-dev libboost-chrono-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev libpugixml-dev libgflags-dev libgoogle-glog-dev googletest libgnutls-openssl-dev liblapack-dev liblog4cpp5-dev libmatio-dev git ca-certificates gnuradio-dev python-mako python-six texlive-latex-base texlive-fonts-recommended texlive-font-utils texlive-pictures epstool fig2dev octave pstoedit gnuplot-x11 && rm -rf /var/lib/apt/lists/*\nRUN git clone https://gitlab.com/gnss-sdr/gnss-sdr && cd gnss-sdr/build && git checkout v0.0.10 && cmake -DENABLE_PACKAGING=ON -DENABLE_INSTALL_TESTS=ON .. && NPROC=$(grep -c ^processor /proc/cpuinfo) && make -j$(($NPROC+1)) && make install && rm -rf /home/src\nWORKDIR /home\nRUN /usr/bin/volk_profile -v 8111\nRUN /usr/local/bin/volk_gnsssdr_profile\nRUN rm -rf /tmp/* /var/tmp/*\nCMD [\"bash\"]" > Dockerfile - - docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" - - docker build -t $DOCKER_HUB_USER/$DOCKER_HUB_REPO . - - docker tag $DOCKER_HUB_USER/$DOCKER_HUB_REPO:latest $DOCKER_HUB_USER/$DOCKER_HUB_REPO:access18-0.0.10 - - docker push $DOCKER_HUB_USER/$DOCKER_HUB_REPO:access18-0.0.10 - only: - - v0.0.10 - allow_failure: true - - -# Stage "experiment" -run-access18: - image: $DOCKER_HUB_USER/$DOCKER_HUB_REPO:access18 - stage: experiment - script: - - apt-get update - # Grab the data set - - mkdir -p exp-access18/data - - cd exp-access18/data - - curl https://zenodo.org/record/1184601/files/L2_signal_samples.tar.xz --output L2_signal_samples.tar.xz - - tar xvfJ L2_signal_samples.tar.xz - - echo "3a04c1eeb970776bb77f5e3b7eaff2df L2_signal_samples.tar.xz" > data.md5 - - md5sum -c data.md5 - - cd .. - # Execute the experiment - - cp ../src/utils/reproducibility/ieee-access18/L2-access18.conf . - - cp ../src/utils/reproducibility/ieee-access18/plot_dump.m . - - cp -r ../src/utils/matlab/libs/geoFunctions . - - gnss-sdr --c=L2-access18.conf - - octave --no-gui plot_dump.m - - epspdf Figure2.eps Figure2.pdf - - cd .. - - mkdir access18 - - cp exp-access18/*.pdf access18/ - artifacts: - paths: - - access18/*.pdf - - -run-access18-0.0.10: - image: $DOCKER_HUB_USER/$DOCKER_HUB_REPO:access18-0.0.10 - stage: experiment - script: - - apt-get update - # Grab the data set - - mkdir -p exp-access18/data - - cd exp-access18/data - - curl https://zenodo.org/record/1184601/files/L2_signal_samples.tar.xz --output L2_signal_samples.tar.xz - - tar xvfJ L2_signal_samples.tar.xz - - echo "3a04c1eeb970776bb77f5e3b7eaff2df L2_signal_samples.tar.xz" > data.md5 - - md5sum -c data.md5 - - cd .. - # Execute the experiment - - cp ../src/utils/reproducibility/ieee-access18/L2-access18.conf . - - cp ../src/utils/reproducibility/ieee-access18/plot_dump.m . - - cp -r ../src/utils/matlab/libs/geoFunctions . - - gnss-sdr --c=L2-access18.conf - - octave --no-gui plot_dump.m - - epspdf Figure2.eps Figure2.pdf - - cd .. - - mkdir access18 - - cp exp-access18/*.pdf access18/ - artifacts: - paths: - - access18/*.pdf - only: - - v0.0.10 From 470e2e0372c3e6b9a95cf030fd2ac9f13dd00ff9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 12 Dec 2018 01:37:37 +0100 Subject: [PATCH 07/19] Recover cmake Modules --- cmake/Modules/FindGFLAGS.cmake | 111 +++++++++++++ cmake/Modules/FindGFORTRAN.cmake | 150 ++++++++++++++++++ cmake/Modules/FindGLOG.cmake | 140 ++++++++++++++++ cmake/Modules/FindGNSSSIMULATOR.cmake | 30 ++++ cmake/Modules/FindGNURADIO.cmake | 202 ++++++++++++++++++++++++ cmake/Modules/FindGPERFTOOLS.cmake | 87 ++++++++++ cmake/Modules/FindGPSTK.cmake | 49 ++++++ cmake/Modules/FindGRDBFCTTC.cmake | 56 +++++++ cmake/Modules/FindGRGN3S.cmake | 56 +++++++ cmake/Modules/FindGRIIO.cmake | 72 +++++++++ cmake/Modules/FindGROSMOSDR.cmake | 92 +++++++++++ cmake/Modules/FindLIBIIO.cmake | 76 +++++++++ cmake/Modules/FindLIBOSMOSDR.cmake | 80 ++++++++++ cmake/Modules/FindLOG4CPP.cmake | 92 +++++++++++ cmake/Modules/FindMATIO.cmake | 129 +++++++++++++++ cmake/Modules/FindOPENBLAS.cmake | 49 ++++++ cmake/Modules/FindOPENCL.cmake | 110 +++++++++++++ cmake/Modules/FindORC.cmake | 75 +++++++++ cmake/Modules/FindPCAP.cmake | 122 ++++++++++++++ cmake/Modules/FindPUGIXML.cmake | 75 +++++++++ cmake/Modules/FindTELEORBIT.cmake | 50 ++++++ cmake/Modules/FindUHD.cmake | 75 +++++++++ cmake/Modules/FindVOLK.cmake | 76 +++++++++ cmake/Modules/FindVOLKGNSSSDR.cmake | 53 +++++++ cmake/Modules/GnsssdrBuildTypes.cmake | 219 ++++++++++++++++++++++++++ cmake/Modules/SetupPython.cmake | 119 ++++++++++++++ cmake/Modules/TestForARM.cmake | 103 ++++++++++++ cmake/Modules/TestForSSE.cmake | 55 +++++++ 28 files changed, 2603 insertions(+) create mode 100644 cmake/Modules/FindGFLAGS.cmake create mode 100644 cmake/Modules/FindGFORTRAN.cmake create mode 100644 cmake/Modules/FindGLOG.cmake create mode 100644 cmake/Modules/FindGNSSSIMULATOR.cmake create mode 100644 cmake/Modules/FindGNURADIO.cmake create mode 100644 cmake/Modules/FindGPERFTOOLS.cmake create mode 100644 cmake/Modules/FindGPSTK.cmake create mode 100644 cmake/Modules/FindGRDBFCTTC.cmake create mode 100644 cmake/Modules/FindGRGN3S.cmake create mode 100644 cmake/Modules/FindGRIIO.cmake create mode 100644 cmake/Modules/FindGROSMOSDR.cmake create mode 100644 cmake/Modules/FindLIBIIO.cmake create mode 100644 cmake/Modules/FindLIBOSMOSDR.cmake create mode 100644 cmake/Modules/FindLOG4CPP.cmake create mode 100644 cmake/Modules/FindMATIO.cmake create mode 100644 cmake/Modules/FindOPENBLAS.cmake create mode 100644 cmake/Modules/FindOPENCL.cmake create mode 100644 cmake/Modules/FindORC.cmake create mode 100644 cmake/Modules/FindPCAP.cmake create mode 100644 cmake/Modules/FindPUGIXML.cmake create mode 100644 cmake/Modules/FindTELEORBIT.cmake create mode 100644 cmake/Modules/FindUHD.cmake create mode 100644 cmake/Modules/FindVOLK.cmake create mode 100644 cmake/Modules/FindVOLKGNSSSDR.cmake create mode 100644 cmake/Modules/GnsssdrBuildTypes.cmake create mode 100644 cmake/Modules/SetupPython.cmake create mode 100644 cmake/Modules/TestForARM.cmake create mode 100644 cmake/Modules/TestForSSE.cmake diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake new file mode 100644 index 000000000..31739e216 --- /dev/null +++ b/cmake/Modules/FindGFLAGS.cmake @@ -0,0 +1,111 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find GFlags +# +# The following CMake and environment variables are optionally searched +# for defaults: +# GFLAGS_ROOT: Base directory where all GFlags components are found +# +# The following are set after configuration is done: +# GFlags_FOUND +# GFlags_INCLUDE_DIRS +# GFlags_LIBS +# GFlags_LIBRARY_DIRS + +if(APPLE) + find_path(GFlags_ROOT_DIR + libgflags.dylib + PATHS + /opt/local/lib + /usr/local/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ) +else() + find_path(GFlags_ROOT_DIR + libgflags.so + HINTS + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ${GFLAGS_ROOT}/lib64 + $ENV{GFLAGS_ROOT}/lib64 + ) +endif() + +if(GFlags_ROOT_DIR) + # We are testing only a couple of files in the include directories + find_path(GFlags_INCLUDE_DIRS + gflags/gflags.h + HINTS + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ${GFLAGS_ROOT}/include + $ENV{GFLAGS_ROOT}/include + ) + + # Find the libraries + set(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) + + find_library(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) + if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) + set(GFLAGS_GREATER_20 TRUE) + else() + set(GFLAGS_GREATER_20 FALSE) + endif() + # set up include and link directory + include_directories(${GFlags_INCLUDE_DIRS}) + link_directories(${GFlags_LIBRARY_DIRS}) + message(STATUS "gflags library found at ${GFlags_lib}") + set(GFlags_LIBS ${GFlags_lib}) + set(GFlags_FOUND true) + mark_as_advanced(GFlags_INCLUDE_DIRS) +else() + message(STATUS "Cannot find gflags") + set(GFlags_FOUND false) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake new file mode 100644 index 000000000..f19ccd77a --- /dev/null +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -0,0 +1,150 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +find_library(GFORTRAN NAMES gfortran + PATHS /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib/i386 + /usr/lib/gcc/x86_64-linux-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/i386-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04 + /usr/lib/gcc/i686-linux-gnu/4.6 + /usr/lib/gcc/x86_64-linux-gnu/4.7 + /usr/lib/gcc/i686-linux-gnu/4.7 + /usr/lib/gcc/x86_64-linux-gnu/4.8 + /usr/lib/gcc/i686-linux-gnu/4.8 + /usr/lib/gcc/x86_64-linux-gnu/4.9 + /usr/lib/gcc/i686-linux-gnu/4.9 + /usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18 + /usr/lib/gcc/i686-redhat-linux/4.7.2 + /usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19 + /usr/lib/gcc/x86_64-redhat-linux/4.8.3 # Fedora 20 + /usr/lib/gcc/x86_64-redhat-linux/4.9.1 # Fedora 21 + /usr/lib/gcc/i686-redhat-linux/4.8.1 + /usr/lib/gcc/i686-redhat-linux/4.8.3 + /usr/lib/gcc/i686-redhat-linux/4.9.1 + /usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6 + /usr/lib/gcc/i686-redhat-linux/4.4.4 + /usr/lib/gcc/x86_64-redhat-linux/4.8.2 + /usr/lib/gcc/i686-redhat-linux/4.8.2 + /usr/lib/gcc/x86_64-redhat-linux/7 + /usr/lib/gcc/i686-redhat-linux/7 + /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/7 + /usr/lib/gcc/aarch64-redhat-linux/7 + /usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1 + /usr/lib/gcc/i586-suse-linux/4.9 + /usr/lib/gcc/x86_64-suse-linux/4.8 + /usr/lib/gcc/x86_64-suse-linux/4.9 + /usr/lib/gcc/i486-linux-gnu # Debian 7 + /usr/lib/gcc/i486-linux-gnu/4.4 + /usr/lib/gcc/i486-linux-gnu/4.6 + /usr/lib/gcc/i486-linux-gnu/4.7 + /usr/lib/gcc/i486-linux-gnu/4.8 + /usr/lib/gcc/i486-linux-gnu/4.9 + /usr/lib/gcc/i586-linux-gnu/4.9 + /usr/lib/gcc/arm-linux-gnueabihf/4.4 # Debian armhf + /usr/lib/gcc/arm-linux-gnueabihf/4.5 + /usr/lib/gcc/arm-linux-gnueabihf/4.6 + /usr/lib/gcc/arm-linux-gnueabihf/4.7 + /usr/lib/gcc/arm-linux-gnueabihf/4.8 + /usr/lib/gcc/arm-linux-gnueabihf/4.9 + /usr/lib/gcc/aarch64-linux-gnu/4.9 # Debian arm64 + /usr/lib/gcc/arm-linux-gnueabi/4.7 # Debian armel + /usr/lib/gcc/arm-linux-gnueabi/4.9 + /usr/lib/gcc/x86_64-linux-gnu/5 + /usr/lib/gcc/i686-linux-gnu/5 + /usr/lib/gcc/arm-linux-gnueabi/5 + /usr/lib/gcc/arm-linux-gnueabihf/5 + /usr/lib/gcc/aarch64-linux-gnu/5 + /usr/lib/gcc/x86_64-linux-gnu/6 # Ubuntu 16.10 + /usr/lib/gcc/alpha-linux-gnu/6 + /usr/lib/gcc/aarch64-linux-gnu/6 + /usr/lib/gcc/arm-linux-gnueabi/6 + /usr/lib/gcc/arm-linux-gnueabihf/6 + /usr/lib/gcc/hppa-linux-gnu/6 + /usr/lib/gcc/i686-gnu/6 + /usr/lib/gcc/i686-linux-gnu/6 + /usr/lib/gcc/x86_64-kfreebsd-gnu/6 + /usr/lib/gcc/i686-kfreebsd-gnu/6 + /usr/lib/gcc/m68k-linux-gnu/6 + /usr/lib/gcc/mips-linux-gnu/6 + /usr/lib/gcc/mips64el-linux-gnuabi64/6 + /usr/lib/gcc/mipsel-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnu/6 + /usr/lib/gcc/powerpc-linux-gnuspe/6 + /usr/lib/gcc/powerpc64-linux-gnu/6 + /usr/lib/gcc/powerpc64le-linux-gnu/6 + /usr/lib/gcc/s390x-linux-gnu/6 + /usr/lib/gcc/sparc64-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnux32/6 + /usr/lib/gcc/sh4-linux-gnu/6 + /usr/lib/gcc/x86_64-linux-gnu/7 # Debian 9 Buster + /usr/lib/gcc/alpha-linux-gnu/7 + /usr/lib/gcc/aarch64-linux-gnu/7 + /usr/lib/gcc/arm-linux-gnueabi/7 + /usr/lib/gcc/arm-linux-gnueabihf/7 + /usr/lib/gcc/hppa-linux-gnu/7 + /usr/lib/gcc/i686-gnu/7 + /usr/lib/gcc/i686-linux-gnu/7 + /usr/lib/gcc/x86_64-kfreebsd-gnu/7 + /usr/lib/gcc/i686-kfreebsd-gnu/7 + /usr/lib/gcc/m68k-linux-gnu/7 + /usr/lib/gcc/mips-linux-gnu/7 + /usr/lib/gcc/mips64el-linux-gnuabi64/7 + /usr/lib/gcc/mipsel-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnu/7 + /usr/lib/gcc/powerpc-linux-gnuspe/7 + /usr/lib/gcc/powerpc64-linux-gnu/7 + /usr/lib/gcc/powerpc64le-linux-gnu/7 + /usr/lib/gcc/s390x-linux-gnu/7 + /usr/lib/gcc/sparc64-linux-gnu/7 + /usr/lib/gcc/x86_64-linux-gnux32/7 + /usr/lib/gcc/sh4-linux-gnu/7 + /usr/lib/x86_64-linux-gnu # libgfortran4 + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/aarch64-linux-gnu + /usr/lib/i386-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran8 + /usr/lib/gcc/aarch64-linux-gnu/8 + /usr/lib/gcc/arm-linux-gnueabihf/8 + /usr/lib/gcc/i686-linux-gnu/8 + /usr/lib/gcc/powerpc64le-linux-gnu/8 + /usr/lib/gcc/s390x-linux-gnu/8 + /usr/lib/gcc/alpha-linux-gnu/8 + ${GFORTRAN_ROOT}/lib + $ENV{GFORTRAN_ROOT}/lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake new file mode 100644 index 000000000..2d8f154f3 --- /dev/null +++ b/cmake/Modules/FindGLOG.cmake @@ -0,0 +1,140 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find the Google Glog library +# +# This module defines the following variables +# +# GLOG_FOUND - Was Glog found +# GLOG_INCLUDE_DIRS - the Glog include directories +# GLOG_LIBRARIES - Link to this +# +# This module accepts the following variables +# +# GLOG_ROOT - Can be set to Glog install path or Windows build path +# + +if(NOT DEFINED GLOG_ROOT) + set(GLOG_ROOT /usr /usr/local) +endif() + +if(MSVC) + set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) +else() + set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) +endif() + +macro(_FIND_GLOG_LIBRARIES _var) + find_library(${_var} + NAMES ${ARGN} + PATHS ${LIB_PATHS} + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GLOG_ROOT}/lib + $ENV{GLOG_ROOT}/lib + ${GLOG_ROOT}/lib64 + $ENV{GLOG_ROOT}/lib64 + PATH_SUFFIXES lib + ) + mark_as_advanced(${_var}) +endmacro() + +macro(_GLOG_APPEND_LIBRARIES _list _release) +set(_debug ${_release}_DEBUG) +if(${_debug}) + set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}}) +else() + set(${_list} ${${_list}} ${${_release}}) +endif() +endmacro() + +if(MSVC) + find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h + PATHS + ${GLOG_ROOT}/src/windows + ${GLOG_ROOT}/src/windows/glog + ) +else() + # Linux/OS X builds + find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h + PATHS + ${GLOG_ROOT}/include/glog + /usr/include/glog + /opt/local/include/glog # default location in Macports + ) +endif() + +# Find the libraries +if(MSVC) + _find_glog_libraries(GLOG_LIBRARIES libglog.lib) +else() + # Linux/OS X builds + if(UNIX) + _find_glog_libraries(GLOG_LIBRARIES libglog.so) + endif() + if(APPLE) + _find_glog_libraries(GLOG_LIBRARIES libglog.dylib) + endif() +endif() + +if(GLOG_FOUND) + message(STATUS "glog library found at ${GLOG_LIBRARIES}") +endif() + +# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES) + +if(MSVC) + string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) + string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) + set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") + string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) +else() + # Linux/OS X builds + set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) + string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) +endif() + +if(GLOG_FOUND) + # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) +endif() diff --git a/cmake/Modules/FindGNSSSIMULATOR.cmake b/cmake/Modules/FindGNSSSIMULATOR.cmake new file mode 100644 index 000000000..66aa9176a --- /dev/null +++ b/cmake/Modules/FindGNSSSIMULATOR.cmake @@ -0,0 +1,30 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +find_program(SW_GENERATOR_BIN gnss_sim + PATHS /usr/bin + /usr/local/bin + /opt/local/bin + ${CMAKE_INSTALL_PREFIX}/bin + ${GNSSSIMULATOR_ROOT}/bin + $ENV{GNSSSIMULATOR_ROOT}/bin + PATH_SUFFIXES bin +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) +mark_as_advanced(SW_GENERATOR_BIN) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake new file mode 100644 index 000000000..7f5deb3ab --- /dev/null +++ b/cmake/Modules/FindGNURADIO.cmake @@ -0,0 +1,202 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GNU Radio +######################################################################## + +include(FindPkgConfig) +include(FindPackageHandleStandardArgs) + +# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list +if(NOT GR_REQUIRED_COMPONENTS) + set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD) +endif() + +# Allows us to use all .cmake files in this directory +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) + +# Easily access all libraries and includes of GNU Radio +set(GNURADIO_ALL_LIBRARIES "") +set(GNURADIO_ALL_INCLUDE_DIRS "") + +macro(LIST_CONTAINS var value) + set(${var}) + foreach(value2 ${ARGN}) + if(${value} STREQUAL ${value2}) + set(${var} TRUE) + endif() + endforeach() +endmacro() + +function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) + list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) + if(NOT REQUIRED_MODULE) + #message("Ignoring GNU Radio Module ${EXTVAR}") + return() + endif() + + message(STATUS "Checking for GNU Radio Module: ${EXTVAR}") + + # check for .pc hints + pkg_check_modules(PC_GNURADIO_${EXTVAR} ${PCNAME}) + + if(NOT PC_GNURADIO_${EXTVAR}_FOUND) + set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE}) + endif() + + set(INCVAR_NAME "GNURADIO_${EXTVAR}_INCLUDE_DIRS") + set(LIBVAR_NAME "GNURADIO_${EXTVAR}_LIBRARIES") + set(PC_INCDIR ${PC_GNURADIO_${EXTVAR}_INCLUDEDIR}) + set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) + + # look for include files + find_path(${INCVAR_NAME} + NAMES ${INCFILE} + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${PC_INCDIR} + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include + ) + + # look for libs + foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) + find_library(${LIBVAR_NAME}_${libname} + NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} + HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_INSTALL_PREFIX}/lib64 + PATHS /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GNURADIO_INSTALL_PREFIX}/lib + ${GNURADIO_ROOT}/lib + $ENV{GNURADIO_ROOT}/lib + ${GNURADIO_ROOT}/lib64 + $ENV{GNURADIO_ROOT}/lib64 + ) + list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) + endforeach() + + set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE) + + # show results + message(STATUS " * INCLUDES=${GNURADIO_${EXTVAR}_INCLUDE_DIRS}") + message(STATUS " * LIBS=${GNURADIO_${EXTVAR}_LIBRARIES}") + + # append to all includes and libs list + set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE) + set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_${EXTVAR}_LIBRARIES} PARENT_SCOPE) + + find_package_handle_standard_args(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) + message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}") + set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE) + + # generate an error if the module is missing + if(NOT GNURADIO_${EXTVAR}_FOUND) + message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") + endif() + + mark_as_advanced(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) +endfunction() + +gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) +gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) +gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) +gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) +gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) +gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) +gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) +gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) +gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) +gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) +gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) +gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) +gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) +gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) +gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) +gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) +gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) +gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) +gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) + +list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS) +list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) + +# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present +if(NOT PC_GNURADIO_RUNTIME_VERSION) + find_file(GNURADIO_VERSION_GREATER_THAN_373 + NAMES gnuradio/blocks/tsb_vector_sink_f.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include + ) + if(GNURADIO_VERSION_GREATER_THAN_373) + set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") + endif() + + find_file(GNURADIO_VERSION_GREATER_THAN_38 + NAMES gnuradio/filter/mmse_resampler_cc.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${CMAKE_INSTALL_PREFIX}/include + ${GNURADIO_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${GNURADIO_ROOT}/include + $ENV{GNURADIO_ROOT}/include + ) + if(GNURADIO_VERSION_GREATER_THAN_38) + set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") + endif() +endif() diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake new file mode 100644 index 000000000..67dfff8af --- /dev/null +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -0,0 +1,87 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find Gperftools. +# +# Usage of this module as follows: +# +# find_package(GPERFTOOLS) +# +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# GPERFTOOLS_ROOT Set this variable to the root installation of +# Gperftools if the module has problems finding +# the proper installation path. +# +# Variables defined by this module: +# +# GPERFTOOLS_FOUND System has Gperftools libs/headers +# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler) +# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers + +find_library(GPERFTOOLS_TCMALLOC + NAMES tcmalloc + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_library(GPERFTOOLS_PROFILER + NAMES profiler + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER + NAMES tcmalloc_and_profiler + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_path(GPERFTOOLS_INCLUDE_DIR + NAMES gperftools/heap-profiler.h + HINTS ${Gperftools_ROOT_DIR}/include + ${GPERFTOOLS_ROOT}/include + $ENV{GPERFTOOLS_ROOT}/include +) + +set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + GPERFTOOLS + DEFAULT_MSG + GPERFTOOLS_LIBRARIES + GPERFTOOLS_INCLUDE_DIR +) + +mark_as_advanced( + Gperftools_ROOT_DIR + GPERFTOOLS_TCMALLOC + GPERFTOOLS_PROFILER + GPERFTOOLS_TCMALLOC_AND_PROFILER + GPERFTOOLS_LIBRARIES + GPERFTOOLS_INCLUDE_DIR) diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake new file mode 100644 index 000000000..f5ecb667e --- /dev/null +++ b/cmake/Modules/FindGPSTK.cmake @@ -0,0 +1,49 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Find gpstk library +# Find the native gpstk includes and library +# This module defines +# GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc. +# GPSTK_FOUND, If false, do not try to use GPSTK. +# GPSTK_LIBRARY, where to find the GPSTK library. + +find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp + HINTS /usr/include + /usr/local/include + /opt/local/include + ${GPSTK_ROOT}/include + $ENV{GPSTK_ROOT}/include +) + +set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) + +find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} + HINTS /usr/lib + /usr/local/lib + /opt/local/lib + ${GPSTK_ROOT}/lib + $ENV{GPSTK_ROOT}/lib + ${GPSTK_ROOT}/lib64 + $ENV{GPSTK_ROOT}/lib64 +) + +# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) +mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR) diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake new file mode 100644 index 000000000..e0689aeaf --- /dev/null +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GR-DBFCTTC Module +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc) + +find_path( + GR_DBFCTTC_INCLUDE_DIRS + NAMES dbfcttc/api.h + HINTS $ENV{GR_DBFCTTC_DIR}/include + ${PC_GR_DBFCTTC_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/include + /usr/local/include + ${GRDBFCTTC_ROOT}/include + $ENV{GRDBFCTTC_ROOT}/include +) + +find_library( + GR_DBFCTTC_LIBRARIES + NAMES gnuradio-dbfcttc + HINTS $ENV{GR_DBFCTTC_DIR}/lib + ${PC_GR_DBFCTTC_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + ${GRDBFCTTC_ROOT}/lib + $ENV{GRDBFCTTC_ROOT}/lib + ${GRDBFCTTC_ROOT}/lib64 + $ENV{GRDBFCTTC_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) +mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake new file mode 100644 index 000000000..93f7bda89 --- /dev/null +++ b/cmake/Modules/FindGRGN3S.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GR-GN3S Module +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_GR_GN3S gr-gn3s) + +find_path( + GR_GN3S_INCLUDE_DIRS + NAMES gn3s/gn3s_api.h + HINTS $ENV{GR_GN3S_DIR}/include + ${PC_GR_GN3S_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${GRGN3S_ROOT}/include + $ENV{GRGN3S_ROOT}/include +) + +find_library( + GR_GN3S_LIBRARIES + NAMES gr-gn3s + HINTS $ENV{GR_GN3S_DIR}/lib + ${PC_GR_GN3S_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${GRGN3S_ROOT}/lib + $ENV{GRGN3S_ROOT}/lib + ${GRGN3S_ROOT}/lib64 + $ENV{GRGN3S_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) +mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake new file mode 100644 index 000000000..6d341e7fd --- /dev/null +++ b/cmake/Modules/FindGRIIO.cmake @@ -0,0 +1,72 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_IIO gnuradio-iio) + +find_path(IIO_INCLUDE_DIRS + NAMES gnuradio/iio/api.h + HINTS $ENV{IIO_DIR}/include + ${PC_IIO_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${GRIIO_ROOT}/include + $ENV{GRIIO_ROOT}/include +) + +find_library(IIO_LIBRARIES + NAMES gnuradio-iio + HINTS $ENV{IIO_DIR}/lib + ${PC_IIO_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu + ${GRIIO_ROOT}/lib + $ENV{GRIIO_ROOT}/lib + ${GRIIO_ROOT}/lib64 + $ENV{GRIIO_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) +mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake new file mode 100644 index 000000000..48379ed76 --- /dev/null +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -0,0 +1,92 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find gr-osmosdr. +# +# Usage of this module as follows: +# +# find_package(GROSMOSDR) +# +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# GrOsmoSDR_ROOT_DIR Set this variable to the root installation of +# gr-osmosdr if the module has problems finding +# the proper installation path. +# +# Variables defined by this module: +# +# GROSMOSDR_FOUND System has gr-osmosdr libs/headers +# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) +# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers + +include(FindPkgConfig) +pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) + +find_path(GROSMOSDR_INCLUDE_DIR + NAMES + osmosdr/source.h + osmosdr/api.h + PATHS + ${GROSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + /opt/local/include + ${GROSMOSDR_ROOT}/include + $ENV{GROSMOSDR_ROOT}/include +) + +find_library(GROSMOSDR_LIBRARIES + NAMES gnuradio-osmosdr + PATHS + ${GROSMOSDR_PKG_LIBRARY_DIRS} + /usr/lib + /usr/local/lib + /opt/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${GROSMOSDR_ROOT}/lib + $ENV{GROSMOSDR_ROOT}/lib + ${GROSMOSDR_ROOT}/lib64 + $ENV{GROSMOSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) +mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake new file mode 100644 index 000000000..a76180ca2 --- /dev/null +++ b/cmake/Modules/FindLIBIIO.cmake @@ -0,0 +1,76 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_LIBIIO libiio) + +find_path( + LIBIIO_INCLUDE_DIRS + NAMES iio.h + HINTS $ENV{LIBIIO_DIR}/include + ${PC_LIBIIO_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + /opt/local/include + ${LIBIIO_ROOT}/include + $ENV{LIBIIO_ROOT}/include +) + +find_library( + LIBIIO_LIBRARIES + NAMES iio libiio.so.0 + HINTS $ENV{LIBIIO_DIR}/lib + ${PC_LIBIIO_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu + /Library/Frameworks/iio.framework/ + ${LIBIIO_ROOT}/lib + $ENV{LIBIIO_ROOT}/lib + ${LIBIIO_ROOT}/lib64 + $ENV{LIBIIO_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) +mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake new file mode 100644 index 000000000..1e3aaf5e0 --- /dev/null +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -0,0 +1,80 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find libosmosdr. +# +# Usage of this module as follows: +# +# find_package(LIBOSMOSDR) +# +# +# Variables defined by this module: +# +# LIBOSMOSDR_FOUND System has libosmosdr libs/headers +# LIBOSMOSDR_LIBRARIES The libosmosdr libraries +# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers + +include(FindPkgConfig) +pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) + +find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h + PATHS + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + ${LIBOSMOSDR_ROOT}/include + $ENV{LIBOSMOSDR_ROOT}/include +) + +find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr + PATHS + ${LIBOSMOSDR_PKG_LIBRARY_DIRS} + /usr/lib + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${LIBOSMOSDR_ROOT}/lib + $ENV{LIBOSMOSDR_ROOT}/lib + ${LIBOSMOSDR_ROOT}/lib64 + $ENV{LIBOSMOSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) +mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake new file mode 100644 index 000000000..283c3ddf9 --- /dev/null +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -0,0 +1,92 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Find Log4cpp +# Find the native LOG4CPP includes and library +# +# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. +# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. +# LOG4CPP_FOUND - True if LOG4CPP found. + + +if(LOG4CPP_INCLUDE_DIR) + # Already in cache, be silent + set(LOG4CPP_FIND_QUIETLY TRUE) +endif() + +find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh + /opt/local/include + /usr/local/include + /usr/include + ${LOG4CPP_ROOT}/include + $ENV{LOG4CPP_ROOT}/include +) + +set(LOG4CPP_NAMES log4cpp) +find_library(LOG4CPP_LIBRARY + NAMES ${LOG4CPP_NAMES} + HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib + ${PC_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib/ + PATHS /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + /usr/local/lib + /opt/local/lib + ${LOG4CPP_ROOT}/lib + $ENV{LOG4CPP_ROOT}/lib + ${LOG4CPP_ROOT}/lib64 + $ENV{LOG4CPP_ROOT}/lib64 +) + +if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) + set(LOG4CPP_FOUND TRUE) + set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE) +else() + set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake new file mode 100644 index 000000000..08facf069 --- /dev/null +++ b/cmake/Modules/FindMATIO.cmake @@ -0,0 +1,129 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# FindMATIO +# +# Try to find MATIO library +# +# Once done this will define: +# +# MATIO_FOUND - True if MATIO found. +# MATIO_LIBRARIES - MATIO libraries. +# MATIO_INCLUDE_DIRS - where to find matio.h, etc.. +# MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") +# +#============================================================================= +# Copyright 2015 Avtech Scientific +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= +# + +# Look for the header file. +find_path(MATIO_INCLUDE_DIR + NAMES matio.h + HINTS + ${MATIO_ROOT}/include + $ENV{MATIO_ROOT}/include + DOC "The MATIO include directory" +) + +# Look for the library. +find_library(MATIO_LIBRARY + NAMES matio + HINTS + ${MATIO_ROOT}/lib + $ENV{MATIO_ROOT}/lib + ${MATIO_ROOT}/lib64 + $ENV{MATIO_ROOT}/lib64 + DOC "The MATIO library" +) + +if(MATIO_INCLUDE_DIR) + # --------------------------------------------------- + # Extract version information from MATIO + # --------------------------------------------------- + + # If the file is missing, set all values to 0 + set(MATIO_MAJOR_VERSION 0) + set(MATIO_MINOR_VERSION 0) + set(MATIO_RELEASE_LEVEL 0) + + # new versions of MATIO have `matio_pubconf.h` + if(EXISTS ${MATIO_INCLUDE_DIR}/matio_pubconf.h) + set(MATIO_CONFIG_FILE "matio_pubconf.h") + else() + set(MATIO_CONFIG_FILE "matioConfig.h") + endif() + + if(MATIO_CONFIG_FILE) + + # Read and parse MATIO config header file for version number + file(STRINGS "${MATIO_INCLUDE_DIR}/${MATIO_CONFIG_FILE}" _matio_HEADER_CONTENTS REGEX "#define MATIO_((MAJOR|MINOR)_VERSION)|(RELEASE_LEVEL) ") + + foreach(line ${_matio_HEADER_CONTENTS}) + if(line MATCHES "#define ([A-Z_]+) ([0-9]+)") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() + + unset(_matio_HEADER_CONTENTS) + endif() + + set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") +endif() + +mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) + +# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) + +if(MATIO_FOUND) + set(MATIO_LIBRARIES ${MATIO_LIBRARY}) + set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR}) +else() + set(MATIO_LIBRARIES) + set(MATIO_INCLUDE_DIRS) +endif() diff --git a/cmake/Modules/FindOPENBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake new file mode 100644 index 000000000..8ff70d65f --- /dev/null +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -0,0 +1,49 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find OpenBLAS library (not headers!) +# +# The following environment variable is optionally searched +# OPENBLAS_HOME: Base directory where all OpenBlas components are found + +set(OPEN_BLAS_SEARCH_PATHS + /lib + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib + ${OPENBLAS_ROOT}/lib + $ENV{OPENBLAS_ROOT}/lib + ${OPENBLAS_ROOT}/lib64 + $ENV{OPENBLAS_ROOT}/lib64 +) + +find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) + +if(OPENBLAS) + set(OPENBLAS_FOUND ON) + message(STATUS "Found OpenBLAS") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS) +mark_as_advanced(OPENBLAS) diff --git a/cmake/Modules/FindOPENCL.cmake b/cmake/Modules/FindOPENCL.cmake new file mode 100644 index 000000000..988360c29 --- /dev/null +++ b/cmake/Modules/FindOPENCL.cmake @@ -0,0 +1,110 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# +# This file taken from FindOpenCL project @ http://gitorious.com/findopencl +# +# - Try to find OpenCL +# This module tries to find an OpenCL implementation on your system. It supports +# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. +# +# Once done this will define +# OPENCL_FOUND - system has OpenCL +# OPENCL_INCLUDE_DIRS - the OpenCL include directory +# OPENCL_LIBRARIES - link these to use OpenCL +# +# WIN32 should work, but is untested + +include(FindPackageHandleStandardArgs) + +set(OPENCL_VERSION_STRING "0.1.0") +set(OPENCL_VERSION_MAJOR 0) +set(OPENCL_VERSION_MINOR 1) +set(OPENCL_VERSION_PATCH 0) + +if(APPLE) + find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") + find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") + find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") + +else() + if(WIN32) + find_path(OPENCL_INCLUDE_DIRS CL/cl.h) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) + + # The AMD SDK currently installs both x86 and x86_64 libraries + # This is only a hack to find out architecture + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") + else() + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") + endif() + + # find out if the user asked for a 64-bit build, and use the corresponding + # 64 or 32 bit NVIDIA library paths to the search: + string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) + if("${ISWIN64}" STREQUAL "Win64") + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) + else() + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) + endif() + + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # On Win32 search relative to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + + else() + # Unix style platforms + find_library(OPENCL_LIBRARIES OpenCL + ENV LD_LIBRARY_PATH + ) + + get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # The AMD SDK currently does not place its headers + # in /usr/include, therefore also search relative + # to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + endif() +endif() + +find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS) + +if(_OPENCL_CPP_INCLUDE_DIRS) + set(OPENCL_HAS_CPP_BINDINGS TRUE) + list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS}) + # This is often the same, so clean up + list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS) +endif() + +mark_as_advanced( + OPENCL_INCLUDE_DIRS +) + +if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES) + set( OPENCL_FOUND TRUE ) + add_definitions( -DOPENCL=1 ) +else() + set( OPENCL_FOUND FALSE ) + add_definitions( -DOPENCL=0 ) +endif() diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake new file mode 100644 index 000000000..fea12b98f --- /dev/null +++ b/cmake/Modules/FindORC.cmake @@ -0,0 +1,75 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +find_package(PkgConfig) +pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22") + +find_program(ORCC_EXECUTABLE orcc + HINTS ${PC_ORC_TOOLSDIR} + PATHS ${ORC_ROOT}/bin + ${CMAKE_INSTALL_PREFIX}/bin +) + +find_path(ORC_INCLUDE_DIR + NAMES orc/orc.h + HINTS ${PC_ORC_INCLUDEDIR} + PATHS ${ORC_ROOT}/include/orc-0.4 + ${CMAKE_INSTALL_PREFIX}/include/orc-0.4 +) + +find_path(ORC_LIBRARY_DIR + NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} + HINTS ${PC_ORC_LIBDIR} + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib64 + /usr/lib + ${ORC_ROOT}/lib + $ENV{ORC_ROOT}/lib + PATHS + ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) + +find_library(ORC_LIB orc-0.4 + HINTS ${PC_ORC_LIBRARY_DIRS} + PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} +) + +list(APPEND ORC_LIBRARY ${ORC_LIB}) + +set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) +set(ORC_LIBRARIES ${ORC_LIBRARY}) +set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) + +mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake new file mode 100644 index 000000000..af746c852 --- /dev/null +++ b/cmake/Modules/FindPCAP.cmake @@ -0,0 +1,122 @@ +################################################################### +# +# Copyright (c) 2006 Frederic Heem, +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the Telsey nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +################################################################### +# - Find pcap +# Find the PCAP includes and library +# http://www.tcpdump.org/ +# +# The environment variable PCAPDIR allows to specficy where to find +# libpcap in non standard location. +# +# PCAP_INCLUDE_DIRS - where to find pcap.h, etc. +# PCAP_LIBRARIES - List of libraries when using pcap. +# PCAP_FOUND - True if pcap found. + + +if(EXISTS $ENV{PCAPDIR}) + find_path(PCAP_INCLUDE_DIR + NAMES + pcap/pcap.h + pcap.h + PATHS + $ENV{PCAPDIR} + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include + NO_DEFAULT_PATH + ) + find_library(PCAP_LIBRARY + NAMES + pcap + PATHS + $ENV{PCAPDIR} + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib + NO_DEFAULT_PATH + ) +else() + find_path(PCAP_INCLUDE_DIR + NAMES + pcap/pcap.h + pcap.h + HINTS + ${PCAP_ROOT}/include + $ENV{PCAP_ROOT}/include + ) + find_library(PCAP_LIBRARY + NAMES + pcap + HINTS + ${PCAP_ROOT}/lib + $ENV{PCAP_ROOT}/lib + ) +endif() + +set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) +set(PCAP_LIBRARIES ${PCAP_LIBRARY}) + +if(PCAP_INCLUDE_DIRS) + message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") +else() + message(FATAL " Pcap include dirs cannot be found") +endif() + +if(PCAP_LIBRARIES) + message(STATUS "Pcap library set to ${PCAP_LIBRARIES}") +else() + message(FATAL "Pcap library cannot be found") +endif() + +#Functions +include(CheckFunctionExists) +set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) +set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) +check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP) +check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) +check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) +check_function_exists("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) +check_function_exists("pcap_freecode" HAVE_PCAP_FREECODE) +check_function_exists("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) +check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION) +check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) +check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) +check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) + +mark_as_advanced( + PCAP_LIBRARIES + PCAP_INCLUDE_DIRS +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake new file mode 100644 index 000000000..236a4c95a --- /dev/null +++ b/cmake/Modules/FindPUGIXML.cmake @@ -0,0 +1,75 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Find the pugixml XML parsing library. +# +# Sets the usual variables expected for find_package scripts: +# +# PUGIXML_INCLUDE_DIR - header location +# PUGIXML_LIBRARIES - library to link against +# PUGIXML_FOUND - true if pugixml was found. + +find_path(PUGIXML_INCLUDE_DIR + NAMES pugixml.hpp + PATHS ${PUGIXML_HOME}/include + /usr/include + /usr/local/include + /opt/local/include + ${PUGIXML_ROOT}/include + $ENV{PUGIXML_ROOT}/include +) + +find_library(PUGIXML_LIBRARY + NAMES pugixml + PATHS ${PUGIXML_HOME}/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/i386-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/local/lib + /opt/local/lib + /usr/lib + /usr/lib64 + /usr/local/lib64 + ${PUGIXML_ROOT}/lib + $ENV{PUGIXML_ROOT}/lib + ${PUGIXML_ROOT}/lib64 + $ENV{PUGIXML_ROOT}/lib64 +) + +# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_LIBRARY + PUGIXML_INCLUDE_DIR) + +if(PUGIXML_FOUND) + set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY}) + if(NOT PUGIXML_FIND_QUIETLY) + message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}") + message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}") + endif() +else() + message(STATUS "PugiXML not found.") +endif() + +mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake new file mode 100644 index 000000000..eb2420687 --- /dev/null +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -0,0 +1,50 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_TELEORBIT teleorbit) + +find_path(TELEORBIT_INCLUDE_DIRS + NAMES teleorbit/api.h + HINTS $ENV{TELEORBIT_DIR}/include + ${PC_TELEORBIT_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${TELEORBIT_ROOT}/include + $ENV{TELEORBIT_ROOT}/include +) + +find_library(TELEORBIT_LIBRARIES + NAMES gnuradio-teleorbit + HINTS $ENV{TELEORBIT_DIR}/lib + ${PC_TELEORBIT_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${TELEORBIT_ROOT}/lib + $ENV{TELEORBIT_ROOT}/lib + ${TELEORBIT_ROOT}/lib64 + $ENV{TELEORBIT_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) +mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake new file mode 100644 index 000000000..31d299937 --- /dev/null +++ b/cmake/Modules/FindUHD.cmake @@ -0,0 +1,75 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find the library for the USRP Hardware Driver +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_UHD uhd) + +find_path(UHD_INCLUDE_DIRS + NAMES uhd/config.hpp + HINTS $ENV{UHD_DIR}/include + ${PC_UHD_INCLUDEDIR} + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${UHD_ROOT}/include + $ENV{UHD_ROOT}/include +) + +find_library(UHD_LIBRARIES + NAMES uhd + HINTS $ENV{UHD_DIR}/lib + ${PC_UHD_LIBDIR} + PATHS /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GNURADIO_INSTALL_PREFIX}/lib + ${UHD_ROOT}/lib + $ENV{UHD_ROOT}/lib + ${UHD_ROOT}/lib64 + $ENV{UHD_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) +mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake new file mode 100644 index 000000000..97191179c --- /dev/null +++ b/cmake/Modules/FindVOLK.cmake @@ -0,0 +1,76 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find VOLK (Vector-Optimized Library of Kernels) +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_VOLK volk) + +find_path(VOLK_INCLUDE_DIRS + NAMES volk/volk.h + HINTS $ENV{VOLK_DIR}/include + ${PC_VOLK_INCLUDEDIR} + PATHS /usr/local/include + /usr/include + ${CMAKE_INSTALL_PREFIX}/include + ${VOLK_ROOT}/include + $ENV{VOLK_ROOT}/include +) + +find_library(VOLK_LIBRARIES + NAMES volk + HINTS $ENV{VOLK_DIR}/lib + ${PC_VOLK_LIBDIR} + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${CMAKE_INSTALL_PREFIX}/lib + ${VOLK_ROOT}/lib + $ENV{VOLK_ROOT}/lib + ${VOLK_ROOT}/lib64 + $ENV{VOLK_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) +mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake new file mode 100644 index 000000000..5cdc4e61d --- /dev/null +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -0,0 +1,53 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) + +find_path(VOLK_GNSSSDR_INCLUDE_DIRS + NAMES volk_gnsssdr/volk_gnsssdr.h + HINTS $ENV{VOLK_GNSSSDR_DIR}/include + ${PC_VOLK_GNSSSDR_INCLUDEDIR} + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${VOLKGNSSSDR_ROOT}/include + $ENV{VOLKGNSSSDR_ROOT}/include +) + +find_library(VOLK_GNSSSDR_LIBRARIES + NAMES volk_gnsssdr + HINTS $ENV{VOLK_GNSSSDR_DIR}/lib + ${PC_VOLK_GNSSSDR_LIBDIR} + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${VOLKGNSSSDR_ROOT}/lib + $ENV{VOLKGNSSSDR_ROOT}/lib + ${VOLKGNSSSDR_ROOT}/lib64 + $ENV{VOLKGNSSSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) diff --git a/cmake/Modules/GnsssdrBuildTypes.cmake b/cmake/Modules/GnsssdrBuildTypes.cmake new file mode 100644 index 000000000..a80cd0c6b --- /dev/null +++ b/cmake/Modules/GnsssdrBuildTypes.cmake @@ -0,0 +1,219 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +if(DEFINED __INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE) + return() +endif() +set(__INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE TRUE) + +# Standard CMake Build Types and their basic CFLAGS: +# - None: nothing set +# - Debug: -O2 -g +# - Release: -O3 +# - RelWithDebInfo: -O3 -g +# - MinSizeRel: -Os + +# Additional Build Types, defined below: +# - NoOptWithASM: -O0 -g -save-temps +# - O2WithASM: -O2 -g -save-temps +# - O3WithASM: -O3 -g -save-temps + +# Defines the list of acceptable cmake build types. When adding a new +# build type below, make sure to add it to this list. +list(APPEND AVAIL_BUILDTYPES + None Debug Release RelWithDebInfo MinSizeRel + Coverage NoOptWithASM O2WithASM O3WithASM ASAN +) + +######################################################################## +# GNSSSDR_CHECK_BUILD_TYPE(build type) +# +# Use this to check that the build type set in CMAKE_BUILD_TYPE on the +# commandline is one of the valid build types used by this project. It +# checks the value set in the cmake interface against the list of +# known build types in AVAIL_BUILDTYPES. If the build type is found, +# the function exits immediately. If nothing is found by the end of +# checking all available build types, we exit with an error and list +# the avialable build types. +######################################################################## +function(GNSSSDR_CHECK_BUILD_TYPE settype) + string(TOUPPER ${settype} _settype) + foreach(btype ${AVAIL_BUILDTYPES}) + string(TOUPPER ${btype} _btype) + if(${_settype} STREQUAL ${_btype}) + return() # found it; exit cleanly + endif() + endforeach() + # Build type not found; error out + message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") +endfunction() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=Coverage +# +# This type uses no optimization (-O0), outputs debug symbols (-g) and +# outputs all intermediary files the build system produces, including +# all assembly (.s) files. Look in the build directory for these +# files. +# NOTE: This is not defined on Windows systems. +######################################################################## +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING + "Flags used by the C++ compiler during Coverage builds." FORCE) + set(CMAKE_C_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING + "Flags used by the C compiler during Coverage builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_COVERAGE + "-W" CACHE STRING + "Flags used for linking binaries during Coverage builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE + "-W" CACHE STRING + "Flags used by the shared lib linker during Coverage builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_COVERAGE + CMAKE_C_FLAGS_COVERAGE + CMAKE_EXE_LINKER_FLAGS_COVERAGE + CMAKE_SHARED_LINKER_FLAGS_COVERAGE) +endif() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=NoOptWithASM +# +# This type uses no optimization (-O0), outputs debug symbols (-g) and +# outputs all intermediary files the build system produces, including +# all assembly (.s) files. Look in the build directory for these +# files. +# NOTE: This is not defined on Windows systems. +######################################################################## +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING + "Flags used by the C++ compiler during NoOptWithASM builds." FORCE) + set(CMAKE_C_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING + "Flags used by the C compiler during NoOptWithASM builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM + "-W" CACHE STRING + "Flags used for linking binaries during NoOptWithASM builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM + "-W" CACHE STRING + "Flags used by the shared lib linker during NoOptWithASM builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_NOOPTWITHASM + CMAKE_C_FLAGS_NOOPTWITHASM + CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM + CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) +endif() + + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=O2WithASM +# +# This type uses level 2 optimization (-O2), outputs debug symbols +# (-g) and outputs all intermediary files the build system produces, +# including all assembly (.s) files. Look in the build directory for +# these files. +# NOTE: This is not defined on Windows systems. +######################################################################## + +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING + "Flags used by the C++ compiler during O2WithASM builds." FORCE) + set(CMAKE_C_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING + "Flags used by the C compiler during O2WithASM builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM + "-W" CACHE STRING + "Flags used for linking binaries during O2WithASM builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM + "-W" CACHE STRING + "Flags used by the shared lib linker during O2WithASM builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_O2WITHASM + CMAKE_C_FLAGS_O2WITHASM + CMAKE_EXE_LINKER_FLAGS_O2WITHASM + CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) +endif() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=O3WithASM +# +# This type uses level 3 optimization (-O3), outputs debug symbols +# (-g) and outputs all intermediary files the build system produces, +# including all assembly (.s) files. Look in the build directory for +# these files. +# NOTE: This is not defined on Windows systems. +######################################################################## + +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING + "Flags used by the C++ compiler during O3WithASM builds." FORCE) + set(CMAKE_C_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING + "Flags used by the C compiler during O3WithASM builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM + "-W" CACHE STRING + "Flags used for linking binaries during O3WithASM builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM + "-W" CACHE STRING + "Flags used by the shared lib linker during O3WithASM builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_O3WITHASM + CMAKE_C_FLAGS_O3WITHASM + CMAKE_EXE_LINKER_FLAGS_O3WITHASM + CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) +endif() + + +######################################################################## +# For GCC and Clang, we can set a build type: +# +# -DCMAKE_BUILD_TYPE=ASAN +# +# This type creates an address sanitized build (-fsanitize=address) +# and defaults to the DebugParanoid linker flags. +# NOTE: This is not defined on Windows systems. +######################################################################## +if(NOT WIN32) + set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + "Flags used by the C++ compiler during Address Sanitized builds." FORCE) + set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING + "Flags used by the C compiler during Address Sanitized builds." FORCE) + set(CMAKE_EXE_LINKER_FLAGS_ASAN + "-W" CACHE STRING + "Flags used for linking binaries during Address Sanitized builds." FORCE) + set(CMAKE_SHARED_LINKER_FLAGS_ASAN + "-W" CACHE STRING + "Flags used by the shared lib linker during Address Sanitized builds." FORCE) + + mark_as_advanced( + CMAKE_CXX_FLAGS_ASAN + CMAKE_C_FLAGS_ASAN + CMAKE_EXE_LINKER_FLAGS_ASAN + CMAKE_SHARED_LINKER_ASAN) +endif() diff --git a/cmake/Modules/SetupPython.cmake b/cmake/Modules/SetupPython.cmake new file mode 100644 index 000000000..f3d59c900 --- /dev/null +++ b/cmake/Modules/SetupPython.cmake @@ -0,0 +1,119 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + + +######################################################################## +# 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_RAW desc python_code have) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}" + OUTPUT_QUIET ERROR_QUIET + RESULT_VARIABLE return_code + ) + if(return_code EQUAL 0) + message(STATUS "Python checking for ${desc} - found") + set(${have} TRUE) + else() + message(STATUS "Python checking for ${desc} - not found") + set(${have} FALSE) + endif() +endmacro() + +macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have) + gnsssdr_python_check_module_raw( + "${desc}" " +######################################### +try: + import ${mod} + assert ${cmd} +except (ImportError, AssertionError): exit(-1) +except: pass +#########################################" + "${have}") +endmacro() + + +######################################################################## +# Setup the python interpreter: +# This allows the user to specify a specific interpreter, +# or finds the interpreter via the built-in cmake module. +######################################################################## + +if(CMAKE_VERSION VERSION_LESS 3.12) + if(PYTHON_EXECUTABLE) + message(STATUS "User set python executable ${PYTHON_EXECUTABLE}") + string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3) + if(IS_PYTHON3 EQUAL -1) + find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) + else() + find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) + endif() + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + else() + message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2") + message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") + find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) + if(NOT PYTHONINTERP_FOUND) + message(STATUS "python2 not found - trying with python3") + find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) + endif() + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) +else() + find_package(Python3 COMPONENTS Interpreter) + if(Python3_FOUND) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) + find_package(Python2 COMPONENTS Interpreter) + if(Python2_FOUND) + set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) + set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR}) + gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) + gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) + gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + endif() + endif() +endif() + +if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) + set(PYTHON3 TRUE) +endif() + +if(CMAKE_CROSSCOMPILING) + set(QA_PYTHON_EXECUTABLE "/usr/bin/python") +else() + set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) +endif() + +# 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") diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake new file mode 100644 index 000000000..05a5c172e --- /dev/null +++ b/cmake/Modules/TestForARM.cmake @@ -0,0 +1,103 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +############################################################################## +# check if the compiler defines the architecture as ARM and set the +# version, if found. +# +# - Anthony Arnold +############################################################################## + +if(__TEST_FOR_ARM_INCLUDED) + return() +endif() +set(__TEST_FOR_ARM_INCLUDED TRUE) + +# Function checks if the input string defines ARM version and sets the +# output variable if found. +function(check_arm_version ppdef input_string version output_var) + string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}") + if(NOT _VERSION_MATCH STREQUAL "") + set(${output_var} "${version}" PARENT_SCOPE) + endif() +endfunction() + +message(STATUS "Checking for ARM") + +set(IS_ARM NO) +set(ARM_VERSION "") + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + execute_process(COMMAND echo "int main(){}" + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - + OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) + + string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") + if(ARM_FOUND STREQUAL "") + string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") + endif() + + if(NOT ARM_FOUND STREQUAL "") + set(IS_ARM YES) + message(STATUS "ARM system detected") + + # detect the version + check_arm_version("__ARM_ARCH_2__" ${TEST_FOR_ARM_RESULTS} "armv2" ARM_VERSION) + check_arm_version("__ARM_ARCH_2A__" ${TEST_FOR_ARM_RESULTS} "armv2a" ARM_VERSION) + check_arm_version("__ARM_ARCH_3__" ${TEST_FOR_ARM_RESULTS} "armv3" ARM_VERSION) + check_arm_version("__ARM_ARCH_3M__" ${TEST_FOR_ARM_RESULTS} "armv3m" ARM_VERSION) + check_arm_version("__ARM_ARCH_4__" ${TEST_FOR_ARM_RESULTS} "armv4" ARM_VERSION) + check_arm_version("__ARM_ARCH_4T__" ${TEST_FOR_ARM_RESULTS} "armv4t" ARM_VERSION) + check_arm_version("__ARM_ARCH_5__" ${TEST_FOR_ARM_RESULTS} "armv5" ARM_VERSION) + check_arm_version("__ARM_ARCH_5T__" ${TEST_FOR_ARM_RESULTS} "armv5t" ARM_VERSION) + check_arm_version("__ARM_ARCH_5E__" ${TEST_FOR_ARM_RESULTS} "armv5e" ARM_VERSION) + check_arm_version("__ARM_ARCH_5TE__" ${TEST_FOR_ARM_RESULTS} "armv5te" ARM_VERSION) + check_arm_version("__ARM_ARCH_6__" ${TEST_FOR_ARM_RESULTS} "armv6" ARM_VERSION) + check_arm_version("__ARM_ARCH_6J__" ${TEST_FOR_ARM_RESULTS} "armv6j" ARM_VERSION) + check_arm_version("__ARM_ARCH_6K__" ${TEST_FOR_ARM_RESULTS} "armv6k" ARM_VERSION) + check_arm_version("__ARM_ARCH_6T2__" ${TEST_FOR_ARM_RESULTS} "armv6t2" ARM_VERSION) + check_arm_version("__ARM_ARCH_6Z__" ${TEST_FOR_ARM_RESULTS} "armv6z" ARM_VERSION) + check_arm_version("__ARM_ARCH_6ZK__" ${TEST_FOR_ARM_RESULTS} "armv6zk" ARM_VERSION) + check_arm_version("__ARM_ARCH_6M__" ${TEST_FOR_ARM_RESULTS} "armv6-m" ARM_VERSION) + check_arm_version("__ARM_ARCH_7__" ${TEST_FOR_ARM_RESULTS} "armv7" ARM_VERSION) + check_arm_version("__ARM_ARCH_7A__" ${TEST_FOR_ARM_RESULTS} "armv7-a" ARM_VERSION) + check_arm_version("__ARM_ARCH_7M__" ${TEST_FOR_ARM_RESULTS} "armv7-m" ARM_VERSION) + check_arm_version("__ARM_ARCH_7R__" ${TEST_FOR_ARM_RESULTS} "armv7-r" ARM_VERSION) + check_arm_version("__ARM_ARCH_7EM_" ${TEST_FOR_ARM_RESULTS} "armv7e-m" ARM_VERSION) + check_arm_version("__ARM_ARCH_7VE__" ${TEST_FOR_ARM_RESULTS} "armv7ve" ARM_VERSION) + check_arm_version("__ARM_ARCH_8A__" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION) + check_arm_version("__ARM_ARCH_8A" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION) + + # anything else just define as arm + if(ARM_VERSION STREQUAL "") + message(STATUS "Couldn't detect ARM version. Setting to 'arm'") + set(ARM_VERSION "arm") + else() + message(STATUS "ARM version ${ARM_VERSION} detected") + endif() + else() + message(STATUS "System is not ARM") + endif() + +else() + # TODO: Other compilers + message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false") + message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually") +endif() + +set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") +set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") diff --git a/cmake/Modules/TestForSSE.cmake b/cmake/Modules/TestForSSE.cmake new file mode 100644 index 000000000..23b2d16a8 --- /dev/null +++ b/cmake/Modules/TestForSSE.cmake @@ -0,0 +1,55 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + + +############################################################################### +# Test for availability of SSE +# +# - Anthony Arnold +############################################################################### + +function(test_for_sse h_file result_var name) + if(NOT DEFINED ${result_var}) + execute_process(COMMAND echo "#include <${h_file}>" + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ - + RESULT_VARIABLE COMPILE_RESULT + OUTPUT_QUIET ERROR_QUIET) + set(detected 0) + if(COMPILE_RESULT EQUAL 0) + message(STATUS "Detected ${name}") + set(detected 1) + endif() + set(${result_var} ${detected} CACHE INTERNAL "${name} Available") + endif() +endfunction() + +message(STATUS "Testing for SIMD extensions") + +enable_language(C) + +test_for_sse("ammintrin.h" SSE4A_AVAILABLE "SSE4A") +test_for_sse("nmmintrin.h" SSE4_2_AVAILABLE "SSE4.2") +test_for_sse("smmintrin.h" SSE4_1_AVAILABLE "SSE4.1") +test_for_sse("tmmintrin.h" SSSE3_AVAILABLE "SSSE3") +test_for_sse("pmmintrin.h" SSE3_AVAILABLE "SSE3") +test_for_sse("emmintrin.h" SSE2_AVAILABLE "SSE2") +test_for_sse("xmmintrin.h" SSE_AVAILABLE "SSE1") +test_for_sse("mmintrin.h" MMX_AVAILABLE "MMX") +test_for_sse("wmmintrin.h" AES_AVAILABLE "AES") +test_for_sse("immintrin.h" AVX_AVAILABLE "AVX") + +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/-.o") From 924716bda27e312589afa737c7f2fd7f23a16f0a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 12 Dec 2018 01:45:39 +0100 Subject: [PATCH 08/19] Remove wrong file --- conf/L5.conf | 402 --------------------------------------------------- 1 file changed, 402 deletions(-) delete mode 100644 conf/L5.conf diff --git a/conf/L5.conf b/conf/L5.conf deleted file mode 100644 index 4856381aa..000000000 --- a/conf/L5.conf +++ /dev/null @@ -1,402 +0,0 @@ -; Default configuration file -; You can define your own receiver and invoke it by doing -; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf -; - -[GNSS-SDR] - -;######### GLOBAL OPTIONS ################## -;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. -GNSS-SDR.internal_fs_sps=20000000 - - -;######### SUPL RRLP GPS assistance configuration ##### -; Check http://www.mcc-mnc.com/ -; On Android: https://play.google.com/store/apps/details?id=net.its_here.cellidinfo&hl=en -GNSS-SDR.SUPL_gps_enabled=false -GNSS-SDR.SUPL_read_gps_assistance_xml=true -GNSS-SDR.SUPL_gps_ephemeris_server=supl.google.com -GNSS-SDR.SUPL_gps_ephemeris_port=7275 -GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com -GNSS-SDR.SUPL_gps_acquisition_port=7275 -GNSS-SDR.SUPL_MCC=244 -GNSS-SDR.SUPL_MNC=5 -GNSS-SDR.SUPL_LAC=0x59e2 -GNSS-SDR.SUPL_CI=0x31b0 - -;######### SIGNAL_SOURCE CONFIG ############ -SignalSource.implementation=Flexiband_Signal_Source -SignalSource.flag_read_file=true -SignalSource.signal_file=/Users/carlesfernandez/Documents/data_samples/Fraunhoffer/L125_III1b_210s.usb; ; <- PUT YOUR FILE HERE -SignalSource.item_type=gr_complex -SignalSource.firmware_file=flexiband_III-1b.bit -SignalSource.RF_channels=3 -;#frontend channels gain. Not usable yet! -SignalSource.gain1=0 -SignalSource.gain2=0 -SignalSource.gain3=0 -SignalSource.AGC=true -;# USB 3.0 packet buffer size (number of SuperSpeed packets) -SignalSource.usb_packet_buffer=128 - -;###################################################### -;######### RF CHANNEL 0 SIGNAL CONDITIONER ############ -;###################################################### - -;######### SIGNAL_CONDITIONER 0 CONFIG ############ -SignalConditioner0.implementation=Signal_Conditioner - -;######### DATA_TYPE_ADAPTER 0 CONFIG ############ -DataTypeAdapter0.implementation=Pass_Through -DataTypeAdapter0.item_type=gr_complex - -;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals -InputFilter0.implementation=Freq_Xlating_Fir_Filter -InputFilter0.dump=false -InputFilter0.dump_filename=../data/input_filter_ch0.dat - -InputFilter0.input_item_type=gr_complex -InputFilter0.output_item_type=gr_complex -InputFilter0.taps_item_type=float -InputFilter0.number_of_taps=5 -InputFilter0.number_of_bands=2 - -InputFilter0.band1_begin=0.0 -InputFilter0.band1_end=0.45 -InputFilter0.band2_begin=0.55 -InputFilter0.band2_end=1.0 - -InputFilter0.ampl1_begin=1.0 -InputFilter0.ampl1_end=1.0 -InputFilter0.ampl2_begin=0.0 -InputFilter0.ampl2_end=0.0 - -InputFilter0.band1_error=1.0 -InputFilter0.band2_error=1.0 - -InputFilter0.filter_type=bandpass -InputFilter0.grid_density=16 - -InputFilter0.sampling_frequency=20000000 -InputFilter0.IF=0 -InputFilter0.decimation_factor=1 - -;######### RESAMPLER CONFIG 0 ############ -Resampler0.implementation=Pass_Through - - -;###################################################### -;######### RF CHANNEL 1 SIGNAL CONDITIONER ############ -;###################################################### - -;######### SIGNAL_CONDITIONER 1 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. -SignalConditioner1.implementation=Signal_Conditioner - -;######### DATA_TYPE_ADAPTER 1 CONFIG ############ -DataTypeAdapter1.implementation=Pass_Through -DataTypeAdapter1.item_type=gr_complex - -;######### INPUT_FILTER 0 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals -InputFilter1.implementation=Freq_Xlating_Fir_Filter -InputFilter1.dump=false -InputFilter1.dump_filename=../data/input_filter_ch1.dat -InputFilter1.input_item_type=gr_complex -InputFilter1.output_item_type=gr_complex -InputFilter1.taps_item_type=float -InputFilter1.number_of_taps=5 -InputFilter1.number_of_bands=2 - -InputFilter1.band1_begin=0.0 -InputFilter1.band1_end=0.45 -InputFilter1.band2_begin=0.55 -InputFilter1.band2_end=1.0 - -InputFilter1.ampl1_begin=1.0 -InputFilter1.ampl1_end=1.0 -InputFilter1.ampl2_begin=0.0 -InputFilter1.ampl2_end=0.0 - -InputFilter1.band1_error=1.0 -InputFilter1.band2_error=1.0 - -InputFilter1.filter_type=bandpass -InputFilter1.grid_density=16 -InputFilter1.sampling_frequency=20000000 -InputFilter1.IF=0 -InputFilter1.decimation_factor=1 - - -;######### RESAMPLER CONFIG 1 ############ -;## Resamples the input data. -Resampler1.implementation=Pass_Through - - -;###################################################### -;######### RF CHANNEL 2 SIGNAL CONDITIONER ############ -;###################################################### - -;######### SIGNAL_CONDITIONER 2 CONFIG ############ -;## It holds blocks to change data type, filter and resample input data. -SignalConditioner2.implementation=Signal_Conditioner - -;######### DATA_TYPE_ADAPTER 2 CONFIG ############ -DataTypeAdapter2.implementation=Pass_Through -DataTypeAdapter2.item_type=gr_complex - -;######### INPUT_FILTER 2 CONFIG ############ -;## Filter the input data. Can be combined with frequency translation for IF signals - -InputFilter2.implementation=Freq_Xlating_Fir_Filter -InputFilter2.dump=false -InputFilter2.dump_filename=../data/input_filter_ch2.dat -InputFilter2.input_item_type=gr_complex -InputFilter2.output_item_type=gr_complex -InputFilter2.taps_item_type=float -InputFilter2.number_of_taps=5 -InputFilter2.number_of_bands=2 - -InputFilter2.band1_begin=0.0 -InputFilter2.band1_end=0.45 -InputFilter2.band2_begin=0.55 -InputFilter2.band2_end=1.0 - -InputFilter2.ampl1_begin=1.0 -InputFilter2.ampl1_end=1.0 -InputFilter2.ampl2_begin=0.0 -InputFilter2.ampl2_end=0.0 - -InputFilter2.band1_error=1.0 -InputFilter2.band2_error=1.0 - -InputFilter2.filter_type=bandpass -InputFilter2.grid_density=16 - -InputFilter2.sampling_frequency=40000000 -InputFilter2.IF=0 -InputFilter2.decimation_factor=2 - - -;######### RESAMPLER CONFIG 1 ############ -Resampler2.implementation=Pass_Through - - -;######### CHANNELS GLOBAL CONFIG ############ -Channels_1C.count=1 -Channels_1B.count=1 -Channels_2S.count=1 -Channels_5X.count=0 -Channels_L5.count=1 - -;#GPS.prns=7,8 - -;Channels.in_acquisition=4 - -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 - -;# CHANNEL CONNECTION - -Channel0.RF_channel_ID=0 -Channel1.RF_channel_ID=0 -Channel2.RF_channel_ID=1 -Channel3.RF_channel_ID=2 -Channel4.RF_channel_ID=2 -Channel5.RF_channel_ID=2 -Channel6.RF_channel_ID=2 -Channel7.RF_channel_ID=2 -Channel8.RF_channel_ID=2 -Channel9.RF_channel_ID=2 -Channel10.RF_channel_ID=2 -Channel11.RF_channel_ID=2 -Channel12.RF_channel_ID=2 -Channel13.RF_channel_ID=2 -Channel14.RF_channel_ID=2 -Channel15.RF_channel_ID=2 -Channel16.RF_channel_ID=2 -Channel17.RF_channel_ID=2 -Channel18.RF_channel_ID=2 -Channel19.RF_channel_ID=2 -Channel20.RF_channel_ID=2 -Channel21.RF_channel_ID=2 -Channel22.RF_channel_ID=2 - -;Channel3.satellite=8 -;Channel4.satellite=10 -;Channel5.satellite=1 - -;######### ACQUISITION GENERIC CONFIG ###### -;#The following options are specific to each channel and overwrite the generic options - -;# GPS L1 CA -Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -Acquisition_1C.item_type=gr_complex -Acquisition_1C.if=0 -Acquisition_1C.coherent_integration_time_ms=1 -Acquisition_1C.threshold=0.005 -Acquisition_1C.doppler_max=5000 -Acquisition_1C.doppler_step=250 -Acquisition_1C.bit_transition_flag=false -Acquisition_1C.max_dwells=1 -Acquisition_1C.dump=false -Acquisition_1C.dump_filename=./acq_dump.dat - - -;# Galileo E1 -Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -Acquisition_1B.item_type=gr_complex -Acquisition_1B.coherent_integration_time_ms=4 -;Acquisition_1B.threshold=0 -Acquisition_1B.pfa=0.000002 -Acquisition_1B.doppler_max=5000 -Acquisition_1B.doppler_step=125 -Acquisition_1B.dump_filename=./acq_dump.dat - - - -;# GPS L2C M -Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition -Acquisition_2S.item_type=gr_complex -Acquisition_2S.threshold=0.00074 -;Acquisition_2S.pfa=0.001 -Acquisition_2S.doppler_max=5000 -Acquisition_2S.doppler_min=-5000 -Acquisition_2S.doppler_step=60 -Acquisition_2S.max_dwells=1 -Acquisition_2S.dump=false -Acquisition_2S.dump_filename=./acq_dump.dat - - -;# GALILEO E5a -Acquisition_5X.implementation=Galileo_E5a_Noncoherent_IQ_Acquisition_CAF -Acquisition_5X.item_type=gr_complex -Acquisition_5X.coherent_integration_time_ms=1 -Acquisition_5X.threshold=0.009 -Acquisition_5X.doppler_max=5000 -Acquisition_5X.doppler_step=125 -Acquisition_5X.bit_transition_flag=false -Acquisition_5X.max_dwells=1 -Acquisition_5X.CAF_window_hz=0 ; **Only for E5a** Resolves doppler ambiguity averaging the specified BW in the winner code delay. If set to 0 CAF filter is desactivated. Recommended value 3000 Hz -Acquisition_5X.Zero_padding=0 ; **Only for E5a** Avoids power loss and doppler ambiguity in bit transitions by correlating one code with twice the input data length, ensuring that at least one full code is present without transitions. If set to 1 it is ON, if set to 0 it is OFF. -Acquisition_5X.dump=false -Acquisition_5X.dump_filename=./acq_dump.dat - -;# GPS L5 -Acquisition_L5.implementation=GPS_L5i_PCPS_Acquisition -Acquisition_L5.item_type=gr_complex -Acquisition_L5.threshold=0.008; 0.00074 -;Acquisition_L5.pfa=0.001 -Acquisition_L5.doppler_max=5000 -Acquisition_L5.doppler_min=-5000 -Acquisition_L5.doppler_step=125 -Acquisition_L5.max_dwells=1 -Acquisition_L5.dump=false -Acquisition_L5.dump_filename=./acq_dump.dat - -;######### TRACKING CONFIG ############ -;######### GPS L1 C/A GENERIC TRACKING CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -Tracking_1C.item_type=gr_complex -Tracking_1C.pll_bw_hz=35.0; -Tracking_1C.dll_bw_hz=2.0; -Tracking_1C.order=3; -Tracking_1C.early_late_space_chips=0.5; -Tracking_1C.dump=false -Tracking_1C.dump_filename=../data/epl_tracking_ch_ - -;######### GALILEO E1 TRK CONFIG ############ -Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -Tracking_1B.item_type=gr_complex -Tracking_1B.track_pilot=true -Tracking_1B.pll_bw_hz=15.0; -Tracking_1B.dll_bw_hz=2.0; -Tracking_1B.order=3; -Tracking_1B.early_late_space_chips=0.15; -Tracking_1B.very_early_late_space_chips=0.6; -Tracking_1B.dump=false -Tracking_1B.dump_filename=../data/veml_tracking_ch_ - - -;######### GPS L2C GENERIC TRACKING CONFIG ############ -Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking -Tracking_2S.item_type=gr_complex -Tracking_2S.pll_bw_hz=2.0; -Tracking_2S.dll_bw_hz=0.25; -Tracking_2S.order=2; -Tracking_2S.early_late_space_chips=0.5; -Tracking_2S.dump=false -Tracking_2S.dump_filename=./tracking_ch_ - - -;######### GALILEO E5 TRK CONFIG ############ -Tracking_5X.implementation=Galileo_E5a_DLL_PLL_Tracking -Tracking_5X.item_type=gr_complex -Tracking_5X.track_pilot=true -Tracking_5X.pll_bw_hz=15.0; -Tracking_5X.dll_bw_hz=2.0; -Tracking_5X.pll_bw_narrow_hz=10.0; -Tracking_5X.dll_bw_narrow_hz=1.0; -Tracking_5X.order=3; -Tracking_5X.early_late_space_chips=0.5; -Tracking_5X.dump=true -Tracking_5X.dump_filename=./tracking_ch_ - -;######### GPS L5 TRK CONFIG ############ -Tracking_L5.implementation=GPS_L5_DLL_PLL_Tracking -Tracking_L5.item_type=gr_complex -Tracking_L5.track_pilot=true -Tracking_L5.pll_bw_hz=15.0; -Tracking_L5.dll_bw_hz=2.0; -Tracking_L5.pll_bw_narrow_hz=5.0; -Tracking_L5.dll_bw_narrow_hz=2.0; -Tracking_L5.order=3; -Tracking_L5.early_late_space_chips=0.5; -Tracking_L5.dump=true -Tracking_L5.dump_filename=./tracking_ch_ - - -;######### TELEMETRY DECODER CONFIG ############ -TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder -TelemetryDecoder_1C.dump=false - -TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder -TelemetryDecoder_1B.dump=false - -TelemetryDecoder_2S.implementation=GPS_L2C_Telemetry_Decoder -TelemetryDecoder_2S.dump=false - -TelemetryDecoder_5X.implementation=Galileo_E5a_Telemetry_Decoder -TelemetryDecoder_5X.dump=false - -TelemetryDecoder_L5.implementation=GPS_L5_Telemetry_Decoder -TelemetryDecoder_L5.dump=false - - -;######### OBSERVABLES CONFIG ############ -Observables.implementation=Hybrid_Observables -Observables.dump=true -Observables.dump_filename=./observables.dat - - -;######### PVT CONFIG ############ -PVT.implementation=RTKLIB_PVT -PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic -PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX -PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -PVT.output_rate_ms=10 -PVT.display_rate_ms=100 -PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -PVT.flag_nmea_tty_port=false; -PVT.nmea_dump_devname=/dev/pts/4 -PVT.flag_rtcm_server=false -PVT.flag_rtcm_tty_port=false -PVT.rtcm_dump_devname=/dev/pts/1 -PVT.dump=false -PVT.dump_filename=./PVT From 79e4a170a9dea908eef2bb10a222af9a2b61720f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 12 Dec 2018 01:50:29 +0100 Subject: [PATCH 09/19] Update date in manpages --- docs/manpage/gnss-sdr-manpage | 2 +- .../cmake/Packaging/volk_gnsssdr-config-info-manpage | 2 +- .../volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/manpage/gnss-sdr-manpage b/docs/manpage/gnss-sdr-manpage index aa5440903..90f7d1a8e 100644 --- a/docs/manpage/gnss-sdr-manpage +++ b/docs/manpage/gnss-sdr-manpage @@ -1,6 +1,6 @@ .\" Manpage for gnss\-sdr. .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH gnss\-sdr 1 "14 Jun 2018" "0.0.10" "gnss\-sdr man page" +.TH gnss\-sdr 1 "12 Dec 2018" "0.0.10" "gnss\-sdr man page" .SH NAME \fBgnss\-sdr\fR \- GNSS Software Defined Receiver. .SH SYNOPSIS diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage index 0d8c0f212..6f273a82b 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage @@ -1,6 +1,6 @@ .\" Manpage for volk_gnsssdr\-config\-info .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH volk_gnsssdr\-config\-info 1 "14 Jun 2018" "0.0.10" "volk_gnsssdr\-config\-info man page" +.TH volk_gnsssdr\-config\-info 1 "12 Dec 2018" "0.0.10" "volk_gnsssdr\-config\-info man page" .SH NAME \fBvolk_gnsssdr\-config\-info\fR \- Prints configuration information of libvolk_gnsssdr functions. .SH SYNOPSIS diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage index 154e78f39..99a9ae316 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage @@ -1,6 +1,6 @@ .\" Manpage for volk_gnsssdr_profile .\" Contact carles.fernandez@cttc.es to correct errors or typos. -.TH volk_gnsssdr_profile 1 "14 Jun 2018" "0.0.10" "volk_gnsssdr_profile man page" +.TH volk_gnsssdr_profile 1 "12 Dec 2018" "0.0.10" "volk_gnsssdr_profile man page" .SH NAME \fBvolk_gnsssdr_profile\fR \- Profiler application for libvolk_gnsssdr functions. .SH SYNOPSIS From 09fb07d47097d6ab357cd2deddcb7fe22a4d0dcc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 12 Dec 2018 02:17:38 +0100 Subject: [PATCH 10/19] Remove sentence --- docs/changelog | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 542c6cc9b..5cc7e5245 100644 --- a/docs/changelog +++ b/docs/changelog @@ -86,7 +86,6 @@ This release has several improvements in different dimensions, addition of new f - The Ninja build system can be used in replacement of make. - The volk_gnsssdr library can be built using Python 2.7 or Python 3.6. - The volk_gnsssdr library is now ready for AArch64 NEON instructions. -- Ready for GNU Radio 3.8 C++ API (as per current master branch of GNU Radio upstream repository). - Improved detection of required and optional dependencies in many GNU/Linux distributions and processor architectures. - Improvement in C++ usage: The library has been replaced by the more modern and portable (except for the interaction with RTKLIB). - Improvement in C++ usage: The library has been replaced by the more modern and portable for file handling. From 046742855a2f5a1bfb0d04d378c25552a0140ed2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 12 Dec 2018 11:12:03 +0100 Subject: [PATCH 11/19] Add some features to the changelog --- docs/changelog | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/changelog b/docs/changelog index 5cc7e5245..36fa85307 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,6 @@ -## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) +## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) -This release has several improvements in different dimensions, addition of new features and bug fixes: +Next release will have several improvements in different dimensions, addition of new features and bug fixes: ### Improvements in Accuracy: @@ -64,7 +64,7 @@ This release has several improvements in different dimensions, addition of new f ### Improvements in Maintainability: -- Setup of a Continuous Integration system that checks building and runs QA code in a wide range of GNU/Linux distributions (ArchLinux, CentOS, Debian, Fedora, OpenSUSE, Ubuntu) and releases. See https://gitlab.com/gnss-sdr/gnss-sdr +- Setup of a Continuous Integration system that checks building and runs QA code in a wide range of GNU/Linux distributions (Arch Linux, CentOS, Debian, Fedora, OpenSUSE, Ubuntu) and releases. See https://gitlab.com/gnss-sdr/gnss-sdr - Creation of multi-system processing blocks, drastically reducing code duplication and maintainability time. - Automated code formatting with clang-format. This tool is widely available and easy to integrate into many code editors, and it also can be used from the command line. It cuts time spent on adhering to the project's code formatting style. - Improvement in C++ usage: C-style casts have been replaced by C++ casts. C-style casts are difficult to search for. C++ casts provide compile time checking ability and express programmers' intent better, so they are safer and clearer. @@ -84,12 +84,13 @@ This release has several improvements in different dimensions, addition of new f - The software builds with C++11, C++14 and C++17 standards. - The software can now be built using GCC >= 4.7.2 or LLVM/Clang >= 3.4.0 compilers on GNU/Linux, and with Clang/AppleClang on MacOS. - The Ninja build system can be used in replacement of make. -- The volk_gnsssdr library can be built using Python 2.7 or Python 3.6. +- The volk_gnsssdr library can be built using Python 2.7+ or Python 3.6+. - The volk_gnsssdr library is now ready for AArch64 NEON instructions. - Improved detection of required and optional dependencies in many GNU/Linux distributions and processor architectures. - Improvement in C++ usage: The library has been replaced by the more modern and portable (except for the interaction with RTKLIB). - Improvement in C++ usage: The library has been replaced by the more modern and portable for file handling. - Improvement in C++ usage: C++ libraries preferred over C libraries (e.g., instead of , instead of ). +- Fix compatibility with Boost 1.67 (closes Debian bug #911882 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911882) - Fixes required by Debian packaging. - Fixes required by Macports packaging. - A downside in portability: BLAS and LAPACK libraries are now required even in ARM devices. @@ -100,7 +101,7 @@ This release has several improvements in different dimensions, addition of new f ### Improvements in Reliability: - Introduced 3 new Input Filter implementations for pulsed and narrowband interference mitigation: `Pulse_Blanking_Filter`, `Notch_Filter` and `Notch_Filter_Lite`. Documented in https://gnss-sdr.org/docs/sp-blocks/input-filter/ -- Improved flow graph stabiliy. +- Improved flow graph stability. - Introduction of high-integrity C++ practices into the source code and included in the coding style guide. See https://gnss-sdr.org/coding-style/ - Fixed a number of defects detected by Coverity Scan. - Improvement of QA code and addition of a number of new tests. Documented at https://gnss-sdr.org/docs/tutorials/testing-software-receiver-2/ @@ -125,7 +126,9 @@ This release has several improvements in different dimensions, addition of new f ### Improvements in Testability: - Several Unit Tests added. Documentation of testing concepts and available tests at https://gnss-sdr.org/docs/tutorials/testing-software-receiver/ +- Improved system testing: position_test accepts a wide list of parameters and can be used with external files. - Receiver channels can now be fixed to a given satellite. +- Testing integrated in a Continuous Reproducibility system (see above). - Improved CTest support in volk_gnsssdr. @@ -141,6 +144,7 @@ This release has several improvements in different dimensions, addition of new f - Added a changelog, a code of conduct, a contributing guide and a pull-request template in the source tree. - Added colors to the commandline user interface. - Updated manfiles. +- Updated examples of configuration files under the conf/ folder. @@ -149,7 +153,6 @@ See the definitions of concepts and metrics at https://gnss-sdr.org/design-force - ## [0.0.9](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.9) DOI: https://doi.org/10.5281/zenodo.291371 From 7f6a798a965db66c65f9c7b715ccda71a89e38df Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 13 Dec 2018 10:39:25 +0100 Subject: [PATCH 12/19] Update changelog --- docs/changelog | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/changelog b/docs/changelog index 36fa85307..f9effa7d2 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,6 @@ -## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) +## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) -Next release will have several improvements in different dimensions, addition of new features and bug fixes: +This release has several improvements in different dimensions, addition of new features and bug fixes: ### Improvements in Accuracy: @@ -14,7 +14,7 @@ Next release will have several improvements in different dimensions, addition of - Internal Finite State Machines rewritten for improved continuity in delivering position fixes. This fixes a bug that was stalling the receiver after about six hours of continuous operation. - Redesign of the time counter for enhanced continuity. -- Improved flow graph in multisystem configurations: the receiver does not get stalled anymore if no signal is found from the first system. +- Improved flow graph in multi-system configurations: the receiver does not get stalled anymore if no signal is found from the first system. - Improved acquisition and tracking sensitivity. - Added mechanisms for Assisted GNSS, thus shortening the Time-To-First-Fix. Provision of data via XML files or via SUPL v1.0. Documented at https://gnss-sdr.org/docs/sp-blocks/global-parameters/ - Other minor bug fixes. @@ -23,7 +23,7 @@ Next release will have several improvements in different dimensions, addition of ### Improvements in Efficiency: - Added the possibility of non-blocking acquisition, which works well when using real-time data from an RF front-end. -- Improved flow graph in multiband configurations: satellites acquired in one band are immediately searched in others. +- Improved flow graph in multi-band configurations: satellites acquired in one band are immediately searched in others. - Complex local codes have been replaced by real codes, alleviating the computational burden. - New volk_gnsssdr kernels: volk_gnsssdr_16i_xn_resampler_16i_xn.h, volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h, volk_gnsssdr_32f_xn_resampler_32f_xn.h, volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h - Some AVX2 implementations added to the volk_gnsssdr library. @@ -126,6 +126,9 @@ Next release will have several improvements in different dimensions, addition of ### Improvements in Testability: - Several Unit Tests added. Documentation of testing concepts and available tests at https://gnss-sdr.org/docs/tutorials/testing-software-receiver/ +- New extra unit test AcquisitionPerformanceTest checks the performance of Acquisition blocks. +- New extra unit test TrackingPullInTest checks acquisition to tracking transition. +- New extra unit test HybridObservablesTest checks the generation of observables. - Improved system testing: position_test accepts a wide list of parameters and can be used with external files. - Receiver channels can now be fixed to a given satellite. - Testing integrated in a Continuous Reproducibility system (see above). From 6e665bdf297a456cd6ffd789200d20a59bfd5e56 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 00:42:05 +0100 Subject: [PATCH 13/19] Improve data types for Galileo navigation data --- src/core/system_parameters/Galileo_E1.h | 8 +-- src/core/system_parameters/Galileo_E5a.h | 8 +-- .../system_parameters/galileo_ephemeris.cc | 20 +++--- .../system_parameters/galileo_ephemeris.h | 28 ++++---- .../system_parameters/galileo_fnav_message.cc | 70 +++++++++---------- .../system_parameters/galileo_fnav_message.h | 36 +++++----- src/core/system_parameters/galileo_iono.cc | 4 +- src/core/system_parameters/galileo_iono.h | 4 +- .../galileo_navigation_message.cc | 64 ++++++++--------- .../galileo_navigation_message.h | 48 ++++++------- .../system_parameters/galileo_utc_model.cc | 16 ++--- .../system_parameters/galileo_utc_model.h | 14 ++-- 12 files changed, 160 insertions(+), 160 deletions(-) diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index d6f08a19e..93a814805 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -103,7 +103,7 @@ const std::vector> PAGE_TYPE_bit({{1, 6}}); /*Page 1 - Word type 1: Ephemeris (1/4)*/ const std::vector> IOD_nav_1_bit({{7, 10}}); const std::vector> T0E_1_bit({{17, 14}}); -const double t0e_1_LSB = 60; +const int32_t t0e_1_LSB = 60; const std::vector> M0_1_bit({{31, 32}}); const double M0_1_LSB = PI_TWO_N31; const std::vector> e_1_bit({{63, 32}}); @@ -151,7 +151,7 @@ const double C_ic_4_LSB = TWO_N29; const std::vector> C_is_4_bit({{39, 16}}); const double C_is_4_LSB = TWO_N29; const std::vector> t0c_4_bit({{55, 14}}); // -const double t0c_4_LSB = 60; +const int32_t t0c_4_LSB = 60; const std::vector> af0_4_bit({{69, 31}}); // const double af0_4_LSB = TWO_N34; const std::vector> af1_4_bit({{100, 21}}); // @@ -198,7 +198,7 @@ const std::vector> A1_6_bit({{39, 24}}); const double A1_6_LSB = TWO_N50; const std::vector> Delta_tLS_6_bit({{63, 8}}); const std::vector> t0t_6_bit({{71, 8}}); -const double t0t_6_LSB = 3600; +const int32_t t0t_6_LSB = 3600; const std::vector> WNot_6_bit({{79, 8}}); const std::vector> WN_LSF_6_bit({{87, 8}}); const std::vector> DN_6_bit({{95, 3}}); @@ -294,7 +294,7 @@ const double A_0G_10_LSB = TWO_N35; const std::vector> A_1G_10_bit({{103, 12}}); const double A_1G_10_LSB = TWO_N51; const std::vector> t_0G_10_bit({{115, 8}}); -const double t_0G_10_LSB = 3600; +const int32_t t_0G_10_LSB = 3600; const std::vector> WN_0G_10_bit({{123, 6}}); diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index c1cf20350..cf7e56ce1 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -83,7 +83,7 @@ const std::vector> FNAV_PAGE_TYPE_bit({{1, 6}}); const std::vector> FNAV_SV_ID_PRN_1_bit({{7, 6}}); const std::vector> FNAV_IODnav_1_bit({{13, 10}}); const std::vector> FNAV_t0c_1_bit({{23, 14}}); -const double FNAV_t0c_1_LSB = 60; +const int32_t FNAV_t0c_1_LSB = 60; const std::vector> FNAV_af0_1_bit({{37, 31}}); const double FNAV_af0_1_LSB = TWO_N34; const std::vector> FNAV_af1_1_bit({{68, 21}}); @@ -143,7 +143,7 @@ const double FNAV_Crc_3_LSB = TWO_N5; const std::vector> FNAV_Crs_3_bit({{145, 16}}); const double FNAV_Crs_3_LSB = TWO_N5; const std::vector> FNAV_t0e_3_bit({{161, 14}}); -const double FNAV_t0e_3_LSB = 60; +const int32_t FNAV_t0e_3_LSB = 60; const std::vector> FNAV_WN_3_bit({{175, 12}}); const std::vector> FNAV_TOW_3_bit({{187, 20}}); @@ -159,13 +159,13 @@ const std::vector> FNAV_A1_4_bit({{81, 24}}); const double FNAV_A1_4_LSB = TWO_N50; const std::vector> FNAV_deltatls_4_bit({{105, 8}}); const std::vector> FNAV_t0t_4_bit({{113, 8}}); -const double FNAV_t0t_4_LSB = 3600; +const int32_t FNAV_t0t_4_LSB = 3600; const std::vector> FNAV_WNot_4_bit({{121, 8}}); const std::vector> FNAV_WNlsf_4_bit({{129, 8}}); const std::vector> FNAV_DN_4_bit({{137, 3}}); const std::vector> FNAV_deltatlsf_4_bit({{140, 8}}); const std::vector> FNAV_t0g_4_bit({{148, 8}}); -const double FNAV_t0g_4_LSB = 3600; +const int32_t FNAV_t0g_4_LSB = 3600; const std::vector> FNAV_A0g_4_bit({{156, 16}}); const double FNAV_A0g_4_LSB = TWO_N35; const std::vector> FNAV_A1g_4_bit({{172, 12}}); diff --git a/src/core/system_parameters/galileo_ephemeris.cc b/src/core/system_parameters/galileo_ephemeris.cc index 0c1021048..a606b2d20 100644 --- a/src/core/system_parameters/galileo_ephemeris.cc +++ b/src/core/system_parameters/galileo_ephemeris.cc @@ -54,26 +54,26 @@ Galileo_Ephemeris::Galileo_Ephemeris() C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] C_ic_4 = 0.0; // Amplitude of the cosine harmonic correction term to the angle of inclination [radians] C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] - t0e_1 = 0.0; // Ephemeris reference time [s] + t0e_1 = 0; // Ephemeris reference time [s] // Clock correction parameters - t0c_4 = 0.0; // Clock correction data reference Time of Week [sec] + t0c_4 = 0; // Clock correction data reference Time of Week [sec] af0_4 = 0.0; // SV clock bias correction coefficient [s] af1_4 = 0.0; // SV clock drift correction coefficient [s/s] af2_4 = 0.0; // SV clock drift rate correction coefficient [s/s^2] // GST - WN_5 = 0.0; - TOW_5 = 0.0; + WN_5 = 0; + TOW_5 = 0; // SV status - SISA_3 = 0.0; - E5a_HS = 0U; - E5b_HS_5 = 0.0; - E1B_HS_5 = 0.0; + SISA_3 = 0; + E5a_HS = 0; + E5b_HS_5 = 0; + E1B_HS_5 = 0; E5a_DVS = false; - E5b_DVS_5 = 0.0; - E1B_DVS_5 = 0.0; + E5b_DVS_5 = false; + E1B_DVS_5 = false; BGD_E1E5a_5 = 0.0; // E1-E5a Broadcast Group Delay [s] BGD_E1E5b_5 = 0.0; // E1-E5b Broadcast Group Delay [s] diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index fd844adf2..75d2bdbd9 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -67,29 +67,29 @@ public: double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] double C_ic_4; //!< Amplitude of the cosine harmonic correction term to the angle of inclination [radians] double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] - double t0e_1; //!< Ephemeris reference time [s] + int32_t t0e_1; //!< Ephemeris reference time [s] /*Clock correction parameters*/ - double t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< SV clock drift rate correction coefficient [s/s^2] + int32_t t0c_4; //!< Clock correction data reference Time of Week [sec] + double af0_4; //!< SV clock bias correction coefficient [s] + double af1_4; //!< SV clock drift correction coefficient [s/s] + double af2_4; //!< SV clock drift rate correction coefficient [s/s^2] /*GST*/ - //Not belong to ephemeris set (page 1 to 4) - double WN_5; //!< Week number - double TOW_5; //!< Time of Week + // Not belong to ephemeris set (page 1 to 4) + int32_t WN_5; //!< Week number + int32_t TOW_5; //!< Time of Week double Galileo_satClkDrift; double Galileo_dtr; //!< relativistic clock correction term // SV status - double SISA_3; - uint32_t E5a_HS; //!< E5a Signal Health Status - double E5b_HS_5; //!< E5b Signal Health Status - double E1B_HS_5; //!< E1B Signal Health Status + int32_t SISA_3; + int32_t E5a_HS; //!< E5a Signal Health Status + int32_t E5b_HS_5; //!< E5b Signal Health Status + int32_t E1B_HS_5; //!< E1B Signal Health Status bool E5a_DVS; //!< E5a Data Validity Status - double E5b_DVS_5; //!< E5b Data Validity Status - double E1B_DVS_5; //!< E1B Data Validity Status + bool E5b_DVS_5; //!< E5b Data Validity Status + bool E1B_DVS_5; //!< E1B Data Validity Status double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 660f7c413..c6026c7b7 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -70,11 +70,11 @@ void Galileo_Fnav_Message::reset() // health and Data validity status FNAV_SV_ID_PRN_1 = 0; FNAV_IODnav_1 = -1; - FNAV_t0c_1 = 0.0; + FNAV_t0c_1 = 0; FNAV_af0_1 = 0.0; FNAV_af1_1 = 0.0; FNAV_af2_1 = 0.0; - FNAV_SISA_1 = 0.0; + FNAV_SISA_1 = 0; FNAV_ai0_1 = 0.0; FNAV_ai1_1 = 0.0; FNAV_ai2_1 = 0.0; @@ -85,8 +85,8 @@ void Galileo_Fnav_Message::reset() FNAV_region5_1 = false; FNAV_BGD_1 = 0.0; FNAV_E5ahs_1 = 0; - FNAV_WN_1 = 0.0; - FNAV_TOW_1 = 0.0; + FNAV_WN_1 = 0; + FNAV_TOW_1 = 0; FNAV_E5advs_1 = false; // WORD 2 Ephemeris (1/3) and GST @@ -97,8 +97,8 @@ void Galileo_Fnav_Message::reset() FNAV_a12_2 = 0.0; FNAV_omega0_2 = 0.0; FNAV_idot_2 = 0.0; - FNAV_WN_2 = 0.0; - FNAV_TOW_2 = 0.0; + FNAV_WN_2 = 0; + FNAV_TOW_2 = 0; // WORD 3 Ephemeris (2/3) and GST FNAV_IODnav_3 = -3; @@ -109,9 +109,9 @@ void Galileo_Fnav_Message::reset() FNAV_Cus_3 = 0.0; FNAV_Crc_3 = 0.0; FNAV_Crs_3 = 0.0; - FNAV_t0e_3 = 0.0; - FNAV_WN_3 = 0.0; - FNAV_TOW_3 = 0.0; + FNAV_t0e_3 = 0; + FNAV_WN_3 = 0; + FNAV_TOW_3 = 0; // WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW. // Note that the clock is repeated in this page type @@ -120,17 +120,17 @@ void Galileo_Fnav_Message::reset() FNAV_Cis_4 = 0.0; FNAV_A0_4 = 0.0; FNAV_A1_4 = 0.0; - FNAV_deltatls_4 = 0.0; - FNAV_t0t_4 = 0.0; - FNAV_WNot_4 = 0.0; - FNAV_WNlsf_4 = 0.0; - FNAV_DN_4 = 0.0; - FNAV_deltatlsf_4 = 0.0; - FNAV_t0g_4 = 0.0; + FNAV_deltatls_4 = 0; + FNAV_t0t_4 = 0; + FNAV_WNot_4 = 0; + FNAV_WNlsf_4 = 0; + FNAV_DN_4 = 0; + FNAV_deltatlsf_4 = 0; + FNAV_t0g_4 = 0; FNAV_A0g_4 = 0.0; FNAV_A1g_4 = 0.0; - FNAV_WN0g_4 = 0.0; - FNAV_TOW_4 = 0.0; + FNAV_WN0g_4 = 0; + FNAV_TOW_4 = 0; // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time FNAV_IODa_5 = 0; @@ -238,7 +238,7 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) case 1: // SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal health and Data validity status FNAV_SV_ID_PRN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit)); FNAV_IODnav_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit)); - FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); + FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); FNAV_t0c_1 *= FNAV_t0c_1_LSB; FNAV_af0_1 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_bit)); FNAV_af0_1 *= FNAV_af0_1_LSB; @@ -246,7 +246,7 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_af1_1 *= FNAV_af1_1_LSB; FNAV_af2_1 = static_cast(read_navigation_signed(data_bits, FNAV_af2_1_bit)); FNAV_af2_1 *= FNAV_af2_1_LSB; - FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); + FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); FNAV_ai0_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_ai0_1_bit)); FNAV_ai0_1 *= FNAV_ai0_1_LSB; FNAV_ai1_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai1_1_bit)); @@ -261,8 +261,8 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_BGD_1 = static_cast(read_navigation_signed(data_bits, FNAV_BGD_1_bit)); FNAV_BGD_1 *= FNAV_BGD_1_LSB; FNAV_E5ahs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit)); - FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); - FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); + FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); + FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); FNAV_E5advs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5advs_1_bit)); flag_TOW_1 = true; flag_TOW_set = true; @@ -282,8 +282,8 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_omega0_2 *= FNAV_omega0_2_LSB; FNAV_idot_2 = static_cast(read_navigation_signed(data_bits, FNAV_idot_2_bit)); FNAV_idot_2 *= FNAV_idot_2_LSB; - FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); - FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); + FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); + FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); flag_TOW_2 = true; flag_TOW_set = true; flag_ephemeris_1 = true; @@ -304,10 +304,10 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_Crc_3 *= FNAV_Crc_3_LSB; FNAV_Crs_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crs_3_bit)); FNAV_Crs_3 *= FNAV_Crs_3_LSB; - FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); + FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); FNAV_t0e_3 *= FNAV_t0e_3_LSB; - FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); - FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); + FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); + FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); flag_TOW_3 = true; flag_TOW_set = true; flag_ephemeris_2 = true; @@ -323,20 +323,20 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) FNAV_A1_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1_4_bit)); FNAV_A1_4 *= FNAV_A1_4_LSB; FNAV_deltatls_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); - FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); + FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); FNAV_t0t_4 *= FNAV_t0t_4_LSB; - FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); - FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); - FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); - FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); - FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); + FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); + FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); + FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); + FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); + FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); FNAV_t0g_4 *= FNAV_t0g_4_LSB; FNAV_A0g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0g_4_bit)); FNAV_A0g_4 *= FNAV_A0g_4_LSB; FNAV_A1g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1g_4_bit)); FNAV_A1g_4 *= FNAV_A1g_4_LSB; - FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); - FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); + FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); + FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); flag_TOW_4 = true; flag_TOW_set = true; flag_ephemeris_3 = true; diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index ff69df958..1bb0ae31d 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -95,11 +95,11 @@ public: // health and Data validity status int32_t FNAV_SV_ID_PRN_1; int32_t FNAV_IODnav_1; - double FNAV_t0c_1; + int32_t FNAV_t0c_1; double FNAV_af0_1; double FNAV_af1_1; double FNAV_af2_1; - double FNAV_SISA_1; + int32_t FNAV_SISA_1; double FNAV_ai0_1; double FNAV_ai1_1; double FNAV_ai2_1; @@ -110,8 +110,8 @@ public: bool FNAV_region5_1; double FNAV_BGD_1; int32_t FNAV_E5ahs_1; - double FNAV_WN_1; - double FNAV_TOW_1; + int32_t FNAV_WN_1; + int32_t FNAV_TOW_1; bool FNAV_E5advs_1; // WORD 2 Ephemeris (1/3) and GST @@ -122,8 +122,8 @@ public: double FNAV_a12_2; double FNAV_omega0_2; double FNAV_idot_2; - double FNAV_WN_2; - double FNAV_TOW_2; + int32_t FNAV_WN_2; + int32_t FNAV_TOW_2; // WORD 3 Ephemeris (2/3) and GST int32_t FNAV_IODnav_3; @@ -134,9 +134,9 @@ public: double FNAV_Cus_3; double FNAV_Crc_3; double FNAV_Crs_3; - double FNAV_t0e_3; - double FNAV_WN_3; - double FNAV_TOW_3; + int32_t FNAV_t0e_3; + int32_t FNAV_WN_3; + int32_t FNAV_TOW_3; // WORD 4 Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW. // Note that the clock is repeated in this page type @@ -145,17 +145,17 @@ public: double FNAV_Cis_4; double FNAV_A0_4; double FNAV_A1_4; - double FNAV_deltatls_4; - double FNAV_t0t_4; - double FNAV_WNot_4; - double FNAV_WNlsf_4; - double FNAV_DN_4; - double FNAV_deltatlsf_4; - double FNAV_t0g_4; + int32_t FNAV_deltatls_4; + int32_t FNAV_t0t_4; + int32_t FNAV_WNot_4; + int32_t FNAV_WNlsf_4; + int32_t FNAV_DN_4; + int32_t FNAV_deltatlsf_4; + int32_t FNAV_t0g_4; double FNAV_A0g_4; double FNAV_A1g_4; - double FNAV_WN0g_4; - double FNAV_TOW_4; + int32_t FNAV_WN0g_4; + int32_t FNAV_TOW_4; // WORD 5 Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time int32_t FNAV_IODa_5; diff --git a/src/core/system_parameters/galileo_iono.cc b/src/core/system_parameters/galileo_iono.cc index d79b2a319..440abbc44 100644 --- a/src/core/system_parameters/galileo_iono.cc +++ b/src/core/system_parameters/galileo_iono.cc @@ -45,6 +45,6 @@ Galileo_Iono::Galileo_Iono() Region4_flag_5 = false; // Ionospheric Disturbance Flag for region 4 Region5_flag_5 = false; // Ionospheric Disturbance Flag for region 5 - TOW_5 = 0.0; - WN_5 = 0.0; + TOW_5 = 0; + WN_5 = 0; } diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index 90c861c12..ab36199c0 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -55,8 +55,8 @@ public: bool Region5_flag_5; //!< Ionospheric Disturbance Flag for region 5 // from page 5 (UTC) to have a timestamp - double TOW_5; //!< UTC data reference Time of Week [s] - double WN_5; //!< UTC data reference Week number [week] + int32_t TOW_5; //!< UTC data reference Time of Week [s] + int32_t WN_5; //!< UTC data reference Week number [week] /*! * Default constructor diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 51c28068d..650ed88bd 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -74,7 +74,7 @@ void Galileo_Navigation_Message::reset() // Word type 1: Ephemeris (1/4) IOD_nav_1 = 0; - t0e_1 = 0.0; + t0e_1 = 0; M0_1 = 0.0; e_1 = 0.0; A_1 = 0.0; @@ -94,7 +94,7 @@ void Galileo_Navigation_Message::reset() C_us_3 = 0.0; // Amplitude of the sine harmonic correction term to the argument of latitude [radians] C_rc_3 = 0.0; // Amplitude of the cosine harmonic correction term to the orbit radius [meters] C_rs_3 = 0.0; // Amplitude of the sine harmonic correction term to the orbit radius [meters] - SISA_3 = 0.0; // + SISA_3 = 0; // // Word type 4: Ephemeris (4/4) and Clock correction parameter/ IOD_nav_4 = 0; @@ -103,7 +103,7 @@ void Galileo_Navigation_Message::reset() C_is_4 = 0.0; // Amplitude of the sine harmonic correction term to the angle of inclination [radians] // Clock correction parameters - t0c_4 = 0.0; + t0c_4 = 0; af0_4 = 0.0; af1_4 = 0.0; af2_4 = 0.0; @@ -129,20 +129,20 @@ void Galileo_Navigation_Message::reset() E1B_DVS_5 = 0; // GST - WN_5 = 0.0; - TOW_5 = 0.0; + WN_5 = 0; + TOW_5 = 0; spare_5 = 0.0; // Word type 6: GST-UTC conversion parameters A0_6 = 0.0; A1_6 = 0.0; - Delta_tLS_6 = 0.0; - t0t_6 = 0.0; - WNot_6 = 0.0; + Delta_tLS_6 = 0; + t0t_6 = 0; + WNot_6 = 0; WN_LSF_6 = 0; DN_6 = 0; - Delta_tLSF_6 = 0.0; - TOW_6 = 0.0; + Delta_tLSF_6 = 0; + TOW_6 = 0; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number IOD_a_7 = 0; @@ -199,13 +199,13 @@ void Galileo_Navigation_Message::reset() // GST-GPS A_0G_10 = 0.0; A_1G_10 = 0.0; - t_0G_10 = 0.0; - WN_0G_10 = 0.0; + t_0G_10 = 0; + WN_0G_10 = 0; // Word type 0: I/NAV Spare Word - Time_0 = 0.0; - WN_0 = 0.0; - TOW_0 = 0.0; + Time_0 = 0; + WN_0 = 0; + TOW_0 = 0; flag_TOW_6 = false; @@ -653,7 +653,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) case 1: // Word type 1: Ephemeris (1/4) IOD_nav_1 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit)); DLOG(INFO) << "IOD_nav_1= " << IOD_nav_1; - t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); + t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); t0e_1 = t0e_1 * t0e_1_LSB; DLOG(INFO) << "t0e_1= " << t0e_1; M0_1 = static_cast(read_navigation_signed(data_jk_bits, M0_1_bit)); @@ -709,7 +709,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) C_rs_3 = static_cast(read_navigation_signed(data_jk_bits, C_rs_3_bit)); C_rs_3 = C_rs_3 * C_rs_3_LSB; DLOG(INFO) << "C_rs_3= " << C_rs_3; - SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); + SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); DLOG(INFO) << "SISA_3= " << SISA_3; flag_ephemeris_3 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; @@ -727,7 +727,7 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) C_is_4 = C_is_4 * C_is_4_LSB; DLOG(INFO) << "C_is_4= " << C_is_4; // Clock correction parameters - t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); + t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); t0c_4 = t0c_4 * t0c_4_LSB; DLOG(INFO) << "t0c_4= " << t0c_4; af0_4 = static_cast(read_navigation_signed(data_jk_bits, af0_4_bit)); @@ -777,14 +777,14 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; - E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); + E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; - E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); + E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; // GST - WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); + WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); DLOG(INFO) << "WN_5= " << WN_5; - TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); + TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); DLOG(INFO) << "TOW_5= " << TOW_5; flag_TOW_5 = true; // set to false externally spare_5 = static_cast(read_navigation_unsigned(data_jk_bits, spare_5_bit)); @@ -801,20 +801,20 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) A1_6 = static_cast(read_navigation_signed(data_jk_bits, A1_6_bit)); A1_6 = A1_6 * A1_6_LSB; DLOG(INFO) << "A1_6= " << A1_6; - Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); + Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); DLOG(INFO) << "Delta_tLS_6= " << Delta_tLS_6; - t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); + t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); t0t_6 = t0t_6 * t0t_6_LSB; DLOG(INFO) << "t0t_6= " << t0t_6; - WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); + WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); DLOG(INFO) << "WNot_6= " << WNot_6; WN_LSF_6 = static_cast(read_navigation_unsigned(data_jk_bits, WN_LSF_6_bit)); DLOG(INFO) << "WN_LSF_6= " << WN_LSF_6; DN_6 = static_cast(read_navigation_unsigned(data_jk_bits, DN_6_bit)); DLOG(INFO) << "DN_6= " << DN_6; - Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); + Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); DLOG(INFO) << "Delta_tLSF_6= " << Delta_tLSF_6; - TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); + TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); DLOG(INFO) << "TOW_6= " << TOW_6; flag_TOW_6 = true; // set to false externally flag_utc_model = true; // set to false externally @@ -963,11 +963,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) A_1G_10 = A_1G_10 * A_1G_10_LSB; flag_GGTO_2 = true; DLOG(INFO) << "A_1G_10= " << A_1G_10; - t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); + t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); t_0G_10 = t_0G_10 * t_0G_10_LSB; flag_GGTO_3 = true; DLOG(INFO) << "t_0G_10= " << t_0G_10; - WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); + WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); flag_GGTO_4 = true; DLOG(INFO) << "WN_0G_10= " << WN_0G_10; flag_almanac_4 = true; @@ -975,11 +975,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) break; case 0: // Word type 0: I/NAV Spare Word - Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); + Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); DLOG(INFO) << "Time_0= " << Time_0; - WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); + WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); DLOG(INFO) << "WN_0= " << WN_0; - TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); + TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); DLOG(INFO) << "TOW_0= " << TOW_0; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index 302c38424..cf1eb0a0f 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -93,7 +93,7 @@ public: // Word type 1: Ephemeris (1/4) int32_t IOD_nav_1; //!< IOD_nav page 1 - double t0e_1; //!< Ephemeris reference time [s] + int32_t t0e_1; //!< Ephemeris reference time [s] double M0_1; //!< Mean anomaly at reference time [semi-circles] double e_1; //!< Eccentricity double A_1; //!< Square root of the semi-major axis [meters^1/2] @@ -113,7 +113,7 @@ public: double C_us_3; //!< Amplitude of the sine harmonic correction term to the argument of latitude [radians] double C_rc_3; //!< Amplitude of the cosine harmonic correction term to the orbit radius [meters] double C_rs_3; //!< Amplitude of the sine harmonic correction term to the orbit radius [meters] - double SISA_3; + int32_t SISA_3; // Word type 4: Ephemeris (4/4) and Clock correction parameters*/ int32_t IOD_nav_4; // @@ -122,10 +122,10 @@ public: double C_is_4; //!< Amplitude of the sine harmonic correction term to the angle of inclination [radians] // Clock correction parameters - double t0c_4; //!< Clock correction data reference Time of Week [sec] - double af0_4; //!< SV clock bias correction coefficient [s] - double af1_4; //!< SV clock drift correction coefficient [s/s] - double af2_4; //!< clock drift rate correction coefficient [s/s^2] + int32_t t0c_4; //!< Clock correction data reference Time of Week [sec] + double af0_4; //!< SV clock bias correction coefficient [s] + double af1_4; //!< SV clock drift correction coefficient [s/s] + double af2_4; //!< clock drift rate correction coefficient [s/s^2] double spare_4; // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ @@ -143,26 +143,26 @@ public: double BGD_E1E5a_5; //!< E1-E5a Broadcast Group Delay [s] double BGD_E1E5b_5; //!< E1-E5b Broadcast Group Delay [s] - int32_t E5b_HS_5; //!< E5b Signal Health Status - int32_t E1B_HS_5; //!< E1B Signal Health Status - int32_t E5b_DVS_5; //!< E5b Data Validity Status - int32_t E1B_DVS_5; //!< E1B Data Validity Status + int32_t E5b_HS_5; //!< E5b Signal Health Status + int32_t E1B_HS_5; //!< E1B Signal Health Status + bool E5b_DVS_5; //!< E5b Data Validity Status + bool E1B_DVS_5; //!< E1B Data Validity Status // GST - double WN_5; - double TOW_5; + int32_t WN_5; + int32_t TOW_5; double spare_5; // Word type 6: GST-UTC conversion parameters double A0_6; double A1_6; - double Delta_tLS_6; - double t0t_6; - double WNot_6; + int32_t Delta_tLS_6; + int32_t t0t_6; + int32_t WNot_6; int32_t WN_LSF_6; int32_t DN_6; - double Delta_tLSF_6; - double TOW_6; + int32_t Delta_tLSF_6; + int32_t TOW_6; // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number int32_t IOD_a_7; @@ -217,15 +217,15 @@ public: int32_t E1B_HS_10; // GST-GPS conversion - double A_0G_10; //!< Constant term of the offset Delta t systems - double A_1G_10; //!< Rate of change of the offset Delta t systems - double t_0G_10; //!< Reference time for Galileo/GPS Time Offset (GGTO) data - double WN_0G_10; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference + double A_0G_10; //!< Constant term of the offset Delta t systems + double A_1G_10; //!< Rate of change of the offset Delta t systems + int32_t t_0G_10; //!< Reference time for Galileo/GPS Time Offset (GGTO) data + int32_t WN_0G_10; //!< Week Number of Galileo/GPS Time Offset (GGTO) reference // Word type 0: I/NAV Spare Word - double Time_0; - double WN_0; - double TOW_0; + int32_t Time_0; + int32_t WN_0; + int32_t TOW_0; double Galileo_satClkDrift; double Galileo_dtr; //!< Relativistic clock correction term diff --git a/src/core/system_parameters/galileo_utc_model.cc b/src/core/system_parameters/galileo_utc_model.cc index e51c7c2f2..96ca127e7 100644 --- a/src/core/system_parameters/galileo_utc_model.cc +++ b/src/core/system_parameters/galileo_utc_model.cc @@ -36,28 +36,28 @@ Galileo_Utc_Model::Galileo_Utc_Model() // Word type 6: GST-UTC conversion parameters A0_6 = 0.0; A1_6 = 0.0; - Delta_tLS_6 = 0.0; - t0t_6 = 0.0; - WNot_6 = 0.0; + Delta_tLS_6 = 0; + t0t_6 = 0; + WNot_6 = 0; WN_LSF_6 = 0; DN_6 = 0; - Delta_tLSF_6 = 0.0; + Delta_tLSF_6 = 0; flag_utc_model = false; // GPS to Galileo GST conversion parameters A_0G_10 = 0.0; A_1G_10 = 0.0; - t_0G_10 = 0.0; - WN_0G_10 = 0.0; + t_0G_10 = 0; + WN_0G_10 = 0; } -double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN) +double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int32_t WN) { double t_Utc; double t_Utc_daytime; double Delta_t_Utc = 0; // Determine if the effectivity time of the leap second event is in the past - int weeksToLeapSecondEvent = WN_LSF_6 - (WN % 256); + int32_t weeksToLeapSecondEvent = WN_LSF_6 - (WN % 256); if ((weeksToLeapSecondEvent) >= 0) // is not in the past { diff --git a/src/core/system_parameters/galileo_utc_model.h b/src/core/system_parameters/galileo_utc_model.h index f91b3ded1..7e9e328b0 100644 --- a/src/core/system_parameters/galileo_utc_model.h +++ b/src/core/system_parameters/galileo_utc_model.h @@ -47,22 +47,22 @@ public: // 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] + int32_t Delta_tLS_6; + int32_t t0t_6; //!< UTC data reference Time of Week [s] + int32_t WNot_6; //!< UTC data reference Week number [week] int32_t WN_LSF_6; int32_t DN_6; - double Delta_tLSF_6; + int32_t Delta_tLSF_6; bool flag_utc_model; // GPS to Galileo GST conversion parameters double A_0G_10; double A_1G_10; - double t_0G_10; - double WN_0G_10; + int32_t t_0G_10; + int32_t WN_0G_10; //double TOW_6; - double GST_to_UTC_time(double t_e, int WN); //!< GST-UTC Conversion Algorithm and Parameters + double GST_to_UTC_time(double t_e, int32_t WN); //!< GST-UTC Conversion Algorithm and Parameters /*! * Default constructor */ From 1725f83fd70cefa76ec367fe4f7d61bdc247e24a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 12:34:53 +0100 Subject: [PATCH 14/19] Delete Eclipse file --- .pydevproject | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .pydevproject diff --git a/.pydevproject b/.pydevproject deleted file mode 100644 index d001f0aea..000000000 --- a/.pydevproject +++ /dev/null @@ -1,5 +0,0 @@ - - -Default -python interpreter - From da2d12dd05980c4c36e423edbabdb60f76f86ce4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 13:33:52 +0100 Subject: [PATCH 15/19] Supress lintian complaint --- src/algorithms/PVT/libs/hybrid_ls_pvt.cc | 2 +- src/algorithms/PVT/libs/rtklib_solver.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index d927786a2..5fbc52ab8 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -334,7 +334,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do } // get time string Gregorian calendar - boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast(utc * 1000.0)); + boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast(utc * 1000.0)); // NOLINT(google-runtime-int) // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2) boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); this->set_position_UTC_time(p_time); diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 1125e704a..b304881ff 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -867,7 +867,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ gtime_t rtklib_time = gpst2time(adjgpsweek(nav_data.eph[0].week), gnss_observables_map.begin()->second.RX_time); gtime_t rtklib_utc_time = gpst2utc(rtklib_time); p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); - p_time += boost::posix_time::microseconds(static_cast(round(rtklib_utc_time.sec * 1e6))); + p_time += boost::posix_time::microseconds(static_cast(round(rtklib_utc_time.sec * 1e6))); // NOLINT(google-runtime-int) this->set_position_UTC_time(p_time); cart2geo(static_cast(rx_position_and_time(0)), static_cast(rx_position_and_time(1)), static_cast(rx_position_and_time(2)), 4); From 95c6bb4dd10fc11408fd4b153c65becba86f54f8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 13:38:29 +0100 Subject: [PATCH 16/19] Remove redundant c_str() --- src/algorithms/PVT/libs/nmea_printer.cc | 2 +- .../gnuradio_blocks/galileo_telemetry_decoder_cc.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index eb1a66db4..2470b1819 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -102,7 +102,7 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi nmea_devname = std::move(nmea_dump_devname); if (flag_nmea_tty_port == true) { - nmea_dev_descriptor = init_serial(nmea_devname.c_str()); + nmea_dev_descriptor = init_serial(nmea_devname); if (nmea_dev_descriptor != -1) { DLOG(INFO) << "NMEA printer writing on " << nmea_devname.c_str(); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index 96d81d65a..bb5b68a9e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -309,7 +309,7 @@ void galileo_telemetry_decoder_cc::decode_INAV_word(double *page_part_symbols, i else { // STORE HALF WORD (even page) - d_inav_nav.split_page(page_String.c_str(), flag_even_word_arrived); + d_inav_nav.split_page(page_String, flag_even_word_arrived); flag_even_word_arrived = 1; } volk_gnsssdr_free(page_part_bits); From 67f3680bf488fcd62326c7ecd2c7d7a334e87cc2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 14:17:04 +0100 Subject: [PATCH 17/19] Remove lintian complaints --- .../signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc | 2 +- src/core/receiver/control_thread.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 971908e3d..f43f3e90c 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -152,7 +152,7 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, } -rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() +rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() // NOLINT(modernize-use-equals-default) { mutex_.unlock(); io_service_.stop(); diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 9ebda09d0..463815bcb 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -189,7 +189,7 @@ void ControlThread::init() } -ControlThread::~ControlThread() +ControlThread::~ControlThread() // NOLINT(modernize-use-equals-default) { if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); } @@ -751,7 +751,7 @@ void ControlThread::assist_GNSS() time_t ref_rx_utc_time = 0; if (agnss_ref_time_.valid == true) { - ref_rx_utc_time = agnss_ref_time_.d_tv_sec; + ref_rx_utc_time = static_cast(agnss_ref_time_.d_tv_sec); } std::vector> visible_sats = get_visible_sats(ref_rx_utc_time, ref_LLH); From 31c6b6bc1da77c9589a04d52a38d2d20edacf06e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 18:59:36 +0100 Subject: [PATCH 18/19] Update CMake modules --- cmake/Modules/FindGFLAGS.cmake | 111 ++++++++++++++++++++++++++++ cmake/Modules/FindGPERFTOOLS.cmake | 87 ++++++++++++++++++++++ cmake/Modules/FindGRDBFCTTC.cmake | 56 ++++++++++++++ cmake/Modules/FindGRGN3S.cmake | 56 ++++++++++++++ cmake/Modules/FindLIBOSMOSDR.cmake | 80 ++++++++++++++++++++ cmake/Modules/FindOPENBLAS.cmake | 49 ++++++++++++ cmake/Modules/FindOPENCL.cmake | 110 +++++++++++++++++++++++++++ cmake/Modules/FindTELEORBIT.cmake | 50 +++++++++++++ cmake/Modules/FindVOLKGNSSSDR.cmake | 53 +++++++++++++ 9 files changed, 652 insertions(+) create mode 100644 cmake/Modules/FindGFLAGS.cmake create mode 100644 cmake/Modules/FindGPERFTOOLS.cmake create mode 100644 cmake/Modules/FindGRDBFCTTC.cmake create mode 100644 cmake/Modules/FindGRGN3S.cmake create mode 100644 cmake/Modules/FindLIBOSMOSDR.cmake create mode 100644 cmake/Modules/FindOPENBLAS.cmake create mode 100644 cmake/Modules/FindOPENCL.cmake create mode 100644 cmake/Modules/FindTELEORBIT.cmake create mode 100644 cmake/Modules/FindVOLKGNSSSDR.cmake diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake new file mode 100644 index 000000000..31739e216 --- /dev/null +++ b/cmake/Modules/FindGFLAGS.cmake @@ -0,0 +1,111 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find GFlags +# +# The following CMake and environment variables are optionally searched +# for defaults: +# GFLAGS_ROOT: Base directory where all GFlags components are found +# +# The following are set after configuration is done: +# GFlags_FOUND +# GFlags_INCLUDE_DIRS +# GFlags_LIBS +# GFlags_LIBRARY_DIRS + +if(APPLE) + find_path(GFlags_ROOT_DIR + libgflags.dylib + PATHS + /opt/local/lib + /usr/local/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ) +else() + find_path(GFlags_ROOT_DIR + libgflags.so + HINTS + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + /usr/lib + ${GFLAGS_ROOT}/lib + $ENV{GFLAGS_ROOT}/lib + ${GFLAGS_ROOT}/lib64 + $ENV{GFLAGS_ROOT}/lib64 + ) +endif() + +if(GFlags_ROOT_DIR) + # We are testing only a couple of files in the include directories + find_path(GFlags_INCLUDE_DIRS + gflags/gflags.h + HINTS + /opt/local/include + /usr/local/include + /usr/include + ${GFlags_ROOT_DIR}/src + ${GFLAGS_ROOT}/include + $ENV{GFLAGS_ROOT}/include + ) + + # Find the libraries + set(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR}) + + find_library(GFlags_lib gflags ${GFlags_LIBRARY_DIRS}) + if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h) + set(GFLAGS_GREATER_20 TRUE) + else() + set(GFLAGS_GREATER_20 FALSE) + endif() + # set up include and link directory + include_directories(${GFlags_INCLUDE_DIRS}) + link_directories(${GFlags_LIBRARY_DIRS}) + message(STATUS "gflags library found at ${GFlags_lib}") + set(GFlags_LIBS ${GFlags_lib}) + set(GFlags_FOUND true) + mark_as_advanced(GFlags_INCLUDE_DIRS) +else() + message(STATUS "Cannot find gflags") + set(GFlags_FOUND false) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake new file mode 100644 index 000000000..67dfff8af --- /dev/null +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -0,0 +1,87 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find Gperftools. +# +# Usage of this module as follows: +# +# find_package(GPERFTOOLS) +# +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# GPERFTOOLS_ROOT Set this variable to the root installation of +# Gperftools if the module has problems finding +# the proper installation path. +# +# Variables defined by this module: +# +# GPERFTOOLS_FOUND System has Gperftools libs/headers +# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler) +# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers + +find_library(GPERFTOOLS_TCMALLOC + NAMES tcmalloc + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_library(GPERFTOOLS_PROFILER + NAMES profiler + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER + NAMES tcmalloc_and_profiler + HINTS ${Gperftools_ROOT_DIR}/lib + ${GPERFTOOLS_ROOT}/lib + $ENV{GPERFTOOLS_ROOT}/lib + ${GPERFTOOLS_ROOT}/lib64 + $ENV{GPERFTOOLS_ROOT}/lib64 +) + +find_path(GPERFTOOLS_INCLUDE_DIR + NAMES gperftools/heap-profiler.h + HINTS ${Gperftools_ROOT_DIR}/include + ${GPERFTOOLS_ROOT}/include + $ENV{GPERFTOOLS_ROOT}/include +) + +set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + GPERFTOOLS + DEFAULT_MSG + GPERFTOOLS_LIBRARIES + GPERFTOOLS_INCLUDE_DIR +) + +mark_as_advanced( + Gperftools_ROOT_DIR + GPERFTOOLS_TCMALLOC + GPERFTOOLS_PROFILER + GPERFTOOLS_TCMALLOC_AND_PROFILER + GPERFTOOLS_LIBRARIES + GPERFTOOLS_INCLUDE_DIR) diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake new file mode 100644 index 000000000..e0689aeaf --- /dev/null +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GR-DBFCTTC Module +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc) + +find_path( + GR_DBFCTTC_INCLUDE_DIRS + NAMES dbfcttc/api.h + HINTS $ENV{GR_DBFCTTC_DIR}/include + ${PC_GR_DBFCTTC_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/include + /usr/local/include + ${GRDBFCTTC_ROOT}/include + $ENV{GRDBFCTTC_ROOT}/include +) + +find_library( + GR_DBFCTTC_LIBRARIES + NAMES gnuradio-dbfcttc + HINTS $ENV{GR_DBFCTTC_DIR}/lib + ${PC_GR_DBFCTTC_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + ${GRDBFCTTC_ROOT}/lib + $ENV{GRDBFCTTC_ROOT}/lib + ${GRDBFCTTC_ROOT}/lib64 + $ENV{GRDBFCTTC_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) +mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake new file mode 100644 index 000000000..93f7bda89 --- /dev/null +++ b/cmake/Modules/FindGRGN3S.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find GR-GN3S Module +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_GR_GN3S gr-gn3s) + +find_path( + GR_GN3S_INCLUDE_DIRS + NAMES gn3s/gn3s_api.h + HINTS $ENV{GR_GN3S_DIR}/include + ${PC_GR_GN3S_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${GRGN3S_ROOT}/include + $ENV{GRGN3S_ROOT}/include +) + +find_library( + GR_GN3S_LIBRARIES + NAMES gr-gn3s + HINTS $ENV{GR_GN3S_DIR}/lib + ${PC_GR_GN3S_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${GRGN3S_ROOT}/lib + $ENV{GRGN3S_ROOT}/lib + ${GRGN3S_ROOT}/lib64 + $ENV{GRGN3S_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) +mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake new file mode 100644 index 000000000..1e3aaf5e0 --- /dev/null +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -0,0 +1,80 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# Tries to find libosmosdr. +# +# Usage of this module as follows: +# +# find_package(LIBOSMOSDR) +# +# +# Variables defined by this module: +# +# LIBOSMOSDR_FOUND System has libosmosdr libs/headers +# LIBOSMOSDR_LIBRARIES The libosmosdr libraries +# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers + +include(FindPkgConfig) +pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) + +find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h + PATHS + ${LIBOSMOSDR_PKG_INCLUDE_DIRS} + /usr/include + /usr/local/include + ${LIBOSMOSDR_ROOT}/include + $ENV{LIBOSMOSDR_ROOT}/include +) + +find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr + PATHS + ${LIBOSMOSDR_PKG_LIBRARY_DIRS} + /usr/lib + /usr/local/lib + /usr/lib/x86_64-linux-gnu + /usr/lib/i386-linux-gnu + /usr/lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabi + /usr/lib/aarch64-linux-gnu + /usr/lib/mipsel-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/hppa-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/i386-gnu + /usr/lib/hppa-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i386-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/sh4-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/alpha-linux-gnu + /usr/lib64 + ${LIBOSMOSDR_ROOT}/lib + $ENV{LIBOSMOSDR_ROOT}/lib + ${LIBOSMOSDR_ROOT}/lib64 + $ENV{LIBOSMOSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) +mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindOPENBLAS.cmake b/cmake/Modules/FindOPENBLAS.cmake new file mode 100644 index 000000000..8ff70d65f --- /dev/null +++ b/cmake/Modules/FindOPENBLAS.cmake @@ -0,0 +1,49 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# - Try to find OpenBLAS library (not headers!) +# +# The following environment variable is optionally searched +# OPENBLAS_HOME: Base directory where all OpenBlas components are found + +set(OPEN_BLAS_SEARCH_PATHS + /lib + /lib64/ + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/OpenBLAS/lib + /opt/local/lib + /usr/lib/openblas-base + $ENV{OPENBLAS_HOME}/lib + ${OPENBLAS_ROOT}/lib + $ENV{OPENBLAS_ROOT}/lib + ${OPENBLAS_ROOT}/lib64 + $ENV{OPENBLAS_ROOT}/lib64 +) + +find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) + +if(OPENBLAS) + set(OPENBLAS_FOUND ON) + message(STATUS "Found OpenBLAS") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS) +mark_as_advanced(OPENBLAS) diff --git a/cmake/Modules/FindOPENCL.cmake b/cmake/Modules/FindOPENCL.cmake new file mode 100644 index 000000000..988360c29 --- /dev/null +++ b/cmake/Modules/FindOPENCL.cmake @@ -0,0 +1,110 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +# +# This file taken from FindOpenCL project @ http://gitorious.com/findopencl +# +# - Try to find OpenCL +# This module tries to find an OpenCL implementation on your system. It supports +# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. +# +# Once done this will define +# OPENCL_FOUND - system has OpenCL +# OPENCL_INCLUDE_DIRS - the OpenCL include directory +# OPENCL_LIBRARIES - link these to use OpenCL +# +# WIN32 should work, but is untested + +include(FindPackageHandleStandardArgs) + +set(OPENCL_VERSION_STRING "0.1.0") +set(OPENCL_VERSION_MAJOR 0) +set(OPENCL_VERSION_MINOR 1) +set(OPENCL_VERSION_PATCH 0) + +if(APPLE) + find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") + find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") + find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") + +else() + if(WIN32) + find_path(OPENCL_INCLUDE_DIRS CL/cl.h) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) + + # The AMD SDK currently installs both x86 and x86_64 libraries + # This is only a hack to find out architecture + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64") + else() + set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") + set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86") + endif() + + # find out if the user asked for a 64-bit build, and use the corresponding + # 64 or 32 bit NVIDIA library paths to the search: + string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR}) + if("${ISWIN64}" STREQUAL "Win64") + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64) + else() + find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32) + endif() + + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # On Win32 search relative to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include) + + else() + # Unix style platforms + find_library(OPENCL_LIBRARIES OpenCL + ENV LD_LIBRARY_PATH + ) + + get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) + get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) + + # The AMD SDK currently does not place its headers + # in /usr/include, therefore also search relative + # to the library + find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include") + endif() +endif() + +find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS) + +if(_OPENCL_CPP_INCLUDE_DIRS) + set(OPENCL_HAS_CPP_BINDINGS TRUE) + list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS}) + # This is often the same, so clean up + list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS) +endif() + +mark_as_advanced( + OPENCL_INCLUDE_DIRS +) + +if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES) + set( OPENCL_FOUND TRUE ) + add_definitions( -DOPENCL=1 ) +else() + set( OPENCL_FOUND FALSE ) + add_definitions( -DOPENCL=0 ) +endif() diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake new file mode 100644 index 000000000..eb2420687 --- /dev/null +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -0,0 +1,50 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +include(FindPkgConfig) +pkg_check_modules(PC_TELEORBIT teleorbit) + +find_path(TELEORBIT_INCLUDE_DIRS + NAMES teleorbit/api.h + HINTS $ENV{TELEORBIT_DIR}/include + ${PC_TELEORBIT_INCLUDEDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/include + /usr/local/include + /usr/include + ${TELEORBIT_ROOT}/include + $ENV{TELEORBIT_ROOT}/include +) + +find_library(TELEORBIT_LIBRARIES + NAMES gnuradio-teleorbit + HINTS $ENV{TELEORBIT_DIR}/lib + ${PC_TELEORBIT_LIBDIR} + PATHS ${CMAKE_INSTALL_PREFIX}/lib + ${CMAKE_INSTALL_PREFIX}/lib64 + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${TELEORBIT_ROOT}/lib + $ENV{TELEORBIT_ROOT}/lib + ${TELEORBIT_ROOT}/lib64 + $ENV{TELEORBIT_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) +mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake new file mode 100644 index 000000000..5cdc4e61d --- /dev/null +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -0,0 +1,53 @@ +# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# +# This file is part of GNSS-SDR. +# +# GNSS-SDR is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNSS-SDR is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNSS-SDR. If not, see . + +######################################################################## +# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library +######################################################################## + +include(FindPkgConfig) +pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) + +find_path(VOLK_GNSSSDR_INCLUDE_DIRS + NAMES volk_gnsssdr/volk_gnsssdr.h + HINTS $ENV{VOLK_GNSSSDR_DIR}/include + ${PC_VOLK_GNSSSDR_INCLUDEDIR} + PATHS /usr/local/include + /usr/include + ${GNURADIO_INSTALL_PREFIX}/include + ${VOLKGNSSSDR_ROOT}/include + $ENV{VOLKGNSSSDR_ROOT}/include +) + +find_library(VOLK_GNSSSDR_LIBRARIES + NAMES volk_gnsssdr + HINTS $ENV{VOLK_GNSSSDR_DIR}/lib + ${PC_VOLK_GNSSSDR_LIBDIR} + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ${GNURADIO_INSTALL_PREFIX}/lib + ${VOLKGNSSSDR_ROOT}/lib + $ENV{VOLKGNSSSDR_ROOT}/lib + ${VOLKGNSSSDR_ROOT}/lib64 + $ENV{VOLKGNSSSDR_ROOT}/lib64 +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) From b6f0c92fd61c2d20888265dac7e4cca64e7a42cb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 14 Dec 2018 19:41:13 +0100 Subject: [PATCH 19/19] Start next branch from 0.0.10 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10cb6b119..a24768c62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,7 @@ endif() ############################### # GNSS-SDR version information ############################### -set(THIS_IS_A_RELEASE ON) # only related to version name, no further implications. +set(THIS_IS_A_RELEASE OFF) # only related to version name, no further implications. if(NOT ${THIS_IS_A_RELEASE}) # Get the current working branch execute_process(