##
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
#
# Authors::   Inge Gutheil <i.gutheil@fz-juelich.de>, Alan O'Cais <a.ocais@fz-juelich.de>
# License::   MIT/GPL
# $Id$
#
##

easyblock = 'ConfigureMake'

name = 'ELPA'
version = '2017.11.001'

homepage = 'http://elpa.rzg.mpg.de'
description = """Eigenvalue SoLvers for Petaflop-Applications ."""

toolchain = {'name': 'intel', 'version': '2018a'}
toolchainopts = {'usempi': True}

source_urls = ['http://elpa.mpcdf.mpg.de/html/Releases/%(version)s/']
sources = [SOURCELOWER_TAR_GZ]

builddependencies = [
    ('Autotools', '20180311', '', True),
]

preconfigopts = 'autoreconf && '

common_configopts = 'FCFLAGS="-I$EBROOTIMKL/mkl/include/intel64/lp64 $FCFLAGS" '
common_configopts += 'LIBS="$LIBSCALAPACK" '

configopts = [
    common_configopts + '--enable-openmp ',
    common_configopts,  # Default version last, so we can get the normal config.h/config-f90.h installed afterwards.
]

buildopts = ' V=1 '

sanity_check_paths = {
    'files': ['lib/libelpa.a', 'lib/libelpa.%s' % SHLIB_EXT, 'lib/libelpa_openmp.a',
              'lib/libelpa_openmp.%s' % SHLIB_EXT],
    'dirs': ['bin', 'include/elpa-%(version)s/elpa', 'include/elpa-%(version)s/modules', 'lib/pkgconfig'],
}

moduleclass = 'math'
