# IT4Innovations 2020

name = 'FFTW'
version = '3.3.8'

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': 'intel', 'version': '2019a'}
toolchainopts = {'pic': True}

source_urls = [homepage]
sources = [SOURCELOWER_TAR_GZ]

# no quad precision, requires GCC v4.6 or higher
# see also
# http://www.fftw.org/doc/Extended-and-quadruple-precision-in-Fortran.html
with_quad_prec = False

# local_compilation fails when configuring with --enable-avx-128-fma, Intel local_compilers do not support FMA4 instructions
use_fma4 = False

preconfigopts = "export FC='mpiifort' && "
preconfigopts += "export CC='mpicc' && "
preconfigopts += 'export FCFLAGS="-O3 -xAVX2" && '
preconfigopts += "export F77='mpiifort' && "
preconfigopts += 'export CFLAGS="-O3 -march=native -mavx2 -mfma -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize" && '
preconfigopts += 'export SCALAPACK_LDFLAG=S"-L$MKLROOT/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread " && '
preconfigopts += 'export SCALAPACK_FCFLAGS="-I$MKL_HOME/include/intel64/lp64" && '

#runtest = 'check'

moduleclass = 'numlib'
