# Built with EasyBuild version 2.2.0dev on 2015-06-29_10-08-02
name = 'imkl'
version = '11.2.3.187'

homepage = 'http://software.intel.com/en-us/intel-mkl/'
description = """Intel Math Kernel Library is a library of highly optimized,
 extensively threaded math routines for science, engineering, and financial
 applications that require maximum performance. Core math functions include
 BLAS, LAPACK, ScaLAPACK, Sparse Solvers, Fast Fourier Transforms, Vector Math, and more."""

toolchain = {'name': 'dummy', 'version': 'dummy'}

sources = ['l_mkl_%(version)s.tgz']

dontcreateinstalldir = 'True'


# license file
import os
license_file = os.path.join(os.getenv('HOME'), "licenses", "intel", "license.lic")

interfaces = True

compver = '2015.3.187-GNU-5.1.0-2.25'
builddependencies = [
    ('icc', compver),
    ('ifort', compver),
    ('impi', '5.0.3.048-iccifort-2015.3.187-GNU-5.1.0-2.25')
]


moduleclass = 'numlib'

postinstallcmds = [
    # extract the examples
    'tar xvzf %(installdir)s/mkl/examples/examples_cluster.tgz -C %(installdir)s/mkl/examples/',
    'tar xvzf %(installdir)s/mkl/examples/examples_core_c.tgz -C %(installdir)s/mkl/examples/',
    'tar xvzf %(installdir)s/mkl/examples/examples_core_f.tgz -C %(installdir)s/mkl/examples/',
    'tar xvzf %(installdir)s/mkl/examples/examples_f95.tgz -C %(installdir)s/mkl/examples/',
    'tar xvzf %(installdir)s/mkl/examples/examples_mic.tgz -C %(installdir)s/mkl/examples/'
]

modextravars = {
     'MKL_EXAMPLES' : '%(installdir)s/mkl/examples/',
     'MKL_INC_DIR': '%(installdir)s/include',
     'MKL_LIB_DIR': '%(installdir)s/lib/intel64',
     'MKL_LIBS': '-L%(installdir)s/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm',
     'MKL_LIBS_MT': '-L%(installdir)s/lib/intel64 -lmkl_rt -liomp5 -lm',
     'MKL_SCA_LIBS': '-L%(installdir)s/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_scalapack_lp64 -lmkl_core -lmkl_blacs_openmpi_lp64 -lm',
     'MKL_SCA_LIBS_MT': '-L%(installdir)s/lib/intel64 -lmkl_rt -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -liomp5 -lm',
     'MKL_TARGET_ARCH': 'intel64',
}

modextrapaths = {
    'MIC_LD_LIBRARY_PATH': 'lib/mic/',
}
