Difference between revisions of "Applications/Fftw3"
From HPC
(Created page with "__TOC__ ==Application Details== *Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input...") |
m |
||
| Line 18: | Line 18: | ||
===Compilation=== | ===Compilation=== | ||
| − | '' | + | ''fftw3'' is a library required at compilation time. |
A typical code snippet requiring is shown below: | A typical code snippet requiring is shown below: | ||
Revision as of 13:13, 19 April 2017
Application Details
- Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data
- Version: 3.3.5 (compiled with gcc)
- Module: fftw3/gcc/3.3.5
- Licence: GNU
Usage
FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).
Module
[username@login01 ~]$ module add fftw3/gcc/3.3.5
Compilation
fftw3 is a library required at compilation time.
A typical code snippet requiring is shown below:
#include <fftw3.h>
...
{
fftw_complex *in, *out;
fftw_plan p;
...
in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
...
fftw_execute(p); /* repeat as needed */
...
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
}
You must link this code with the fftw3 library. On Viper, link with -lfftw3 -lm.
Further Information
| |