Skip to content

Commit

Permalink
using the new foldrescale
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Barbone committed May 8, 2024
1 parent cc8629f commit 5aa2705
Show file tree
Hide file tree
Showing 11 changed files with 447 additions and 107 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ option(FINUFFT_USE_OPENMP "Whether to use OpenMP for parallelization. If disable
option(FINUFFT_USE_CUDA "Whether to build CUDA accelerated FINUFFT library (libcufinufft). This is completely independent of the main FINUFFT library" OFF)
option(FINUFFT_USE_CPU "Whether to build the ordinary FINUFFT library (libfinufft)." ON)
option(FINUFFT_STATIC_LINKING "Whether to link the static FINUFFT library (libfinufft_static)." ON)
option(FINUFTT_BUILD_DEVEL "Whether to build developement executables" OFF)
# sphinx tag (don't remove): @cmake_opts_end

if(FINUFFT_USE_CPU)
Expand All @@ -45,10 +46,11 @@ if(FINUFFT_USE_CPU)
endif()

set(CPM_DOWNLOAD_VERSION 0.38.0)
include(cmake/setupCPM.cmake)

set(FFTW_VERSION 3.3.10)

include(cmake/setupCPM.cmake)
include(cmake/setupFFTW.cmake)

endif()

if (FINUFFT_BUILD_MATLAB)
Expand Down Expand Up @@ -106,11 +108,11 @@ function(finufft_link_test target)
endif()
endif()
else()
target_link_libraries(${target} PRIVATE finufft)
if(WIN32)
target_compile_definitions(${target} PRIVATE FINUFFT_DLL)
endif()
endif()
target_link_libraries(${target} PUBLIC finufft)
enable_asan(${target})
endfunction()

Expand Down Expand Up @@ -165,7 +167,6 @@ if(FINUFFT_USE_CPU)
target_compile_definitions(finufft_f64 PRIVATE)
set_finufft_options(finufft_f64)
target_link_libraries(finufft_f64 PUBLIC ${FINUFFT_FFTW_LIBRARIES})

if(WIN32)
add_library(finufft_f32_dll OBJECT ${FINUFFT_PRECISION_DEPENDENT_SOURCES})
target_compile_definitions(finufft_f32_dll PRIVATE SINGLE dll_EXPORTS FINUFFT_DLL)
Expand Down Expand Up @@ -246,6 +247,10 @@ if (FINUFFT_BUILD_MATLAB)
add_subdirectory(matlab)
endif ()

if (FINUFTT_BUILD_DEVEL)
add_subdirectory(devel)
endif ()

include(GNUInstallDirs)
install(TARGETS ${INSTALL_TARGETS} PUBLIC_HEADER)
install(FILES ${PROJECT_SOURCE_DIR}/LICENSE
Expand Down
19 changes: 17 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@
"generator": "Ninja Multi-Config",
"cacheVariables": {
"FINUFFT_BUILD_TESTS": "ON",
"FINUFFT_BUILD_EXAMPLES": "ON"
"FINUFFT_BUILD_EXAMPLES": "ON",
"FINUFTT_BUILD_DEVEL": "ON"
}
},
{
"name": "benchmark",
"binaryDir": "build/benchmark",
"displayName": "Benchmark",
"description": "Benchmark release configuration (ninja)",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"FINUFFT_BUILD_TESTS": "ON",
"FINUFFT_BUILD_EXAMPLES": "ON",
"FINUFFT_FFTW_SUFFIX": "",
"FINUFFT_USE_OPENMP": "OFF"
}
},
{
Expand Down Expand Up @@ -104,7 +119,7 @@
{
"name": "dev",
"configurePreset": "dev",
"configuration": "Debug"
"configuration": "RelWithDebInfo"
},
{
"name": "ninja-multi",
Expand Down
21 changes: 21 additions & 0 deletions devel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project(finufft_devel)
# Set the minimum required version of CMake
cmake_minimum_required(VERSION 3.5)


# include cpm cmake, downloading it
CPMAddPackage(
NAME benchmark
GITHUB_REPOSITORY google/benchmark
VERSION 1.8.3
OPTIONS "BENCHMARK_ENABLE_TESTING OFF"

)

if (benchmark_ADDED)
# patch benchmark target
set_target_properties(benchmark PROPERTIES CXX_STANDARD 17)
endif()

add_executable(foldrescale foldrescale.cpp)
target_link_libraries(foldrescale finufft benchmark)
Loading

0 comments on commit 5aa2705

Please sign in to comment.