cleanups for cmake files, fixes to linker errors

master
Paul Sutton 9 years ago
parent 14a889bcf9
commit 47eb847913

@ -33,14 +33,14 @@ endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (SRSLTE)
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
INCLUDE(SRSLTEVersion) #sets version information
INCLUDE(SRSLTEPackage) #setup cpack
INCLUDE(BuildMex)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
include(SRSLTEVersion) #sets version information
include(SRSLTEPackage) #setup cpack
include(BuildMex)
include(CTest)
set( CTEST_MEMORYCHECK_COMMAND valgrind )
CONFIGURE_FILE(
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake"
IMMEDIATE @ONLY)
@ -63,112 +63,112 @@ if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_LIBDIR lib)
endif()
SET(RUNTIME_DIR bin)
SET(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
SET(INCLUDE_DIR include)
SET(MEX_DIR mex)
SET(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}")
SET(DATA_DIR share/${CPACK_PACKAGE_NAME})
set(RUNTIME_DIR bin)
set(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
set(INCLUDE_DIR include)
set(MEX_DIR mex)
set(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}")
set(DATA_DIR share/${CPACK_PACKAGE_NAME})
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
MESSAGE(STATUS "Build type not specified: defaulting to Release.")
ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Build type not specified: defaulting to Release.")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
########################################################################
# Compiler specific setup
########################################################################
macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(${flag} ${have})
check_cxx_compiler_flag(${flag} ${have})
if(${have})
add_definitions(${flag})
endif(${have})
endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
IF(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX)
#Any additional flags for CXX
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
endif(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-write-strings -Wno-format-extra-args -Winline -Wno-unused-result -Wno-format -std=c99 -D_GNU_SOURCE -g")
IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
ELSE(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
FIND_PACKAGE(SSE)
IF(HAVE_AVX)
else(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
find_package(SSE)
if(HAVE_AVX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
ELSEIF(HAVE_SSE)
elseif(HAVE_SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
ENDIF(HAVE_AVX)
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
endif(HAVE_AVX)
endif(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
IF(NOT WIN32)
if(NOT WIN32)
ADD_CXX_COMPILER_FLAG_IF_AVAILABLE(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
ENDIF(NOT WIN32)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(MSVC)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/msvc) #missing headers
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max
ADD_DEFINITIONS( #stop all kinds of compatibility warnings
endif(NOT WIN32)
endif(CMAKE_COMPILER_IS_GNUCC)
if(MSVC)
include_directories(${PROJECT_SOURCE_DIR}/msvc) #missing headers
add_definitions(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
add_definitions(-DNOMINMAX) #disables stupidity and enables std::min and std::max
add_definitions( #stop all kinds of compatibility warnings
-D_SCL_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
)
ADD_DEFINITIONS(/MP) #build with multiple processors
ENDIF(MSVC)
add_definitions(/MP) #build with multiple processors
endif(MSVC)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# The following is needed for weak linking to work under OS X
SET(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
########################################################################
# Create uninstall targets
########################################################################
CONFIGURE_FILE(
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
########################################################################
# Macro to add -fPIC property to static libs
########################################################################
MACRO(SRSLTE_SET_PIC)
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
SET_TARGET_PROPERTIES(${ARGV} PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
ENDMACRO(SRSLTE_SET_PIC)
macro(SRSLTE_SET_PIC)
if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
set_target_properties(${ARGV} PROPERTIES COMPILE_FLAGS -fPIC)
endif( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
endmacro(SRSLTE_SET_PIC)
########################################################################
# Print summary
########################################################################
MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
MESSAGE(STATUS "Building for version: ${VERSION}")
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Building for version: ${VERSION}")
########################################################################
# Add general includes and dependencies
########################################################################
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/srslte/include/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/srslte/include/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/mex/include)
include_directories(${PROJECT_BINARY_DIR}/srslte/include/)
include_directories(${PROJECT_SOURCE_DIR}/srslte/include/)
include_directories(${PROJECT_SOURCE_DIR}/mex/include)
########################################################################
# Add the subdirectories
########################################################################
ADD_SUBDIRECTORY(srslte)
ADD_SUBDIRECTORY(mex)
add_subdirectory(srslte)
add_subdirectory(mex)

@ -53,13 +53,13 @@ MACRO(CHECK_FUNCTION_EXISTS_MATH FUNCTION VARIABLE)
IF(${VARIABLE})
SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
MESSAGE(STATUS "Looking for ${FUNCTION} - found")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n")
ELSE(${VARIABLE})
MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n\n")
ENDIF(${VARIABLE})

@ -31,19 +31,19 @@ if(NOT DisableMEX)
########################################################################
# Add headers to cmake project (useful for IDEs)
########################################################################
SET(HEADERS_ALL "")
FILE(GLOB headers *)
set(HEADERS_ALL "")
file(GLOB headers *)
FOREACH (_header ${headers})
IF(IS_DIRECTORY ${_header})
FILE(GLOB_RECURSE tmp "${_header}/*.h")
LIST(APPEND HEADERS_ALL ${tmp})
ENDIF(IS_DIRECTORY ${_header})
if(IS_DIRECTORY ${_header})
file(GLOB_RECURSE tmp "${_header}/*.h")
list(APPEND HEADERS_ALL ${tmp})
endif(IS_DIRECTORY ${_header})
ENDFOREACH()
ADD_CUSTOM_TARGET (add_mex_headers SOURCES ${HEADERS_ALL})
add_custom_target (add_mex_headers SOURCES ${HEADERS_ALL})
########################################################################
# Add the subdirectories
########################################################################
ADD_SUBDIRECTORY(lib)
add_subdirectory(lib)
endif()

@ -29,61 +29,61 @@ INSTALL(DIRECTORY include/
########################################################################
# Add headers to cmake project (useful for IDEs)
########################################################################
SET(HEADERS_ALL "")
FILE(GLOB headers *)
set(HEADERS_ALL "")
file(GLOB headers *)
FOREACH (_header ${headers})
IF(IS_DIRECTORY ${_header})
FILE(GLOB_RECURSE tmp "${_header}/*.h")
LIST(APPEND HEADERS_ALL ${tmp})
ENDIF(IS_DIRECTORY ${_header})
if(IS_DIRECTORY ${_header})
file(GLOB_RECURSE tmp "${_header}/*.h")
list(APPEND HEADERS_ALL ${tmp})
endif(IS_DIRECTORY ${_header})
ENDFOREACH()
ADD_CUSTOM_TARGET (add_srslte_headers SOURCES ${HEADERS_ALL})
add_custom_target (add_srslte_headers SOURCES ${HEADERS_ALL})
########################################################################
# Find Dependencies
########################################################################
FIND_PACKAGE(UHD)
FIND_PACKAGE(bladeRF)
find_package(UHD)
find_package(bladeRF)
IF(UHD_FOUND)
INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS})
LINK_DIRECTORIES(${UHD_LIBRARY_DIRS})
ENDIF(UHD_FOUND)
if(UHD_FOUND)
include_directories(${UHD_INCLUDE_DIRS})
link_directories(${UHD_LIBRARY_DIRS})
endif(UHD_FOUND)
IF(BLADERF_FOUND)
INCLUDE_DIRECTORIES(${BLADERF_INCLUDE_DIRS})
LINK_DIRECTORIES(${BLADERF_LIBRARY_DIRS})
ENDIF(BLADERF_FOUND)
if(BLADERF_FOUND)
include_directories(${BLADERF_INCLUDE_DIRS})
link_directories(${BLADERF_LIBRARY_DIRS})
endif(BLADERF_FOUND)
IF(BLADERF_FOUND OR UHD_FOUND)
if(BLADERF_FOUND OR UHD_FOUND)
set(RF_FOUND TRUE CACHE INTERNAL "RF frontend found")
ELSE(BLADERF_FOUND OR UHD_FOUND)
else(BLADERF_FOUND OR UHD_FOUND)
set(RF_FOUND FALSE CACHE INTERNAL "RF frontend found")
add_definitions(-DDISABLE_RF)
ENDIF(BLADERF_FOUND OR UHD_FOUND)
endif(BLADERF_FOUND OR UHD_FOUND)
include(CheckFunctionExistsMath)
IF(${DISABLE_VOLK})
IF(${DISABLE_VOLK} EQUAL 0)
FIND_PACKAGE(Volk)
ELSE(${DISABLE_VOLK} EQUAL 0)
MESSAGE(STATUS "VOLK library disabled (DISABLE_VOLK=1)")
ENDIF(${DISABLE_VOLK} EQUAL 0)
ELSE(${DISABLE_VOLK})
FIND_PACKAGE(Volk)
ENDIF(${DISABLE_VOLK})
if(${DISABLE_VOLK})
if(${DISABLE_VOLK} EQUAL 0)
find_package(Volk)
else(${DISABLE_VOLK} EQUAL 0)
message(STATUS "VOLK library disabled (DISABLE_VOLK=1)")
endif(${DISABLE_VOLK} EQUAL 0)
else(${DISABLE_VOLK})
find_package(Volk)
endif(${DISABLE_VOLK})
IF(VOLK_FOUND)
INCLUDE_DIRECTORIES(${VOLK_INCLUDE_DIRS})
LINK_DIRECTORIES(${VOLK_LIBRARY_DIRS})
MESSAGE(STATUS " Compiling with VOLK SIMD library.")
ELSE(VOLK_FOUND)
MESSAGE(STATUS " VOLK SIMD library NOT found. Using generic implementation.")
ENDIF(VOLK_FOUND)
if(VOLK_FOUND)
include_directories(${VOLK_INCLUDE_DIRS})
link_directories(${VOLK_LIBRARY_DIRS})
message(STATUS " Compiling with VOLK SIMD library.")
else(VOLK_FOUND)
message(STATUS " VOLK SIMD library NOT found. Using generic implementation.")
endif(VOLK_FOUND)
########################################################################
# Add subdirectories
########################################################################
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(examples)
add_subdirectory(lib)
add_subdirectory(include)
add_subdirectory(examples)

@ -36,28 +36,28 @@ target_link_libraries(pdsch_ue srslte pthread)
add_executable(pdsch_enodeb pdsch_enodeb.c)
target_link_libraries(pdsch_enodeb srslte pthread)
IF(RF_FOUND)
if(RF_FOUND)
target_link_libraries(pdsch_ue srslte_rf)
target_link_libraries(pdsch_enodeb srslte_rf)
ELSE(RF_FOUND)
else(RF_FOUND)
add_definitions(-DDISABLE_RF)
ENDIF(RF_FOUND)
endif(RF_FOUND)
FIND_PACKAGE(SRSGUI)
find_package(SRSGUI)
IF(SRSGUI_FOUND)
if(SRSGUI_FOUND)
include_directories(${SRSGUI_INCLUDE_DIRS})
target_link_libraries(pdsch_ue ${SRSGUI_LIBRARIES})
ELSE(SRSGUI_FOUND)
else(SRSGUI_FOUND)
add_definitions(-DDISABLE_GRAPHICS)
ENDIF(SRSGUI_FOUND)
endif(SRSGUI_FOUND)
#################################################################
# These examples need the UHD driver
#################################################################
IF(RF_FOUND)
if(RF_FOUND)
add_executable(cell_search cell_search.c)
target_link_libraries(cell_search srslte srslte_rf)
@ -74,12 +74,12 @@ IF(RF_FOUND)
add_executable(usrp_txrx usrp_txrx.c)
target_link_libraries(usrp_txrx srslte srslte_rf)
MESSAGE(STATUS " examples will be installed.")
message(STATUS " examples will be installed.")
ELSE(RF_FOUND)
MESSAGE(STATUS " examples will NOT BE INSTALLED.")
ENDIF(RF_FOUND)
else(RF_FOUND)
message(STATUS " examples will NOT BE INSTALLED.")
endif(RF_FOUND)
# Add subdirectories
ADD_SUBDIRECTORY(tutorial_examples)
add_subdirectory(tutorial_examples)

@ -23,7 +23,7 @@
# EXAMPLES shown in WinnForum 2015 Tutorial
#################################################################
IF(SRSGUI_FOUND AND UHD_FOUND)
if(SRSGUI_FOUND AND UHD_FOUND)
add_executable(pss pss.c)
target_link_libraries(pss srslte ${SRSGUI_LIBRARIES} srslte_rf)
@ -31,5 +31,5 @@ IF(SRSGUI_FOUND AND UHD_FOUND)
add_executable(simple_tx simple_tx.c)
target_link_libraries(simple_tx srslte srslte_rf)
ENDIF(SRSGUI_FOUND AND UHD_FOUND)
endif(SRSGUI_FOUND AND UHD_FOUND)

@ -21,5 +21,5 @@
########################################################################
# Add subdirectories
########################################################################
ADD_SUBDIRECTORY(srslte)
add_subdirectory(srslte)

@ -18,7 +18,7 @@
# and at http://www.gnu.org/licenses/.
#
CONFIGURE_FILE(
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h
)

@ -18,25 +18,25 @@
# and at http://www.gnu.org/licenses/.
#
ADD_SUBDIRECTORY(agc)
ADD_SUBDIRECTORY(ch_estimation)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(fec)
ADD_SUBDIRECTORY(mimo)
ADD_SUBDIRECTORY(phch)
ADD_SUBDIRECTORY(rf)
ADD_SUBDIRECTORY(sync)
ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(channel)
ADD_SUBDIRECTORY(dft)
ADD_SUBDIRECTORY(io)
ADD_SUBDIRECTORY(modem)
ADD_SUBDIRECTORY(resampling)
ADD_SUBDIRECTORY(scrambling)
ADD_SUBDIRECTORY(ue)
add_subdirectory(agc)
add_subdirectory(ch_estimation)
add_subdirectory(common)
add_subdirectory(fec)
add_subdirectory(mimo)
add_subdirectory(phch)
add_subdirectory(rf)
add_subdirectory(sync)
add_subdirectory(utils)
add_subdirectory(channel)
add_subdirectory(dft)
add_subdirectory(io)
add_subdirectory(modem)
add_subdirectory(resampling)
add_subdirectory(scrambling)
add_subdirectory(ue)
ADD_LIBRARY(srslte SHARED version.c)
TARGET_LINK_LIBRARIES(srslte srslte_agc
add_library(srslte SHARED version.c)
target_link_libraries(srslte srslte_agc
srslte_ch_estimation
srslte_common
srslte_fec
@ -53,13 +53,13 @@ TARGET_LINK_LIBRARIES(srslte srslte_agc
srslte_ue
srslte_rf
pthread)
SET_TARGET_PROPERTIES(srslte PROPERTIES
set_target_properties(srslte PROPERTIES
VERSION ${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR})
IF(VOLK_FOUND)
SET_TARGET_PROPERTIES(srslte PROPERTIES COMPILE_DEFINITIONS "${VOLK_DEFINITIONS}")
TARGET_LINK_LIBRARIES(srslte ${VOLK_LIBRARIES})
ENDIF(VOLK_FOUND)
if(VOLK_FOUND)
set_target_properties(srslte PROPERTIES COMPILE_DEFINITIONS "${VOLK_DEFINITIONS}")
target_link_libraries(srslte ${VOLK_LIBRARIES})
endif(VOLK_FOUND)
INSTALL(TARGETS srslte DESTINATION ${LIBRARY_DIR})
SRSLTE_SET_PIC(srslte)

@ -18,5 +18,5 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_agc ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_agc ${SOURCES})

@ -18,10 +18,10 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_ch_estimation ${SOURCES})
TARGET_LINK_LIBRARIES(srslte_ch_estimation srslte_common
file(GLOB SOURCES "*.c")
add_library(srslte_ch_estimation ${SOURCES})
target_link_libraries(srslte_ch_estimation srslte_common
srslte_resampling
srslte_utils
srslte_phch)
ADD_SUBDIRECTORY(test)
add_subdirectory(test)

@ -22,16 +22,16 @@
# Downlink Channel Estimation TEST
########################################################################
ADD_EXECUTABLE(chest_test_dl chest_test_dl.c)
TARGET_LINK_LIBRARIES(chest_test_dl srslte)
add_executable(chest_test_dl chest_test_dl.c)
target_link_libraries(chest_test_dl srslte)
ADD_TEST(chest_test_dl_cellid0 chest_test_dl -c 0)
ADD_TEST(chest_test_dl_cellid1 chest_test_dl -c 1)
ADD_TEST(chest_test_dl_cellid2 chest_test_dl -c 2)
add_test(chest_test_dl_cellid0 chest_test_dl -c 0)
add_test(chest_test_dl_cellid1 chest_test_dl -c 1)
add_test(chest_test_dl_cellid2 chest_test_dl -c 2)
ADD_TEST(chest_test_dl_cellid0 chest_test_dl -c 0 -r 50)
ADD_TEST(chest_test_dl_cellid1 chest_test_dl -c 1 -r 50)
ADD_TEST(chest_test_dl_cellid2 chest_test_dl -c 2 -r 50)
add_test(chest_test_dl_cellid0 chest_test_dl -c 0 -r 50)
add_test(chest_test_dl_cellid1 chest_test_dl -c 1 -r 50)
add_test(chest_test_dl_cellid2 chest_test_dl -c 2 -r 50)
########################################################################
# Downlink MEX libs
@ -44,8 +44,8 @@ BuildMex(MEXNAME chest SOURCES chest_test_dl_mex.c LIBRARIES srslte)
# Uplink Channel Estimation TEST
########################################################################
ADD_EXECUTABLE(refsignal_ul_test_all refsignal_ul_test.c)
TARGET_LINK_LIBRARIES(refsignal_ul_test_all srslte)
add_executable(refsignal_ul_test_all refsignal_ul_test.c)
target_link_libraries(refsignal_ul_test_all srslte)
BuildMex(MEXNAME refsignal_pusch SOURCES refsignal_pusch_mex.c LIBRARIES srslte srslte_mex)

@ -18,5 +18,5 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_channel ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_channel ${SOURCES})

@ -18,5 +18,5 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_common ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_common ${SOURCES})

@ -18,15 +18,18 @@
# and at http://www.gnu.org/licenses/.
#
FIND_PACKAGE(FFTW3F REQUIRED)
IF(FFTW3F_FOUND)
INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS})
LINK_DIRECTORIES(${FFTW3F_LIBRARY_DIRS})
ENDIF(FFTW3F_FOUND)
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_dft ${SOURCES})
TARGET_LINK_LIBRARIES(srslte_dft srslte_utils
find_package(FFTW3F REQUIRED)
if(FFTW3F_FOUND)
include_directories(${FFTW3F_INCLUDE_DIRS})
link_directories(${FFTW3F_LIBRARY_DIRS})
endif(FFTW3F_FOUND)
set(SRCS dft_fftw.c dft_precoding.c ofdm.c)
add_library(srslte_dft ${SRCS})
target_link_libraries(srslte_dft srslte_utils
m
${FFTW3F_LIBRARIES})
ADD_SUBDIRECTORY(test)
add_subdirectory(test)

@ -22,12 +22,12 @@
# FFT TEST
########################################################################
ADD_EXECUTABLE(ofdm_test ofdm_test.c)
TARGET_LINK_LIBRARIES(ofdm_test srslte)
add_executable(ofdm_test ofdm_test.c)
target_link_libraries(ofdm_test srslte)
ADD_TEST(ofdm_normal ofdm_test)
ADD_TEST(ofdm_extended ofdm_test -e)
add_test(ofdm_normal ofdm_test)
add_test(ofdm_extended ofdm_test -e)
ADD_TEST(ofdm_normal_single ofdm_test -n 6)
ADD_TEST(ofdm_extended_single ofdm_test -e -n 6)
add_test(ofdm_normal_single ofdm_test -n 6)
add_test(ofdm_extended_single ofdm_test -e -n 6)

@ -18,7 +18,7 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_fec ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_fec ${SOURCES})
target_link_libraries(srslte_fec srslte_utils)
ADD_SUBDIRECTORY(test)
add_subdirectory(test)

@ -23,53 +23,53 @@
# RATEMATCHING TEST
########################################################################
ADD_EXECUTABLE(rm_conv_test rm_conv_test.c)
TARGET_LINK_LIBRARIES(rm_conv_test srslte)
add_executable(rm_conv_test rm_conv_test.c)
target_link_libraries(rm_conv_test srslte)
ADD_EXECUTABLE(rm_turbo_test rm_turbo_test.c)
TARGET_LINK_LIBRARIES(rm_turbo_test srslte)
add_executable(rm_turbo_test rm_turbo_test.c)
target_link_libraries(rm_turbo_test srslte)
ADD_TEST(rm_conv_test_1 rm_conv_test -t 480 -r 1920)
ADD_TEST(rm_conv_test_2 rm_conv_test -t 1920 -r 480)
add_test(rm_conv_test_1 rm_conv_test -t 480 -r 1920)
add_test(rm_conv_test_2 rm_conv_test -t 1920 -r 480)
ADD_TEST(rm_turbo_test_1 rm_turbo_test -e 1920)
ADD_TEST(rm_turbo_test_2 rm_turbo_test -e 8192)
add_test(rm_turbo_test_1 rm_turbo_test -e 1920)
add_test(rm_turbo_test_2 rm_turbo_test -e 8192)
BuildMex(MEXNAME rm_turbo_rx SOURCES rm_turbo_rx_mex.c LIBRARIES srslte srslte_mex)
########################################################################
# Turbo Coder TEST
########################################################################
ADD_EXECUTABLE(turbodecoder_test turbodecoder_test.c)
TARGET_LINK_LIBRARIES(turbodecoder_test srslte)
add_executable(turbodecoder_test turbodecoder_test.c)
target_link_libraries(turbodecoder_test srslte)
ADD_TEST(turbodecoder_test_504_1 turbodecoder_test -n 100 -s 1 -l 504 -e 1.0 -t)
ADD_TEST(turbodecoder_test_504_2 turbodecoder_test -n 100 -s 1 -l 504 -e 2.0 -t)
ADD_TEST(turbodecoder_test_6114_1_5 turbodecoder_test -n 100 -s 1 -l 6144 -e 1.5 -t)
ADD_TEST(turbodecoder_test_known turbodecoder_test -n 1 -s 1 -k -e 0.5)
add_test(turbodecoder_test_504_1 turbodecoder_test -n 100 -s 1 -l 504 -e 1.0 -t)
add_test(turbodecoder_test_504_2 turbodecoder_test -n 100 -s 1 -l 504 -e 2.0 -t)
add_test(turbodecoder_test_6114_1_5 turbodecoder_test -n 100 -s 1 -l 6144 -e 1.5 -t)
add_test(turbodecoder_test_known turbodecoder_test -n 1 -s 1 -k -e 0.5)
BuildMex(MEXNAME turbodecoder SOURCES turbodecoder_test_mex.c LIBRARIES srslte srslte_mex)
ADD_EXECUTABLE(turbocoder_test turbocoder_test.c)
TARGET_LINK_LIBRARIES(turbocoder_test srslte)
ADD_TEST(turbocoder_test_all turbocoder_test)
add_executable(turbocoder_test turbocoder_test.c)
target_link_libraries(turbocoder_test srslte)
add_test(turbocoder_test_all turbocoder_test)
########################################################################
# Viterbi TEST
########################################################################
ADD_EXECUTABLE(viterbi_test viterbi_test.c)
TARGET_LINK_LIBRARIES(viterbi_test srslte)
add_executable(viterbi_test viterbi_test.c)
target_link_libraries(viterbi_test srslte)
ADD_TEST(viterbi_40_0 viterbi_test -n 1000 -s 1 -l 40 -t -e 0.0)
ADD_TEST(viterbi_40_2 viterbi_test -n 1000 -s 1 -l 40 -t -e 2.0)
ADD_TEST(viterbi_40_3 viterbi_test -n 1000 -s 1 -l 40 -t -e 3.0)
ADD_TEST(viterbi_40_4 viterbi_test -n 1000 -s 1 -l 40 -t -e 4.5)
add_test(viterbi_40_0 viterbi_test -n 1000 -s 1 -l 40 -t -e 0.0)
add_test(viterbi_40_2 viterbi_test -n 1000 -s 1 -l 40 -t -e 2.0)
add_test(viterbi_40_3 viterbi_test -n 1000 -s 1 -l 40 -t -e 3.0)
add_test(viterbi_40_4 viterbi_test -n 1000 -s 1 -l 40 -t -e 4.5)
ADD_TEST(viterbi_1000_0 viterbi_test -n 100 -s 1 -l 1000 -t -e 0.0)
ADD_TEST(viterbi_1000_2 viterbi_test -n 100 -s 1 -l 1000 -t -e 2.0)
ADD_TEST(viterbi_1000_3 viterbi_test -n 100 -s 1 -l 1000 -t -e 3.0)
ADD_TEST(viterbi_1000_4 viterbi_test -n 100 -s 1 -l 1000 -t -e 4.5)
add_test(viterbi_1000_0 viterbi_test -n 100 -s 1 -l 1000 -t -e 0.0)
add_test(viterbi_1000_2 viterbi_test -n 100 -s 1 -l 1000 -t -e 2.0)
add_test(viterbi_1000_3 viterbi_test -n 100 -s 1 -l 1000 -t -e 3.0)
add_test(viterbi_1000_4 viterbi_test -n 100 -s 1 -l 1000 -t -e 4.5)
BuildMex(MEXNAME viterbi SOURCES viterbi_test_mex.c LIBRARIES srslte srslte_mex)
@ -77,12 +77,12 @@ BuildMex(MEXNAME viterbi SOURCES viterbi_test_mex.c LIBRARIES srslte srslte_mex)
# CRC TEST
########################################################################
ADD_EXECUTABLE(crc_test crc_test.c)
TARGET_LINK_LIBRARIES(crc_test srslte)
add_executable(crc_test crc_test.c)
target_link_libraries(crc_test srslte)
ADD_TEST(crc_24A crc_test -n 5001 -l 24 -p 0x1864CFB -s 1)
ADD_TEST(crc_24B crc_test -n 5001 -l 24 -p 0x1800063 -s 1)
ADD_TEST(crc_16 crc_test -n 5001 -l 16 -p 0x11021 -s 1)
ADD_TEST(crc_8 crc_test -n 5001 -l 8 -p 0x19B -s 1)
add_test(crc_24A crc_test -n 5001 -l 24 -p 0x1864CFB -s 1)
add_test(crc_24B crc_test -n 5001 -l 24 -p 0x1800063 -s 1)
add_test(crc_16 crc_test -n 5001 -l 16 -p 0x11021 -s 1)
add_test(crc_8 crc_test -n 5001 -l 8 -p 0x19B -s 1)

@ -18,5 +18,5 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_io ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_io ${SOURCES})

@ -18,6 +18,6 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_mimo ${SOURCES})
ADD_SUBDIRECTORY(test)
file(GLOB SOURCES "*.c")
add_library(srslte_mimo ${SOURCES})
add_subdirectory(test)

@ -22,43 +22,43 @@
# LAYER MAPPING TEST
########################################################################
ADD_EXECUTABLE(layermap_test layermap_test.c)
TARGET_LINK_LIBRARIES(layermap_test srslte)
add_executable(layermap_test layermap_test.c)
target_link_libraries(layermap_test srslte)
ADD_TEST(layermap_single layermap_test -n 1000 -m single -c 1 -l 1)
add_test(layermap_single layermap_test -n 1000 -m single -c 1 -l 1)
ADD_TEST(layermap_diversity_2 layermap_test -n 1000 -m diversity -c 1 -l 2)
ADD_TEST(layermap_diversity_4 layermap_test -n 1000 -m diversity -c 1 -l 4)
add_test(layermap_diversity_2 layermap_test -n 1000 -m diversity -c 1 -l 2)
add_test(layermap_diversity_4 layermap_test -n 1000 -m diversity -c 1 -l 4)
ADD_TEST(layermap_multiplex_11 layermap_test -n 1000 -m multiplex -c 1 -l 1)
ADD_TEST(layermap_multiplex_12 layermap_test -n 1000 -m multiplex -c 1 -l 2)
ADD_TEST(layermap_multiplex_13 layermap_test -n 1002 -m multiplex -c 1 -l 3)
ADD_TEST(layermap_multiplex_14 layermap_test -n 1000 -m multiplex -c 1 -l 4)
ADD_TEST(layermap_multiplex_15 layermap_test -n 1000 -m multiplex -c 1 -l 5)
ADD_TEST(layermap_multiplex_16 layermap_test -n 1002 -m multiplex -c 1 -l 6)
ADD_TEST(layermap_multiplex_17 layermap_test -n 994 -m multiplex -c 1 -l 7)
ADD_TEST(layermap_multiplex_18 layermap_test -n 1000 -m multiplex -c 1 -l 8)
add_test(layermap_multiplex_11 layermap_test -n 1000 -m multiplex -c 1 -l 1)
add_test(layermap_multiplex_12 layermap_test -n 1000 -m multiplex -c 1 -l 2)
add_test(layermap_multiplex_13 layermap_test -n 1002 -m multiplex -c 1 -l 3)
add_test(layermap_multiplex_14 layermap_test -n 1000 -m multiplex -c 1 -l 4)
add_test(layermap_multiplex_15 layermap_test -n 1000 -m multiplex -c 1 -l 5)
add_test(layermap_multiplex_16 layermap_test -n 1002 -m multiplex -c 1 -l 6)
add_test(layermap_multiplex_17 layermap_test -n 994 -m multiplex -c 1 -l 7)
add_test(layermap_multiplex_18 layermap_test -n 1000 -m multiplex -c 1 -l 8)
ADD_TEST(layermap_multiplex_22 layermap_test -n 1000 -m multiplex -c 2 -l 2)
ADD_TEST(layermap_multiplex_23 layermap_test -n 1002 -m multiplex -c 2 -l 3)
ADD_TEST(layermap_multiplex_24 layermap_test -n 1000 -m multiplex -c 2 -l 4)
ADD_TEST(layermap_multiplex_25 layermap_test -n 1002 -m multiplex -c 2 -l 5)
ADD_TEST(layermap_multiplex_26 layermap_test -n 1002 -m multiplex -c 2 -l 6)
ADD_TEST(layermap_multiplex_27 layermap_test -n 1000 -m multiplex -c 2 -l 7)
ADD_TEST(layermap_multiplex_28 layermap_test -n 1000 -m multiplex -c 2 -l 8)
add_test(layermap_multiplex_22 layermap_test -n 1000 -m multiplex -c 2 -l 2)
add_test(layermap_multiplex_23 layermap_test -n 1002 -m multiplex -c 2 -l 3)
add_test(layermap_multiplex_24 layermap_test -n 1000 -m multiplex -c 2 -l 4)
add_test(layermap_multiplex_25 layermap_test -n 1002 -m multiplex -c 2 -l 5)
add_test(layermap_multiplex_26 layermap_test -n 1002 -m multiplex -c 2 -l 6)
add_test(layermap_multiplex_27 layermap_test -n 1000 -m multiplex -c 2 -l 7)
add_test(layermap_multiplex_28 layermap_test -n 1000 -m multiplex -c 2 -l 8)
########################################################################
# LAYER MAPPING TEST
########################################################################
ADD_EXECUTABLE(precoding_test precoding_test.c)
TARGET_LINK_LIBRARIES(precoding_test srslte)
add_executable(precoding_test precoding_test.c)
target_link_libraries(precoding_test srslte)
ADD_TEST(precoding_single precoding_test -n 1000 -m single)
ADD_TEST(precoding_diversity2 precoding_test -n 1000 -m diversity -l 2 -p 2)
ADD_TEST(precoding_diversity4 precoding_test -n 1024 -m diversity -l 4 -p 4)
add_test(precoding_single precoding_test -n 1000 -m single)
add_test(precoding_diversity2 precoding_test -n 1000 -m diversity -l 2 -p 2)
add_test(precoding_diversity4 precoding_test -n 1024 -m diversity -l 4 -p 4)

@ -18,6 +18,6 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_modem ${SOURCES})
ADD_SUBDIRECTORY(test)
file(GLOB SOURCES "*.c")
add_library(srslte_modem ${SOURCES})
add_subdirectory(test)

@ -22,21 +22,21 @@
# MODEM TEST
########################################################################
ADD_EXECUTABLE(modem_test modem_test.c)
TARGET_LINK_LIBRARIES(modem_test srslte)
add_executable(modem_test modem_test.c)
target_link_libraries(modem_test srslte)
ADD_TEST(modem_bpsk modem_test -n 1024 -m 1)
ADD_TEST(modem_qpsk modem_test -n 1024 -m 2)
ADD_TEST(modem_qam16 modem_test -n 1024 -m 4)
ADD_TEST(modem_qam64 modem_test -n 1008 -m 6)
add_test(modem_bpsk modem_test -n 1024 -m 1)
add_test(modem_qpsk modem_test -n 1024 -m 2)
add_test(modem_qam16 modem_test -n 1024 -m 4)
add_test(modem_qam64 modem_test -n 1008 -m 6)
ADD_TEST(modem_bpsk_soft modem_test -n 1024 -m 1)
ADD_TEST(modem_qpsk_soft modem_test -n 1024 -m 2)
ADD_TEST(modem_qam16_soft modem_test -n 1024 -m 4)
ADD_TEST(modem_qam64_soft modem_test -n 1008 -m 6)
add_test(modem_bpsk_soft modem_test -n 1024 -m 1)
add_test(modem_qpsk_soft modem_test -n 1024 -m 2)
add_test(modem_qam16_soft modem_test -n 1024 -m 4)
add_test(modem_qam64_soft modem_test -n 1008 -m 6)
ADD_EXECUTABLE(soft_demod_test soft_demod_test.c)
TARGET_LINK_LIBRARIES(soft_demod_test srslte)
add_executable(soft_demod_test soft_demod_test.c)
target_link_libraries(soft_demod_test srslte)

@ -18,12 +18,12 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_phch ${SOURCES})
TARGET_LINK_LIBRARIES(srslte_phch srslte_common
file(GLOB SOURCES "*.c")
add_library(srslte_phch ${SOURCES})
target_link_libraries(srslte_phch srslte_common
srslte_mimo
srslte_fec
srslte_modem
srslte_scrambling
srslte_ch_estimation)
ADD_SUBDIRECTORY(test)
add_subdirectory(test)

@ -22,15 +22,15 @@
# PBCH TEST
########################################################################
ADD_EXECUTABLE(pbch_test pbch_test.c)
TARGET_LINK_LIBRARIES(pbch_test srslte)
add_executable(pbch_test pbch_test.c)
target_link_libraries(pbch_test srslte)
ADD_TEST(pbch_test_6 pbch_test -p 1 -n 6 -c 100)
ADD_TEST(pbch_test_62 pbch_test -p 2 -n 6 -c 100)
ADD_TEST(pbch_test_64 pbch_test -p 4 -n 6 -c 100)
ADD_TEST(pbch_test_50 pbch_test -p 1 -n 50 -c 50)
ADD_TEST(pbch_test_502 pbch_test -p 2 -n 50 -c 50)
ADD_TEST(pbch_test_504 pbch_test -p 4 -n 50 -c 50)
add_test(pbch_test_6 pbch_test -p 1 -n 6 -c 100)
add_test(pbch_test_62 pbch_test -p 2 -n 6 -c 100)
add_test(pbch_test_64 pbch_test -p 4 -n 6 -c 100)
add_test(pbch_test_50 pbch_test -p 1 -n 50 -c 50)
add_test(pbch_test_502 pbch_test -p 2 -n 50 -c 50)
add_test(pbch_test_504 pbch_test -p 4 -n 50 -c 50)
BuildMex(MEXNAME pbch SOURCES pbch_test_mex.c LIBRARIES srslte srslte_mex)
@ -39,15 +39,15 @@ BuildMex(MEXNAME pbch SOURCES pbch_test_mex.c LIBRARIES srslte srslte_mex)
# PCFICH TEST
########################################################################
ADD_EXECUTABLE(pcfich_test pcfich_test.c)
TARGET_LINK_LIBRARIES(pcfich_test srslte)
add_executable(pcfich_test pcfich_test.c)
target_link_libraries(pcfich_test srslte)
ADD_TEST(pcfich_test_6 pcfich_test -p 1 -n 6)
ADD_TEST(pcfich_test_62 pcfich_test -p 2 -n 6)
ADD_TEST(pcfich_test_64 pcfich_test -p 4 -n 6)
ADD_TEST(pcfich_test_10 pcfich_test -p 1 -n 10)
ADD_TEST(pcfich_test_102 pcfich_test -p 2 -n 10)
ADD_TEST(pcfich_test_104 pcfich_test -p 4 -n 10)
add_test(pcfich_test_6 pcfich_test -p 1 -n 6)
add_test(pcfich_test_62 pcfich_test -p 2 -n 6)
add_test(pcfich_test_64 pcfich_test -p 4 -n 6)
add_test(pcfich_test_10 pcfich_test -p 1 -n 10)
add_test(pcfich_test_102 pcfich_test -p 2 -n 10)
add_test(pcfich_test_104 pcfich_test -p 4 -n 10)
BuildMex(MEXNAME pcfich SOURCES pcfich_test_mex.c LIBRARIES srslte srslte_mex)
@ -55,33 +55,33 @@ BuildMex(MEXNAME pcfich SOURCES pcfich_test_mex.c LIBRARIES srslte srslte_mex)
# PHICH TEST
########################################################################
ADD_EXECUTABLE(phich_test phich_test.c)
TARGET_LINK_LIBRARIES(phich_test srslte)
add_executable(phich_test phich_test.c)
target_link_libraries(phich_test srslte)
ADD_TEST(phich_test_6 phich_test -p 1 -n 6)
ADD_TEST(phich_test_62 phich_test -p 2 -n 6)
ADD_TEST(phich_test_64 phich_test -p 4 -n 6 -g 1/6)
add_test(phich_test_6 phich_test -p 1 -n 6)
add_test(phich_test_62 phich_test -p 2 -n 6)
add_test(phich_test_64 phich_test -p 4 -n 6 -g 1/6)
ADD_TEST(phich_test_6e phich_test -p 1 -n 6 -e)
ADD_TEST(phich_test_62e phich_test -p 2 -n 6 -e -l)
ADD_TEST(phich_test_64e phich_test -p 4 -n 6 -e -l -g 2)
add_test(phich_test_6e phich_test -p 1 -n 6 -e)
add_test(phich_test_62e phich_test -p 2 -n 6 -e -l)
add_test(phich_test_64e phich_test -p 4 -n 6 -e -l -g 2)
ADD_TEST(phich_test_10 phich_test -p 1 -n 10 -e)
ADD_TEST(phich_test_102 phich_test -p 2 -n 10 -g 2)
ADD_TEST(phich_test_104 phich_test -p 4 -n 10 -e -l -g 1/2)
add_test(phich_test_10 phich_test -p 1 -n 10 -e)
add_test(phich_test_102 phich_test -p 2 -n 10 -g 2)
add_test(phich_test_104 phich_test -p 4 -n 10 -e -l -g 1/2)
########################################################################
# PDCCH TEST
########################################################################
ADD_EXECUTABLE(pdcch_test pdcch_test.c)
TARGET_LINK_LIBRARIES(pdcch_test srslte)
add_executable(pdcch_test pdcch_test.c)
target_link_libraries(pdcch_test srslte)
ADD_TEST(pdcch_test pdcch_test)
add_test(pdcch_test pdcch_test)
ADD_EXECUTABLE(dci_unpacking dci_unpacking.c)
TARGET_LINK_LIBRARIES(dci_unpacking srslte)
add_executable(dci_unpacking dci_unpacking.c)
target_link_libraries(dci_unpacking srslte)
BuildMex(MEXNAME pdcch SOURCES pdcch_test_mex.c LIBRARIES srslte srslte_mex)
@ -89,12 +89,12 @@ BuildMex(MEXNAME pdcch SOURCES pdcch_test_mex.c LIBRARIES srslte srslte_mex)
# PDSCH TEST
########################################################################
ADD_EXECUTABLE(pdsch_test pdsch_test.c)
TARGET_LINK_LIBRARIES(pdsch_test srslte)
add_executable(pdsch_test pdsch_test.c)
target_link_libraries(pdsch_test srslte)
ADD_TEST(pdsch_test_qpsk pdsch_test -m 10 -n 50 -r 1)
ADD_TEST(pdsch_test_qam16 pdsch_test -m 20 -n 100)
ADD_TEST(pdsch_test_qam64 pdsch_test -m 28 -n 100 -r 0)
add_test(pdsch_test_qpsk pdsch_test -m 10 -n 50 -r 1)
add_test(pdsch_test_qam16 pdsch_test -m 20 -n 100)
add_test(pdsch_test_qam64 pdsch_test -m 28 -n 100 -r 0)
BuildMex(MEXNAME pdsch SOURCES pdsch_test_mex.c LIBRARIES srslte srslte_mex)
BuildMex(MEXNAME dlsch_encode SOURCES dlsch_encode_test_mex.c LIBRARIES srslte srslte_mex)
@ -103,47 +103,47 @@ BuildMex(MEXNAME dlsch_encode SOURCES dlsch_encode_test_mex.c LIBRARIES srslte s
# FILE TEST
########################################################################
ADD_EXECUTABLE(pbch_file_test pbch_file_test.c)
TARGET_LINK_LIBRARIES(pbch_file_test srslte)
add_executable(pbch_file_test pbch_file_test.c)
target_link_libraries(pbch_file_test srslte)
ADD_EXECUTABLE(pcfich_file_test pcfich_file_test.c)
TARGET_LINK_LIBRARIES(pcfich_file_test srslte)
add_executable(pcfich_file_test pcfich_file_test.c)
target_link_libraries(pcfich_file_test srslte)
ADD_EXECUTABLE(phich_file_test phich_file_test.c)
TARGET_LINK_LIBRARIES(phich_file_test srslte)
add_executable(phich_file_test phich_file_test.c)
target_link_libraries(phich_file_test srslte)
ADD_EXECUTABLE(pdcch_file_test pdcch_file_test.c)
TARGET_LINK_LIBRARIES(pdcch_file_test srslte)
add_executable(pdcch_file_test pdcch_file_test.c)
target_link_libraries(pdcch_file_test srslte)
ADD_EXECUTABLE(pdsch_pdcch_file_test pdsch_pdcch_file_test.c)
TARGET_LINK_LIBRARIES(pdsch_pdcch_file_test srslte)
add_executable(pdsch_pdcch_file_test pdsch_pdcch_file_test.c)
target_link_libraries(pdsch_pdcch_file_test srslte)
ADD_TEST(pbch_file_test pbch_file_test -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.dat)
ADD_TEST(pcfich_file_test pcfich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat)
ADD_TEST(phich_file_test phich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat)
ADD_TEST(pdcch_file_test pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat)
ADD_TEST(pdsch_pdcch_file_test pdsch_pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat)
add_test(pbch_file_test pbch_file_test -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.dat)
add_test(pcfich_file_test pcfich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat)
add_test(phich_file_test phich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.10M.dat)
add_test(pdcch_file_test pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat)
add_test(pdsch_pdcch_file_test pdsch_pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat)
########################################################################
# PUSCH TEST
########################################################################
ADD_EXECUTABLE(pusch_test pusch_test.c)
TARGET_LINK_LIBRARIES(pusch_test srslte)
add_executable(pusch_test pusch_test.c)
target_link_libraries(pusch_test srslte)
BuildMex(MEXNAME ulsch_encode SOURCES ulsch_encode_test_mex.c LIBRARIES srslte srslte_mex)
BuildMex(MEXNAME pusch_encode SOURCES pusch_encode_test_mex.c LIBRARIES srslte srslte_mex)
ADD_TEST(pusch_test pusch_test)
add_test(pusch_test pusch_test)
########################################################################
# PUCCH TEST
########################################################################
ADD_EXECUTABLE(pucch_test pucch_test.c)
TARGET_LINK_LIBRARIES(pucch_test srslte)
add_executable(pucch_test pucch_test.c)
target_link_libraries(pucch_test srslte)
ADD_TEST(pucch_test pucch_test)
add_test(pucch_test pucch_test)
BuildMex(MEXNAME pucch_encode SOURCES pucch_encode_test_mex.c LIBRARIES srslte srslte_mex)
@ -155,45 +155,45 @@ BuildMex(MEXNAME pucch_encode SOURCES pucch_encode_test_mex.c LIBRARIES srslte s
# PRACH TEST
########################################################################
ADD_EXECUTABLE(prach_test prach_test.c)
TARGET_LINK_LIBRARIES(prach_test srslte)
add_executable(prach_test prach_test.c)
target_link_libraries(prach_test srslte)
ADD_TEST(prach prach_test)
add_test(prach prach_test)
ADD_TEST(prach_256 prach_test -N 256)
ADD_TEST(prach_512 prach_test -N 512)
ADD_TEST(prach_1024 prach_test -N 1024)
ADD_TEST(prach_1536 prach_test -N 1536)
ADD_TEST(prach_2048 prach_test -N 2048)
add_test(prach_256 prach_test -N 256)
add_test(prach_512 prach_test -N 512)
add_test(prach_1024 prach_test -N 1024)
add_test(prach_1536 prach_test -N 1536)
add_test(prach_2048 prach_test -N 2048)
ADD_TEST(prach_f0 prach_test -f 0)
ADD_TEST(prach_f1 prach_test -f 1)
ADD_TEST(prach_f2 prach_test -f 2)
ADD_TEST(prach_f3 prach_test -f 3)
add_test(prach_f0 prach_test -f 0)
add_test(prach_f1 prach_test -f 1)
add_test(prach_f2 prach_test -f 2)
add_test(prach_f3 prach_test -f 3)
ADD_TEST(prach_rs1 prach_test -r 1)
ADD_TEST(prach_rs2 prach_test -r 2)
ADD_TEST(prach_rs3 prach_test -r 3)
add_test(prach_rs1 prach_test -r 1)
add_test(prach_rs2 prach_test -r 2)
add_test(prach_rs3 prach_test -r 3)
ADD_TEST(prach_zc0 prach_test -z 0)
ADD_TEST(prach_zc2 prach_test -z 2)
ADD_TEST(prach_zc3 prach_test -z 3)
add_test(prach_zc0 prach_test -z 0)
add_test(prach_zc2 prach_test -z 2)
add_test(prach_zc3 prach_test -z 3)
ADD_EXECUTABLE(prach_test_multi prach_test_multi.c)
TARGET_LINK_LIBRARIES(prach_test_multi srslte)
add_executable(prach_test_multi prach_test_multi.c)
target_link_libraries(prach_test_multi srslte)
ADD_TEST(prach_test_multi prach_test_multi)
add_test(prach_test_multi prach_test_multi)
ADD_TEST(prach_test_multi_n32 prach_test_multi -n 32)
ADD_TEST(prach_test_multi_n16 prach_test_multi -n 16)
ADD_TEST(prach_test_multi_n8 prach_test_multi -n 8)
ADD_TEST(prach_test_multi_n4 prach_test_multi -n 4)
add_test(prach_test_multi_n32 prach_test_multi -n 32)
add_test(prach_test_multi_n16 prach_test_multi -n 16)
add_test(prach_test_multi_n8 prach_test_multi -n 8)
add_test(prach_test_multi_n4 prach_test_multi -n 4)
BuildMex(MEXNAME prach SOURCES prach_test_mex.c LIBRARIES srslte srslte_mex)
IF(UHD_FOUND)
ADD_EXECUTABLE(prach_test_usrp prach_test_usrp.c)
TARGET_LINK_LIBRARIES(prach_test_usrp srslte_rf srslte pthread)
ENDIF(UHD_FOUND)
if(UHD_FOUND)
add_executable(prach_test_usrp prach_test_usrp.c)
target_link_libraries(prach_test_usrp srslte_rf srslte pthread)
endif(UHD_FOUND)

@ -18,6 +18,6 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_resampling ${SOURCES})
ADD_SUBDIRECTORY(test)
file(GLOB SOURCES "*.c")
add_library(srslte_resampling ${SOURCES})
add_subdirectory(test)

@ -22,13 +22,13 @@
# RESAMPLING TEST
########################################################################
ADD_EXECUTABLE(resample_arb_test resample_arb_test.c)
TARGET_LINK_LIBRARIES(resample_arb_test srslte)
add_executable(resample_arb_test resample_arb_test.c)
target_link_libraries(resample_arb_test srslte)
ADD_EXECUTABLE(resample_arb_bench resample_arb_bench.c)
TARGET_LINK_LIBRARIES(resample_arb_bench srslte)
add_executable(resample_arb_bench resample_arb_bench.c)
target_link_libraries(resample_arb_bench srslte)
ADD_TEST(resample resample_arb_test)
add_test(resample resample_arb_test)

@ -18,29 +18,30 @@
# and at http://www.gnu.org/licenses/.
#
IF(RF_FOUND)
if(RF_FOUND)
# Include common RF files
SET(SOURCES_RF "")
LIST(APPEND SOURCES_RF rf_imp.c rf_utils.c)
set(SOURCES_RF "")
list(APPEND SOURCES_RF rf_imp.c rf_utils.c)
IF (UHD_FOUND)
if (UHD_FOUND)
add_definitions(-DENABLE_UHD)
LIST(APPEND SOURCES_RF rf_uhd_imp.c uhd_c_api.cpp)
ENDIF (UHD_FOUND)
list(APPEND SOURCES_RF rf_uhd_imp.c uhd_c_api.cpp)
endif (UHD_FOUND)
IF (BLADERF_FOUND)
if (BLADERF_FOUND)
add_definitions(-DENABLE_BLADERF)
LIST(APPEND SOURCES_RF rf_blade_imp.c)
ENDIF (BLADERF_FOUND)
list(APPEND SOURCES_RF rf_blade_imp.c)
endif (BLADERF_FOUND)
ADD_LIBRARY(srslte_rf ${SOURCES_RF})
add_library(srslte_rf ${SOURCES_RF})
target_link_libraries(srslte_rf pthread)
IF (UHD_FOUND)
TARGET_LINK_LIBRARIES(srslte_rf ${UHD_LIBRARIES})
ENDIF (UHD_FOUND)
if (UHD_FOUND)
target_link_libraries(srslte_rf ${UHD_LIBRARIES})
endif (UHD_FOUND)
IF (BLADERF_FOUND)
TARGET_LINK_LIBRARIES(srslte_rf ${BLADERF_LIBRARIES})
ENDIF (BLADERF_FOUND)
if (BLADERF_FOUND)
target_link_libraries(srslte_rf ${BLADERF_LIBRARIES})
endif (BLADERF_FOUND)
ENDIF(RF_FOUND)
endif(RF_FOUND)

@ -18,6 +18,6 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_scrambling ${SOURCES})
ADD_SUBDIRECTORY(test)
file(GLOB SOURCES "*.c")
add_library(srslte_scrambling ${SOURCES})
add_subdirectory(test)

@ -22,13 +22,13 @@
# SCRAMBLING TEST
########################################################################
ADD_EXECUTABLE(scrambling_test scrambling_test.c)
TARGET_LINK_LIBRARIES(scrambling_test srslte)
add_executable(scrambling_test scrambling_test.c)
target_link_libraries(scrambling_test srslte)
ADD_TEST(scrambling_pbch_bit scrambling_test -s PBCH -c 50)
ADD_TEST(scrambling_pbch_float scrambling_test -s PBCH -c 50 -f)
ADD_TEST(scrambling_pbch_e_bit scrambling_test -s PBCH -c 50 -e)
ADD_TEST(scrambling_pbch_e_float scrambling_test -s PBCH -c 50 -f -e)
add_test(scrambling_pbch_bit scrambling_test -s PBCH -c 50)
add_test(scrambling_pbch_float scrambling_test -s PBCH -c 50 -f)
add_test(scrambling_pbch_e_bit scrambling_test -s PBCH -c 50 -e)
add_test(scrambling_pbch_e_float scrambling_test -s PBCH -c 50 -f -e)

@ -18,7 +18,7 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_sync ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_sync ${SOURCES})
target_link_libraries(srslte_sync srslte_common)
ADD_SUBDIRECTORY(test)
add_subdirectory(test)

@ -22,24 +22,24 @@
# PROGRAM TO DEBUG PSS FROM USRP
########################################################################
ADD_EXECUTABLE(pss_file pss_file.c)
TARGET_LINK_LIBRARIES(pss_file srslte)
add_executable(pss_file pss_file.c)
target_link_libraries(pss_file srslte)
IF(SRSGUI_FOUND)
if(SRSGUI_FOUND)
target_link_libraries(pss_file ${SRSGUI_LIBRARIES})
ELSE(SRSGUI_FOUND)
SET_TARGET_PROPERTIES(pss_file PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS")
ENDIF(SRSGUI_FOUND)
IF(UHD_FOUND)
ADD_EXECUTABLE(pss_usrp pss_usrp.c)
TARGET_LINK_LIBRARIES(pss_usrp srslte srslte_rf)
IF(SRSGUI_FOUND)
else(SRSGUI_FOUND)
set_target_properties(pss_file PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS")
endif(SRSGUI_FOUND)
if(UHD_FOUND)
add_executable(pss_usrp pss_usrp.c)
target_link_libraries(pss_usrp srslte srslte_rf)
if(SRSGUI_FOUND)
target_link_libraries(pss_usrp ${SRSGUI_LIBRARIES})
ELSE(SRSGUI_FOUND)
SET_TARGET_PROPERTIES(pss_usrp PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS")
ENDIF(SRSGUI_FOUND)
ENDIF(UHD_FOUND)
else(SRSGUI_FOUND)
set_target_properties(pss_usrp PROPERTIES COMPILE_DEFINITIONS "DISABLE_GRAPHICS")
endif(SRSGUI_FOUND)
endif(UHD_FOUND)
BuildMex(MEXNAME pss SOURCES pss_mex.c LIBRARIES srslte srslte_mex)
BuildMex(MEXNAME sss SOURCES sss_mex.c LIBRARIES srslte srslte_mex)
@ -51,28 +51,28 @@ BuildMex(MEXNAME cp_synch SOURCES cp_mex.c LIBRARIES srslte srslte_mex)
# SYNC TEST
########################################################################
ADD_EXECUTABLE(sync_test sync_test.c)
TARGET_LINK_LIBRARIES(sync_test srslte)
add_executable(sync_test sync_test.c)
target_link_libraries(sync_test srslte)
ADD_TEST(sync_test_100 sync_test -o 100 -c 501)
ADD_TEST(sync_test_400 sync_test -o 400 -c 2)
ADD_TEST(sync_test_100_e sync_test -o 100 -e -c 150)
ADD_TEST(sync_test_400_e sync_test -o 400 -e -c 151)
add_test(sync_test_100 sync_test -o 100 -c 501)
add_test(sync_test_400 sync_test -o 400 -c 2)
add_test(sync_test_100_e sync_test -o 100 -e -c 150)
add_test(sync_test_400_e sync_test -o 400 -e -c 151)
ADD_TEST(sync_test_100 sync_test -o 100 -p 50 -c 501)
ADD_TEST(sync_test_400 sync_test -o 400 -p 50 -c 500)
ADD_TEST(sync_test_100_e sync_test -o 100 -e -p 50 -c 133)
ADD_TEST(sync_test_400_e sync_test -o 400 -e -p 50 -c 123)
add_test(sync_test_100 sync_test -o 100 -p 50 -c 501)
add_test(sync_test_400 sync_test -o 400 -p 50 -c 500)
add_test(sync_test_100_e sync_test -o 100 -e -p 50 -c 133)
add_test(sync_test_400_e sync_test -o 400 -e -p 50 -c 123)
########################################################################
# CFO TEST
########################################################################
ADD_EXECUTABLE(cfo_test cfo_test.c)
TARGET_LINK_LIBRARIES(cfo_test srslte)
add_executable(cfo_test cfo_test.c)
target_link_libraries(cfo_test srslte)
ADD_TEST(cfo_test_1 cfo_test -f 0.12345 -n 1000)
ADD_TEST(cfo_test_2 cfo_test -f 0.99849 -n 1000)
add_test(cfo_test_1 cfo_test -f 0.12345 -n 1000)
add_test(cfo_test_2 cfo_test -f 0.99849 -n 1000)

@ -18,9 +18,9 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_ue ${SOURCES})
TARGET_LINK_LIBRARIES(srslte_ue srslte_io
file(GLOB SOURCES "*.c")
add_library(srslte_ue ${SOURCES})
target_link_libraries(srslte_ue srslte_io
srslte_sync
srslte_dft
srslte_ch_estimation

@ -18,7 +18,7 @@
# and at http://www.gnu.org/licenses/.
#
FILE(GLOB SOURCES "*.c")
ADD_LIBRARY(srslte_utils ${SOURCES})
file(GLOB SOURCES "*.c")
add_library(srslte_utils ${SOURCES})
target_link_libraries(srslte_utils srslte_dft)
ADD_SUBDIRECTORY(test)
add_subdirectory(test)

@ -22,14 +22,14 @@
# DFT TEST
########################################################################
ADD_EXECUTABLE(dft_test dft_test.c)
TARGET_LINK_LIBRARIES(dft_test srslte)
add_executable(dft_test dft_test.c)
target_link_libraries(dft_test srslte)
ADD_TEST(dft_test dft_test)
ADD_TEST(dft_reverse dft_test -b) # Backwards first
ADD_TEST(dft_mirror dft_test -m) # Mirror the freq bins
ADD_TEST(dft_norm dft_test -n) # Normalize each transform
ADD_TEST(dft_dc dft_test -b -d) # Backwards first & handle dc internally
ADD_TEST(dft_odd dft_test -N 255) # Odd-length
ADD_TEST(dft_odd_dc dft_test -N 255 -b -d) # Odd-length, backwards first, handle dc
add_test(dft_test dft_test)
add_test(dft_reverse dft_test -b) # Backwards first
add_test(dft_mirror dft_test -m) # Mirror the freq bins
add_test(dft_norm dft_test -n) # Normalize each transform
add_test(dft_dc dft_test -b -d) # Backwards first & handle dc internally
add_test(dft_odd dft_test -N 255) # Odd-length
add_test(dft_odd_dc dft_test -N 255 -b -d) # Odd-length, backwards first, handle dc

Loading…
Cancel
Save