Skip to content

Commit 8f2be29

Browse files
committed
added fftw support to cmakelists, and linux-arm configurations to vscode json files
1 parent 9e18ccf commit 8f2be29

File tree

6 files changed

+57
-6
lines changed

6 files changed

+57
-6
lines changed

.vscode/c_cpp_properties.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@
4545
"${commonDefs}"
4646
],
4747
"configurationProvider": "ms-vscode.cmake-tools"
48+
},
49+
{
50+
"name": "Linux-arm",
51+
"includePath": [
52+
"${commonIncludePaths}"
53+
],
54+
"defines": [
55+
"SAF_USE_OPEN_BLAS_AND_LAPACKE",
56+
"SAF_ENABLE_SOFA_READER_MODULE",
57+
"SAF_ENABLE_TRACKER_MODULE"
58+
],
59+
"macFrameworkPath": [],
60+
"compilerPath": "/usr/bin/gcc",
61+
"cStandard": "c11",
62+
"cppStandard": "c++17",
63+
"intelliSenseMode": "${default}",
64+
"configurationProvider": "ms-vscode.cmake-tools"
4865
}
4966
],
5067
"version": 4

.vscode/launch.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
78
{
8-
"name": "(lldb) Launch",
9+
"name": "(gdb) Launch",
910
"type": "cppdbg",
1011
"request": "launch",
11-
"targetArchitecture": "x86_64",
1212
"program": "${workspaceFolder}/build/test/saf_test",
1313
"args": [],
1414
"stopAtEntry": false,
15-
"cwd": "${workspaceFolder}",
15+
"cwd": "${fileDirname}",
1616
"environment": [],
1717
"externalConsole": false,
18-
"MIMode": "lldb",
19-
"miDebuggerPath": "/usr/bin/gdb"
18+
"MIMode": "gdb",
19+
"setupCommands": [
20+
{
21+
"description": "Enable pretty-printing for gdb",
22+
"text": "-enable-pretty-printing",
23+
"ignoreFailures": true
24+
}
25+
]
2026
}
2127
]
2228
}

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ option(SAF_BUILD_EXTRAS "Build SAF extras."
1111
option(SAF_ENABLE_SOFA_READER_MODULE "Enable the SAF SOFA READER module" OFF)
1212
option(SAF_ENABLE_TRACKER_MODULE "Enable the SAF TRACKER module" OFF)
1313
option(SAF_USE_INTEL_IPP "Use Intel IPP for the FFT, resampler, etc." OFF)
14+
option(SAF_USE_FFTW "Use FFTW3 for the FFT." OFF)
1415
option(SAF_ENABLE_SIMD "Enable the use of SSE3, AVX2, AVX512" OFF)
1516
if (NOT SAF_PERFORMANCE_LIB)
1617
set(SAF_PERFORMANCE_LIB "SAF_USE_INTEL_MKL_LP64" CACHE STRING "Performance library for SAF to use.")

framework/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,29 @@ if(SAF_USE_INTEL_IPP)
213213
target_link_libraries(${PROJECT_NAME} PUBLIC ${INTEL_IPP_LIB} )
214214
endif()
215215

216+
############################################################################
217+
# Enable/Disable FFTW
218+
if(SAF_USE_FFTW)
219+
# Indicate to saf that the saf_sofa_reader module should be enabled
220+
target_compile_definitions(${PROJECT_NAME} PUBLIC SAF_USE_FFTW=${SAF_USE_FFTW})
221+
222+
# Header path and libs are platform dependent
223+
if(MSVC)
224+
message(FATAL_ERROR "Incomplete list")
225+
elseif(MSYS OR MINGW)
226+
message(FATAL_ERROR "Incomplete list")
227+
elseif(APPLE)
228+
message(FATAL_ERROR "Incomplete list")
229+
elseif(UNIX AND NOT APPLE)
230+
find_library(FFTW_LIBRARY fftw3f HINTS /usr/local/lib)
231+
if (NOT FFTW_LIBRARY)
232+
message(FATAL_ERROR "FFTW_LIBRARY not found")
233+
endif()
234+
target_link_libraries(${PROJECT_NAME} PUBLIC ${FFTW_LIBRARY})
235+
message(STATUS "Linking FFTW: ${FFTW_LIBRARY}")
236+
endif()
237+
endif()
238+
216239
############################################################################
217240
# Enable SIMD intrinsics
218241
if(SAF_ENABLE_SIMD)

framework/include/saf_externals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
* implementations found in Intel IPP, Intel MKL and Apple Accelerate are
210210
* usually faster options.
211211
*
212-
* Note, SAF uses the single-precision version (fftw3f.a), which is built with:
212+
* Note, SAF uses the single-precision version (fftw3f), which is built with:
213213
* $ ./configure --enable-float
214214
* $ make
215215
*

framework/modules/saf_utilities/saf_utility_veclib.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,10 @@ void utility_cvvmul
12021202
}
12031203
for(; i<len; i++) /* The residual (if len was not divisable by the step size): */
12041204
c[i] = a[i] * b[i];
1205+
#elif __STDC_VERSION__ >= 199901L
1206+
int i;
1207+
for (i = 0; i < len; i++)
1208+
c[i] = a[i] * b[i];
12051209
#else
12061210
int i;
12071211
for (i = 0; i < len; i++)

0 commit comments

Comments
 (0)