easyblock = 'MakeCp'

name = 'LAPACKE'
version = '3.5.0'
toolchain = SYSTEM

lapackver = '3.5.0'
versionsuffix = '-LAPACK-%s' % lapackver

homepage = 'http://www.netlib.org/lapack/lapacke.html'
description = """LAPACKE C Interface to LAPACK header files and library"""

lapack_src = 'lapack-%s.tgz' % lapackver

sources = [
    lapack_src,
]
source_urls = [
    "http://www.netlib.org/lapack/",
]

sanity_check_paths = {
    'files': ['include/lapacke.h', 'lib/liblapacke.a'],
    'dirs': [],
}

files_to_copy = [
    (['lapacke/include/*.h'], 'include'),
    (['liblapacke.a'], 'lib')
]
postinstallcmds = [
    'mv %(installdir)s/include/lapacke_mangling_with_flags.h %(installdir)s/include/lapacke_mangling.h']
prebuildopts = 'cp make.inc.example make.inc && '
buildopts = 'lapackelib CFLAGS="-O3 -fPIC"'
modextrapaths = {'CPATH': 'include'}

moduleclass = 'numlib'