From b3bb649501ff3b9f4868387e593a0209e93bcb24 Mon Sep 17 00:00:00 2001 From: Hayley Date: Tue, 9 Jul 2019 17:22:31 -0500 Subject: [PATCH 1/7] Initial Cmake file added --- DSP_API/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 DSP_API/CMakeLists.txt diff --git a/DSP_API/CMakeLists.txt b/DSP_API/CMakeLists.txt new file mode 100644 index 0000000..6c2dd46 --- /dev/null +++ b/DSP_API/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.14) +project(thumbdv) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION gnu) + +## Setting up the four types of builds we have +set(CMAKE_CONFIGURATION_TYPES "ThumbDV_Debug;ThumbDV_Release" CACHE STRING "" FORCE) + +include_directories(.) +include_directories(include) +include_directories(lib) +include_directories(SmartSDR_Interface) +include_directories(ThumbDV) + +add_executable(thumbdv + SmartSDR_Interface/cmd_basics.c + SmartSDR_Interface/cmd_engine.c + SmartSDR_Interface/discovery_client.c + SmartSDR_Interface/hal_buffer.c + SmartSDR_Interface/hal_listener.c + SmartSDR_Interface/hal_vita.c + SmartSDR_Interface/io_utils.c + SmartSDR_Interface/sched_waveform.c + SmartSDR_Interface/smartsdr_dsp_api.c + SmartSDR_Interface/status_processor.c + SmartSDR_Interface/traffic_cop.c + SmartSDR_Interface/utils.c + SmartSDR_Interface/vita_output.c + ThumbDV/bit_pattern_matcher.c + ThumbDV/dstar.c + ThumbDV/gmsk_modem.c + ThumbDV/slow_data.c + ThumbDV/thumbDV.c + circular_buffer.c + main.c + resampler.c) + +add_custom_command(TARGET thumbdv POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ /nfsroots/microburst/home/root) \ No newline at end of file From e7049021f188712f01a2679501bf237e5bad5a21 Mon Sep 17 00:00:00 2001 From: Hayley Date: Wed, 10 Jul 2019 12:29:16 -0500 Subject: [PATCH 2/7] Cmake file complete for build on ThumbDV_Release Next will be working on the other two builds --- DSP_API/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/DSP_API/CMakeLists.txt b/DSP_API/CMakeLists.txt index 6c2dd46..57244a3 100644 --- a/DSP_API/CMakeLists.txt +++ b/DSP_API/CMakeLists.txt @@ -4,15 +4,18 @@ project(thumbdv) set(CMAKE_C_STANDARD 11) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION gnu) +set(CMAKE_VERBOSE_MAKEFILE ON) ## Setting up the four types of builds we have set(CMAKE_CONFIGURATION_TYPES "ThumbDV_Debug;ThumbDV_Release" CACHE STRING "" FORCE) include_directories(.) include_directories(include) -include_directories(lib) -include_directories(SmartSDR_Interface) include_directories(ThumbDV) +include_directories(SmartSDR_Interface) + +link_directories(/src/flex/smoothlake/firmware/src/Firmware/lib + /src/flex/smartsdr-dsp/DSP_API/lib) add_executable(thumbdv SmartSDR_Interface/cmd_basics.c @@ -34,8 +37,43 @@ add_executable(thumbdv ThumbDV/slow_data.c ThumbDV/thumbDV.c circular_buffer.c - main.c - resampler.c) + resampler.c + main.c) + +if (CMAKE_BUILD_TYPE MATCHES ThumbDV_Release) + target_compile_options(thumbdv PRIVATE + -U_FORTIFY_SOURCE + -c + -fmessage-length=0 + -lpthread + -MMD + -MP) +endif() + +TARGET_LINK_LIBRARIES(thumbdv PRIVATE + ftd2xx + rt + pthread + dl + m) + +if (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES ThumbDV_Debug) + target_compile_definitions(thumbdv PRIVATE + DEBUG) +endif() + +target_link_options(thumbdv INTERFACE + -Map=Firmware.map) + + +target_compile_options(thumbdv PRIVATE + -O3 + -mcpu=cortex-a8 + -mfpu=neon + -mfloat-abi=softfp + -ftree-vectorize + -Wall + ) add_custom_command(TARGET thumbdv POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ /nfsroots/microburst/home/root) \ No newline at end of file From aa353e98173bc381c96a6224ed6193e3f9622870 Mon Sep 17 00:00:00 2001 From: Hayley Date: Wed, 10 Jul 2019 12:55:11 -0500 Subject: [PATCH 3/7] Added the ThumbDV_Debug configuration This configuration causes a stack smash error; however, this configuration does not build in Eclipse --- DSP_API/CMakeLists.txt | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/DSP_API/CMakeLists.txt b/DSP_API/CMakeLists.txt index 57244a3..80c2919 100644 --- a/DSP_API/CMakeLists.txt +++ b/DSP_API/CMakeLists.txt @@ -40,14 +40,45 @@ add_executable(thumbdv resampler.c main.c) + + if (CMAKE_BUILD_TYPE MATCHES ThumbDV_Release) + target_compile_options(thumbdv PRIVATE + -O3 + -mcpu=cortex-a8 + -mfpu=neon + -mfloat-abi=softfp + -ftree-vectorize + -Wall + ) target_compile_options(thumbdv PRIVATE -U_FORTIFY_SOURCE -c -fmessage-length=0 -lpthread -MMD - -MP) + -MP + -MF) +elseif(CMAKE_BUILD_TYPE MATCHES ThumbDV_Debug) + target_compile_options(thumbdv PRIVATE + -O0 + -mcpu=cortex-a8 + -mfpu=neon + -mfloat-abi=softfp + -ftree-vectorize + -Wall + -ggdb + -g3 + -fstack-protector-all + -funwind-tables + -c + -fmessage-length=0 + -lpthread + -MMD + -MP + -MF + ) + endif() TARGET_LINK_LIBRARIES(thumbdv PRIVATE @@ -66,14 +97,7 @@ target_link_options(thumbdv INTERFACE -Map=Firmware.map) -target_compile_options(thumbdv PRIVATE - -O3 - -mcpu=cortex-a8 - -mfpu=neon - -mfloat-abi=softfp - -ftree-vectorize - -Wall - ) + add_custom_command(TARGET thumbdv POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ /nfsroots/microburst/home/root) \ No newline at end of file From 8fd933905ac3a6cc2f4ebebb732c1b62a6406b71 Mon Sep 17 00:00:00 2001 From: Hayley Date: Wed, 10 Jul 2019 13:01:56 -0500 Subject: [PATCH 4/7] Added the Debug configuration This configuration causes a stack smash error; however, this configuration does not build in Eclipse --- DSP_API/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/DSP_API/CMakeLists.txt b/DSP_API/CMakeLists.txt index 80c2919..7a12ac7 100644 --- a/DSP_API/CMakeLists.txt +++ b/DSP_API/CMakeLists.txt @@ -78,6 +78,23 @@ elseif(CMAKE_BUILD_TYPE MATCHES ThumbDV_Debug) -MP -MF ) +elseif(CMAKE_BUILD_TYPE MATCHES Debug) + target_compile_options(thumbdv PRIVATE + -O0 + -ftree-vectorize + -g3 + -ggdb + -g3 + -fstack-protector-all + -funwind-tables + -Wall + -c + -fmessage-length=0 + -lpthread + -MMD + -MP + -MF + ) endif() From 1652d3002b0da6c98c397377a1b5fe2c3dbb0842 Mon Sep 17 00:00:00 2001 From: Hayley Date: Wed, 10 Jul 2019 13:07:21 -0500 Subject: [PATCH 5/7] Cleaned up the compile definitions if statements --- DSP_API/CMakeLists.txt | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/DSP_API/CMakeLists.txt b/DSP_API/CMakeLists.txt index 7a12ac7..6f71681 100644 --- a/DSP_API/CMakeLists.txt +++ b/DSP_API/CMakeLists.txt @@ -41,24 +41,23 @@ add_executable(thumbdv main.c) - if (CMAKE_BUILD_TYPE MATCHES ThumbDV_Release) target_compile_options(thumbdv PRIVATE + -U_FORTIFY_SOURCE -O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -Wall - ) - target_compile_options(thumbdv PRIVATE - -U_FORTIFY_SOURCE -c -fmessage-length=0 -lpthread -MMD -MP - -MF) + -MF + ) + elseif(CMAKE_BUILD_TYPE MATCHES ThumbDV_Debug) target_compile_options(thumbdv PRIVATE -O0 @@ -78,6 +77,9 @@ elseif(CMAKE_BUILD_TYPE MATCHES ThumbDV_Debug) -MP -MF ) + target_compile_definitions(thumbdv PRIVATE + DEBUG) + elseif(CMAKE_BUILD_TYPE MATCHES Debug) target_compile_options(thumbdv PRIVATE -O0 @@ -95,7 +97,9 @@ elseif(CMAKE_BUILD_TYPE MATCHES Debug) -MP -MF ) - + target_compile_definitions(thumbdv PRIVATE + DEBUG) + endif() TARGET_LINK_LIBRARIES(thumbdv PRIVATE @@ -105,16 +109,10 @@ TARGET_LINK_LIBRARIES(thumbdv PRIVATE dl m) -if (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES ThumbDV_Debug) - target_compile_definitions(thumbdv PRIVATE - DEBUG) -endif() target_link_options(thumbdv INTERFACE -Map=Firmware.map) - - add_custom_command(TARGET thumbdv POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ /nfsroots/microburst/home/root) \ No newline at end of file From 3034d9ad2ab4f1ca7274fa77d38a89db8480484a Mon Sep 17 00:00:00 2001 From: Hayley Date: Wed, 10 Jul 2019 15:04:01 -0500 Subject: [PATCH 6/7] modifying gitignore for cmake --- .gitignore | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.gitignore b/.gitignore index f0f4d72..5234d66 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,37 @@ bin Debug Release .settings + +# Clion files # +###################### +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-*/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# File-based project format +*.iws From cba41ca67a2c0d7178ee14b8be4f5492df80d9a3 Mon Sep 17 00:00:00 2001 From: Hayley Date: Wed, 10 Jul 2019 15:19:05 -0500 Subject: [PATCH 7/7] Adding .idea/ folder --- DSP_API/.idea/.name | 1 + DSP_API/.idea/DSP_API.iml | 2 + DSP_API/.idea/misc.xml | 7 ++ DSP_API/.idea/modules.xml | 8 ++ DSP_API/.idea/vcs.xml | 6 + DSP_API/.idea/workspace.xml | 239 ++++++++++++++++++++++++++++++++++++ 6 files changed, 263 insertions(+) create mode 100644 DSP_API/.idea/.name create mode 100644 DSP_API/.idea/DSP_API.iml create mode 100644 DSP_API/.idea/misc.xml create mode 100644 DSP_API/.idea/modules.xml create mode 100644 DSP_API/.idea/vcs.xml create mode 100644 DSP_API/.idea/workspace.xml diff --git a/DSP_API/.idea/.name b/DSP_API/.idea/.name new file mode 100644 index 0000000..39227f3 --- /dev/null +++ b/DSP_API/.idea/.name @@ -0,0 +1 @@ +thumbdv \ No newline at end of file diff --git a/DSP_API/.idea/DSP_API.iml b/DSP_API/.idea/DSP_API.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/DSP_API/.idea/DSP_API.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/DSP_API/.idea/misc.xml b/DSP_API/.idea/misc.xml new file mode 100644 index 0000000..8822db8 --- /dev/null +++ b/DSP_API/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/DSP_API/.idea/modules.xml b/DSP_API/.idea/modules.xml new file mode 100644 index 0000000..ed3c9ca --- /dev/null +++ b/DSP_API/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/DSP_API/.idea/vcs.xml b/DSP_API/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/DSP_API/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DSP_API/.idea/workspace.xml b/DSP_API/.idea/workspace.xml new file mode 100644 index 0000000..f745567 --- /dev/null +++ b/DSP_API/.idea/workspace.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stac + terminated + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +