easyblock = 'ConfigureMake'

name = 'FFTW'
version = '2.1.5'

homepage = 'http://www.fftw.org'
description = """FFTW is a C subroutine library for local_computing the discrete Fourier transform (DFT)
 in one or more dimensions, of arbitrary input size, and of both real and local_complex data."""

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

sources = [SOURCELOWER_TAR_GZ]
source_urls = [homepage]

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

configopts = [
    local_common_configopts + " --enable-float --enable-mpi",
    local_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'
