easyblock = 'ConfigureMake'

name = 'FFTW'
version = '2.1.5'

homepage = 'http://www.fftw.org'
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."""

toolchain = {'name': 'gompi', 'version': '1.5.12'}
toolchainopts = {'optarch': True, 'pic': True}

sources = [SOURCELOWER_TAR_GZ]
source_urls = [homepage]

common_configopts = "--enable-shared --enable-type-prefix --enable-threads --with-pic"

configopts = [
    common_configopts + " --enable-float --enable-mpi",
    common_configopts + " --enable-mpi",  # default as last
]

sanity_check_paths = {
    'files': ['include/%sfftw%s.h' % (x, y) for x in ['d', 'dr', 's', 'sr'] for y in ['', '_mpi', '_threads']] +
             ['lib/lib%sfftw%s.a' % (x, y) for x in ['d', 'dr', 's', 'sr'] for y in ['', '_mpi', '_threads']] +
             ['lib/lib%sfftw%s.%s' % (x, y, SHLIB_EXT) for x in ['d', 'dr', 's', 'sr'] for y in ['', '_mpi', '_threads']],
    'dirs': [],
}

moduleclass = 'numlib'
