File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ option(BUILD_TESTS "Build test executables" OFF)
3737option (BUILD_ODYSSEY "Build Odyssey components with MPI support" OFF )
3838option (ODYSSEY_DEBUG_RESULTS "Print Odyssey search results (query_result) for debug before copy to I,D" OFF )
3939option (BUILD_SING "Enable CUDA support" OFF )
40+ option (BUILD_SOFA "Build SOFA with FFTW3 support" OFF )
4041
4142# Backward compatibility: ENABLE_MPI and ODYSSEY_MPI map to BUILD_ODYSSEY
4243if (DEFINED ENABLE_MPI)
@@ -214,6 +215,31 @@ else()
214215 endif ()
215216endif ()
216217
218+ if (BUILD_SOFA)
219+ if (DEBUG_MSG)
220+ message (STATUS "Attempting to build with SOFA support (BUILD_SOFA is ON)..." )
221+ endif ()
222+
223+ find_package (FFTW3 QUIET COMPONENTS single )
224+
225+ if (FFTW3_FOUND)
226+ set (BUILD_SOFA_AVAILABLE TRUE CACHE INTERNAL "Internal flag indicating if FFTW3 is available." FORCE )
227+ if (DEBUG_MSG)
228+ message (STATUS "FFTW3 found and will be used for SOFA components." )
229+ endif ()
230+ else ()
231+ if (DEBUG_MSG)
232+ message (WARNING "FFTW3 not found. Skipping SOFA FFTW3 components." )
233+ endif ()
234+ set (BUILD_SOFA_AVAILABLE FALSE CACHE INTERNAL "Internal flag indicating if FFTW3 is available." FORCE )
235+ endif ()
236+ else ()
237+ if (DEBUG_MSG)
238+ message (STATUS "Building without SOFA support (BUILD_SOFA is OFF)" )
239+ endif ()
240+ set (BUILD_SOFA_AVAILABLE FALSE CACHE INTERNAL "Internal flag indicating if FFTW3 is available." FORCE )
241+ endif ()
242+
217243if (BUILD_TESTS)
218244 include (CTest )
219245 enable_testing ()
Original file line number Diff line number Diff line change @@ -52,6 +52,29 @@ if(DEBUG_MSG)
5252 message (STATUS "Messi.cpp added (commented out)." )
5353endif ()
5454
55+ # ///// SOFA //////
56+ if (BUILD_SOFA_AVAILABLE)
57+ if (DEBUG_MSG)
58+ message (STATUS "Adding Sofa.cpp to dino_lib sources." )
59+ endif ()
60+ target_sources (dino_lib
61+ PRIVATE
62+ ${CMAKE_CURRENT_SOURCE_DIR } /Sofa.cpp
63+ ${CMAKE_CURRENT_SOURCE_DIR } /../isax/iSAXSearch.cpp
64+ )
65+ if (DEBUG_MSG)
66+ message (STATUS "Sofa.cpp added" )
67+ endif ()
68+
69+ target_compile_definitions (dino_lib PUBLIC SOFA_FFTW_ENABLED )
70+ target_link_libraries (dino_lib PUBLIC FFTW3::fftw3f )
71+ else ()
72+ if (DEBUG_MSG)
73+ message (STATUS "BUILD_SOFA_AVAILABLE is FALSE. Skipping SOFA sources (requires FFTW3)." )
74+ endif ()
75+ endif ()
76+
77+
5578# ////// ODYSSEY //////
5679if (BUILD_ODYSSEY_AVAILABLE)
5780 if (DEBUG_MSG)
You can’t perform that action at this time.
0 commit comments