1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

Adds the option to avoid the use of OpenCL by doing 'cmake ../ -DDISABLE_OPENCL=1'

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@485 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2014-03-15 01:21:17 +00:00
parent f73137e736
commit 26d2bc70b3
5 changed files with 30 additions and 7 deletions

View File

@ -657,6 +657,17 @@ endif(NOT ARMADILLO_FOUND)
# OpenCL # OpenCL
############################################################################### ###############################################################################
find_package(OpenCL) find_package(OpenCL)
if($ENV{DISABLE_OPENCL})
set(DISABLE_OPENCL TRUE)
endif($ENV{DISABLE_OPENCL})
if(DISABLE_OPENCL)
set(OPENCL_FOUND FALSE)
else(DISABLE_OPENCL)
if(OPENCL_FOUND)
message(STATUS "OpenCL has been found and will be used by some processing blocks")
message(STATUS "You can disable OpenCL use by doing 'cmake -DDISABLE_OPENCL=1 ../' ")
endif(OPENCL_FOUND)
endif(DISABLE_OPENCL)
if(NOT OPENCL_FOUND) if(NOT OPENCL_FOUND)
message(STATUS "Processing blocks using OpenCL will not be built.") message(STATUS "Processing blocks using OpenCL will not be built.")
endif(NOT OPENCL_FOUND) endif(NOT OPENCL_FOUND)

View File

@ -100,7 +100,9 @@ endif( RTLSDR_DRIVER )
#Enable OpenCL if found in the system #Enable OpenCL if found in the system
if(OPENCL_FOUND) if(OPENCL_FOUND)
message(STATUS "Adding processing blocks implemented using OpenCL" ) message(STATUS "Adding processing blocks implemented using OpenCL" )
add_definitions(-DOPENCL=1) add_definitions(-DOPENCL_BLOCKS=1)
else(OPENCL_FOUND)
add_definitions(-DOPENCL_BLOCKS=0)
endif(OPENCL_FOUND) endif(OPENCL_FOUND)

View File

@ -79,7 +79,7 @@
#include "gps_l1_ca_pvt.h" #include "gps_l1_ca_pvt.h"
#include "galileo_e1_pvt.h" #include "galileo_e1_pvt.h"
#if OPENCL #if OPENCL_BLOCKS
#include "gps_l1_ca_pcps_opencl_acquisition.h" #include "gps_l1_ca_pcps_opencl_acquisition.h"
#endif #endif
@ -403,7 +403,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
out_streams, queue); out_streams, queue);
} }
#if OPENCL #if OPENCL_BLOCKS
else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0) else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0)
{ {
block = new GpsL1CaPcpsOpenClAcquisition(configuration, role, in_streams, block = new GpsL1CaPcpsOpenClAcquisition(configuration, role, in_streams,

View File

@ -81,6 +81,7 @@ else(NOT GTEST_DIR_LOCAL)
endif(NOT GTEST_DIR_LOCAL) endif(NOT GTEST_DIR_LOCAL)
include_directories( include_directories(
${GTEST_INCLUDE_DIRECTORIES} ${GTEST_INCLUDE_DIRECTORIES}
${CMAKE_SOURCE_DIR}/src/core/system_parameters ${CMAKE_SOURCE_DIR}/src/core/system_parameters
@ -104,6 +105,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/output_filter/adapters ${CMAKE_SOURCE_DIR}/src/algorithms/output_filter/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/pvt/libs
${GLOG_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS}
@ -120,6 +122,10 @@ if(OS_IS_MACOSX)
endif(MACOSX_MAVERICKS) endif(MACOSX_MAVERICKS)
endif(OS_IS_MACOSX) endif(OS_IS_MACOSX)
if(OPENCL_FOUND)
add_definitions(-DOPENCL_BLOCKS_TEST=1)
endif(OPENCL_FOUND)
add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc)
target_link_libraries(run_tests ${MAC_LIBRARIES} target_link_libraries(run_tests ${MAC_LIBRARIES}
@ -135,6 +141,8 @@ target_link_libraries(run_tests ${MAC_LIBRARIES}
gnss_rx gnss_rx
signal_generator_blocks signal_generator_blocks
signal_generator_adapters signal_generator_adapters
out_adapters
pvt_gr_blocks
) )
install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install) install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install)
@ -168,7 +176,7 @@ add_executable(gnss_block_test EXCLUDE_FROM_ALL
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc # ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc
@ -187,6 +195,7 @@ target_link_libraries(gnss_block_test ${Boost_LIBRARIES}
gnss_sp_libs gnss_sp_libs
gnss_rx gnss_rx
signal_generator_blocks signal_generator_blocks
out_adapters
) )
add_test(gnss_block_test gnss_block_test) add_test(gnss_block_test gnss_block_test)

View File

@ -78,6 +78,7 @@
#include "string_converter/string_converter_test.cc" #include "string_converter/string_converter_test.cc"
//#include "flowgraph/gnss_flowgraph_test.cc" //#include "flowgraph/gnss_flowgraph_test.cc"
#include "gnss_block/rtcm_printer_test.cc"
#include "gnss_block/file_output_filter_test.cc" #include "gnss_block/file_output_filter_test.cc"
#include "gnss_block/file_signal_source_test.cc" #include "gnss_block/file_signal_source_test.cc"
#include "gnss_block/fir_filter_test.cc" #include "gnss_block/fir_filter_test.cc"
@ -85,7 +86,7 @@
#include "gnss_block/gps_l1_ca_pcps_acquisition_test.cc" #include "gnss_block/gps_l1_ca_pcps_acquisition_test.cc"
#include "gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc" #include "gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc"
//#include "gnss_block/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc" //#include "gnss_block/gps_l1_ca_pcps_multithread_acquisition_gsoc2013_test.cc"
#if OPENCL #if OPENCL_BLOCKS_TEST
#include "gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc" #include "gnss_block/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc"
#endif #endif
#include "gnss_block/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc" #include "gnss_block/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc"