Skip to content

Commit

Permalink
periodogram example
Browse files Browse the repository at this point in the history
  • Loading branch information
thinks committed Nov 12, 2024
1 parent 3e94a29 commit 117ab27
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 289 deletions.
12 changes: 6 additions & 6 deletions cmake/fetch-fftw.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function(fetch_fftw)
"-DENABLE_THREADS:BOOL=ON" # Use pthread
"-DWITH_COMBINED_THREADS:BOOL=ON" # Don't need to link in fftw3f_threads

"-DENABLE_FLOAT:BOOL=ON" # <float>
# "-DENABLE_FLOAT:BOOL=ON" # <float>

# Use SSE, but not AVX.
"-DENABLE_SSE:BOOL=ON"
Expand Down Expand Up @@ -102,7 +102,7 @@ function(fetch_fftw)
)

unset(generator)

if(result)
file(READ ${fftw_BINARY_DIR}/build_output.log build_log)
message(FATAL_ERROR "Result = ${result}\nFailed FFTW-${args_VERSION} build, see build log:\n"
Expand All @@ -116,19 +116,19 @@ function(fetch_fftw)
# Confirm that we can find FFTW.

# Ugly work-around for CMake errors in CI builds.
set(_cmake_import_check_xcframework_for_FFTW3::fftw3f "")
set(_cmake_import_check_xcframework_for_FFTW3::fftw3 "")

find_package(FFTW3f
find_package(FFTW3
QUIET
REQUIRED
CONFIG
PATHS "${fftw_BINARY_DIR}/install"
NO_DEFAULT_PATH
)

unset(_cmake_import_check_xcframework_for_FFTW3::fftw3f)
unset(_cmake_import_check_xcframework_for_FFTW3::fftw3)

if(NOT FFTW3f_FOUND)
if(NOT FFTW3_FOUND)
message(FATAL_ERROR "FFTW-${args_VERSION} not found")
endif()
endfunction()
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (LINUX)
add_example(
NAME periodogram
SRC periodogram.c
DEPS FFTW3::fftw3f nothings::stb)
DEPS FFTW3::fftw3 nothings::stb)
endif()

# ---- End-of-file commands ----
Expand Down
2 changes: 2 additions & 0 deletions examples/custom_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#define TPH_POISSON_IMPLEMENTATION
#include "thinks/tph_poisson.h"

static_assert(sizeof(tph_poisson_real) == 4, "");

typedef struct my_alloc_ctx_
{
ptrdiff_t total_malloc;
Expand Down
Loading

0 comments on commit 117ab27

Please sign in to comment.