NAME

Alien::FFTW3 - Alien wrapper for FFTW3

SYNOPSIS

use strict;
use warnings;

use Module::Build;
use Alien::FFTW3;

my $cflags = Alien::FFTW3->cflags;
my $ldflags = Alien::FFTW3->libs;

if( Alien::FFTW3->precision('q') ) {
  # compile quad-precision library...
}

my $cflags_for_float = Alien::FFTW3->cflags('f');

ABSTRACT

Alien wrapper for FFTW3. Because FFTW3 comes in several flavors for different levels of numerical precision, the typical access methods 'cflags' and 'libs' work slightly differently than the simple Alien::Base case. You can feed in nothing at all, in which case you get back cflags and libs strings appropriate for compiling *all* available fftw3 libraries; or you can specify which precision you want by passing in an allowed precision. The allowed precisions are currently 'f','d','l', and 'q' for floats, doubles, long doubles, and quad doubles respecetively.

On initial use, Alien::FFTW3 checks for which precisions are available. If more than zero are available, it succeeds. If none are available, then it fails.

You can query which precisions are installed on your system using the "precision" method, documented below.

As an Alien module, Alien::FFTW3 attempts to build fftw on your system from source if it's not found at install time. Because I'm Lazy, I use the existing fine infrastructure from Joel Berger to install in that case. But the default compile only generates the double-precision library, so if you want more you'll have to install it yourself with a package manager or your own source compilation.

DESCRIPTION

This module provides package validation and installation for FFTW3. It depends on the external POSIX program pkg-config to find the FFTW3 libraries.

SEE ALSO

Alien::Base, PDL::FFTW3, http://fftw.org

METHODS

precision

Test presence of fftw3 libs with different precisions. Returns a hash ref with keys set to TRUE for each library queried, or undef if none of the queried libraries exist. If you pass in no arguments, all precisions are tested.

The allowed precisions are 'f','d','l', and 'q'.

You can pass them in as an array ref or as a single packed string.

cflags

Returns the cflags compiler flags required for the specified precision, or for all of 'em.

libs

Returns the libs linker flags required for the specified precision, or for all of 'em.