From 6a833c7393c677f30f919533fc66b01359be0472 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 6 Oct 2012 12:56:33 -0400 Subject: [PATCH] Added a new test for the fourier interface --- CMakeLists.txt | 4 ++++ sample/CMakeLists.txt | 7 ++++++- sample/test_fft_calls.cpp | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 sample/test_fft_calls.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d673d3..6c4dd9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,10 @@ if(HDF5_ROOTDIR) endif(HDF5_ROOTDIR) include(FindHDF5) +include(FindPkgConfig) + +pkg_check_modules(FFTW3 fftw3>=3.3) +pkg_check_modules(EIGEN3 eigen3) include(FindPackageHandleStandardArgs) set(NETCDF_FIND_REQUIRED TRUE) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index b170c7f..a98ccdd 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -1,5 +1,5 @@ SET(tolink CosmoTool ${CosmoTool_LIBS}) -include_directories(${CMAKE_SOURCE_DIR}/src ${NETCDF_INCLUDE_PATH} ${GSL_INCLUDE_PATH}) +include_directories(${CMAKE_SOURCE_DIR}/src ${FFTW3_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${NETCDF_INCLUDE_PATH} ${GSL_INCLUDE_PATH}) add_executable(testBQueue testBQueue.cpp) target_link_libraries(testBQueue ${tolink}) @@ -39,3 +39,8 @@ target_link_libraries(testAlgo ${tolink}) add_executable(testBSP testBSP.cpp) target_link_libraries(testBSP ${tolink}) + +if (FFTW3_FOUND AND EIGEN3_FOUND) + add_executable(test_fft_calls test_fft_calls) + target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES}) +endif (FFTW3_FOUND AND EIGEN3_FOUND) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp new file mode 100644 index 0000000..35eeb12 --- /dev/null +++ b/sample/test_fft_calls.cpp @@ -0,0 +1,12 @@ +#include "fourier/euclidian.hpp" + +using namespace CosmoTool; + +int main() +{ + EuclidianFourierTransform_2d dft(128,128,1.0,1.0); + + dft.realSpace().eigen().setRandom(); + dft.analysis(); + return 0; +}