mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-02-25 07:20:08 +00:00
Merge branch 'cross-compile' of
https://github.com/anthony-arnold/gnss-sdr into anthony-cross-compile # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
This commit is contained in:
commit
ce5783ca61
136
CMakeLists.txt
136
CMakeLists.txt
@ -21,7 +21,7 @@
|
||||
# Project setup
|
||||
########################################################################
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
message(FATAL_ERROR "Prevented in-tree build. This is bad practice. Try 'cd build && cmake ../' ")
|
||||
message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ")
|
||||
endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(gnss-sdr CXX C)
|
||||
@ -51,9 +51,9 @@ endif(ENABLE_PACKAGING)
|
||||
|
||||
|
||||
###############################
|
||||
# GNSS-SDR version information
|
||||
# GNSS-SDR version information
|
||||
###############################
|
||||
set(THIS_IS_A_RELEASE OFF) # 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(
|
||||
@ -96,7 +96,7 @@ endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
set(OS_IS_MACOSX "")
|
||||
set(OS_IS_LINUX "")
|
||||
|
||||
# Detect Linux Distribution
|
||||
# Detect Linux Distribution
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(OperatingSystem "Linux")
|
||||
set(OS_IS_LINUX TRUE)
|
||||
@ -135,7 +135,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
RESULT_VARIABLE LINUX_VER_RESULT
|
||||
)
|
||||
endif(EXISTS "/etc/linuxmint/info")
|
||||
endif(NOT LINUX_DISTRIBUTION)
|
||||
endif(NOT LINUX_DISTRIBUTION)
|
||||
if(NOT LINUX_DISTRIBUTION)
|
||||
if(EXISTS "/etc/os-release")
|
||||
execute_process(COMMAND cat /etc/os-release
|
||||
@ -158,7 +158,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(LINUX_DISTRIBUTION "Debian")
|
||||
file(READ /etc/debian_version LINUX_VER)
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Debian")
|
||||
endif(EXISTS "/etc/os-release")
|
||||
endif(EXISTS "/etc/os-release")
|
||||
endif(NOT LINUX_DISTRIBUTION)
|
||||
if(NOT LINUX_DISTRIBUTION)
|
||||
if(EXISTS "/etc/redhat-release")
|
||||
@ -175,7 +175,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(NOT LINUX_DISTRIBUTION)
|
||||
set(LINUX_DISTRIBUTION "Generic")
|
||||
set(LINUX_VER "Unknown")
|
||||
endif(NOT LINUX_DISTRIBUTION)
|
||||
endif(NOT LINUX_DISTRIBUTION)
|
||||
message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}")
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
@ -218,7 +218,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
else(ENABLE_GPERFTOOLS)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
message(STATUS "Build type not specified: defaulting to Release.")
|
||||
endif(ENABLE_GPERFTOOLS)
|
||||
endif(ENABLE_GPERFTOOLS)
|
||||
endif(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
|
||||
|
||||
@ -319,7 +319,7 @@ set(Boost_ADDITIONAL_VERSIONS
|
||||
)
|
||||
set(Boost_USE_MULTITHREAD ON)
|
||||
set(Boost_USE_STATIC_LIBS OFF)
|
||||
find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED)
|
||||
find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED)
|
||||
if(NOT Boost_FOUND)
|
||||
message(FATAL_ERROR "Fatal error: Boost (version >=1.45.0) required.")
|
||||
endif(NOT Boost_FOUND)
|
||||
@ -414,7 +414,7 @@ if(NOT VOLK_GNSSSDR_FOUND)
|
||||
set(ORC_LIBRARIES "")
|
||||
set(ORC_INCLUDE_DIRS "")
|
||||
endif(NOT ORC_FOUND)
|
||||
|
||||
|
||||
add_library(volk_gnsssdr UNKNOWN IMPORTED)
|
||||
set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr.a)
|
||||
set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}")
|
||||
@ -440,8 +440,8 @@ if (NOT GFlags_FOUND)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/tmp/configure_osx
|
||||
"#!/bin/sh
|
||||
export CXXFLAGS=\"-stdlib=libc++\"
|
||||
export CC=clang
|
||||
export CXXFLAGS=\"-stdlib=libc++\"
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}/configure")
|
||||
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/tmp/configure_osx
|
||||
@ -459,7 +459,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}/configure
|
||||
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
set(CONF_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/configure_linux)
|
||||
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
|
||||
ExternalProject_Add(
|
||||
gflags-${gflags_RELEASE}
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
||||
@ -468,17 +468,17 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}/configure
|
||||
URL_MD5 ${gflags_MD5}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
||||
CONFIGURE_COMMAND ${CONF_SCRIPT} --prefix=${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
||||
CONFIGURE_COMMAND ${CONF_SCRIPT} --prefix=${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
||||
BUILD_COMMAND make
|
||||
UPDATE_COMMAND ""
|
||||
PATCH_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
|
||||
set(GFlags_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/src CACHE PATH "Local Gflags headers"
|
||||
set(GFlags_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/src CACHE PATH "Local Gflags headers"
|
||||
)
|
||||
|
||||
|
||||
add_library(gflags UNKNOWN IMPORTED)
|
||||
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}gflags.a)
|
||||
add_dependencies(gflags gflags-${gflags_RELEASE})
|
||||
@ -516,7 +516,7 @@ if (NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
endif(NOT ${LOCAL_GFLAGS})
|
||||
set(glog_RELEASE 0.3.3)
|
||||
set(glog_MD5 "a6fd2c22f8996846e34c763422717c18")
|
||||
|
||||
|
||||
if(${LOCAL_GFLAGS})
|
||||
set(TARGET_GFLAGS ${gflags})
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
@ -525,8 +525,8 @@ if (NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
||||
export LDFLAGS=-L${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs
|
||||
export LIBS=${GFlags_SHARED_LIBS}
|
||||
export CXXFLAGS=\"-stdlib=libc++\"
|
||||
export CC=clang
|
||||
export CXXFLAGS=\"-stdlib=libc++\"
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
||||
@ -544,8 +544,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
||||
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
else(${LOCAL_GFLAGS})
|
||||
set(TARGET_GFLAGS gflags-${gflags_RELEASE})
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
@ -554,8 +554,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
||||
export LDFLAGS=-L${GFlags_LIBRARY_DIRS}
|
||||
export LIBS=\"${GFlags_LIBS} -lc++\"
|
||||
export CXXFLAGS=\"-stdlib=libc++\"
|
||||
export CC=clang
|
||||
export CXXFLAGS=\"-stdlib=libc++\"
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
||||
@ -573,10 +573,10 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
||||
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
endif(${LOCAL_GFLAGS})
|
||||
|
||||
set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/configure_with_gflags)
|
||||
set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/configure_with_gflags)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
ExternalProject_Add(
|
||||
glog-${glog_RELEASE}
|
||||
@ -587,7 +587,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/glog-${glog_RELEASE}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
||||
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
||||
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
||||
BUILD_COMMAND make
|
||||
UPDATE_COMMAND ""
|
||||
PATCH_COMMAND ""
|
||||
@ -603,7 +603,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
URL_MD5 ${glog_MD5}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
||||
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
||||
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
||||
BUILD_COMMAND make
|
||||
UPDATE_COMMAND ""
|
||||
PATCH_COMMAND ""
|
||||
@ -611,15 +611,15 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/configure")
|
||||
)
|
||||
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# Set up variables
|
||||
set(GLOG_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/src/
|
||||
set(GLOG_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/src/
|
||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/src
|
||||
)
|
||||
set(GLOG_LIBRARIES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.a
|
||||
set(GLOG_LIBRARIES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.a
|
||||
)
|
||||
set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE)
|
||||
else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
else(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
add_library(glog-${glog_RELEASE} UNKNOWN IMPORTED)
|
||||
set_property(TARGET glog-${glog_RELEASE} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}")
|
||||
endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
@ -631,7 +631,7 @@ endif(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
||||
################################################################################
|
||||
if(OS_IS_LINUX)
|
||||
#############################################################################
|
||||
# Check that LAPACK is found in the system
|
||||
# Check that LAPACK is found in the system
|
||||
# LAPACK is required for matrix decompositions (eg. SVD) and matrix inverse.
|
||||
#############################################################################
|
||||
find_library(LAPACK lapack)
|
||||
@ -639,11 +639,11 @@ if(OS_IS_LINUX)
|
||||
message(" The LAPACK library has not been found.")
|
||||
message(" You can try to install it by typing:")
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo yum install lapack-devel")
|
||||
message(" sudo yum install lapack-devel")
|
||||
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
||||
message(" sudo zypper install lapack-devel")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install liblapack-dev")
|
||||
message(" sudo apt-get install liblapack-dev")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(FATAL_ERROR "LAPACK is required to build gnss-sdr")
|
||||
endif(NOT LAPACK)
|
||||
@ -657,9 +657,9 @@ if(OS_IS_LINUX)
|
||||
message(" The BLAS library has not been found.")
|
||||
message(" You can try to install it by typing:")
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo yum install blas-devel")
|
||||
message(" sudo yum install blas-devel")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install libopenblas-dev")
|
||||
message(" sudo apt-get install libopenblas-dev")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(FATAL_ERROR "BLAS is required to build gnss-sdr")
|
||||
endif(NOT BLAS)
|
||||
@ -716,15 +716,15 @@ if(OS_IS_LINUX)
|
||||
)
|
||||
if(NOT GFORTRAN)
|
||||
message(" The gfortran library has not been found.")
|
||||
message(" You can try to install it by typing:")
|
||||
message(" You can try to install it by typing:")
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo yum install gcc-fortran")
|
||||
message(" sudo yum install gcc-fortran")
|
||||
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
||||
message(" sudo zypper install gcc-fortran")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install gfortran")
|
||||
message(" sudo apt-get install gfortran")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(FATAL_ERROR "gfortran is required to build gnss-sdr")
|
||||
#message(FATAL_ERROR "gfortran is required to build gnss-sdr")
|
||||
endif(NOT GFORTRAN)
|
||||
endif(OS_IS_LINUX)
|
||||
|
||||
@ -733,10 +733,10 @@ if(NOT ARMADILLO_FOUND)
|
||||
message (STATUS " Armadillo has not been found.")
|
||||
message (STATUS " Armadillo will be downloaded and built automatically ")
|
||||
message (STATUS " when doing 'make'. ")
|
||||
|
||||
set(armadillo_RELEASE 4.600.2)
|
||||
set(armadillo_MD5 "cfa4962bfa48bf3953d012b2f8fcfa35")
|
||||
|
||||
|
||||
set(armadillo_RELEASE 4.600.2)
|
||||
set(armadillo_MD5 "cfa4962bfa48bf3953d012b2f8fcfa35")
|
||||
|
||||
ExternalProject_Add(
|
||||
armadillo-${armadillo_RELEASE}
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
|
||||
@ -746,13 +746,13 @@ if(NOT ARMADILLO_FOUND)
|
||||
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND make
|
||||
UPDATE_COMMAND ""
|
||||
UPDATE_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
|
||||
# Set up variables
|
||||
ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir)
|
||||
set(ARMADILLO_INCLUDE_DIRS ${binary_dir}/include )
|
||||
set(ARMADILLO_INCLUDE_DIRS ${binary_dir}/include )
|
||||
find_library(LAPACK NAMES lapack HINTS /usr/lib /usr/local/lib /usr/lib64)
|
||||
if(OS_IS_MACOSX)
|
||||
find_library(BLAS blas)
|
||||
@ -768,7 +768,7 @@ if(NOT ARMADILLO_FOUND)
|
||||
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo
|
||||
)
|
||||
else(NOT ARMADILLO_FOUND)
|
||||
set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING})
|
||||
set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING})
|
||||
add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED)
|
||||
set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}")
|
||||
endif(NOT ARMADILLO_FOUND)
|
||||
@ -782,13 +782,13 @@ find_package(OpenSSL)
|
||||
if(NOT OPENSSL_FOUND)
|
||||
message(" The OpenSSL library has not been found.")
|
||||
message(" You can try to install it by typing:")
|
||||
if(OS_IS_LINUX)
|
||||
if(OS_IS_LINUX)
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo yum install openssl-devel")
|
||||
message(" sudo yum install openssl-devel")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install libssl-dev")
|
||||
message(" sudo apt-get install libssl-dev")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
endif(OS_IS_LINUX)
|
||||
endif(OS_IS_LINUX)
|
||||
if(OS_IS_MACOSX)
|
||||
message(" sudo port install openssl")
|
||||
endif(OS_IS_MACOSX)
|
||||
@ -842,7 +842,7 @@ if(DOXYGEN_FOUND)
|
||||
COMMENT "Generating API documentation with Doxygen." VERBATIM
|
||||
)
|
||||
if(LATEX_COMPILER)
|
||||
message(STATUS "'make pdfmanual' will generate a manual at ${CMAKE_SOURCE_DIR}/docs/GNSS-SDR_manual.pdf")
|
||||
message(STATUS "'make pdfmanual' will generate a manual at ${CMAKE_SOURCE_DIR}/docs/GNSS-SDR_manual.pdf")
|
||||
add_custom_target(pdfmanual
|
||||
COMMAND ${CMAKE_MAKE_PROGRAM}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_SOURCE_DIR}/docs/GNSS-SDR_manual.pdf
|
||||
@ -865,9 +865,9 @@ else(DOXYGEN_FOUND)
|
||||
message(STATUS " Get it from http://www.stack.nl/~dimitri/doxygen/index.html")
|
||||
if(OS_IS_LINUX)
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" or simply by doing 'sudo yum install doxygen-latex'.")
|
||||
message(" or simply by doing 'sudo yum install doxygen-latex'.")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" or simply by doing 'sudo apt-get install doxygen-latex'.")
|
||||
message(" or simply by doing 'sudo apt-get install doxygen-latex'.")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
endif(OS_IS_LINUX)
|
||||
if(OS_IS_MACOSX)
|
||||
@ -938,10 +938,10 @@ if(GN3S_DRIVER)
|
||||
endif(GN3S_DRIVER)
|
||||
if(ENABLE_GN3S)
|
||||
message(STATUS "The GN3S driver will be compiled.")
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'" )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'" )
|
||||
else(ENABLE_GN3S)
|
||||
message(STATUS "The (optional and experimental) GN3S driver is not enabled." )
|
||||
message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle." )
|
||||
message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle." )
|
||||
endif(ENABLE_GN3S)
|
||||
|
||||
|
||||
@ -956,7 +956,7 @@ endif(RAW_ARRAY_DRIVER)
|
||||
|
||||
if(ENABLE_ARRAY)
|
||||
message(STATUS "CTTC's Antenna Array front-end driver will be compiled." )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'" )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'" )
|
||||
# copy firmware to install folder
|
||||
# Build project gr-dbfcttc
|
||||
else(ENABLE_ARRAY)
|
||||
@ -971,7 +971,7 @@ endif($ENV{RTLSDR_DRIVER})
|
||||
|
||||
if(ENABLE_OSMOSDR)
|
||||
message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled." )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'" )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'" )
|
||||
else(ENABLE_OSMOSDR)
|
||||
message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled." )
|
||||
message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)" )
|
||||
@ -988,7 +988,7 @@ endif(FLEXIBAND_DRIVER)
|
||||
|
||||
if(ENABLE_FLEXIBAND)
|
||||
message(STATUS "CTTC's Antenna Array front-end driver will be compiled." )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'" )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'" )
|
||||
else(ENABLE_FLEXIBAND)
|
||||
message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled." )
|
||||
message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end." )
|
||||
@ -1004,9 +1004,9 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing")
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-unused-private-field")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-unused-private-field")
|
||||
endif(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
@ -1044,21 +1044,21 @@ if(ENABLE_GPERFTOOLS)
|
||||
# See http://gperftools.googlecode.com/svn/trunk/README
|
||||
if(GPERFTOOLS_FOUND)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin")
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif(GPERFTOOLS_FOUND)
|
||||
endif(ENABLE_GPERFTOOLS)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}")
|
||||
|
||||
if(OS_IS_LINUX)
|
||||
if(OS_IS_LINUX)
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
||||
link_libraries(pthread)
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
||||
endif(OS_IS_LINUX)
|
||||
endif(OS_IS_LINUX)
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -1080,5 +1080,3 @@ add_subdirectory(src)
|
||||
if(ENABLE_PACKAGING)
|
||||
include(GnssSdrPackaging)
|
||||
endif(ENABLE_PACKAGING)
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ set (ARM_VERSION "")
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
execute_process(COMMAND echo "int main(){}"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -dM -E -
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E -
|
||||
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
|
||||
|
||||
string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
|
||||
|
@ -8,7 +8,7 @@
|
||||
function (test_for_sse h_file result_var name)
|
||||
if (NOT DEFINED ${result_var})
|
||||
execute_process(COMMAND echo "#include <${h_file}>"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -c -x c++ -
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ -
|
||||
RESULT_VARIABLE COMPILE_RESULT
|
||||
OUTPUT_QUIET ERROR_QUIET)
|
||||
set(detected 0)
|
||||
|
@ -29,10 +29,12 @@ GNSS-SDR.SUPL_CI=0x31b0
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
;SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
SignalSource.filename=../../../Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=short
|
||||
;SignalSource.item_type=short
|
||||
SignalSource.item_type=byte
|
||||
|
||||
;#sampling_frequency: Original Signal sampling frequency in [Hz]
|
||||
SignalSource.sampling_frequency=4000000
|
||||
@ -75,7 +77,10 @@ SignalConditioner.implementation=Signal_Conditioner
|
||||
;######### DATA_TYPE_ADAPTER CONFIG ############
|
||||
;## Changes the type of input data. Please disable it in this version.
|
||||
;#implementation: [Pass_Through] disables this block
|
||||
DataTypeAdapter.implementation=Ishort_To_Complex
|
||||
;DataTypeAdapter.implementation=Ishort_To_Complex
|
||||
;DataTypeAdapter.implementation=Ibyte_To_Cbyte
|
||||
DataTypeAdapter.implementation=Pass_Through
|
||||
DataTypeAdapter.item_type=byte
|
||||
|
||||
;######### INPUT_FILTER CONFIG ############
|
||||
;## Filter the input data. Can be combined with frequency translation for IF signals
|
||||
@ -86,8 +91,8 @@ DataTypeAdapter.implementation=Ishort_To_Complex
|
||||
;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz.
|
||||
|
||||
;InputFilter.implementation=Fir_Filter
|
||||
;InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
InputFilter.implementation=Pass_Through
|
||||
InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
;InputFilter.implementation=Pass_Through
|
||||
|
||||
;#dump: Dump the filtered data to a file.
|
||||
InputFilter.dump=false
|
||||
@ -100,7 +105,7 @@ InputFilter.dump_filename=../data/input_filter.dat
|
||||
;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse reponse given a set of band edges, the desired reponse on those bands, and the weight given to the error in those bands.
|
||||
|
||||
;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
|
||||
InputFilter.input_item_type=gr_complex
|
||||
InputFilter.input_item_type=byte
|
||||
|
||||
;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
|
||||
InputFilter.output_item_type=gr_complex
|
||||
@ -167,6 +172,7 @@ Resampler.dump_filename=../data/resampler.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Resampler.item_type=gr_complex
|
||||
;Resampler.item_type=cbyte
|
||||
|
||||
;#sample_freq_in: the sample frequency of the input signal
|
||||
Resampler.sample_freq_in=8000000
|
||||
|
@ -17,7 +17,7 @@ ControlThread.wait_for_flowgraph=false
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
SignalSource.filename=../../../Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=short
|
||||
@ -166,7 +166,7 @@ Resampler.sample_freq_out=4000000
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_GPS.count=0
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_Galileo.count=4
|
||||
Channels_Galileo.count=8
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
|
||||
@ -193,7 +193,7 @@ Acquisition_Galileo.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
;#threshold: Acquisition threshold
|
||||
;Acquisition_Galileo.threshold=0
|
||||
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_Galileo.pfa=0.0000002
|
||||
Acquisition_Galileo.pfa=0.000002
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_Galileo.doppler_max=15000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
|
@ -17,7 +17,7 @@ ControlThread.wait_for_flowgraph=false
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
SignalSource.filename=../data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
SignalSource.filename=../../../Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=short
|
||||
@ -164,9 +164,9 @@ Resampler.sample_freq_out=4000000
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_GPS.count=2
|
||||
Channels_GPS.count=4
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_Galileo.count=2
|
||||
Channels_Galileo.count=4
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
|
||||
|
@ -38,6 +38,7 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-proje
|
||||
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) #location for custom "Modules"
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
########################################################################
|
||||
# Environment setup
|
||||
|
@ -20,8 +20,7 @@
|
||||
#include "volk_gnsssdr/volk_gnsssdr_malloc.h"
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* For #defines used to determine support for allocation functions,
|
||||
@ -52,12 +51,20 @@
|
||||
//#else // _ISOC11_SOURCE
|
||||
|
||||
// Otherwise, test if we are a POSIX or X/Open system
|
||||
// This only has a restriction that alignment be a power of 2.
|
||||
// This only has a restriction that alignment be a power of 2and a
|
||||
// multiple of sizeof(void *).
|
||||
#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || HAVE_POSIX_MEMALIGN
|
||||
|
||||
void *volk_gnsssdr_malloc(size_t size, size_t alignment)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
// quoting posix_memalign() man page:
|
||||
// "alignment must be a power of two and a multiple of sizeof(void *)"
|
||||
// volk_get_alignment() could return 1 for some machines (e.g. generic_orc)
|
||||
if (alignment == 1)
|
||||
return malloc(size);
|
||||
|
||||
int err = posix_memalign(&ptr, alignment, size);
|
||||
if(err == 0)
|
||||
{
|
||||
@ -65,7 +72,9 @@ void *volk_gnsssdr_malloc(size_t size, size_t alignment)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "VOLK: Error allocating memory (posix_memalign: %d)\n", err);
|
||||
fprintf(stderr,
|
||||
"VOLK: Error allocating memory "
|
||||
"(posix_memalign: error %d: %s)\n", err, strerror(err));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user