Fixing detection of GNU Radio when installed in non-usual locations (e.g. /home/user/target). Now the user can tell cmake where GNU Radio is by 'cmake ../ -DGNURADIO_INSTALL_PREFIX=/home/user/target'

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@462 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2013-12-14 10:23:33 +00:00
parent 61ff27165d
commit 004495507d
15 changed files with 57 additions and 51 deletions

View File

@ -81,7 +81,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(NOT LINUX_DISTRIBUTION) if(NOT LINUX_DISTRIBUTION)
if(EXISTS "/etc/os-release") if(EXISTS "/etc/os-release")
execute_process(COMMAND cat /etc/os-release execute_process(COMMAND cat /etc/os-release
COMMAND grep -m1 NAME COMMAND grep -e "^[NAME]"
COMMAND awk -F= "{ print $2 }" COMMAND awk -F= "{ print $2 }"
COMMAND tr "\n" " " COMMAND tr "\n" " "
COMMAND sed "s/ //" COMMAND sed "s/ //"
@ -125,7 +125,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX_DISTRIBUTION "Generic") set(LINUX_DISTRIBUTION "Generic")
set(LINUX_VER "Unknown") set(LINUX_VER "Unknown")
endif(NOT LINUX_DISTRIBUTION) endif(NOT LINUX_DISTRIBUTION)
message(STATUS "Configuring GNSS-SDR to be built on ${LINUX_DISTRIBUTION} Release ${LINUX_VER} ${ARCH_}") message(STATUS "Configuring GNSS-SDR to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Detect Mac OS X Version # Detect Mac OS X Version
@ -184,8 +184,14 @@ endif(GTEST_DIR)
################################################################################ ################################################################################
if(UNIX AND EXISTS "/usr/lib64") if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix
endif(UNIX AND EXISTS "/usr/lib64") endif(UNIX AND EXISTS "/usr/lib64")
if(GNURADIO_INSTALL_PREFIX)
if(EXISTS "${GNURADIO_INSTALL_PREFIX}/lib/libboost_thread-mt.so")
list(APPEND BOOST_LIBRARYDIR "${GNURADIO_INSTALL_PREFIX}/lib") # Boost installed by PyBOMBS
list(APPEND BOOST_INCLUDEDIR "${GNURADIO_INSTALL_PREFIX}/include") # Boost installed by PyBOMBS
endif(EXISTS "${GNURADIO_INSTALL_PREFIX}/lib/libboost_thread-mt.so")
endif(GNURADIO_INSTALL_PREFIX)
set(Boost_ADDITIONAL_VERSIONS set(Boost_ADDITIONAL_VERSIONS
"1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
"1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49" "1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49"

14
README
View File

@ -5,7 +5,7 @@ This document describes how to set up the compilation environment and build GNSS
GNU/Linux GNU/Linux
----------------------------------------------------------- -----------------------------------------------------------
Tested distributions: Ubuntu 12.04, 12.10, 13.04 and 13.10 (32 and 64 bits), Debian 6.0.6, Fedora 18 (newer versions should work, too) Tested distributions: Ubuntu 12.04, 12.10, 13.04 and 13.10 (32 and 64 bits), Debian 6.0.6 and 7.2, Fedora 18 (newer versions should work, too)
* Install GNU Radio: * Install GNU Radio:
@ -16,13 +16,14 @@ $ cd pybombs
Configure PyBOMBS: Configure PyBOMBS:
$ ./pybombs config $ sudo ./pybombs config
You can safely accept the default options but for prefix. We recommend to put /usr/local there. After the configuration, you should get something similar to: You can safely accept the default options but for prefix. We recommend to put /usr/local there. After the configuration, you should get something similar to:
gituser = username gituser = username
prefix = /usr/local prefix = /usr/local
satisfy_order = deb,src satisfy_order = deb,src # For Debian/Ubuntu/LinuxMint
satisfy_order = rpm,src # For Fedora/CentOS/RHEL
forcepkgs = forcepkgs =
timeout = 30 timeout = 30
cmakebuildtype = RelWithDebInfo cmakebuildtype = RelWithDebInfo
@ -40,7 +41,9 @@ In case you do not want to use PyBOMBS and prefer to build and install GNU Radio
- Download, compile, and install the Armadillo linear algebra library - Download, compile, and install the Armadillo linear algebra library
$ sudo apt-get install libblas-dev liblapack-dev gfortran $ sudo apt-get install libblas-dev liblapack-dev gfortran # For Debian/Ubuntu/LinuxMint
$ sudo yum install lapack-devel blas-devel gcc-fortran # For Fedora/CentOS/RHEL
$ wget http://sourceforge.net/projects/arma/files/armadillo-3.920.2.tar.gz $ wget http://sourceforge.net/projects/arma/files/armadillo-3.920.2.tar.gz
$ tar xvfz armadillo-3.920.2.tar.gz $ tar xvfz armadillo-3.920.2.tar.gz
$ cd armadillo-3.920.2 $ cd armadillo-3.920.2
@ -96,7 +99,8 @@ changing /home/username/gtest-1.7.0 by the actual directory where you downloaded
- Install Subversion and the SSL development libraries: - Install Subversion and the SSL development libraries:
$ sudo apt-get install libssl-dev subversion $ sudo apt-get install libssl-dev subversion # For Debian/Ubuntu/LinuxMint
$ sudo yum install openssl-devel subversion # For Fedora/CentOS/RHEL
* Check out the latest version of GNSS-SDR * Check out the latest version of GNSS-SDR

View File

@ -1,21 +1,6 @@
# Copyright 2013 Free Software Foundation, Inc. ########################################################################
# # Find GNU Radio
# This file is part of GNU Radio ########################################################################
#
# GNU Radio 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, or (at your option)
# any later version.
#
# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)

View File

@ -12,6 +12,7 @@ FIND_PATH(
${PC_UHD_INCLUDEDIR} ${PC_UHD_INCLUDEDIR}
PATHS /usr/local/include PATHS /usr/local/include
/usr/include /usr/include
${GNURADIO_INSTALL_PREFIX}/include
) )
FIND_LIBRARY( FIND_LIBRARY(
@ -21,6 +22,7 @@ FIND_LIBRARY(
${PC_UHD_LIBDIR} ${PC_UHD_LIBDIR}
PATHS /usr/local/lib PATHS /usr/local/lib
/usr/lib /usr/lib
${GNURADIO_INSTALL_PREFIX}/lib
) )
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)

View File

@ -1,3 +1,7 @@
########################################################################
# Find VOLK (Vector-Optimized Library of Kernels)
########################################################################
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_VOLK volk) PKG_CHECK_MODULES(PC_VOLK volk)
@ -8,6 +12,7 @@ FIND_PATH(
${PC_VOLK_INCLUDEDIR} ${PC_VOLK_INCLUDEDIR}
PATHS /usr/local/include PATHS /usr/local/include
/usr/include /usr/include
${GNURADIO_INSTALL_PREFIX}/include
) )
FIND_LIBRARY( FIND_LIBRARY(
@ -19,6 +24,7 @@ FIND_LIBRARY(
/usr/local/lib64 /usr/local/lib64
/usr/lib /usr/lib
/usr/lib64 /usr/lib64
${GNURADIO_INSTALL_PREFIX}/lib
) )
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)

View File

@ -53,6 +53,7 @@ include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
add_library(acq_adapters ${ACQ_ADAPTER_SOURCES}) add_library(acq_adapters ${ACQ_ADAPTER_SOURCES})

View File

@ -30,4 +30,4 @@ include_directories(
) )
add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES}) add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES})
target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES}) target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES})

