summaryrefslogtreecommitdiff
path: root/scripts/cmake/cmsis-dsp.cmake
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-07 16:08:14 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-07 17:28:51 +0100
commitf9c19eaa9ab11e4409679fc6d2862c89410493a7 (patch)
treeb791a4c03f1fe986a2ac32593a3dc817ae3f247a /scripts/cmake/cmsis-dsp.cmake
parent2181d0ac35f30202985a877950c88325ff665f6b (diff)
downloadml-embedded-evaluation-kit-f9c19eaa9ab11e4409679fc6d2862c89410493a7.tar.gz
MLECO-1860: Support for Arm GNU Embedded Toolchain
This patch enables compilation of ML use cases bare-metal applications using Arm GNU Embedded Toolchain. The GNU toolchain can be used instead of the Arm Compiler that was already supported. The GNU toolchain is also set as the default toolchain when building applications for the MPS3 target. Note: The version of GNU toolchain must be 10.2.1 or higher. Change-Id: I5fff242f0f52d2db6c75d292f9fa990df1aec978 Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'scripts/cmake/cmsis-dsp.cmake')
-rw-r--r--scripts/cmake/cmsis-dsp.cmake25
1 files changed, 24 insertions, 1 deletions
diff --git a/scripts/cmake/cmsis-dsp.cmake b/scripts/cmake/cmsis-dsp.cmake
index cb0243b..bb26b69 100644
--- a/scripts/cmake/cmsis-dsp.cmake
+++ b/scripts/cmake/cmsis-dsp.cmake
@@ -37,7 +37,16 @@ set(CMSIS_CORE_INC_DIR "${CMSIS_SRC_PATH}/${CMSIS_CORE_PATH_SUFFIX}/Include
file(GLOB_RECURSE
CMSIS_DSP_SRC
- "${CMSIS_DSP_SRC_DIR}/arm_*.c")
+
+ "${CMSIS_DSP_SRC_DIR}/BasicMathFunctions/arm_*.c"
+ "${CMSIS_DSP_SRC_DIR}/FastMathFunctions/arm_*.c"
+ "${CMSIS_DSP_SRC_DIR}/CommonTables/arm_*.c"
+ "${CMSIS_DSP_SRC_DIR}/TransformFunctions/arm_*.c"
+ "${CMSIS_DSP_SRC_DIR}/StatisticsFunctions/arm_*.c"
+
+ # Issue with q15 and q31 functions with Arm GNU toolchain, we only
+ # need f32 functions.
+ "${CMSIS_DSP_SRC_DIR}/ComplexMathFunctions/arm_*f32.c")
# 4. Create static library
set(CMSIS_DSP_TARGET cmsis-dsp)
@@ -50,6 +59,20 @@ target_include_directories(${CMSIS_DSP_TARGET} PUBLIC
target_include_directories(${CMSIS_DSP_TARGET} PRIVATE
${CMSIS_DSP_PRI_INC_DIR})
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ target_compile_options(${CMSIS_DSP_TARGET} PUBLIC -flax-vector-conversions)
+
+ # There is a known issue with -O0 optimisation option that affects
+ # FFT functions from CMSIS-DSP when compiling with Arm GNU embedded
+ # toolchain version 10.2.1
+ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+ message(WARNING "There are known issues with CMSIS-DSP builds using "
+ "MVE extension without optimisation. Forcing -O3 "
+ "optimisation level")
+ target_compile_options(${CMSIS_DSP_TARGET} PUBLIC -O3)
+ endif()
+endif ()
+
# 5. Add any custom/conditional flags for compilation or linkage
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL cortex-m55)
target_compile_definitions(${CMSIS_DSP_TARGET} PUBLIC