View File

@ -27,6 +27,7 @@ include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
add_library(channel_fsm ${CHANNEL_FSM_SOURCES}) add_library(channel_fsm ${CHANNEL_FSM_SOURCES})

View File

@ -47,6 +47,7 @@ include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
if(OPENCL_FOUND) if(OPENCL_FOUND)

View File

@ -74,7 +74,12 @@ if(RTLSDR_DRIVER)
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${RTL_DRIVER_INCLUDE_DIRS}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${RTL_DRIVER_INCLUDE_DIRS})
endif(RTLSDR_DRIVER) endif(RTLSDR_DRIVER)
set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc gen_signal_source.cc uhd_signal_source.cc nsr_file_signal_source.cc ${OPT_DRIVER_SOURCES}) set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc
gen_signal_source.cc
uhd_signal_source.cc
nsr_file_signal_source.cc
${OPT_DRIVER_SOURCES}
)
include_directories( include_directories(
@ -95,4 +100,13 @@ if(ARCH_64BITS)
endif(ARCH_64BITS) endif(ARCH_64BITS)
add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES}) add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES})
target_link_libraries(signal_source_adapters signal_source_gr_blocks ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${OPT_LIBRARIES} gnss_sp_libs)
target_link_libraries(signal_source_adapters signal_source_gr_blocks
${Boost_LIBRARIES}
${GNURADIO_PMT_LIBRARIES}
${GNURADIO_BLOCKS_LIBRARIES}
${UHD_LIBRARIES}
${GNURADIO_UHD_LIBRARIES}
${OPT_LIBRARIES}
gnss_sp_libs
)

View File

@ -30,6 +30,7 @@ include_directories(
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES}) add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES})

View File

@ -16,15 +16,7 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
#if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#set(TRACKING_ADAPTER_SOURCES
# galileo_e1_dll_pll_veml_tracking.cc
# galileo_e1_tcp_connector_tracking.cc
# gps_l1_ca_dll_fll_pll_tracking.cc
# gps_l1_ca_dll_pll_tracking.cc
# gps_l1_ca_tcp_connector_tracking.cc
#)
#else(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(TRACKING_ADAPTER_SOURCES set(TRACKING_ADAPTER_SOURCES
galileo_e1_dll_pll_veml_tracking.cc galileo_e1_dll_pll_veml_tracking.cc
galileo_e1_tcp_connector_tracking.cc galileo_e1_tcp_connector_tracking.cc
@ -33,7 +25,6 @@ set(TRACKING_ADAPTER_SOURCES
gps_l1_ca_dll_pll_tracking.cc gps_l1_ca_dll_pll_tracking.cc
gps_l1_ca_tcp_connector_tracking.cc gps_l1_ca_tcp_connector_tracking.cc
) )
#endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
include_directories( include_directories(
$(CMAKE_CURRENT_SOURCE_DIR) $(CMAKE_CURRENT_SOURCE_DIR)

View File

@ -16,15 +16,6 @@
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
# #
#if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#set(TRACKING_GR_BLOCKS_SOURCES
# galileo_e1_dll_pll_veml_tracking_cc.cc
# galileo_e1_tcp_connector_tracking_cc.cc
# gps_l1_ca_dll_fll_pll_tracking_cc.cc
# gps_l1_ca_dll_pll_tracking_cc.cc
# gps_l1_ca_tcp_connector_tracking_cc.cc
#)
#else(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(TRACKING_GR_BLOCKS_SOURCES set(TRACKING_GR_BLOCKS_SOURCES
galileo_e1_dll_pll_veml_tracking_cc.cc galileo_e1_dll_pll_veml_tracking_cc.cc
galileo_e1_tcp_connector_tracking_cc.cc galileo_e1_tcp_connector_tracking_cc.cc
@ -33,7 +24,6 @@ set(TRACKING_GR_BLOCKS_SOURCES
gps_l1_ca_dll_pll_tracking_cc.cc gps_l1_ca_dll_pll_tracking_cc.cc
gps_l1_ca_tcp_connector_tracking_cc.cc gps_l1_ca_tcp_connector_tracking_cc.cc
) )
#endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
include_directories( include_directories(
$(CMAKE_CURRENT_SOURCE_DIR) $(CMAKE_CURRENT_SOURCE_DIR)
@ -45,6 +35,7 @@ include_directories(
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES}) add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES})

View File

@ -32,7 +32,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/core/libs ${CMAKE_SOURCE_DIR}/src/core/libs
${CMAKE_SOURCE_DIR}/src/core/libs/supl ${CMAKE_SOURCE_DIR}/src/core/libs/supl
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
${CMAKE_SOURCE_DIR}/src/algorithms/libs ${CMAKE_SOURCE_DIR}/src/algorithms/libs
${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks
@ -60,6 +60,7 @@ include_directories(
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )

View File

@ -24,11 +24,12 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/core/libs ${CMAKE_SOURCE_DIR}/src/core/libs
${CMAKE_SOURCE_DIR}/src/core/libs/supl ${CMAKE_SOURCE_DIR}/src/core/libs/supl
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${ARMADILLO_INCLUDE_DIRS} ${ARMADILLO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
) )
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" ) add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
@ -53,6 +54,7 @@ target_link_libraries(gnss-sdr ${MAC_LIBRARIES}
${GFlags_LIBS} ${GFlags_LIBS}
${GLOG_LIBRARIES} ${GLOG_LIBRARIES}
${ARMADILLO_LIBRARIES} ${ARMADILLO_LIBRARIES}
${UHD_LIBRARIES}
gnss_sp_libs gnss_sp_libs
gnss_rx gnss_rx
) )